summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.cvsignore21
-rw-r--r--AUTHORS327
-rw-r--r--COPYING340
-rw-r--r--ChangeLog2216
-rw-r--r--GUILE-VERSION43
-rw-r--r--INSTALL467
-rw-r--r--Makefile.am43
-rw-r--r--NEWS6167
-rw-r--r--README248
-rw-r--r--THANKS36
-rw-r--r--acinclude.m4109
-rw-r--r--am/.cvsignore2
-rw-r--r--am/ChangeLog18
-rw-r--r--am/Makefile.am28
-rw-r--r--am/README3
-rw-r--r--am/maintainer-dirs34
-rw-r--r--am/pre-inst-guile34
-rwxr-xr-xautogen.sh147
-rw-r--r--benchmark-guile.in48
-rw-r--r--benchmark-suite/COPYING340
-rw-r--r--benchmark-suite/ChangeLog52
-rw-r--r--benchmark-suite/Makefile.am16
-rw-r--r--benchmark-suite/README18
-rw-r--r--benchmark-suite/benchmarks/0-reference.bm2
-rw-r--r--benchmark-suite/benchmarks/continuations.bm5
-rw-r--r--benchmark-suite/benchmarks/if.bm51
-rw-r--r--benchmark-suite/benchmarks/logand.bm6
-rwxr-xr-xbenchmark-suite/guile-benchmark220
-rw-r--r--benchmark-suite/lib.scm520
-rw-r--r--check-guile.in48
-rw-r--r--configure.in864
-rw-r--r--doc/.cvsignore23
-rw-r--r--doc/BUGS13
-rw-r--r--doc/COPYING340
-rw-r--r--doc/ChangeLog977
-rw-r--r--doc/ChangeLog-guile-doc48
-rw-r--r--doc/Makefile.am51
-rw-r--r--doc/NEWS44
-rw-r--r--doc/README33
-rw-r--r--doc/THANKS19
-rw-r--r--doc/example-smob/COPYING340
-rw-r--r--doc/example-smob/ChangeLog48
-rw-r--r--doc/example-smob/Makefile12
-rw-r--r--doc/example-smob/README6
-rw-r--r--doc/example-smob/image-type.c126
-rw-r--r--doc/example-smob/image-type.h3
-rw-r--r--doc/example-smob/myguile.c37
-rw-r--r--doc/goops/.cvsignore22
-rw-r--r--doc/goops/ChangeLog22
-rw-r--r--doc/goops/Makefile.am43
-rw-r--r--doc/goops/goops-tutorial.texi810
-rw-r--r--doc/goops/goops.texi2803
-rw-r--r--doc/goops/hierarchy.eps127
-rw-r--r--doc/goops/hierarchy.txt14
-rw-r--r--doc/goops/mop.text66
-rw-r--r--doc/groupings.alist176
-rw-r--r--doc/guile-api.alist3219
-rw-r--r--doc/guile.193
-rw-r--r--doc/hacks.el16
-rw-r--r--doc/maint/ChangeLog59
-rw-r--r--doc/maint/README35
-rw-r--r--doc/maint/docstring.el622
-rw-r--r--doc/maint/guile.texi7846
-rw-r--r--doc/mbapi.texi987
-rw-r--r--doc/mltext.texi146
-rw-r--r--doc/oldfmt.c218
-rw-r--r--doc/r5rs/.cvsignore22
-rw-r--r--doc/r5rs/ChangeLog10
-rw-r--r--doc/r5rs/Makefile.am26
-rw-r--r--doc/r5rs/r5rs.texi8538
-rw-r--r--doc/recipe-guidelines.txt80
-rw-r--r--doc/ref/.cvsignore26
-rw-r--r--doc/ref/ChangeLog610
-rw-r--r--doc/ref/ChangeLog-guile-doc-ref890
-rw-r--r--doc/ref/Makefile.am62
-rw-r--r--doc/ref/api.txt185
-rw-r--r--doc/ref/autoconf.texi234
-rw-r--r--doc/ref/data-rep.texi2047
-rw-r--r--doc/ref/debugging.texi115
-rw-r--r--doc/ref/deprecated.texi3
-rw-r--r--doc/ref/expect.texi142
-rw-r--r--doc/ref/extend.texi44
-rw-r--r--doc/ref/gh.texi1170
-rw-r--r--doc/ref/guile.texi389
-rw-r--r--doc/ref/indices.texi52
-rw-r--r--doc/ref/intro.texi1128
-rw-r--r--doc/ref/misc-modules.texi426
-rw-r--r--doc/ref/new-docstrings.texi701
-rw-r--r--doc/ref/posix.texi2490
-rw-r--r--doc/ref/preface.texi200
-rw-r--r--doc/ref/program.texi776
-rw-r--r--doc/ref/repl-modules.texi131
-rw-r--r--doc/ref/scheme-binding.texi279
-rw-r--r--doc/ref/scheme-compound.texi2431
-rw-r--r--doc/ref/scheme-control.texi979
-rwxr-xr-xdoc/ref/scheme-data.texi3086
-rw-r--r--doc/ref/scheme-debug.texi206
-rw-r--r--doc/ref/scheme-evaluation.texi426
-rw-r--r--doc/ref/scheme-ideas.texi1459
-rw-r--r--doc/ref/scheme-indices.texi10
-rw-r--r--doc/ref/scheme-intro.texi36
-rw-r--r--doc/ref/scheme-io.texi1116
-rw-r--r--doc/ref/scheme-memory.texi396
-rw-r--r--doc/ref/scheme-modules.texi909
-rw-r--r--doc/ref/scheme-options.texi651
-rw-r--r--doc/ref/scheme-procedures.texi816
-rw-r--r--doc/ref/scheme-reading.texi27
-rw-r--r--doc/ref/scheme-scheduling.texi453
-rw-r--r--doc/ref/scheme-translation.texi48
-rw-r--r--doc/ref/scheme-utility.texi731
-rw-r--r--doc/ref/scm.texi181
-rw-r--r--doc/ref/script-getopt.texi435
-rw-r--r--doc/ref/scripts.texi225
-rw-r--r--doc/ref/scsh.texi18
-rw-r--r--doc/ref/slib.texi105
-rw-r--r--doc/ref/srfi-modules.texi2399
-rw-r--r--doc/ref/tcltk.texi3
-rw-r--r--doc/ref/tools.texi386
-rw-r--r--doc/sources/.cvsignore20
-rw-r--r--doc/sources/ChangeLog5
-rw-r--r--doc/sources/Makefile.am7
-rw-r--r--doc/sources/contributors.texi80
-rw-r--r--doc/sources/debug-c.texi2
-rw-r--r--doc/sources/debug-scheme.texi2
-rw-r--r--doc/sources/env.texi1165
-rw-r--r--doc/sources/format.texi434
-rw-r--r--doc/sources/guile-slib.texi2
-rw-r--r--doc/sources/jimb-org.texi131
-rw-r--r--doc/sources/libguile-overview.texi30
-rw-r--r--doc/sources/libguile-tools.texi191
-rw-r--r--doc/sources/new-types.texi2
-rw-r--r--doc/sources/old-intro.texi290
-rw-r--r--doc/sources/sample-APIs.texi6
-rw-r--r--doc/sources/scheme-concepts.texi249
-rw-r--r--doc/sources/scm-ref.texi4
-rw-r--r--doc/sources/strings.texi45
-rw-r--r--doc/sources/tk.texi5
-rw-r--r--doc/sources/unix-other.texi132
-rw-r--r--doc/sources/unix.texi622
-rw-r--r--doc/tutorial/.cvsignore22
-rw-r--r--doc/tutorial/ChangeLog34
-rw-r--r--doc/tutorial/ChangeLog-guile-doc-tutorial16
-rw-r--r--doc/tutorial/Makefile.am39
-rw-r--r--doc/tutorial/guile-tut.texi1373
-rw-r--r--doc/use-cases.fig199
-rw-r--r--doc/use-cases.txt22
-rw-r--r--emacs/ChangeLog89
-rw-r--r--emacs/README13
-rw-r--r--emacs/gud-guile.el81
-rw-r--r--emacs/guile-c.el178
-rw-r--r--emacs/guile-emacs.scm154
-rw-r--r--emacs/guile-scheme.el346
-rw-r--r--emacs/guile.el215
-rw-r--r--emacs/multistring.el222
-rw-r--r--emacs/patch.el106
-rw-r--r--emacs/ppexpand.el94
-rw-r--r--emacs/update-changelog.el145
-rw-r--r--examples/.cvsignore2
-rw-r--r--examples/ChangeLog144
-rw-r--r--examples/Makefile.am25
-rw-r--r--examples/README36
-rw-r--r--examples/box-dynamic-module/.cvsignore2
-rw-r--r--examples/box-dynamic-module/Makefile.am36
-rw-r--r--examples/box-dynamic-module/README77
-rw-r--r--examples/box-dynamic-module/box-mixed.scm44
-rw-r--r--examples/box-dynamic-module/box-module.scm25
-rw-r--r--examples/box-dynamic-module/box.c127
-rwxr-xr-xexamples/box-dynamic-module/check.test48
-rw-r--r--examples/box-dynamic/.cvsignore2
-rw-r--r--examples/box-dynamic/Makefile.am36
-rw-r--r--examples/box-dynamic/README58
-rw-r--r--examples/box-dynamic/box.c128
-rwxr-xr-xexamples/box-dynamic/check.test38
-rw-r--r--examples/box-module/.cvsignore3
-rw-r--r--examples/box-module/Makefile.am36
-rw-r--r--examples/box-module/README56
-rw-r--r--examples/box-module/box.c160
-rwxr-xr-xexamples/box-module/check.test38
-rw-r--r--examples/box/.cvsignore3
-rw-r--r--examples/box/Makefile.am36
-rw-r--r--examples/box/README48
-rw-r--r--examples/box/box.c148
-rwxr-xr-xexamples/box/check.test38
-rw-r--r--examples/modules/.cvsignore2
-rw-r--r--examples/modules/Makefile.am25
-rw-r--r--examples/modules/README32
-rwxr-xr-xexamples/modules/check.test27
-rw-r--r--examples/modules/main52
-rw-r--r--examples/modules/module-0.scm24
-rw-r--r--examples/modules/module-1.scm24
-rw-r--r--examples/modules/module-2.scm28
-rw-r--r--examples/safe/.cvsignore2
-rw-r--r--examples/safe/Makefile.am25
-rw-r--r--examples/safe/README41
-rwxr-xr-xexamples/safe/check.test40
-rw-r--r--examples/safe/evil.scm27
-rwxr-xr-xexamples/safe/safe85
-rw-r--r--examples/safe/untrusted.scm33
-rw-r--r--examples/scripts/.cvsignore2
-rw-r--r--examples/scripts/Makefile.am25
-rw-r--r--examples/scripts/README38
-rwxr-xr-xexamples/scripts/check.test53
-rwxr-xr-xexamples/scripts/fact69
-rwxr-xr-xexamples/scripts/hello57
-rw-r--r--examples/scripts/simple-hello.scm16
-rwxr-xr-xguile-aclocal.sh0
-rw-r--r--guile-config/.cvsignore3
-rw-r--r--guile-config/COPYING340
-rw-r--r--guile-config/ChangeLog182
-rw-r--r--guile-config/Makefile.am46
-rw-r--r--guile-config/guile-config.in299
-rw-r--r--guile-config/guile.m4221
-rw-r--r--guile-config/qthreads.m4165
-rw-r--r--guile-readline/.cvsignore16
-rw-r--r--guile-readline/ChangeLog534
-rw-r--r--guile-readline/LIBGUILEREADLINE-VERSION13
-rw-r--r--guile-readline/Makefile.am66
-rwxr-xr-xguile-readline/autogen.sh11
-rw-r--r--guile-readline/configure.in130
-rw-r--r--guile-readline/readline-activator.scm17
-rw-r--r--guile-readline/readline.c594
-rw-r--r--guile-readline/readline.h65
-rw-r--r--guile-readline/readline.scm217
-rw-r--r--guile-tools.in114
-rw-r--r--ice-9/.cvsignore5
-rw-r--r--ice-9/COPYING340
-rw-r--r--ice-9/ChangeLog3686
-rw-r--r--ice-9/Makefile.am54
-rw-r--r--ice-9/README12
-rw-r--r--ice-9/and-let-star.scm71
-rw-r--r--ice-9/arrays.scm82
-rw-r--r--ice-9/boot-9.scm2918
-rw-r--r--ice-9/buffered-input.scm132
-rw-r--r--ice-9/calling.scm351
-rw-r--r--ice-9/channel.scm195
-rw-r--r--ice-9/common-list.scm303
-rw-r--r--ice-9/compile-psyntax.scm25
-rw-r--r--ice-9/debug.scm159
-rw-r--r--ice-9/debugger.scm841
-rw-r--r--ice-9/documentation.scm227
-rw-r--r--ice-9/emacs.scm296
-rw-r--r--ice-9/expect.scm196
-rw-r--r--ice-9/format.scm1745
-rw-r--r--ice-9/ftw.scm384
-rw-r--r--ice-9/gap-buffer.scm308
-rw-r--r--ice-9/getopt-long.scm449
-rw-r--r--ice-9/hcons.scm105
-rw-r--r--ice-9/history.scm65
-rw-r--r--ice-9/lineio.scm140
-rw-r--r--ice-9/ls.scm121
-rw-r--r--ice-9/mapping.scm153
-rw-r--r--ice-9/match.scm223
-rw-r--r--ice-9/networking.scm107
-rw-r--r--ice-9/null.scm60
-rw-r--r--ice-9/optargs.scm444
-rw-r--r--ice-9/poe.scm143
-rw-r--r--ice-9/popen.scm205
-rw-r--r--ice-9/posix.scm94
-rw-r--r--ice-9/pretty-print.scm344
-rw-r--r--ice-9/psyntax.pp11
-rw-r--r--ice-9/psyntax.ss2232
-rw-r--r--ice-9/q.scm178
-rw-r--r--ice-9/r4rs.scm236
-rw-r--r--ice-9/r5rs.scm69
-rw-r--r--ice-9/rdelim.scm197
-rw-r--r--ice-9/receive.scm51
-rw-r--r--ice-9/regex.scm239
-rw-r--r--ice-9/runq.scm266
-rw-r--r--ice-9/rw.scm52
-rw-r--r--ice-9/safe-r5rs.scm169
-rw-r--r--ice-9/safe.scm59
-rw-r--r--ice-9/session.scm499
-rw-r--r--ice-9/slib.scm331
-rw-r--r--ice-9/stack-catch.scm70
-rw-r--r--ice-9/streams.scm242
-rw-r--r--ice-9/string-fun.scm304
-rw-r--r--ice-9/syncase.scm231
-rw-r--r--ice-9/test.scm1031
-rw-r--r--ice-9/threads.scm117
-rw-r--r--ice-9/time.scm81
-rw-r--r--lang/.cvsignore2
-rw-r--r--lang/Makefile.am24
-rw-r--r--lang/elisp/.cvsignore2
-rw-r--r--lang/elisp/ChangeLog359
-rw-r--r--lang/elisp/Makefile.am39
-rw-r--r--lang/elisp/README303
-rw-r--r--lang/elisp/STATUS35
-rw-r--r--lang/elisp/base.scm47
-rw-r--r--lang/elisp/example.el39
-rw-r--r--lang/elisp/interface.scm128
-rw-r--r--lang/elisp/internals/.cvsignore2
-rw-r--r--lang/elisp/internals/Makefile.am42
-rw-r--r--lang/elisp/internals/evaluation.scm13
-rw-r--r--lang/elisp/internals/format.scm62
-rw-r--r--lang/elisp/internals/fset.scm113
-rw-r--r--lang/elisp/internals/lambda.scm108
-rw-r--r--lang/elisp/internals/load.scm45
-rw-r--r--lang/elisp/internals/null.scm13
-rw-r--r--lang/elisp/internals/set.scm20
-rw-r--r--lang/elisp/internals/signal.scm18
-rw-r--r--lang/elisp/internals/time.scm14
-rw-r--r--lang/elisp/internals/trace.scm28
-rw-r--r--lang/elisp/primitives/.cvsignore2
-rw-r--r--lang/elisp/primitives/Makefile.am50
-rw-r--r--lang/elisp/primitives/buffers.scm16
-rw-r--r--lang/elisp/primitives/features.scm26
-rw-r--r--lang/elisp/primitives/fns.scm45
-rw-r--r--lang/elisp/primitives/format.scm6
-rw-r--r--lang/elisp/primitives/guile.scm20
-rw-r--r--lang/elisp/primitives/keymaps.scm26
-rw-r--r--lang/elisp/primitives/lists.scm103
-rw-r--r--lang/elisp/primitives/load.scm17
-rw-r--r--lang/elisp/primitives/match.scm68
-rw-r--r--lang/elisp/primitives/numbers.scm43
-rw-r--r--lang/elisp/primitives/pure.scm8
-rw-r--r--lang/elisp/primitives/read.scm10
-rw-r--r--lang/elisp/primitives/signal.scm6
-rw-r--r--lang/elisp/primitives/strings.scm34
-rw-r--r--lang/elisp/primitives/symprop.scm40
-rw-r--r--lang/elisp/primitives/syntax.scm266
-rw-r--r--lang/elisp/primitives/system.scm14
-rw-r--r--lang/elisp/primitives/time.scm17
-rw-r--r--lang/elisp/transform.scm111
-rw-r--r--lang/elisp/variables.scm42
-rw-r--r--libguile.h149
-rw-r--r--oop/.cvsignore2
-rw-r--r--oop/ChangeLog151
-rw-r--r--oop/Makefile.am33
-rw-r--r--oop/goops.scm1528
-rw-r--r--oop/goops/.cvsignore2
-rw-r--r--oop/goops/Makefile.am34
-rw-r--r--oop/goops/active-slot.scm91
-rw-r--r--oop/goops/compile.scm164
-rw-r--r--oop/goops/composite-slot.scm107
-rw-r--r--oop/goops/describe.scm225
-rw-r--r--oop/goops/dispatch.scm293
-rw-r--r--oop/goops/internal.scm50
-rw-r--r--oop/goops/old-define-method.scm85
-rw-r--r--oop/goops/save.scm899
-rw-r--r--oop/goops/stklos.scm122
-rw-r--r--oop/goops/util.scm136
-rw-r--r--pre-inst-guile.in83
-rw-r--r--qt/.cvsignore9
-rw-r--r--qt/CHANGES15
-rw-r--r--qt/ChangeLog273
-rw-r--r--qt/INSTALL81
-rw-r--r--qt/Makefile.am54
-rw-r--r--qt/Makefile.base112
-rw-r--r--qt/README89
-rw-r--r--qt/README.MISC56
-rw-r--r--qt/README.PORT112
-rw-r--r--qt/b.h11
-rwxr-xr-xqt/config308
-rw-r--r--qt/copyright.h12
-rw-r--r--qt/libqthreads.def10
-rw-r--r--qt/md/.cvsignore2
-rw-r--r--qt/md/Makefile.am30
-rw-r--r--qt/md/_sparc.s142
-rw-r--r--qt/md/_sparc_b.s106
-rw-r--r--qt/md/arm.h96
-rw-r--r--qt/md/arm.s34
-rw-r--r--qt/md/axp.1.Makefile5
-rw-r--r--qt/md/axp.2.Makefile5
-rw-r--r--qt/md/axp.Makefile5
-rw-r--r--qt/md/axp.README10
-rw-r--r--qt/md/axp.c133
-rw-r--r--qt/md/axp.h160
-rw-r--r--qt/md/axp.s160
-rw-r--r--qt/md/axp_b.s111
-rw-r--r--qt/md/default.Makefile6
-rw-r--r--qt/md/hppa-cnx.Makefile9
-rw-r--r--qt/md/hppa.Makefile9
-rw-r--r--qt/md/hppa.h194
-rw-r--r--qt/md/hppa.s237
-rw-r--r--qt/md/hppa_b.s203
-rw-r--r--qt/md/i386.README7
-rw-r--r--qt/md/i386.asm112
-rw-r--r--qt/md/i386.h120
-rw-r--r--qt/md/i386.s108
-rw-r--r--qt/md/i386_b.s30
-rw-r--r--qt/md/ksr1.Makefile6
-rw-r--r--qt/md/ksr1.h164
-rw-r--r--qt/md/ksr1.s424
-rw-r--r--qt/md/ksr1_b.s49
-rw-r--r--qt/md/m88k.Makefile6
-rw-r--r--qt/md/m88k.c111
-rw-r--r--qt/md/m88k.h159
-rw-r--r--qt/md/m88k.s132
-rw-r--r--qt/md/m88k_b.s117
-rw-r--r--qt/md/mips-irix5.s182
-rw-r--r--qt/md/mips.h134
-rw-r--r--qt/md/mips.s164
-rw-r--r--qt/md/mips_b.s99
-rw-r--r--qt/md/null.README0
-rw-r--r--qt/md/null.c14
-rw-r--r--qt/md/solaris.README19
-rw-r--r--qt/md/sparc.h140
-rw-r--r--qt/md/sparc.s142
-rw-r--r--qt/md/sparc_b.s106
-rw-r--r--qt/md/vax.h130
-rw-r--r--qt/md/vax.s69
-rw-r--r--qt/md/vax_b.s92
-rw-r--r--qt/meas.c1049
-rw-r--r--qt/qt.c48
-rw-r--r--qt/qt.h.in186
-rw-r--r--qt/stp.c199
-rw-r--r--qt/stp.h51
-rw-r--r--qt/time/.cvsignore2
-rw-r--r--qt/time/Makefile.am24
-rw-r--r--qt/time/README.time17
-rwxr-xr-xqt/time/assim42
-rwxr-xr-xqt/time/cswap37
-rwxr-xr-xqt/time/go43
-rwxr-xr-xqt/time/init42
-rwxr-xr-xqt/time/prim41
-rwxr-xr-xqt/time/raw58
-rw-r--r--scripts/.cvsignore2
-rw-r--r--scripts/ChangeLog286
-rw-r--r--scripts/Makefile.am67
-rwxr-xr-xscripts/PROGRAM45
-rw-r--r--scripts/README76
-rwxr-xr-xscripts/api-diff181
-rwxr-xr-xscripts/autofrisk221
-rwxr-xr-xscripts/display-commentary70
-rwxr-xr-xscripts/doc-snarf442
-rwxr-xr-xscripts/frisk292
-rwxr-xr-xscripts/generate-autoload146
-rwxr-xr-xscripts/lint319
-rwxr-xr-xscripts/punify89
-rwxr-xr-xscripts/read-rfc822133
-rwxr-xr-xscripts/read-scheme-source284
-rwxr-xr-xscripts/read-text-outline255
-rwxr-xr-xscripts/scan-api225
-rwxr-xr-xscripts/snarf-check-and-output-texi313
-rwxr-xr-xscripts/snarf-guile-m4-docs88
-rwxr-xr-xscripts/summarize-guile-TODO214
-rwxr-xr-xscripts/use2dot113
-rw-r--r--srfi/.cvsignore13
-rw-r--r--srfi/ChangeLog736
-rw-r--r--srfi/Makefile.am75
-rw-r--r--srfi/README76
-rw-r--r--srfi/srfi-1.scm1056
-rw-r--r--srfi/srfi-10.scm114
-rw-r--r--srfi/srfi-11.scm281
-rw-r--r--srfi/srfi-13.c3009
-rw-r--r--srfi/srfi-13.h140
-rw-r--r--srfi/srfi-13.scm176
-rw-r--r--srfi/srfi-14.c1453
-rw-r--r--srfi/srfi-14.h128
-rw-r--r--srfi/srfi-14.scm175
-rw-r--r--srfi/srfi-16.scm151
-rw-r--r--srfi/srfi-17.scm130
-rw-r--r--srfi/srfi-19.scm1561
-rw-r--r--srfi/srfi-2.scm56
-rw-r--r--srfi/srfi-4.c2155
-rw-r--r--srfi/srfi-4.h153
-rw-r--r--srfi/srfi-4.scm202
-rw-r--r--srfi/srfi-6.scm57
-rw-r--r--srfi/srfi-8.scm56
-rw-r--r--srfi/srfi-9.scm116
-rw-r--r--test-suite/.cvsignore6
-rw-r--r--test-suite/COPYING340
-rw-r--r--test-suite/ChangeLog815
-rw-r--r--test-suite/Makefile.am52
-rw-r--r--test-suite/README47
-rwxr-xr-xtest-suite/guile-test235
-rw-r--r--test-suite/lib.scm484
-rw-r--r--test-suite/tests/alist.test269
-rw-r--r--test-suite/tests/asmobs/Makefile0
-rw-r--r--test-suite/tests/asmobs/README0
-rw-r--r--test-suite/tests/asmobs/asmobs-test.scm0
-rw-r--r--test-suite/tests/asmobs/asmobs.c0
-rw-r--r--test-suite/tests/bit-operations.test354
-rw-r--r--test-suite/tests/c-api.test46
-rw-r--r--test-suite/tests/c-api/Makefile16
-rw-r--r--test-suite/tests/c-api/README7
-rw-r--r--test-suite/tests/c-api/strings.c70
-rw-r--r--test-suite/tests/c-api/testlib.c121
-rw-r--r--test-suite/tests/c-api/testlib.h28
-rw-r--r--test-suite/tests/chars.test31
-rw-r--r--test-suite/tests/common-list.test242
-rw-r--r--test-suite/tests/dynamic-scope.test78
-rw-r--r--test-suite/tests/elisp.test355
-rw-r--r--test-suite/tests/environments.test1070
-rw-r--r--test-suite/tests/eval.test248
-rw-r--r--test-suite/tests/exceptions.test86
-rw-r--r--test-suite/tests/format.test39
-rw-r--r--test-suite/tests/gc.test67
-rw-r--r--test-suite/tests/getopt-long.test274
-rw-r--r--test-suite/tests/goops.test169
-rw-r--r--test-suite/tests/guardians.test65
-rw-r--r--test-suite/tests/hooks.test149
-rw-r--r--test-suite/tests/import.test76
-rw-r--r--test-suite/tests/interp.test53
-rw-r--r--test-suite/tests/list.test628
-rw-r--r--test-suite/tests/load.test126
-rw-r--r--test-suite/tests/multilingual.nottest81
-rw-r--r--test-suite/tests/numbers.test1490
-rw-r--r--test-suite/tests/optargs.test29
-rw-r--r--test-suite/tests/ports.test466
-rw-r--r--test-suite/tests/r4rs.test1024
-rw-r--r--test-suite/tests/reader.test41
-rw-r--r--test-suite/tests/regexp.test102
-rw-r--r--test-suite/tests/srfi-10.test30
-rw-r--r--test-suite/tests/srfi-13.test1029
-rw-r--r--test-suite/tests/srfi-14.test188
-rw-r--r--test-suite/tests/srfi-17.test32
-rw-r--r--test-suite/tests/srfi-19.test157
-rw-r--r--test-suite/tests/srfi-4.test312
-rw-r--r--test-suite/tests/srfi-9.test42
-rw-r--r--test-suite/tests/strings.test88
-rw-r--r--test-suite/tests/symbols.test90
-rw-r--r--test-suite/tests/syncase.test37
-rw-r--r--test-suite/tests/syntax.test532
-rw-r--r--test-suite/tests/time.test28
-rw-r--r--test-suite/tests/version.test30
-rw-r--r--test-suite/tests/weaks.test210
517 files changed, 0 insertions, 146467 deletions
diff --git a/.cvsignore b/.cvsignore
deleted file mode 100644
index cdcf44864..000000000
--- a/.cvsignore
+++ /dev/null
@@ -1,21 +0,0 @@
-Makefile
-Makefile.in
-aclocal.m4
-autom4te.cache
-check-guile
-check-guile.log
-config.build-subdirs
-config.cache
-config.guess
-config.h.in
-config.log
-config.status
-config.sub
-configure
-guile-*.tar.gz
-guile-tools
-libltdl
-libtool
-ltconfig
-ltmain.sh
-pre-inst-guile
diff --git a/AUTHORS b/AUTHORS
deleted file mode 100644
index 9df01eb13..000000000
--- a/AUTHORS
+++ /dev/null
@@ -1,327 +0,0 @@
-To find out what should go in this file, see "Information For
-Maintainers of GNU Software" (maintain.texi), the section called
-"Recording Changes".
-
-
-Aubrey Jaffer:
-is the author of SCM, the Scheme interpreter upon which Guile is
-based. Guile started from SCM version 4e1 in November -94 and is
-still largely composed of the original SCM code.
-
-George Carrette:
-wrote files present in Siod version 2.3, released in December of 1989.
-Siod was the starting point for SCM. The major innovations taken from
-Siod are the evaluator's use of the C-stack and being able to garbage
-collect off the C-stack
-
-Radey Shouman:
-In the subdirectory libguile, wrote:
- gsubr.c ramap.c unif.c
- gsubr.h ramap.h unif.h
-
-Gary Houston:
-In the subdirectory libguile, wrote:
- rw.c
-In the subdirectory ice-9, wrote:
- expect.scm networking.scm popen.scm posix.scm rw.scm
-In the subdirectory doc, changes to:
- data-rep.texi expect.texi guile-tut.texi
- posix.texi r5rs.texi scheme-io.texi
-Many other changes throughout.
-
-Jim Blandy: Many changes throughout.
-In the subdirectory libguile, wrote:
- script.c (partially)
-In the subdirectory doc, wrote:
- data-rep.texi env.texi mbapi.texi
- mltext.texi hacks.el
-In the subdirectory doc/example-smob, wrote:
- image-type.c image-type.h myguile.c
-
-Tom Lord: Many changes throughout.
-In the subdirectory ice-9, wrote:
- Makefile.in configure.in lineio.scm poe.scm
- boot-9.scm hcons.scm mapping.scm
-
-Anthony Green: wrote the following files in libguile:
- coop-defs.h coop-threads.h fsu-pthreads.h mit-pthreads.h threads.h
- coop-threads.c coop.c mit-pthreads.c threads.c
-and ice-9/threads.scm.
-
-Mikael Djurfeldt:
-In the subdirectory ice-9, wrote:
- emacs.scm syncase.scm
-In the subdirectory libguile, wrote:
- backtrace.c debug.c options.c root.c srcprop.c stacks.c
- backtrace.h debug.h options.h root.h srcprop.h stacks.h
- iselect.c gdbint.c objects.c objprop.c stackchk.c modules.c
- iselect.h gdbint.h objects.h objprop.h stackchk.h modules.h
- random.c
- random.h
- gdb_interface.h
-In the subdirectory libguile, rewrote:
- coop-threads.c coop.c mit-pthreads.c threads.c print.c
- coop-threads.h fsu-pthreads.h mit-pthreads.h threads.h print.h
-In the subdirectory doc, wrote:
- goops-tutorial.texi hierarchy.eps
- hierarchy.txt mop.txt oldfmt.c
-In the subdirectory doc, changes to:
- data-rep.texi gh.texi goops.texi
-Many other changes throughout.
-
-Mark Galassi:
-Designed and implemented the high-level libguile API (the @code{gh_}
-interface), based largely on the defunct @code{gscm_} interface. In the
-subdirectory libguile, wrote:
-gh.h gh_funcs.c gh_list.c gh_test_repl.c
-gh_data.c gh_init.c gh_predicates.c
-gh_eval.c gh_io.c gh_test_c.c
-In the subdirectory doc, wrote:
- appendices.texi gh.texi guile-tut.texi
-
-Marius Vollmer: Many changes throughout.
-In the subdirectory libguile, wrote:
- fluids.c fluids.h extensions.h
- deprecation.h deprecation.c extensions.c
-In the subdirectory libguile, rewrote:
- dynl.c dynl-dl.c dynl-shl.c
- dynl.h dynl-dld.c
-In the subdirectory doc, changes to:
- data-rep.texi intro.texi posix.texi
- scheme-modules.texi
-In the subdirectory ice-9, wrote
- and-let-star-compat.scm
-
-R. Kent Dybvig:
-In the subdirectory ice-9, wrote:
- psyntax.ss
-
-Roland Orre:
-In the subdirectory libguile, wrote:
- sort.c
- sort.h
-In the subdirectory ice-9, wrote:
- session.scm
-
-Michael Livshin: Some changes throughout.
-Implemented support for double-word heap cells and converted some
-smobs to use them.
-In the subdirectory libguile, wrote:
- guardians.c guardians.h filter-doc-snarfage.c
- guile-snarf-docs.in guile-snarf-docs-texi.in
-In the subdirectory libguile, changed extensively:
- gc.c gc.h
-In the subdirectory ice-9, wrote:
- streams.scm and-let*.scm
-In the subdirectory scripts, wrote:
- snarf-check-and-output-texi
-
-Tim Pierce:
-In the subdirectory libguile, wrote:
- regex-posix.c
- regex-posix.h
-In the subdirectory doc, changes to:
- appendices.texi posix.texi
-
-Rob Browning:
- wrote initial srfi/srfi-2.scm.
- wrote initial srfi/srfi-6.scm.
- wrote initial srfi/srfi-8.scm.
- wrote initial srfi/srfi-11.scm.
- ported srfi/srfi-19.scm to Guile.
- and many other changes throughout.
-
-Martin Grabmueller:
-In the subdirectory libguile, changes to:
- backtrace.c eval.c strorder.c script.c
- strop.c strop.h struct.c macros.c
- numbers.c posix.h posix.c symbols.c
- gh_data.c strports.h strports.c validate.h
- read.c
- and many docstrings changes throughout.
-In the subdirectory srfi, wrote:
- srfi-1.scm srfi-9.scm srfi-10.scm
- srfi-13.scm srfi-14.scm srfi-13.c
- srfi-14.c srfi-13.h srfi-14.h
- srfi-16.scm srfi-4.c srfi-4.h
- srfi-4.scm
-In the subdirectory scripts, wrote:
- doc-snarf
-In the subdirectory doc, wrote:
- script-getopt.texi srfi-modules.texi
- repl-modules.texi misc-modules.texi
-In the subdirectory doc, changes to:
- guile.texi intro.texi posix.texi
- scheme-binding.texi scheme-control.texi
- scheme-data.texi scheme-evaluation.texi
- scheme-indices.texi scheme-io.texi
- scheme-memory.texi scheme-modules.texi
- scheme-options.texi scheme-procedures.texi
- scheme-scheduling.texi scheme-utility.texi
-In the subdirectory example, wrote
- scripts modules safe
- box box-module box-dynamic
-In the subdirectory test-suite/tests, wrote:
- srfi-4.test srfi-9.test srfi-10.test
- srfi-13.test
-
-Will Fitzgerald:
- wrote initial srfi/srfi-19.scm.
-
-Jost Boekemeier:
-In the subdirectory libguile, wrote:
- environments.c, environments.h
-
-Dirk Herrmann:
-In the subdirectory doc, changes to:
- data-rep.texi, scm.texi
-In the subdirectory libguile, rewrote:
- environments.c, environments.h
-In the subdirectory libguile, changes to:
- error.c, gc.c, gc.h, numbers.c, strings.c, symbols.c
-In the subdirectory test-suite, rewrote:
- lib.scm
-In the subdirectory test-suite/tests, wrote:
- bit-operations.test, common-list.test, environments.test, eval.test,
- gc.test, list.test, numbers.test, symbols.test, syntax.test
-Many other changes throughout.
-
-Greg Badros:
-In the subdirectory doc, changes to:
- data-rep.texi
-Many changes throughout.
-
-Neil Jerram:
-In the subdirectory ice-9, wrote:
- buffered-input.scm
-In the subdirectory doc, wrote:
- deprecated.texi goops.texi scheme-ideas.texi
- scheme-reading.texi
-In the subdirectory doc, changes to:
- appendices.texi data-rep.texi expect.texi
- extend.texi gh.texi guile-tut.texi
- guile.texi indices.texi intro.texi
- posix.texi preface.texi r5rs.texi
- scheme-binding.texi scheme-modules.texi
- scheme-control.texi scheme-data.texi
- scheme-debug.texi scheme-evaluation.texi
- scheme-ideas.texi scheme-indices.texi
- scheme-intro.texi scheme-io.texi
- scheme-memory.texi scheme-options.texi
- scheme-procedures.texi scheme-scheduling.texi
- scheme-translation.texi scheme-utility.texi
- scm.texi scripts.texi script-getopt.texi
-In the subdirectory doc/maint, wrote:
- docstring.el
-
-Thien-Thi Nguyen:
-In the top-level directory, wrote:
- check-guile.in guile-tools.in
-In the subdirectory ice-9, changes to:
- boot-9.scm documentation.scm emacs.scm
- ls.scm session.scm string-fun.scm
- threads.scm getopt-long.scm
-In the subdirectory scripts, wrote:
- Makefile.am PROGRAM
- display-commentary generate-autoload
- punify read-scheme-source
- use2dot
-In the subdirectory scripts, changes to:
- doc-snarf
-In the subdirectory libguile, changes to:
- guile-doc-snarf.in regex-posix.c
-In the subdirectory doc, changes to:
- intro.texi preface.texi
- scheme-modules.texi scheme-procedures.texi
- scheme-scheduling.texi
-In the subdirectory test-suite, changes to:
- guile-test lib.scm
-In the subdirectory test-suite/tests, wrote:
- exceptions.test getopt-long.test
-In the subdirectory test-suite/tests, changes to:
- eval.test
-
-Robert Merkel:
-In the subdirectory doc, co-wrote:
- guile.1
-
-Marc Feeley:
-In the subdirectory doc, wrote:
- pretty-print.scm
-
-Matthias Koeppe:
-In the subdirectory test-suite/tests, wrote:
- format.test, srfi-19.test, optargs.test
-In the subdirectory test-suite/tests, changes to:
- ports.test
-
-The file libguile/gc_os_dep.c is from the Boehm-Weiser conservative
-collector. A lot of people have contributed to it, but probably not
-all to the code in gc_os_dep.c:
-
- The SPARC specific code was contributed by Mark Weiser
- (weiser@parc.xerox.com). The Encore Multimax modifications were
- supplied by Kevin Kenny (kenny@m.cs.uiuc.edu). The adaptation to
- the RT is largely due to Vernon Lee (scorpion@rice.edu), on
- machines made available by IBM. Much of the HP specific code and
- a number of good suggestions for improving the generic code are
- due to Walter Underwood (wunder@hp-ses.sde.hp.com). Robert
- Brazile (brazile@diamond.bbn.com) originally supplied the ULTRIX
- code. Al Dosser (dosser@src.dec.com) and Regis Cridlig
- (Regis.Cridlig@cl.cam.ac.uk) subsequently provided updates and
- information on variation between ULTRIX systems. Parag Patel
- (parag@netcom.com) supplied the A/UX code. Jesper
- Peterson(jep@mtiame.mtia.oz.au), Michel Schinz, and Martin
- Tauchmann (martintauchmann@bigfoot.com) supplied the Amiga port.
- Thomas Funke (thf@zelator.in-berlin.de(?)) and Brian D.Carlstrom
- (bdc@clark.lcs.mit.edu) supplied the NeXT ports. Douglas Steel
- (doug@wg.icl.co.uk) provided ICL DRS6000 code. Bill Janssen
- (janssen@parc.xerox.com) supplied the SunOS dynamic loader
- specific code. Manuel Serrano (serrano@cornas.inria.fr) supplied
- linux and Sony News specific code. Al Dosser provided Alpha/OSF/1
- code. He and Dave Detlefs(detlefs@src.dec.com) also provided
- several generic bug fixes. Alistair G. Crooks(agc@uts.amdahl.com)
- supplied the NetBSD and 386BSD ports. Jeffrey Hsu
- (hsu@soda.berkeley.edu) provided the FreeBSD port. Brent Benson
- (brent@jade.ssd.csd.harris.com) ported the collector to a Motorola
- 88K processor running CX/UX (Harris NightHawk). Ari Huttunen
- (Ari.Huttunen@hut.fi) generalized the OS/2 port to nonIBM
- development environments (a nontrivial task). Patrick Beard
- (beard@cs.ucdavis.edu) provided the initial MacOS port. David
- Chase, then at Olivetti Research, suggested several improvements.
- Scott Schwartz (schwartz@groucho.cse.psu.edu) supplied some of the
- code to save and print call stacks for leak detection on a SPARC.
- Jesse Hull and John Ellis supplied the C++ interface code. Zhong
- Shao performed much of the experimentation that led to the current
- typed allocation facility. (His dynamic type inference code
- hasn't made it into the released version of the collector, yet.)
- (Blame for misinstallation of these modifications goes to the
- first author, however.)
-
-Keisuke Nishida: [added by ttn; kei, please review]
-In the top-level directory, changes to:
- libguile.h
-In the subdirectory ice-9, wrote:
- channel.scm history.scm time.scm
- match.scm
-In the subdirectory ice-9, changes to:
- boot-9.scm receive.scm safe-r5rs.scm
- common-list.scm
-In the subdirectory emacs, wrote:
- guile.el guile-scheme.el guile-emacs.scm
-In the subdirectory libguile, changes to:
- goops.c vectors.h vectors.c
- eval.c hashtab.h hashtab.c
- environments.c smob.h smob.c
- keywords.c list.c strports.c
- tag.c Makefile.am guile-snarf.awk.in
-Many other changes throughout.
-
-Stefan Jahn:
-In the subdirectory libguile, changes to:
- continuations.h
- continuations.c
- gc.c
-
-John W. Eaton, based on code from AT&T Bell Laboratories and Bellcore:
- The complex number division method in libguile/numbers.c.
diff --git a/COPYING b/COPYING
deleted file mode 100644
index eeb586b39..000000000
--- a/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED 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.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
-
- 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 of the License, 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 program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) 19yy name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644
index 9f3b87388..000000000
--- a/ChangeLog
+++ /dev/null
@@ -1,2216 +0,0 @@
-2002-07-22 Han-Wen <hanwen@cs.uu.nl>
-
- * autogen.sh (mscripts): find and check version number of
- automake. Complain if 1.6 is not found.
-
-2002-07-20 Han-Wen <hanwen@cs.uu.nl>
-
- * autogen.sh (mscripts): find and check version number of
- autoconf. Complain if 2.53 is not found.
-
-2002-07-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * benchmark-guile.in: Copied from check-guile.in and adapted for
- use with benchmarks.
-
- * Makefile.am: Recurse into the benchmark-suite subdir.
-
- * configure.in: Added benchmarking files.
-
-2002-07-12 Gary Houston <ghouston@arglist.com>
-
- * configure.in: check dynamic linking before modules. Add dynl.c
- if dynamic linking is available, i.e., unless --with-modules=no
- was given to configure.
-
-2002-07-09 Marius Vollmer <marius.vollmer@uni-dortmund.de>
-
- * autogen.sh: Patch libltdl/ltdl.c to avoid a nasty bug in
- libtool-1.4.2.
-
-2002-07-07 Marius Vollmer <mvo@zagadka.ping.de>
-
- * autogen.sh: Do not copy INSTALL from workbook since it is not
- uniform across branches.
- * INSTALL: Re-added to repository.
-
- Crosscompiling and Cygwin fixes from Jan Nieuwenhuizen. Thanks!
-
- * autogen.sh: Only fix libltdl/configure.in if it exists. Current
- libtool CVS does not need this fix.
-
- * configure.in (AC_LIBTOOL_WIN32_DLL): Add for shared Cygwin
- build.
- Add --with-cc-for-build option to re-enable cross building.
- Add --with-guile-for-build option to re-enable cross building.
-
-2002-06-30 Gary Houston <ghouston@arglist.com>
-
- * autogen.sh: Changed the path to the scripts directory.
- In libltdl, run aclocal before autoconf and automake: this
- eliminated various warnings after upgrading to newer automake.
-
-2002-05-22 Marius Vollmer <mvo@zagadka.ping.de>
-
- From John W. Eaton <jwe@bevo.che.wisc.edu>
-
- * configure.in (AC_CHECK_FUNCS): Check for copysign.
-
-2002-05-10 Marius Vollmer <marius.vollmer@uni-dortmund.de>
-
- * libguile.h: Added inclusion of "extensions.h".
-
-2002-05-06 Marius Vollmer <mvo@zagadka.ping.de>
-
- * configure.in: Include <sys/types.h> before <netinet/in.h> when
- checking vor IPv6. This is for NetBSD 1.5. Thanks to Greg
- Troxel!
-
- From John W. Eaton.
-
- * configure.in (AC_CHECK_HEADERS): Check for floatingpoint.h
- ieeefp.h, and nan.h.
- (AC_CHECK_FUNCS): Check for finite, isinf, and isnan.
-
-2002-05-01 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * autogen.sh: Add call to $mscripts/render-bugs
- to create BUGS file.
-
- * BUGS: bye bye
-
-2002-04-27 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * Makefile.am (EXTRA_DIST): Remove qthreads.m4.
-
-2002-04-26 Marius Vollmer <mvo@zagadka.ping.de>
-
- * guile-aclocal.sh: Replaced with a simple invocation of "aclocal
- -I guile-config". This works as of automake 1.5.
- * qthreads.m4: Moved to guile-config/.
-
-2002-04-18 Marius Vollmer <marius.vollmer@uni-dortmund.de>
-
- * autogen.sh: Call automake twice for guile-core so that two
- copies of mdate-sh get a chance of being installed (one in
- doc/ref/ and one in doc/tutorial/).
-
-2002-04-16 Marius Vollmer <mvo@zagadka.ping.de>
-
- * Makefile.am (AUTOMAKE_OPTIONS): New, to request version 1.5.
- (EXTRA_DIST): Don't distribute acconfig.h, which is gone.
- (dist-hook): Removed.
- (DISTCLEANFILES): Added check-guile.log.
- (EXTRA_DIST): Don't distribute TODO.
-
- * configure.in: Bump required autoconf version to 2.53. Move uses
- of AC_LIBOBJ after AC_PROG_CC. AC_LIBOBJ needs OBJEXT which is
- set by AC_PROG_CC.
-
-2002-04-10 Rob Browning <rlb@defaultvalue.org>
-
- * configure.in: updates for new autoconf -- add definitions to
- AC_DEFINE calls, and convert occurences of LIBOBJS to AC_LIBOBJ
- calls.
-
- * acinclude.m4: add definitions to AC_DEFINE calls for new
- autoconf.
-
- * acconfig.h: removed -- newer autoconf doesn't like it, and now
- we don't need it.
-
- * .cvsignore: add autom4te.cache and pre-inst-guile.
-
-2002-04-03 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * RELEASE: bye bye
-
-2002-03-31 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * Makefile.am: Update copyright.
- (dist-hook): Add, including related am/maintainers-dirs,
- surrounded by "if MAINTAINER_MODE".
-
- * TODO: bye bye
-
- * autogen.sh: Add usage comment.
- Add workbook specification.
- Add dist-files symlinking.
-
- * ANON-CVS, HACKING, INSTALL, SNAPSHOTS: bye bye
-
-2002-03-06 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * guile-tools.in: Handle "--source" option.
-
-2002-03-04 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * configure.in (top_srcdir_absolute): New AC_SUBST var.
-
- * pre-inst-guile.in, check-guile.in (top_srcdir):
- Use `top_srcdir_absolute' AC_SUBST var.
-
- * pre-inst-guile.in (top_srcdir): Fix ref bug: Force absolute.
-
-2002-02-27 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * pre-inst-guile.in: Typofix; nfc.
-
-2002-02-27 Stefan Jahn <stefan@lkcc.org>
-
- * Makefile.am (SUBDIRS): Added the `am' directory.
-
-2002-02-26 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * pre-inst-guile.in: New file.
-
- * pre-inst-guile, pre-inst-guile.am: bye bye
-
- * configure.in (top_builddir_absolute): New AC_SUBST var.
- (AC_CONFIG_FILES): Add am/Makefile, pre-inst-guile.
- (AC_CONFIG_COMMANDS): Also chmod +x pre-inst-guile.
-
- * check-guile.in (top_builddir): Use AC_SUBST var
- `top_builddir_absolute'.
- (guile): Look for pre-inst-guile in $top_builddir.
-
- * Makefile.am (EXTRA_DIST): Remove pre-inst-guile,
- pre-inst-guile.am.
-
-2002-02-24 Rob Browning <rlb@defaultvalue.org>
-
- * GUILE-VERSION: move all but guile-readline library versioning
- information here. guile-readline is still standalone. Bump
- CURRENT interfaces to 15 to allow some headroom for 1.6 release at
- Thi-Thien's request.
-
- * configure.in: AC_SUBST the centralized shared lib versioning
- variables from ./GUILE-VERSION.
- (LIBQTHREADS_INTERFACE_CURRENT): new AC_SUBST.
- (LIBQTHREADS_INTERFACE_REVISION): new AC_SUBST.
- (LIBQTHREADS_INTERFACE_AGE): new AC_SUBST.
- (LIBQTHREADS_INTERFACE): new AC_SUBST.
- (LIBGUILE_INTERFACE_CURRENT): new AC_SUBST.
- (LIBGUILE_INTERFACE_REVISION): new AC_SUBST.
- (LIBGUILE_INTERFACE_AGE): new AC_SUBST.
- (LIBGUILE_INTERFACE): new AC_SUBST.
- (LIBGUILE_SRFI_SRFI_4_INTERFACE_CURRENT): new AC_SUBST.
- (LIBGUILE_SRFI_SRFI_4_INTERFACE_REVISION): new AC_SUBST.
- (LIBGUILE_SRFI_SRFI_4_INTERFACE_AGE): new AC_SUBST.
- (LIBGUILE_SRFI_SRFI_4_INTERFACE): new AC_SUBST.
- (LIBGUILE_SRFI_SRFI_13_14_INTERFACE_CURRENT): new AC_SUBST.
- (LIBGUILE_SRFI_SRFI_13_14_INTERFACE_REVISION): new AC_SUBST.
- (LIBGUILE_SRFI_SRFI_13_14_INTERFACE_AGE): new AC_SUBST.
- (LIBGUILE_SRFI_SRFI_13_14_INTERFACE): new AC_SUBST.
-
- * autogen.sh: make absolutely sure we can't have stale files from
- old versions lying around the libltdl dir since libtoolize
- doesn't. Also hack libltdl's configure.in to require autoconf 2.5
- so the main tree and libltdl can't get out of sync again.
-
- * RELEASE: update release building instructions.
-
-2002-02-21 Neil Jerram <neil@ossau.uklinux.net>
-
- * acinclude.m4 (GUILE_HEADER_LIBC_WITH_UNISTD): Use [] rather than
- "" for multiword string. Thanks to Christopher Cramer for
- pointing this out.
-
-2002-02-11 Marius Vollmer <marius.vollmer@uni-dortmund.de>
-
- * acconfig.h (GUILE_DEBUG_MALLOC): Refer to scm_gc_malloc, etc,
- instead of to scm_must_malloc.
-
-2002-02-07 Marius Vollmer <marius.vollmer@uni-dortmund.de>
-
- * Makefile.am (EXTRA_DIST): Added pre-inst-guile and
- pre-inst-guile.am.
-
-2002-02-05 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * pre-inst-guile.am, pre-inst-guile: New files.
-
- * check-guile.in (srcdir): Delete var.
- (top_builddir, top_srcdir, guile_opts): New vars.
-
- Use "set -e".
- No longer set LTDL_LIBRARY_PATH.
- Use ${top_srcdir}/pre-inst-guile instead of libguile/guile.
-
- * configure.in (libguile/guile-snarf-docs-texi): Remove
- from `AC_CONFIG_FILES' and `AC_CONFIG_COMMANDS'.
-
- * check-guile.in (top_builddir): Fix bug: Use cwd.
- (TEST_SUITE_DIR): Fix bug: Use `top_srcdir'.
- (GUILE_LOAD_PATH): No longer include $top_srcdir.
-
- * pre-inst-guile: Fix bug: Use ":" in `case' pattern to prevent
- prefix aliasing.
-
-2002-01-31 Stefan Jahn <stefan@lkcc.org>
-
- * configure.in: Add -DLIBLTDL_DLL_IMPORT to INCLTDL when using
- `libltdl.dll'.
-
-2002-01-28 Stefan Jahn <stefan@lkcc.org>
-
- * configure.in (guile_cv_have_uint32_t): Look also in
- `stdint.h' for uint32_t.
-
-2002-01-13 Neil Jerram <neil@ossau.uklinux.net>
-
- * Makefile.am (SUBDIRS): Added lang.
-
- * configure.in (AC_CONFIG_FILES): Added Makefiles in lang,
- lang/elisp, lang/elisp/internals and lang/elisp/primitives.
-
-2002-01-11 Neil Jerram <neil@ossau.uklinux.net>
-
- * acconfig.h (SCM_ENABLE_ELISP): New conditional.
-
- * configure.in (SCM_ENABLE_ELISP): Define this conditional (or
- not) according to absence (or presence) of `--disable-elisp'
- in the configure args.
-
-2001-12-31 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * TODO: Added two items.
-
-2001-12-26 Marius Vollmer <mvo@zagadka.ping.de>
-
- * configure.in (HAVE_MAKEINFO): Check for the makeinfo program and
- set this conditional accordingly.
-
-2001-12-01 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * README: Fix virulent typo.
-
-2001-11-25 Marius Vollmer <mvo@zagadka.ping.de>
-
- * acconfig.h (HAVE_INLINE): Added template.
- * configure.in (HAVE_INLINE): Define it when the compiler supports
- inline functions.
-
- * libguile.h: Include "libguile/inline.h".
-
-2001-11-22 Gary Houston <ghouston@arglist.com>
-
- * HACKING: Modified the Hacking It Yourself section. Removed the
- version numbers from the tools.
- HACKING, README, ANON-CVS: updates.
-
-2001-11-21 Gary Houston <ghouston@arglist.com>
-
- * HACKING: Removed reference to no longer practiced * in ChangeLog
- convention.
-
-2001-11-19 Thien-Thi Nguyen <ttn@glug.org>
-
- * BUGS (11): Set "fixed: no-need".
-
- * TODO (write emacs/patch.el): New item, self-assigned.
-
-2001-11-19 Rob Browning <rlb@defaultvalue.org>
-
- * configure.in: switch to AC_LIBLTDL_INSTALLABLE so we'll use the
- system libltdl when it's available. Aside from the normal reasons
- to prefer installed shared libs, this means other apps that link
- with libguile and also use libltdl will be more likely to work
- right.
-
-2001-11-17 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * BUGS (4): Set "fixed: 2001-11-17 (1.7.x)".
-
-2001-11-15 Thien-Thi Nguyen <ttn@glug.org>
-
- * guile-tools.in: Handle command "list" specially: list scripts dir.
-
- (help): Make more informative.
-
-2001-11-12 Marius Vollmer <mvo@zagadka.ping.de>
-
- * autogen.sh: Recurse into libltdl directory and invoke autoconf
- there.
-
-2001-11-11 Thien-Thi Nguyen <ttn@glug.org>
-
- * HACKING: Restrict documentation change log
- waiver to only apply to ChangeLog files.
-
-2001-11-12 Marius Vollmer <mvo@zagadka.ping.de>
-
- * configure.in: Check for sizes of short, size_t, uintptr_t, and
- ptrdiff_t. Checking for a size also checks automatically for the
- existence of the type, so we don't check for the existence of
- uintptr_t, ptrdiff_t and long long ourselves.
-
-2001-11-10 Thien-Thi Nguyen <ttn@glug.org>
-
- * BUGS (11): New.
-
-2001-11-07 Stefan Jahn <stefan@lkcc.org>
-
- * configure.in: Include `win32-socket.o' in the list of object
- files if networking is enabled on Win32.
-
-2001-11-06 Thien-Thi Nguyen <ttn@glug.org>
-
- * TODO (sync srfi-modules.texi): New, done.
-
- * BUGS (9, 10): New.
-
-2001-11-04 Stefan Jahn <stefan@lkcc.org>
-
- * NEWS: Corrected remarks about SCM_API.
-
- * configure.in: Defining USE_DLL_IMPORT definition to indicate
- usage of DLL import macros in `libguile/__scm.h'.
- (LIBOBJS): Removed `fileblocks.o' from the list of object files.
- Somehow Jim Blandy's patch from 1997 did not survive.
-
-2001-11-02 Marius Vollmer <mvo@zagadka.ping.de>
-
- Support for native Win32. Thanks to Stefan Jahn!
-
- * check-guile.in: Replaced `ln -s' by `@LN_S@' to supports
- build systems which do not have symbolic links.
- * configure.in: Define AC_LIBTOOL_WIN32_DLL to build clean dlls
- on Win32 platforms.
- Checking for `ws2_32.dll', `winsock2.h', add `win32-uname.o'
- and `win32-dirent.o' and define extra compiler flags necessary
- to build clean dlls.
- Check for `regcomp()' inside `-lregex'.
-
-2001-10-26 Thien-Thi Nguyen <ttn@glug.org>
-
- * BUGS (7, 8): New.
-
-2001-10-25 Thien-Thi Nguyen <ttn@glug.org>
-
- * BUGS: Expand on file format description.
-
- (1): Update "fixed" field.
- (2, 3, 4, 5, 6): New.
-
-2001-10-14 Gary Houston <ghouston@arglist.com>
-
- * configure.in: include sys/types.h when testing uint32_t.
- thanks to Bill Schottstaedt.
-
-2001-10-14 Marius Vollmer <mvo@zagadka.ping.de>
-
- * configure.in: Do not use an absolute path for <unistd.h> when
- checking for return type of usleep. Thanks to Michael Carmack.
-
-2001-09-30 Thien-Thi Nguyen <ttn@glug.org>
-
- * BUGS: New file.
- * Makefile.am (EXTRA_DIST): Add BUGS file.
-
-2001-09-25 Thien-Thi Nguyen <ttn@glug.org>
-
- * TODO: Add bugfix item to "Eventually".
-
-2001-09-20 Rob Browning <rlb@defaultvalue.org>
-
- * configure.in (AC_CONFIG_FILES): add libguile/version.h.
-
-2001-09-11 Rob Browning <rlb@defaultvalue.org>
-
- * RELEASE: Deleted Ian Grant and Julian Satchell's addresses from
- the testing list since they're no longer functional.
-
-2001-09-04 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * TODO:
- Use outline mode instead of text.
- Reword protocol explanation.
- Add "make error-signalling functions more consistent" to Eventually.
- Move some C-related GOOPS tasks to 1.8.0, take ownership.
-
-2001-08-31 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * HACKING (Sample GDB Initialization File): New section.
-
- * TODO (1.8.0): Add "move .gdbinit" entry.
-
-2001-08-31 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * TODO: Added some points, and eliminated all done items.
-
- * acconfig.h, configure.in (SCM_DEBUG_DEPRECATED,
- SCM_ENABLE_DEPRECATED): Renamed SCM_DEBUG_DEPRECATED to
- SCM_ENABLE_DEPRECATED with the logic reversed.
-
-2001-08-31 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * libguile.h: Removed bogus comment, rearranged includes, removed
- deprecated definitions.
-
- (LIBGUILEH, SCM_LIBGUILE_H): Renamed <foo>H to SCM_<foo>_H.
-
-2001-08-30 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * HACKING: Mention libtool ./configure-regeneration requirement.
-
-2001-08-27 Marius Vollmer <mvo@zagadka.ping.de>
-
- * check-guile.in: Do not include ".libs" in LTDL_LIBRARY_PATH,
- libltdl provides it itself.
-
-2001-08-24 Neil Jerram <neil@ossau.uklinux.net>
-
- * configure.in (AC_CONFIG_FILES): Add per-manual doc directory
- Makefiles.
-
-2001-08-15 Rob Browning <rlb@defaultvalue.org>
-
- * configure.in
- (LIBGUILE_INTERFACE_CURRENT): use libtool versioning scheme.
- (LIBGUILE_INTERFACE_REVISION): use libtool versioning scheme.
- (LIBGUILE_INTERFACE_AGE): use libtool versioning scheme.
- (LIBGUILE_INTERFACE): use libtool versioning scheme.
- (LIBGUILEQTHREADS_INTERFACE_CURRENT): use libtool versioning scheme.
- (LIBGUILEQTHREADS_INTERFACE_REVISION): use libtool versioning scheme.
- (LIBGUILEQTHREADS_INTERFACE_AGE): use libtool versioning scheme.
- (LIBGUILEQTHREADS_INTERFACE): use libtool versioning scheme.
-
- * GUILE-VERSION (GUILE_MINOR_VERSION): bump for new unstable.
- (GUILE_MICRO_VERSION): reset for new unstable.
- (LIBGUILE_INTERFACE_CURRENT): use libtool versioning scheme.
- (LIBGUILE_INTERFACE_REVISION): use libtool versioning scheme.
- (LIBGUILE_INTERFACE_AGE): use libtool versioning scheme.
- (LIBGUILE_INTERFACE): use libtool versioning scheme.
- (LIBGUILEQTHREADS_INTERFACE_CURRENT): use libtool versioning scheme.
- (LIBGUILEQTHREADS_INTERFACE_REVISION): use libtool versioning scheme.
- (LIBGUILEQTHREADS_INTERFACE_AGE): use libtool versioning scheme.
- (LIBGUILEQTHREADS_INTERFACE): use libtool versioning scheme.
-
-2001-08-07 Marius Vollmer <mvo@zagadka.ping.de>
-
- * Makefile.am (EXTRA_DIST, SUBDIRS): Move test-suite from
- EXTRA_DIST to SUBDIRS.
-
- * configure.in: Added "test-suite/Makefile".
-
-2001-08-01 Marius Vollmer <mvo@zagadka.ping.de>
-
- * configure.in: Added `--disable-linuxthreads' option and do not
- define GUILE_PTHREAD_COMPAT nor link with -lpthread when it is
- given. Thanks to Cris Cramer!
-
-2001-07-23 Marius Vollmer <mvo@zagadka.ping.de>
-
- * Makefile.am (SUBDIRS): Build libguile before ice-9.
-
-2001-07-22 Marius Vollmer <mvo@zagadka.ping.de>
-
- * configure.in: Check for "inttypes.h".
-
-2001-07-19 Rob Browning <rlb@defaultvalue.org>
-
- * configure.in: add checks for setitimer and getitimer.
- Add --enable-error-on-warning.
-
-2001-07-18 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * INSTALL, Makefile.am, configure.in: Updated copyright notice.
-
-2001-07-15 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * HACKING: Remove onerous authorship-info deletion clause.
-
-2001-07-13 Keisuke Nishida <knishida@nurs.or.jp>
-
- * autogen.sh: Call libtoolize with --force.
-
-2001-07-10 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * INSTALL: Point to HACKING for tool versions.
-
-2001-07-08 Rob Browning <rlb@defaultvalue.org>
-
- * TODO: updated to include relevant itemized post-1.6-RELEASE
- tasks that are distributable so we can check them off as they are
- done, and delete 1.6.0 tasks.
-
- * RELEASE: add a note that the RELEASE instructions are out of
- date now that we're using branches.
-
- * AUTHORS: add "many files throughout" for myself.
-
-2001-06-28 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * README: Also mention guile-tools.
-
- * README: Mention libguile-srfi-*, oop/*, scripts/* and srfi/*.
-
-2001-06-27 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * RELEASE: Move todo items to file TODO.
-
- * TODO: Initial revision
-
- * Makefile.am (EXTRA_DIST): Add TODO.
-
- * HACKING: Refer to TODO and SNAPSHOTS.
- No longer refer to devel/tasks.text.
-
- * SNAPSHOTS: Fix reference bug; recommended tool
- versions are in HACKING.
-
- * TODO: Add completion and ownership protocol to header comments.
-
- * RELEASE: Add TODO-processing to spiffing checklist.
-
- * HACKING: Update deprecation procedure to refer to TODO.
-
-2001-06-27 Michael Livshin <mlivshin@bigfoot.com>
-
- * autogen.sh: don't run flex here.
-
- * HACKING: clarify that newer versions of flex should be just
- fine.
-
-2001-06-26 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * HACKING, ANON-CVS: Removed mentioning of guile-doc CVS module.
-
- * configure.in: Added some header and function checks.
-
-2001-06-25 Neil Jerram <neil@ossau.uklinux.net>
-
- * autogen.sh: Quoting fix for `--enable-maintainer-mode'.
-
-2001-06-25 Marius Vollmer <mvo@zagadka.ping.de>
-
- * autogen.sh: Added message about what to do next. Tell them to
- use `--enable-maintainer-mode'.
-
-2001-06-25 Michael Livshin <mlivshin@bigfoot.com>
-
- * HACKING: mention flex.
-
- * autogen.sh: generate libguile/c-tokenize.c.
-
-2001-06-20 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * libguile.h: Removed inclusion of libguile/tag.h.
-
-2001-06-16 Marius Vollmer <mvo@zagadka.ping.de>
-
- * libguile.h (scm_cond_t, scm_key_t, scm_mutex_t): Only define
- these when using threads.
-
-2001-06-14 Marius Vollmer <mvo@zagadka.ping.de>
-
- * libguile.h: Added deprecated section with the olde type names.
-
- * configure.in: Check for header <stdint.h>. Check for uintptr_t
- type. Use AC_CHECK_TYPES for this. Do not caus ptrdiff_t to be
- `#defined'.
-
- * acconfig.h (ptrdiff_t): Removed.
-
-2001-06-05 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * configure.in: Generate examples/box-dynamic-module/Makefile.
-
-2001-06-03 Marius Vollmer <mvo@zagadka.ping.de>
-
- * configure.in (AC_CONFIG_FILES, AC_CONFIG_COMMANDS): Add
- guile-snarf.
-
-2001-06-02 Rob Browning <rlb@cs.utexas.edu>
-
- * configure.in: changes for autoconf 2.50.
- (AC_PREREQ): require at least autoconf 2.50.
- (AC_INIT): no longer takes an arg.
- (AC_CONFIG_SRCDIR): takes arg AC_INIT used to take.
- (AC_STRUCT_ST_RDEV): changed -> AC_CHECK_MEMBERS.
- (AC_STRUCT_ST_BLKSIZE): deprecated -> AC_CHECK_MEMBERS.
- (AC_STRUCT_ST_BLOCKS): use it rather than our version.
- (AC_CONFIG_FILES): now generated files go here, not in AC_OUTPUT.
- (AC_CONFIG_COMMANDS): now actions go here, not in AC_OUTPUT.
- (AC_OUTPUT): no longer takes args.
-
- * acinclude.m4: AC_LANG not a variable now -- use __cplusplus
- unconditionally .
-
-2001-06-02 Marius Vollmer <mvo@zagadka.ping.de>
-
- * configure.in: Check for mkstemp via AC_REPLACE_FUNCS. Thanks to
- I. N. Golubev!
-
-2001-06-01 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * configure.in: Generate examples/box-dynamic/Makefile.
-
-2001-05-31 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * Makefile.am (EXTRA_DIST): New subdirectory `examples'.
-
- * configure.in: Added all Makefiles in the `examples' directory to
- AC_OUTPUT.
-
-2001-05-31 Michael Livshin <mlivshin@bigfoot.com>
-
- * configure.in: generate guile-snarf-docs & guile-snarf-docs-texi.
- don't generate guile-snarf.awk.
-
- * Makefile.am (EXTRA_DIST): add test-suite.
-
-2001-05-28 Michael Livshin <mlivshin@bigfoot.com>
-
- * check-guile.in: fix to be runnable when srcdir!=builddir.
-
-2001-05-26 Michael Livshin <mlivshin@bigfoot.com>
-
- revert the controversial part of the 2001-05-23 changes
-
-2001-05-23 Michael Livshin <mlivshin@bigfoot.com>
-
- * configure.in: configury for SCM_[U]BITS_T, some more sizeofs.
- also, make sure that the integral type choosen to represent an SCM
- has exactly the same size as a void pointer.
-
- * acconfig.h: add undefs for SCM_BITS_T, SCM_UBITS_T,
- SCM_SIZEOF_BITS_T, ptrdiff_t.
-
-2001-05-16 Rob Browning <rlb@cs.utexas.edu>
-
- * configure.in: add AC_SUBST for GUILE_MICRO_VERSION.
-
- * GUILE-VERSION
- (GUILE_VERSION): now MAJOR.MINOR.MICRO
- (GUILE_MICRO_VERSION): new variable, records final revision.
- i.e. the 5 in 1.6.5. MINOR_VERSION is now just the middle number,
- i.e. the 6.
-
-2001-05-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * acconfig.h, configure.in: Renamed
- GUILE_WARN_DEPRECATED_DEFAULT to SCM_WARN_DEPRECATED_DEFAULT.
-
-2001-05-15 Marius Vollmer <mvo@zagadka.ping.de>
-
- * acinclude.m4: Removed copy of "libtool.m4".
-
-2001-05-14 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * configure.in (SCM_DEBUG_DEPRECATED): Always defined.
-
-2001-05-13 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * AUTHORS (Martin Grabmueller, Thien-Thi Nguyen): Update.
-
- * HACKING: Update copyright.
- Add blurb pointing to devel/tasks.text.
-
-2001-05-11 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * check-guile.in: For SRFI testing, set and export env
- var `LTDL_LIBRARY_PATH'.
-
-2001-05-07 Neil Jerram <neil@ossau.uklinux.net>
-
- * AUTHORS: Add docs-related authorship details.
-
-2001-05-05 Marius Vollmer <mvo@zagadka.ping.de>
-
- * configure.in (--enable-deprecated): Recognize "shutup" option
- argument and turn it into the default warning level "no".
-
-2001-05-05 Gary Houston <ghouston@arglist.com>
-
- * acconfig.h: add HAVE_IPV6.
- * configure.in: check whether we can compile with IPv6 support.
-
-2001-05-04 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * guile-tools.in: New file.
-
- * configure.in (AC_OUTPUT): Add guile-tools, and make
- executable.
-
- * Makefile.am (bin_SCRIPTS): New var.
-
-2001-05-04 Gary Houston <ghouston@arglist.com>
-
- * configure.in: check whether uint32_t is defined when netdb.h
- is included.
- acconfig.h: added HAVE_UINT32_T.
-
-2001-05-02 Marius Vollmer <mvo@zagadka.ping.de>
-
- * configure.in: Added handling of `--enable-deprecated'.
-
- * acconfig.h (SCM_DEBUG_DEPRECATED,
- GUILE_WARN_DEPRECATED_DEFAULT): Added.
-
-2001-04-29 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * Makefile.am (SUBDIRS): Add "scripts".
-
- * configure.in (AC_OUTPUT): Add scripts/Makefile.
-
-2001-04-29 Gary Houston <ghouston@arglist.com>
-
- * libguile.h: include rw.h.
-
-2001-04-27 Rob Browning <rlb@cs.utexas.edu>
-
- * GUILE-VERSION (GUILE_MINOR_VERSION): change to 5.0, switching to
- the new odd/even ustable/stable version numbering scheme.
- (LIBGUILEQTHREADS_MAJOR_VERSION): change to 10 to match Debian and
- libguile. In the future, libguile and libguileqthreads may not
- stay in sync. This still doesn't appear to affect
- libguileqthreads, but we'll fix that next.
-
-2001-04-25 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * configure.in: Don't treat srfi directory specially, just create
- the Makefile there (thanks to Neil Jerram for the patch).
-
-2001-04-23 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * Makefile.am (SUBDIRS): Added `srfi'.
-
- * configure.in: Added subdirectory `srfi' to build process.
-
- * libguile.h: Added inclusion of `values.h'.
-
-2001-04-22 Gary Houston <ghouston@arglist.com>
-
- * configure.in: check for inet_pton and inet_ntop.
-
-2001-04-20 Gary Houston <ghouston@arglist.com>
-
- * acconfig.h: include HAVE_SIN6_SCOPE_ID.
- * configure.in: check for sin6_scope_id in sockaddr_in6.
-
-2001-04-19 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * RELEASE: Added deprecated macro SCM_ARRAY_CONTIGUOUS
-
-2001-04-17 Gary Houston <ghouston@arglist.com>
-
- * configure.in: run the autoconf BIGENDIAN check.
-
-2001-04-12 Niibe Yutaka <gniibe@m17n.org>
-
- * GUILE-VERSION (LIBGUILEQTHREADS_MAJOR_VERSION,
- LIBGUILEQTHREADS_MINOR_VERSION, LIBGUILEQTHREADS_REVISION_VERSION,
- LIBGUILEQTHREADS_VERSION): Added libguileqthreads version info.
-
- * configure.in: Likewise.
-
-2001-04-11 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * configure.in (AC_CHECK_FUNCS): Don't check bzero.
- (GUILE_FUNC_DECLARED): Removed checking of bzero.
- Thanks to NIIBE Yutaka.
-
-2001-04-10 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * Undeprecated scm_init_oop_goopscore_module.
-
-2001-03-25 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * check-guile.in: Fix sh standard conformance bug: Replace
- "test -e" with "test -f". Thanks to Alexander Klimov.
-
-2001-03-19 Gary Houston <ghouston@arglist.com>
-
- * check-guile.in: rename $parent to $srcdir. if it's equal to "."
- set it to `pwd`.
-
- * check-guile.in: 16 documentation tests were failing if "make
- check" was run before Guile had been installed with the current
- --prefix. made various changes to the script so that it runs
- without a cd to the test-suite directory. For the -i option,
- don't point GUILE_LOAD_PATH to the current directory, but let it
- use it's own scheme library.
-
-2001-03-18 Gary Houston <ghouston@arglist.com>
-
- * check-guile.in: use @srcdir@ instead of @test_suite_dir@. use
- the current directory (build dir) not srcdir to find guile
- executable. otherwise "make check" doesn't work with a separate
- build directory. create the test log in
- $build_dir/check-guile.log instead of in srcdir/test-suite
- directory.
- * configure.in: don't define or substitute test_suite_dir.
-
-2001-03-17 Gary Houston <ghouston@arglist.com>
-
- * configure.in: don't append threads.doc to EXTRA_DOT_DOC_FILES,
- since EXTRA_DOT_DOC_FILES is redefined later. define
- EXTRA_DOT_X_FILES and hand it to AC_SUBST.
-
-2001-03-09 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * configure.in: Added header checks for crypt.h, sys/resource.h
- and sys/file.h, function checks for chroot, flock, getlogin,
- cuserid, getpriority, setpriority, getpass, sethostname,
- gethostname, and for crypt() in libcrypt.
-
-2001-03-09 Neil Jerram <neil@ossau.uklinux.net>
-
- * configure.in (htmldoc): Merge handling of `--enable-htmldoc'
- option from guile-doc/configure.in.
-
-2001-03-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * libguile.h: Removed #include "libguile/dump.h".
-
-2001-02-02 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * libguile.h: Added #include "libguile/dump.h".
-
-2001-01-29 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * libguile.h: Added #include "libguile/rdelim.h".
-
-2001-01-26 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- The following patch was sent by Thien-Thi Nguyen.
-
- * check-guile.in: New file.
-
- * Makefile.am: Add TESTS rule.
-
- * configure.in: Add support for "make check".
-
-2000-11-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * acconfig.h: Removed bogus #ifndef. Thanks to Lars J. Aas.
-
-2000-10-25 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * GUILE-VERSION (LIBGUILE_MAJOR_VERSION): Incremented major
- version number to 10 due to the merge of GOOPS.
-
- * oop: New directory.
-
-2000-09-20 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * libguile.h: #include "libguile/properties.h".
-
-2000-09-17 Gary Houston <ghouston@arglist.com>
-
- * configure.in, acconfig.h: remove the GCSE test: it doesn't seem
- to be reliable on all platforms.
-
-2000-08-18 Gary Houston <ghouston@arglist.com>
-
- * acconfig.h: added BROKEN_GCSE.
- * configure.in: check for a gcc GCSE optimisation bug.
-
-2000-07-31 Gary Houston <ghouston@arglist.com>
-
- * acconfig.h: added HAVE_H_ERRNO
- * configure.in: removed some dnl'd & obsolete cygwin stuff.
- added a test for h_errno.
-
-2000-06-21 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * Guile 1.4 released.
-
-2000-06-20 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * GUILE-VERSION: Changed to work also when included by a Makefile
- (e.g. debian/rules). (Thanks to Karl M. Hegbloom.)
- (LIBGUILE_MAJOR_VERSION): Bumped to 9.
- (GUILE_MINOR_VERSION): Bumped to 4.
-
-2000-06-12 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * libguile.h: Removed #include "libguile/kw.h".
-
- * Makefile.am (ACLOCAL): Define as ./guile-aclocal.sh.
- (The rule will cd to $(top_srcdir).)
-
- * configure.in (EXTRA_DOT_DOC_FILES): Create from LIBOBJS and
- substitute it into libguile/Makefile.
-
- * HACKING: Updated recommended libtool version to be 1.3.5.
-
- * RELEASE: Say that we should update HACKING to reflect the
- versions of the tools we're using rather than README.
-
-2000-06-02 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * NOTES: Removed.
-
- * TODO: Moved to devel/.
-
-2000-06-01 Craig Brozefsky <craig@red-bean.com>
-
- * GUILE-VERSION: added defnitions for LIBGUILE_MAJOR_VERSION,
- LIBGUILE_MINOR_VERSION, LIBGUILE_REVISION_VERSION so that we now
- define libguile.so version in a well-lit place.
-
- * configure.in: added AC_SUBST lines for the new LIBGUILE version
- variables.
-
-2000-06-01 Michael Livshin <mlivshin@bigfoot.com>
-
- * autogen.sh: call ./guile-aclocal.sh instead of aclocal.
-
- * guile-aclocal.sh: new file, works around aclocal problems.
-
-2000-05-30 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * acconfig.h (USE_FSU_PTHREADS, USE_MIT_PTHREADS,
- USE_PCTHREADS_PTHREADS): Removed.
-
-2000-05-01 Gary Houston <ghouston@arglist.com>
-
- * Makefile.am: add include_HEADERS.
- libguile.h: moved from libguile directory. maybe libguile.h should
- be installed in $prefix/include/libguile/libguile.h instead?
-
-2000-04-21 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * qthreads.m4: Removed THREADS_CPPFLAGS.
-
- * acinclude.m4: Removed qthreads macros. They are provided in
- qthreads.m4, so these were redundant.
-
- * acconfig.h (GUILE_DEBUG_MALLOC): New.
-
- * configure.in: New --enable-debug-malloc configuration option.
-
-2000-03-29 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * acconfig.h (GUILE_PTHREAD_COMPAT): New config variable.
-
- * configure.in: Enable workaround for COOP-linuxthreads
- compatibility on Linux systems.
-
-2000-03-19 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * devel: New directory. Intended to carry documentation related
- to Guile development (as opposed to the doc directory which
- contains documentation related to the use of the current Guile).
- This directory (devel) is not included in the Guile distribution,
- but is accessible via anonymous CVS.
-
-2000-03-13 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * configure.in: Don't add iselect.o to LIBOBJS.
-
-2000-03-13 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * configure.in: Added end-tag for local variables. (Thanks to
- Thien-Thi Nguyen.)
-
-2000-03-12 Gary Houston <ghouston@arglist.com>
-
- * README (Guile Documentation, About This Distribution): updated.
-
-2000-03-12 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * configure.in (ac_cv_struct_timespec): Added test for struct
- timespec.
-
- * acconfig.h (HAVE_STRUCT_TIMESPEC): Added.
-
-2000-01-25 Marius Vollmer <mvo@zagadka.ping.de>
-
- * autogen.sh: Call libtoolize. Pass --add-missing option to
- automake. Do not decent into libltdl directory. The libltdl
- directory is now populated by libtoolize and does not need any
- further autogeneration.
-
-2000-01-23 Gary Houston <ghouston@arglist.com>
-
- * configure.in: check for fchown.
-
-Tue Jan 18 12:55:15 2000 Mikael Djurfeldt <mdj@r11n07-s.pdc.kth.se>
-
- * acinclude.m4 (AC_LIBLTDL_CONVENIENCE): Add $(top_srcdir)/libltdl
- instead of $(top_builddir)/libltdl to includepath.
-
-2000-01-18 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * emacs: New subdirectory for elisp tools.
-
-2000-01-15 Marius Vollmer <mvo@zagadka.ping.de>
-
- * README, HACKING: Moved "Hacking it yourself" section from README
- to HACKING. Updated recommended libtool version to be 1.3.4.
-
-2000-01-14 Gary Houston <ghouston@arglist.com>
-
- * configure.in: needs to have --disable-networking, not
- --disable-net.
-
-2000-01-12 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * libltdl/acconfig.h: New file: Needed by autogen.sh.
-
-Tue Jan 11 13:42:35 2000 Greg J. Badros <gjb@cs.washington.edu>
-
- * autogen.sh: Added messages as we run autogen in subdirectories.
-
- * configure.in: Output libugile/guile-func-name-check script, and
- chmod +x it.
-
-2000-01-11 Marius Vollmer <mvo@zagadka.ping.de>
-
- * libltdl/autogen.sh: New file.
- * autogen.sh: Invoke libltdl/autogen.sh.
-
-2000-01-09 Marius Vollmer <mvo@zagadka.ping.de>
-
- Finally applied the libltdl patch from Thomas Tanner, with slight
- modifications. All code copied from the libtool package is from
- libtool-1.3.4.
-
- * configure.in: Make "--with-modules=yes" the default. Do not
- clear INCLTDL, LIBLTDL prior to processing "--with-modules".
-
- 1999-07-25 Thomas Tanner <tanner@ffii.org>
-
- * Makefile.am: add libltdl to SUBDIRS, automake automatically
- includes ltconfig, ltmain.sh and acconfig.h in EXTRA_DIST
- * acinclude.m4: remove GUILE_DLSYM_USCORE, add libtool.m4
- (no need to install libtool any more)
- * configure.in: replace --enable-dynamic-linking with
- --with-modules, required modules can be specified using
- --with-modules="/path/to/mod.la" and will be linked
- statically on platforms that don't support dynamic loading,
- configure libltdl, configure libtool for dlopening
- * libltdl: added using libtoolize -c --ltdl
-
-2000-01-09 Gary Houston <ghouston@arglist.com>
-
- * configure.in: check whether localtime caches TZ. copied from
- Emacs 20.5.
- * acconfig.h: add LOCALTIME_CACHE.
-
-Tue Dec 14 09:12:22 1999 Greg J. Badros <gjb@cs.washington.edu>
-
- * configure.in: Make it be guile-snarf.awk, since we'll be
- switching names for guile-doc-snarf. (I wouldn't have changed
- this, but I was getting ready to commit this way when the below
- change was committed).
-
-1999-12-14 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * configure.in: Create guile-doc-snarf.awk.
-
-1999-12-12 Greg J. Badros <gjb@cs.washington.edu>
-
- * configure.in: Create guile-doc-snarf, chmod +x that script after
- AC_OUTPUTted.
-
-1999-12-10 Greg J. Badros <gjb@cs.washington.edu>
-
- * NEWS: More complete description for --enable-debug-freelist.
-
-1999-12-09 Gary Houston <ghouston@freewire.co.uk>
-
- * configure.in (CFLAGS): don't add -Wpointer-arith, since it
- causes numerous spurious warnings with recent gcc and/or glibc
- versions.
-
-1999-11-19 Gary Houston <ghouston@freewire.co.uk>
-
- * acconfig.h: add HAVE_ARRAYS.
-
- * configure.in: add --disable-arrays option, probably temporary.
-
-1999-11-17 Gary Houston <ghouston@freewire.co.uk>
-
- * configure.in: check for hstrerror.
-
-1999-10-05 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * autogen.sh: Don't call autoreconf at all; it's not reliable.
- Instead, call the various tools explicitly. Invoke
- guile-readline's autogen.sh script.
-
- Straighten up the situation regarding guile.m4 and qthreads.m4.
-
- We can't have .m4 files which are installed where aclocal can
- see them, but also used by guile's own configure.in, because
- aclocal will read both copies, complain about duplicate macro
- definitions, and refuse to generate aclocal.m4 at all. This
- happens if you invoke it as `aclocal -I .', as autoreconf does.
- This is probably a flaw in the autotools, but Guile doesn't need
- that flaw fixed immediately.
-
- guile.m4 is intended for use by people linking against guile, so
- it needs to be installed. But Guile itself doesn't use it. So
- move guile.m4 into guile-config. That makes sense, since
- guile.m4's GUILE_FLAGS macro is just an easy way to call
- guile-config.
-
- qthreads.m4 is indented to help configure a qthreads tree. It's
- only useful to a package which actually includes a qthreads tree,
- and it's intimately related to that tree, so it's not useful to
- install this. So don't install it.
-
- * guile.m4: Moved to guile-config.
- * Makefile.am (aclocaldir, aclocal_DATA): Delete.
- (EXTRA_DIST): Move qthreads.m4 here.
-
- Don't store generated files in the repository any more. Instead,
- require people to run autogen.sh on trees from snapshots and CVS.
- * Makefile.in, aclocal.m4, configure: Deleted.
- * autogen.sh: New file.
- * ANON-CVS, SNAPSHOTS: Updated instructions.
-
-1999-10-02 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * acconfig.h (HAVE_POSIX, HAVE_NETWORKING): Add comments.
-
-1999-09-27 Greg J. Badros <gjb@cs.washington.edu>
-
- * configure.in: Added --enable-debug-freelist option.
-
- * acconfig.h: Added GUILE_DEBUG_FREELIST.
-
-1999-09-23 Gary Houston <ghouston@freewire.co.uk>
-
- * acconfig.h: add HAVE_POSIX, HAVE_NETWORKING. remove FD_SETTER,
- FILE_CNT_FIELD, FILE_CNT_GPTR, FILE_CNT_READPTR.
-
- * configure.in: new options --disable-posix, --disable-net
- and --disable-regex
- export HAVE_POSIX and HAVE_NETWORKING definitions.
- don't add regex-posix.o to LIBOBJS if regex disabled.
-
- LIBOBJS: add filesys.c, posix.c, net_db.c, socket.c,
- conditionally.
-
-1999-09-25 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * Guile 1.3.4 released.
-
-1999-09-22 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * configure.in: Call AM_PROG_CC_STDC before AM_PROG_LIBTOOL, so
- libtool knows how to get ANSI C behavior from the compiler.
- * configure: Regenerated.
-
-1999-09-20 Gary Houston <ghouston@freewire.co.uk>
-
- * configure.in: check availability of siginterrupt.
-
-1999-09-18 Gary Houston <ghouston@freewire.co.uk>
-
- * configure.in: use AC_SYS_RESTARTABLE_SYSCALLS instead of
- testing for SA_RESTART.
-
-1999-09-12 Mikael Djurfeldt <mdj@mdj-pc.nada.kth.se>
-
- * configure.in: Removed ice-9/version.scm from AC_OUTPUT.
-
-1999-09-11 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * configure.in (GUILE_STAMP): Don't set this variable, or
- substitute it into anything. Full explanation in ice-9/ChangeLog.
- * configure, Makefile.in: Regenerated.
-
-1999-09-06 James Blandy <jimb@mule.m17n.org>
-
- Propagate the changes of 2 Sept the rest of the way through.
- * configure: Regenerated.
- * Makefile.in: Regenerated. Not sure why this diff is so big.
-
-1999-09-02 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * acinclude.m4 (GUILE_HEADER_LIBC_WITH_UNISTD): Fix typo in
- variable name. (Thanks to Bill Schottstaedt.)
- * aclocal.m4: Regenerated.
-
-1999-09-02 Mikael Djurfeldt <mdj@mdj-pc.nada.kth.se>
-
- * configure.in: Test for presence of function on_exit.
-
-1999-09-01 James Blandy <jimb@mule.m17n.org>
-
- * configure.in: Use AC_REPLACE_FUNCS to grab libguile/memmove.c if
- the system doesn't have memmove. Don't test for memmove and bcopy
- with AC_CHECK_FUNCS.
- * configure: Regenerated.
-
-1999-08-30 Mikael Djurfeldt <mdj@mdj-pc.nada.kth.se>
-
- * configure.in: Test for atexit.
-
-1999-08-29 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * acinclude.m4: Updated. (Thanks to Karl Eichwalder.)
-
- * configure.in: Test for presence of S_ISLNK in sys/stat.h.
- (Thanks to Bernard Urban.)
- Test for memmove and bcopy. (Thanks to
- suzukis@file.phys.tohoku.ac.jp.)
-
- * acconfig.h: Added HAVE_S_ISLNK.
-
-1999-08-20 James Blandy <jimb@mule.m17n.org>
-
- * Guile 1.3.2 released.
-
- * Makefile.in: Regenerated.
-
-1999-07-24 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * README, config.guess, config.sub, liconfig, ltmain.sh: Switched
- to libtool-1.3.3.
-
-1999-07-22 Marius Vollmer <mvo@zagadka.ping.de>
-
- Added guile-readline subdirectory with the removed readline
- support.
- * guile-readline: New directory, see ChangeLog there.
- * configure.in: Cause configure to descend into guile-readline
- dir.
- * Makefile.am: Likewise for make.
- * NEWS: Explain how to activate the readline support.
- * configure, Makefile.in: Regenerated.
-
-1999-07-19 Jim Blandy <jimb@savonarola.red-bean.com>
-
- Fixes for EMX from Mikael Ståldal.
-
- * configure.in: Check for <io.h>.
- * configure: Regenerated.
-
-1999-07-18 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * qthreads.m4 (QTHREADS_CONFIGURE): 'alpha' in a configuration
- name can have suffixes, like alphaev56-unknown-linux-gnu.
- * aclocal.m4, configure: Rebuilt.
- (Thanks to Sebastien Villemot.)
-
-1999-07-04 Gary Houston <ghouston@easynet.co.uk>
-
- * configure.in: don't check for ways to violate stdio abstraction.
-
-1999-05-02 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * configure.in (AC_CHECK_FUNCS): Fill in list of functions that
- libguile/net_db.h wants to use. (Add setprotoent, setservent.)
-
-1999-04-17 Jim Blandy <jimb@savonarola.red-bean.com>
-
- Remove all automatic readline support, to avoid copyright
- confusion.
- * INSTALL: Update text.
- * NEWS: Explain the situation.
- * configure.in: Remove configury for readline and its supporting
- libraries.
- * configure: Regenerated.
-
- * README: Change URL's for automake and autoconf.
-
- * Makefile.in, configure: Regenerated with autoconf 2.13, automake
- 1.4, libtool 1.2f (1.385 1999/03/15 17:24:54). I've upgraded to
- all the right tools, according to README, but I'm still getting
- different results than Mikael is. Hmm.
-
-1999-03-22 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
-
- * New libtool: 1.2f
- * ltmain.sh, ltconfig, config.guess, config.sub: New versions.
- * README: Mention new version number of libtool.
-
-1999-03-04 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- New automake: 1.4
- * config.guess, config.sub, install-sh, mdate-sh, missing,
- mkinstalldirs: New versions.
- * Makefile.in, aclocal.m4, configure: Regenerated.
- * README: Mention new version numbers on autoconf and automake.
-
-1999-02-12 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * configure.in: Add --with-readline flag.
- * configure: Rebuilt.
-
-1999-02-09 Maciej Stachowiak <mstachow@alum.mit.edu>
-
- * NEWS: Added entry for optargs module.
-
-1999-02-06 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * configure: Regenerated using autoconf 2.12.
-
-1999-01-26 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * configure.in: Removed test AC_C_BIGENDIAN. (This test was
- considered to encourage bad coding style.)
-
-1999-01-21 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * configure.in: Added test AC_C_BIGENDIAN.
-
-1999-01-11 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * configure.in: Remove quotes around ac_cv_lib_readline_main and
- ac_cv_var_rl_getc_function. They should both always be set to
- non-null values; this way, we get error messages.
- * configure: Regenerated.
-
-1999-01-10 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * configure.in: Cite the variable ac_cv_lib_readline_main, not
- ac_cv_lib_readline_readline; the latter isn't set any more, since
- we look for 'main' in libreadline now. Add quotes around
- reference to the variable references, too, so this will work even
- when a variable's value is the empty string.
- * configure: Regenerated.
-
-1999-01-07 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * acconfig.h: Added HAVE_LONG_LONGS.
-
- * configure.in: Added AC_CHECK_SIZEOF(long), AC_CHECK_SIZEOF(int);
- Added check for long longs.
-
-1998-12-14 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * configure.in: Check for tgoto in ncurses, then termcap.
- S.u.S.E. Linux doesn't have a termcap. (Thanks to Karl
- Eichwalder.)
- * configure: Regenerated.
-
-1998-10-24 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * configure.in: Call AM_PROG_CC_STDC, to see what flags we should
- pass the compiler to make it support ANSI. (Thanks to Bernard
- Urban.)
- * aclocal.m4, configure: Regenerated.
-
-1998-10-20 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * Guile 1.3 released.
-
-1998-10-19 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * GUILE-VERSION: Bump to 1.3.
-
- * Makefile.am (EXTRA_DIST): Don't omit ANON-CVS and SNAPSHOTS.
- * Makefile.in: Regenerated.
-
-1998-10-16 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * qthreads.m4 (QTHREADS_CONFIGURE): On NetBSD, pass through a flag
- to the Makefile which explicitly tells it to pass assembly files
- through the preprocessor. (Thanks to Perry Metzger.)
- * aclocal.m4, configure, Makefile.in: Regenerated.
-
-1998-10-14 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * configure.in: Define SCM_SINGLES whenever a float can fit in a
- long, not only when a float is the same size as a long. This gets
- us SCM_SINGLES defined on alphas. (Thanks to Clark McGrew.)
- * configure: Regenerated.
-
- * configure.in: Construct libguile/versiondat.h here; see
- log entry in libguile/ChangeLog for details.
- * configure: Regenerated.
-
- * configure.in: Allow tabs and whitespace between `void' and
- `usleep'. (Thanks to Harvey J. Stein.)
- * configure: Regenerated.
-
- Don't redefine sleep/usleep.
- * configure.in: Remove tests for usleep's argument type; we only
- need that if we're going to replace it.
-
- * acconfig.h (USLEEP_ARG_TYPE): Delete. All the other SLEEP
- garbage is needed just to use usleep and sleep without compiler
- warnings.
- * configure: Regenerated.
-
-1998-10-12 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * configure: Regenerated.
-
- * configure.in (GUILE_FUNC_DECLARED): Name the cache variables
- starting with guile_cv_; ac_cv_ is autoconf's namespace.
-
- The type of the argument to usleep varies from system to system,
- as does the return type. We really shouldn't be redefining usleep
- at all, but I don't have time to clean that up before the 1.3
- release. It's on the schedule for afterwards.
- * configure.in: Cache results from usleep return value test.
- Test for the type of the usleep argument, and cache that too.
- * acconfig.h (USLEEP_ARG_TYPE): New macro.
-
-1998-10-11 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * acconfig.h (HAVE_RL_GETC_FUNCTION): Fix this entry.
-
-1998-10-10 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * GUILE-VERSION: bump to 1.2.91, since we're doing snapshots again.
-
- * Guile 1.2.90 released --- beta.
- * GUILE-VERSION: Set to 1.2.90. This would appear to be a
- regression from 1.3a, but everyone knows that the next release is
- 1.3, I want to switch to a more coherent version numbering system,
- and now is the time.
-
-1998-10-09 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * configure.in: Call AC_C_INLINE, so we can use inline happily in
- libguile.
- * configure: Regenerated.
-
-1998-10-07 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * configure.in: Don't forget to #define HAVE_RL_GETC_FUNCTION if
- we do find the rl_getc_function variable in the readline library;
- AC_CHECK_FUNCS used to do this for us, but we're not using it any
- more.
- * acconfig.h: Add an entry for HAVE_RL_GETC_FUNCTION.
-
- * configure.in: Properly test for the presence of rl_getc_function;
- it's a variable, not a function.
- * configure: Regenerated.
-
- * doc: New subdirectory.
- * Makefile.am (SUBDIRS): List it.
- * configure.in (AC_OUTPUT): Build its Makefile.
- * configure, Makefile.in: Regenerated.
-
- * guile.m4 (GUILE_FLAGS): New macro.
-
- * guile.m4 (AM_INIT_GUILE_MODULE): Deleted; it doesn't do anything
- terribly helpful any more, nobody's using it, and this is not
- really the way I want to handle modules anyway.
-
-1998-10-03 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * configure.in (FD_SETTER, FILE_CNT_GPTR): New cases for SCO's
- stdio implementation. (Thanks to David Tillman.)
- * configure: Rebuilt.
-
- * guile-config: Renamed from `build'.
- * Makefile.am (SUBDIRS): Mention `guile-config', not `build'.
- * configure.in: Create `guile-config/Makefile.in', not
- `build/Makefile.in'. Doc fix, too.
-
- * qthreads.m4: Doc fix.
- * Makefile.in, aclocal.m4, configure: Regeneranegerederadea.
-
-1998-10-03 <jimb@savonarola.red-bean.com>
-
- * configure.in: Check for a missing `sleep' declaration.
- * acconfig.h (MISSING_SLEEP_DECL): Provide some text for this.
- * configure: Regenerated.
-
- * configure.in: Don't use the canonical host name to decide
- whether `bzero' and `usleep' have declarations --- that's going
- back to the bad old days before autoconf. Remove the call to
- AC_CANONICAL_HOST and the subsequent case statement.
- (GUILE_FUNC_DECLARED): New m4 macro. Use it to check for
- declarations for `bzero', `usleep', and (new!) `strptime'.
- * acconfig.h: (DECLARE_BZERO, DECLARE_USLEEP): Removed.
- (MISSING_BZERO_DECL, MISSING_USLEEP_DECL, MISSING_STRPTIME_DECL):
- Added. I think this naming convention is more consistent with the
- rest of autoconf; names generally describes the system, not what
- the package should do to accomodate the system.
- * configure: Regenerated.
-
-1998-09-05 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * configure.in: Remove --disable-debug option. The debugging
- support is pretty stable now, and it's confusing people.
- * configure: Regenerated.
-
- * HACKING: Remove -Wstrict-prototypes from the list of requested
- flags (to match 1998-07-30 change).
-
-1998-07-30 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * configure.in: Don't use -Wstrict-prototypes after all.
- * configure: Regenerated.
-
-1998-07-29 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * configure.in: Request more warnings.
- * configure: Regenerated.
- * HACKING: Ask people not to make changes that introduce those
- warnings. Now I have to go through the code and actually bring it
- up to standards... :(
-
- * Makefile.in, aclocal.m4, configure: Regenerated using the last
- public version of automake, not the hacked Cygnus version.
- * config.guess, config.sub, ltconfig, ltmain.sh: New versions from
- libtool.
-
- * configure.in, qthreads.m4: Display a message about how the
- threads configuration went.
- * aclocal.m4, configure: Regenerated.
-
-1998-07-28 Jim Blandy <jimb@zwingli.cygnus.com>
-
- Remove the TOTORO kludge. We're not doing snapshots any more, so
- totoro is completely uninvolved. (Poor Totoro!)
- * configure.in: Remove code to check the hostname and #define
- TOTORO.
- * acconfig.h: Remove comments for TOTORO symbol.
- * configure, Makefile.in: Regenerated.
-
- * qthreads.m4 (QTHREADS_CONFIGURE): We *can* use AC_REQUIRE here
- to get AC_PROG_LN_S.
- * aclocal.m4, configure: Regenerated.
-
-1998-07-26 Jim Blandy <jimb@zwingli.cygnus.com>
-
- Clean up thread configuration.
- * qthreads.m4: New file, which knows how to configure the qthreads
- library.
- * configure.in: Replace all thread package selection code. Do the
- --with-threads argument processing here. Enable the appropriate
- thread interface files in libguile. Remove all qthreads
- configuration code; call QTHREADS_CONFIGURE instead. Set
- GUILE_LIBS using the info provided by QTHREADS_CONFIGURE.
- * threads.m4: Removed; not used any more.
- * Makefile.am (aclocal_DATA): Mention qthreads.m4, not threads.m4.
- * Makefile.in, aclocal.m4, configure: Rgnrtd. (Sv th vwls!)
- Note that these were regenerated with the tools available from
- Cygnus's source tree, which have patches not available to the
- general public. I'm not sure this was a good idea; feel free to
- revert them to the latest released versions of the tools.
-
- Upgrade to the version of libtool available at Cygnus. See note
- above.
- * config.guess, config.sub, ltconfig, ltmain.sh: Upgraded.
-
-1998-07-12 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
-
- * configure.in: Changed variable HOSTNAME --> PROG_HOSTNAME in
- totoro kludge.
-
-Sat Jul 11 21:54:29 1998 Mikael Djurfeldt <mdj@totoro.red-bean.com>
-
- * acconfig.h, configure.in: Define TOTORO if configuring on
- totoro.red-bean.com.
-
- * configure.in: Check for strdup.
-
-1998-05-19 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * configure.in: Check for rl_cleanup_after_signal.
-
-1998-05-11 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * configure.in: Added test for rl_getc_function. Warn if
- libreadline is found but not this function.
-
-1998-05-06 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * configure.in: Replaced some AC_CHECK_FUNC --> AC_CHECK_FUNCS so
- that suitable HAVE_<function name> symbols get defined.
-
-1998-04-25 Mikael Djurfeldt <mdj@kenneth>
-
- * configure.in: Define USLEEP_RETURNS_VOID on some systems.
- (Thanks to Julian Satchell.)
-
-1998-04-20 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * configure.in: Check for usleep; Define DECLARE_BZERO and
- DECLARE_USLEEP on Solaris 2.5 since it supplies those functions
- without declaring them.
-
- * acconfig.h: Added DECLARE_BZERO, DECLARE_USLEEP
-
-1998-04-19 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * configure.in: Define HAVE_DLOPEN also when HAVE_LIBDL is
- defined.
-
-1998-04-18 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * configure.in (GUILE_LIBS): New variable. Contains libraries
- which libguile needs to be linked with. Substituted into
- libpath.h.
-
- * threads.m4 (threads_package): Don't add $LDFLAGS and $LIBS to
- $cy_cv_threads_libs.
-
-1998-04-11 Mikael Djurfeldt <mdj@kenneth>
-
- New libtool: 1.2
- * ltconfig, ltmain.sh, config.sub, config.guess: Updated.
- New automake: 1.3
- * Makefile.in, aclocal.m4, configure: Regenerated.
- * README: Mention new version numbers on libtool and automake.
-
-1997-12-11 Tim Pierce <twp@skepsis.com>
-
- * HACKING: Note that SSH is mandatory for CVS access.
-
-Sun Dec 7 06:11:24 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * README: using Automake 1.2d
- * configure.in: AC_CHECK_FUNCS: add "system".
-
-1997-12-01 Tim Pierce <twp@skepsis.com>
-
- * acconfig.h: Add USCORE.
-
-1997-11-27 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * configure.in: Added code to enable GUILE_ISELECT on systems
- which have the necessary functions (gettimeofday, select).
-
- * acconfig.h: Added GUILE_ISELECT.
-
-1997-11-24 Tim Pierce <twp@twp.tezcat.com>
-
- * acinclude.m4: Assume dlsym does not add underscore if
- cross-compiling.
- * aclocal.m4, configure: Regenderated.
-
-1997-11-21 Tim Pierce <twp@twp.tezcat.com>
-
- * acinclude.m4 (GUILE_DLSYM_USCORE): New macro, thanks Dan Hagerty
- <hag@ai.mit.edu>.
- * configure.in: Use it.
- * configure: Regenerated.
- * acconfig.h (DLSYM_ADDS_USCORE): New #define.
-
-1997-10-26 Mikael Djurfeldt <mdj@nada.kth.se>
-
- * README (libtool): Tell people to use version 1.0e.
-
-Sat Oct 25 02:50:43 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- Call the QuickThreads library libqthreads.a, not libqt.a. The old
- name conflicts with the Qt user interface toolkit.
- * threads.m4 (CY_AC_WITH_THREADS): Use new library name.
- * configure.in: Same.
- * aclocal.m4, configure: Regenerated.
-
-Thu Oct 23 00:58:06 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- * configure.in: Check for the readline library, and the termcap
- library (on which readline relies).
- * configure: Regenerated.
-
-Wed Oct 22 16:55:57 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- New libtool: 1.0e
- * ltconfig, ltmain.sh, config.sub, config.guess: Updated.
- * configure, aclocal.m4: Regenerated.
-
-1997-10-02 Marius Vollmer <mvo@zagadka.ping.de>
-
- Make dynamic linking work on Dec Unix. (Thanks to Clark McGrew)
- * configure.in: Check whether dlopen can be found without -ldl.
-
-Mon Sep 29 23:52:52 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- * Makefile.in: Regenerated with automake 1.2c.
-
-Sat Sep 27 23:01:58 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- * Makefile.am: Add new `build' subdirectory to SUBDIRS.
- * configure.in: Add build/Makefile to AC_OUTPUT clause.
- * Makefile.in, configure: Regenerated.
-
- * Makefile.in, aclocal.m4: Regenerated with automake 1.2a.
-
-Tue Sep 16 00:19:46 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * README, ltconfig, ltmain.sh: New libtool: 1.0c.
-
-Thu Sep 11 11:28:24 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * ltmain.sh: Added a missing '\' before \n on line 32.
-
-Thu Aug 28 23:40:43 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- New libtool: 1.0b.
- * ltconfig, ltmain.sh, config.guess: Freshly libtoolized.
- * Makefile.in, aclocal.m4, configure: Regenerated, salamander-style.
-
-Wed Aug 27 11:35:09 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- * Makefile.in: Regenerated, so it uses "tar", not "gtar".
-
- * configure.in: Use the QuickThreads assembler fragment with Irix
- dynamic linking support for Irix 6 as well as Irix 5. Thanks to
- Jesse Glick.
- * configure: Regenerated.
-
-Sun Aug 24 15:51:12 1997 Mikael Djurfeldt <mdj@kenneth>
-
- * acinclude.m4 (GUILE_NAMED_CHECK_FUNC): New macro: Tagged test,
- so that test for the same function can be performed multiple
- times.
-
- * configure.in (AC_CHECK_HEADERS): Test for rxposix.h,
- rx/rxposix.h. Add library rx only if regcomp can't be found
- without it.
-
- * acconfig.h (HAVE_REGCOMP): Added it here since autoheader misses
- it for some reason!
-
-Fri Aug 22 21:21:49 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- * THANKS: New file.
- * Makefile.in, aclocal.m4, configure: Regenerated.
-
-Wed Jul 23 20:24:27 1997 Mikael Djurfeldt <djurf@zafir.e.kth.se>
-
- * configure.in: Added thread support for the alpha architecture.
- configure: Regenerated.
-
-Thu Jul 17 07:56:05 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * configure.in: use AC_CHECK_FUNCS for sethostent etc.,
- so scmconfig.h is updated with the test results. this may
- disable one of the cygwin hacks.
-
-Fri Jul 11 00:18:19 1997 Jim Blandy <jimb@floss.red-bean.com>
-
- Changes to compile under gnu-win32, from Marcus Daniels:
- * configure.in: When sys/un.h exists, define HAVE_UNIX_DOMAIN_SOCKETS
- to indicate that Unix domain sockets will work.
- Check for socketpair, getgroups, setwent, pause, and tzset
- (cygwin currently lacks these them).
- Check for sethostent endhostent getnetent setnetent endnetent
- getprotoent endprotoent getservent endservent getnetbyaddr
- getnetbyname inet_lnaof inet_makeaddr inet_netof (cygwin currently
- lacks them). In the case of cygwin, temporarily prefix these
- functions with "cygwin32_", the way that netdb.h does.
- Don't define HAVE_REGCOMP unless both regcomp and regex.h are
- available (cygwin b18 came distributed without a working regex.h
- file).
- * acconfig.h (HAVE_UNIX_DOMAIN_SOCKETS): Add this.
- * configure: Regenerated.
-
-Wed Jul 2 12:28:40 1997 Tim Pierce <twp@twp.tezcat.com>
-
- * ltmain.sh: Remove any trailing colon on $shlibpath_var
- (i.e. LD_LIBRARY_PATH) for braindamaged linkers that choke on it.
- Patch sent to bug-libtool.
-
-Sat Jun 28 16:13:43 1997 Tim Pierce <twp@twp.tezcat.com>
-
- * configure.in: Add alloca.o explicitly to LIBOBJS (thanks Eric
- Backus for reporting this problem and suggesting a fix).
- * configure: Regenerated.
-
-Thu Jun 26 20:43:31 1997 Jim Blandy <jimb@floss.red-bean.com>
-
- * Guile 1.2 released.
-
- * configure.in: Check for librx after libm; fundamentals need to
- come first.
- * configure: Regenerated.
-
-Tue Jun 24 13:34:20 1997 Tim Pierce <twpierce@bio-5.bsd.uchicago.edu>
-
- * aclocal.m4 (AM_PATH_PROG_LD): Change `ac_cv_path_LD' typo to
- `am_cv_path_LD'.
- * configure: Regenerated.
-
-Sun Jun 22 15:43:07 1997 Jim Blandy <jimb@floss.red-bean.com>
-
- Try to detect when people are using one version of libguile and a
- different version of ice-9. People have been skewing things and
- sending in bug reports.
- * configure.in: Provide libguile its version information through a
- separate header file generated by the Makefile, not through
- scmconfig.h.
- (GUILE_MAJOR_VERSION, GUILE_MINOR_VERSION, GUILE_VERSION):
- AC_SUBST these, instead of AC_DEFINE'ing them.
- (GUILE_STAMP): New AC_SUBST: the time we configured the tree.
- (AC_OUTPUT): Create ice-9/version.scm.
- * acconfig.h (GUILE_MAJOR_VERSION, GUILE_MINOR_VERSION,
- GUILE_VERSION): Deleted.
- * Makefile.in: Regenerated.
-
- * aclocal.m4: Regenerated, using the libtool 0.9h m4 macros.
-
- * Makefile.am (EXTRA_DIST): Include acconfig.h in the
- distribution.
- * Makefile.in: Regenerated.
-
-Sat Jun 21 00:14:07 1997 Jim Blandy <jimb@floss.red-bean.com>
-
- * ltmain.sh (line 1191): Don't forget 'test' in if statement.
-
- * ltconfig, ltmain.sh: libtoolized, using libtool 0.9h.
-
-Wed Jun 11 00:34:01 1997 Jim Blandy <jimb@floss.red-bean.com>
-
- * ltconfig, ltmain.sh, config.guess: New files from libtool 0.9g.
-
- * configure.in: By default, include functions in Guile to allow
- linking with dynamic libraries at run-time. In other words,
- --enable-dynamic-linking is now the default.
- * configure: Rebuilt.
-
- * configure.in: Remove space between AC_CHECK_LIB and opening
- paren in check for Rx.
- * configure: Regenerated.
-
- * configure.in: Remove all mention of xtra_PLUGIN_guile_libs.
- It's never used.
- * configure, Makefile.in: Regenerated.
-
-Tue Jun 10 23:37:12 1997 Jim Blandy <jimb@floss.red-bean.com>
-
- * configure.in: Move checks for libraries (-lm, -lnsl, -lsocket,
- -dl, -dld) before checks for functions.
- * configure: Regenerated.
-
-Mon Jun 9 02:35:46 1997 Tim Pierce <twp@twp.tezcat.com>
-
- * config.guess: New copy from autoconf-2.12, which recognizes
- OpenBSD.
-
-Tue Jun 3 16:34:19 1997 Jim Blandy <jimb@totoro.cyclic.com>
-
- * configure.in: Check for Rx, so we will use its routines (which I
- pretty much trust) if it is installed.
- * configure: Regenerated.
-
-Sat May 31 03:48:45 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * acconfig.h: mention HAVE_RESTARTS.
- * configure.in: check for sigaction and restartable system calls.
-
-Tue May 27 22:47:52 1997 Tim Pierce <twp@twp.tezcat.com>
-
- * configure.in: Check for presence of regcomp.
- * configure: Regenerated.
-
-Mon May 26 12:14:20 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- * COPYING: New address for FSF.
-
- * configure.in: We don't need to add fileblocks.o to LIBOBJS if
- struct stat doesn't have the st_blocks field. We take care of
- that case in the code. Replace AC_STRUCT_ST_BLOCKS with its
- definition, edited appropriately. (Bernard URBAN)
- * configure: Regenerated.
-
-Sat May 17 13:49:28 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- * configure.in: Don't link against -lnsl or -lsocket unless we
- actually need to. This causes trouble on Irix. (Thanks to Larry
- Schwimmer.)
-
- * config.sub: Get newer version, that recognizes the i686.
-
-Fri May 16 17:26:10 1997 Jim Blandy <jimb@totoro.cyclic.com>
-
- * README: Changed Mikael's threads work attribution in order
- to sooth Anthony's enormous, but wounded, ego.
-
-Fri May 16 17:26:53 1997 Jim Blandy <jimb@totoro.cyclic.com>
-
- Just kidding!!!
-
-Fri May 16 04:24:48 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- Guile 1.1 released.
- * GUILE-VERSION: Bump to 1.1.
-
-Tue May 13 16:34:40 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- Switch to automake-1.1p.
- * Makefile.in, aclocal.m4, configure: Regenerated.
-
-Mon May 12 18:29:45 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- * threads.m4: Copy Anthony's change here, so it'll actually
- survive.
-
-Thu May 8 11:48:40 1997 Anthony Green <green@hoser.cygnus.com>
-
- * aclocal.m4: Fixes for building with coop threads in a
- seperate compilation directory.
- * configure: Rebuilt.
-
-Fri May 2 16:24:15 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- Upgrade to libtool 0.9e.
- * ltconfig, ltmain.sh, config.guess, config.sub: New versions,
- supplied by libtool.
-
- * configure.in: When configuring qt, sunos needs the underscore
- files; Solaris and Linux both need the normal files.
- * configure: Reebilt.
-
-Thu May 1 15:35:49 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- * configure.in: Get the paths for qt's md files right, so it can
- build correctly when using a separate compilation directory.
- * configure: Regenerated.
-
-Thu Apr 24 01:20:34 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- Get threads to work again.
- * Makefile.am (SUBDIRS): List libguile last, so qt gets built
- first.
- * Makefile.in: Regenerated.
- * aclocal.m4, configure: Regenerate, with modern definition of
- CY_AC_WITH_THREADS. Where did the old text come from? Creepy...
-
- Reduced Guile distribution: one configure script, no plugins.
- * configure.in: Merged the old text from qt/configure.in and
- libguile/configure.in; Tom Tromey says automake only wants one
- configure.in script. This seems fishy, but...
- * Makefile.am: List the subdirectories explicitly; no more PLUGIN
- gubbish.
- * acconfig.h, acinclude.m4: Moved here from libguile, since
- libguile's configure script lives here now.
- * AUTHORS, INSTALL, README: Updated.
- * Makefile.in, aclocal.m4 configure: Regenerated. Just like
- amputated amphibian limbs.
-
-Tue Apr 22 16:57:38 1997 Jim Blandy <jimb@totoro.cyclic.com>
-
- * newdoc/ref/Makefile.am (dist_texis): Distribute the index files.
- * newdoc/ref/Makefile.in: Regenerated.
-
-Mon Apr 14 18:51:25 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- * threads.m4 (CY_AC_WITH_THREADS): When using coop threads, no
- need to link against libthreads; the files it used to contain
- are now a part of libguile.
-
-Sun Apr 13 22:14:10 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- * guile.m4: Revert change of Mar 15, and use the new 'no-define'
- argument to the AM_INIT_AUTOMAKE macro.
-
-Fri Apr 11 15:43:07 1997 Jim Blandy <jimb@totoro.cyclic.com>
-
- * ltconfig, ltmain.sh: Upgraded libtool files to 0.9d.
- * README: Say where to find libtool 0.9d.
-
-Wed Apr 9 17:51:13 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- Changes to work with automake-1.1n, which has better libtool
- support. Also use libtool 0.8.
- * README: Note new version numbers for automake and libtool.
- * missing: New file required by new automake.
- * Makefile.in: Regenerated.
-
-Sat Apr 5 16:48:38 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- * newdoc/ref/scheme.texi (set-object-property!): Fix function name.
-
- * Makefile.am: Omit doc subtree.
- * configure.in: Omit makefiles in doc subtree.
- * Makefile.in, configure: Rebuilt.
-
-Sat Mar 15 01:11:44 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * guile.m4 (AM_INIT_GUILE_MODULE): Replaced AM_INIT_AUTOMAKE macro
- with its definition and commented out definition of PACKAGE. This
- changed seemed necessary after having removed PACKAGE from
- libguile/acconfig.h.
-
-Mon Feb 24 21:43:26 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * ltconfig, ltmain.sh: New versions from libtool-0.9.
-
- * configure.in: Added AM_MAINTAINER_MODE
-
-Fri Feb 7 17:57:46 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- * config.sub, config.guess: New versions, that handle i686, etc.
-
-Thu Jan 23 07:06:15 1997 Mark Galassi <rosalia@papageno.lanl.gov>
-
- * newdoc/tutorial/guile-tut.texi: started checking in the Guile
- tutorial rewrite, but have not merged much into it yet.
-
-Tue Jan 21 17:28:40 1997 Mark Galassi <rosalia@sarastro.lanl.gov>
-
- * newdoc/ref/guile-ref.texi: started checking in parts of the
- reference manual re-write.
-
-Sat Jan 11 14:40:17 1997 Marius Vollmer <mvo@zagadka.ping.de>
-
- * ltconfig, ltmain.sh: New files for libtool support. libguile,
- rx, gh and gtcltk-lib can now be build as shared libraries.
- * Makefile.am (EXTRA_DIST): Added ltconfig and ltmain.sh
-
-Sun Jan 5 16:57:10 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- * Guile 1.0 released. This is the first release by the Free
- Software Foundation; Cygnus has also released earlier versions of
- Guile.
-
- * GUILE-VERSION: Updated version number.
- * NEWS: Added comments for all the user-visible changes marked in
- the ChangeLogs.
- * README: Updated for release.
-
-Thu Dec 12 00:14:32 1996 Gary Houston <ghouston@actrix.gen.nz>
-
- * scsh: new directory.
-
-Mon Dec 2 17:33:04 1996 Tom Tromey <tromey@cygnus.com>
-
- * configure.in: Generate doc/guile-programmer/Makefile and
- doc/guile-user/Makefile.
-
-Sat Nov 30 23:45:54 1996 Tom Tromey <tromey@cygnus.com>
-
- * aclocal.m4: Now automatically generated by aclocal.
- * threads.m4: New file.
- * guile.m4: New file.
- * Makefile.am, doc/Makefile.am: New files.
- * configure.in: Updated for Automake. Avoid excessively verbose
- "greet" messages.
-
-Wed Oct 16 07:32:14 1996 Mark Galassi <rosalia@sarastro.lanl.gov>
-
- * lgh: directory renamed to gh, along with all prefixes of the
- high level library procedures.
-
-Thu Oct 10 14:37:43 1996 Jim Blandy <jimb@floss.cyclic.com>
-
- * Makefile.in (TAGS tags): Find the source files in $srcdir.
-
-Wed Oct 9 19:37:14 1996 Jim Blandy <jimb@floss.cyclic.com>
-
- * Makefile.in (DISTFILES): Add AUTHORS and aclocal.m4.
-
-Tue Oct 1 00:13:55 1996 Mikael Djurfeldt <mdj@woody.nada.kth.se>
-
- * configure.in: Added some configuration magic from the Cygnus
- distribution.
-
- * aclocal.m4: New file. For now used for thread support
- configuration.
-
-Fri Sep 13 14:39:30 1996 Mark Galassi <rosalia@sarastro.lanl.gov>
-
- * Makefile.in (DISTFILES): added mkinstalldirs to the DISTFILES
-
- * PLUGIN: changed the PLUGIN/REQ files in the ice-9 and lgh
- directories, to arrange for lgh to the last thing
- configured/built.
-
-Wed Sep 11 21:11:33 1996 Mark Galassi <rosalia@nis.lanl.gov>
-
- * lgh/: added the directory in which I implement the high level
- libguile library (lgh_) for this release of Guile. See the
- ChangeLog in there for further details.
-
-Wed Sep 11 16:12:53 1996 Mark Galassi <rosalia@sarastro.lanl.gov>
-
- * doc/ (guile-user and guile-programmer): added the guile-user and
- guile-programmer directories which contain the user and programmer
- manuals. See the ChangeLog entries there for detail.
-
-Wed Sep 11 14:33:49 1996 Jim Blandy <jimb@floss.cyclic.com>
-
- * Makefile.in (distclean): Don't forget to delete doc/Makefile.
-
- * Makefile.in (distclean): Don't forget to delete
- config.build-subdirs.
-
-Thu Sep 5 17:36:15 1996 Jim Blandy <jimb@floss.cyclic.com>
-
- * Makefile.in (tags): New name for `TAGS' target, which will
- always run the commands.
-
-Thu Sep 5 09:56:50 1996 Jim Blandy <jimb@totoro.cyclic.com>
-
- * README: Doc fixes.
-
-Fri Aug 30 16:56:27 1996 Jim Blandy <jimb@floss.cyclic.com>
-
- * Makefile.in (TAGS): Produce a single tags file for all of Guile.
-
-Thu Aug 15 19:03:03 1996 Jim Blandy <jimb@floss.cyclic.com>
-
- * configure.in: Check for -ldl, so the check for Tcl won't fail
- spuriously.
-
-Thu Aug 15 01:29:29 1996 Jim Blandy <jimb@totoro.cyclic.com>
-
- Change the way we decide whether to build gtcltk-lib, so that it's
- omitted from the build process when appropriate, but never from
- the dist process.
- * configure.in: Don't edit all_subdirs depending on the
- availability of Tk; let that be the list of all PLUGIN
- subdirectories present, as it used to be. Instead, edit a new
- variable, build_subdirs; write its final value, the list of
- subdirs we do want to compile in, to config.build-subdirs.
- Substitute that into the top-level Makefile too.
- * Makefile.in (subdirs): Set this to @build_subdirs@, so we only
- recurse on the subdirectories we should build.
- (distdirs): Set this to @existingdirs@, so it includes the subdirs
- we decided not to build.
-
- * doc/gtcltk.texi: File resurrected from old Guile releases.
- * doc/Makefile.in (info): Build the gtcltk documentation.
- (DIST_FILES): Include it in the distribution.
-
- * configure.in: If we can find the library for tcl7.5, build
- gtcltk-lib. Call AC_PROG_CC, to help run that test with the right
- compiler (not sure this is necessary).
-
-Mon Aug 12 15:09:37 1996 Jim Blandy <jimb@totoro.cyclic.com>
-
- * NEWS: Fix bug reporting address.
-
-Fri Aug 9 15:58:42 1996 Jim Blandy <jimb@totoro.cyclic.com>
-
- * AUTHORS: New file, in accordance with the GNU maintainers'
- standards.
-
-Tue Aug 6 14:40:44 1996 Jim Blandy <jimb@totoro.cyclic.com>
-
- * README: Renamed from ANNOUNCE; include bug report address,
- description, and short tour.
- * INSTALL: Renamed from BUILDING.
- * NEWS: New file.
- * Makefile.in (DISTFILES): Update appropriately.
-
-Thu Aug 1 02:31:53 1996 Jim Blandy <jimb@totoro.cyclic.com>
-
- * doc/Makefile.in: Added pattern targets for creating DVI and
- PostScript files.
- (%.ps, %.dvi, %.txt): New targets.
- (DVIPS, TEXI2DVI): New variables.
-
- * GUILE-VERSION: Updated to 1.0b3.
-
- Rehashed distribution system, in preparation for nightly
- snapshots. Other changes in subdirectories.
- * Makefile.in (dist): Rewritten --- the old target was out of
- date, dependent on files that we don't have, and relied on GNU
- tar. The new target is simpler.
- (VERSION, srcdir, dist_dirs): New variables.
- (DISTFILES): Renamed from localfiles. Added GUILE-VERSION and
- TODO.
- (localtreats): Variable removed. We don't have this file.
- (info): cd to doc and make info there; don't make info in every
- ${subdir}; those Makefiles don't know what to do.
- (distname, distdir, treats, announcefile): Variables removed.
- (manifest-file): Target removed.
- (dist-dir): New target, responsible for distributable files in
- this directory.
- (GZIP, GZIP_EXT, TAR_VERBOSE, DIST_NAME): New variables,
- controlling the 'dist' target.
- * configure.in: Substitute GUILE-VERSION into the top-level
- Makefile. Build doc/Makefile from doc/Makefile.in.
-
- * doc/Makefile.in: New file.
diff --git a/GUILE-VERSION b/GUILE-VERSION
deleted file mode 100644
index f687039de..000000000
--- a/GUILE-VERSION
+++ /dev/null
@@ -1,43 +0,0 @@
-# -*-shell-script-*-
-
-GUILE_MAJOR_VERSION=1
-GUILE_MINOR_VERSION=7
-GUILE_MICRO_VERSION=0
-
-GUILE_VERSION=${GUILE_MAJOR_VERSION}
-GUILE_VERSION=${GUILE_VERSION}.${GUILE_MINOR_VERSION}
-GUILE_VERSION=${GUILE_VERSION}.${GUILE_MICRO_VERSION}
-
-# For automake.
-VERSION=${GUILE_VERSION}
-PACKAGE=guile
-
-# All of the shared lib versioning info. Right now, for this to work
-# properly, you'll also need to add AC_SUBST calls to the right place
-# in configure.in, add the right -version-info statement to your
-# Makefile.am The only library not handled here is
-# guile-readline/libguile-readline. It is handled in
-# ./guile-readline/LIBGUILEREADLINE-VERSION.
-
-# See libtool info pages for more information on how and when to
-# change these.
-
-LIBQTHREADS_INTERFACE_CURRENT=15
-LIBQTHREADS_INTERFACE_REVISION=0
-LIBQTHREADS_INTERFACE_AGE=0
-LIBQTHREADS_INTERFACE="${LIBQTHREADS_INTERFACE_CURRENT}:${LIBQTHREADS_INTERFACE_REVISION}:${LIBQTHREADS_INTERFACE_AGE}"
-
-LIBGUILE_INTERFACE_CURRENT=15
-LIBGUILE_INTERFACE_REVISION=0
-LIBGUILE_INTERFACE_AGE=0
-LIBGUILE_INTERFACE="${LIBGUILE_INTERFACE_CURRENT}:${LIBGUILE_INTERFACE_REVISION}:${LIBGUILE_INTERFACE_AGE}"
-
-LIBGUILE_SRFI_SRFI_4_INTERFACE_CURRENT=1
-LIBGUILE_SRFI_SRFI_4_INTERFACE_REVISION=0
-LIBGUILE_SRFI_SRFI_4_INTERFACE_AGE=0
-LIBGUILE_SRFI_SRFI_4_INTERFACE="${LIBGUILE_SRFI_SRFI_4_INTERFACE_CURRENT}:${LIBGUILE_SRFI_SRFI_4_INTERFACE_REVISION}:${LIBGUILE_SRFI_SRFI_4_INTERFACE_AGE}"
-
-LIBGUILE_SRFI_SRFI_13_14_INTERFACE_CURRENT=1
-LIBGUILE_SRFI_SRFI_13_14_INTERFACE_REVISION=0
-LIBGUILE_SRFI_SRFI_13_14_INTERFACE_AGE=0
-LIBGUILE_SRFI_SRFI_13_14_INTERFACE="${LIBGUILE_SRFI_SRFI_13_14_INTERFACE_CURRENT}:${LIBGUILE_SRFI_SRFI_13_14_INTERFACE_REVISION}:${LIBGUILE_SRFI_SRFI_13_14_INTERFACE_AGE}"
diff --git a/INSTALL b/INSTALL
deleted file mode 100644
index d75cc57a4..000000000
--- a/INSTALL
+++ /dev/null
@@ -1,467 +0,0 @@
-Guile Installation Guide
-Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
-
- Permission is granted to anyone to make or distribute verbatim copies
- of this document as received, in any medium, provided that the
- copyright notice and permission notice are preserved,
- and that the distributor grants the recipient permission
- for further redistribution as permitted by this notice.
-
- Permission is granted to distribute modified versions
- of this document, or of portions of it,
- under the above conditions, provided also that they
- carry prominent notices stating who last changed them,
- and that any new or changed statements about the activities
- of the Free Software Foundation are approved by the Foundation.
-
-
-Brief Installation Instructions ===========================================
-
-To build Guile on unix, there are two basic steps:
-
- 1. Type "./configure", to configure the package for your system.
- 2. Type "make", to build the package.
-
-Generic instructions for configuring and compiling GNU distributions
-are included below. (For instructions how to install SLIB, the scheme
-procedure library, see below.)
-
-
-Guile can use a number of external packages such as `readline' when
-they are available. Guile expects to be able to find these packages
-in the default compiler setup, it does not try to make any special
-arrangements itself. For example, for the `readline' package, Guile
-expects to be able to find the include file <readline/readline.h>,
-without passing any special `-I' options to the compiler.
-
-If you installed an external package, and you used the --prefix
-installation option to install it somewhere else than /usr/local, you
-must arrange for your compiler to find it by default. If that
-compiler is gcc, one convenient way of making such arrangements is to
-use the --with-local-prefix option during installation, naming the
-same directory as you used in the --prefix option of the package. In
-particular, it is not good enough to use the same --prefix option when
-you install gcc and the package; you need to use the
---with-local-prefix option as well. See the gcc documentation for
-more details.
-
-
-Special Instructions For Some Systems =====================================
-
-We would like Guile to build on all systems using the simple
-instructions above, but it seems that a few systems still need special
-treatment. If you can send us fixes for these problems, we'd be
-grateful.
-
-SunOS 4.1: Guile's shared library support seems to be confused, but
- hey; shared libraries are confusing. You may need to configure
- Guile with a command like:
- ./configure --disable-shared
- For more information on `--disable-shared', see below, "Flags
- Accepted by Configure".
-
-HP/UX: GCC 2.7.2 (and maybe other versions) have trouble creating
- shared libraries if they depend on any non-shared libraries. GCC
- seems to have other problems as well. To work around this, we
- suggest you configure Guile to use the system's C compiler:
- CC=cc ./configure
-
-NetBSD: Perry Metzger says, "Guile will build under NetBSD only using
- gmake -- the native make will not work. (gmake is in our package
- system, so this will not be a problem when we packagize 1.3.)"
-
-
-Flags Accepted by Configure ===============================================
-
-If you run the configure script with no arguments, it should examine
-your system and set things up appropriately. However, there are a few
-switches specific to Guile you may find useful in some circumstances.
-
-
---enable-maintainer-mode
-
- If you have automake, autoconf, and libtool installed on your
- system, this switch causes configure to generate Makefiles which
- know how to automatically regenerate configure scripts, makefiles,
- and headers, when they are out of date. The HACKING file says which
- versions of those tools you will need.
-
-
---with-threads --- Build with thread support
-
- Build a Guile executable and library that supports cooperative
- threading. If you use this switch, Guile will also build and
- install the QuickThreads non-preemptive threading library,
- libqthreads, which you will need to link into your programs after
- libguile. When you use `guile-config', you will pick up all
- neccessary linker flags automatically.
-
- Cooperative threads are not yet thoroughly tested; once they are,
- they will be enabled by default. The interaction with blocking I/O
- is pretty ad hoc at the moment. In our experience, bugs in the
- thread support do not affect you if you don't actually use threads.
-
-
---disable-linuxthreads --- Disable pthread compatability hack on Linux
-
- If you experience problems on GNU/Linux that are related to
- pthreads, you might try this option. Guile with then not link with
- the pthreads library, but will also not try to be compatible to
- programs that use both libguile and libpthread.
-
-
---with-modules --- Specify statically linked `modules'
-
- Guile can dynamically load `plugin modules' during runtime, using
- facilities provided by libtool. Not all platforms support this,
- however. On these platforms, you can statically link the plugin
- modules into libguile when Guile itself is build. XXX - how does
- one specify the modules?
-
-
---enable-deprecated=LEVEL --- Control the inclusion of deprecated features.
-
- You can select between different behaviours via the LEVEL argument:
- a value of "no" will omit all deprecated features and you will get
- "undefined reference", "variable unbound" or similar errors when you
- try to use them. All other values will include all deprecated
- features. The LEVEL argument is used to determine the default value
- for the environment variable GUILE_WARN_DEPRECATED. See the README
- for more information.
-
- The default is to get a vague warning at program exit if deprecated
- features were used:
-
- --enable-deprecated=yes
- --enable-deprecated=summary
-
- To get a detailed warning at first use of a deprecated feature:
-
- --enable-deprecated=detailed
-
- To get no warnings:
-
- --enable-deprecated=shutup
-
- To omit deprecated features completely and irrevokably:
-
- --enable-deprecated=no
-
-
---disable-shared --- Do not build shared libraries.
---disable-static --- Do not build static libraries.
-
- Normally, both static and shared libraries will be built if your
- system supports them.
-
-
---enable-debug-freelist --- Enable freelist debugging.
-
- This enables a debugging version of SCM_NEWCELL(), and also
- registers an extra primitive, the setter
- `gc-set-debug-check-freelist!'.
-
- Configure with the --enable-debug-freelist option to enable the
- gc-set-debug-check-freelist! primitive, and then use:
-
- (gc-set-debug-check-freelist! #t) # turn on checking of the freelist
- (gc-set-debug-check-freelist! #f) # turn off checking
-
- Checking of the freelist forces a traversal of the freelist and a
- garbage collection before each allocation of a cell. This can slow
- down the interpreter dramatically, so the setter should be used to
- turn on this extra processing only when necessary.
-
-
---enable-debug-malloc --- Enable malloc debugging.
-
- Include code for debugging of calls to scm_must_malloc/realloc/free.
-
- Checks that
-
- 1. objects freed by scm_must_free has been mallocated by scm_must_malloc
- 2. objects reallocated by scm_must_realloc has been allocated by
- scm_must_malloc
- 3. reallocated objects are reallocated with the same what string
-
- But, most importantly, it records the number of allocated objects of
- each kind. This is useful when searching for memory leaks.
-
- A Guile compiled with this option provides the primitive
- `malloc-stats' which returns an alist with pairs of kind and the
- number of objects of that kind.
-
-
---enable-guile-debug --- Include internal debugging functions
---disable-arrays --- omit array and uniform array support
---disable-posix --- omit posix interfaces
---disable-networking --- omit networking interfaces
---disable-regex --- omit regular expression interfaces
-
-
-Cross building Guile =====================================================
-
-As of guile-1.5.x, the build process uses compiled C files for
-snarfing, and (indirectly, through libtool) for linking, and uses the
-guile executable for generating documentation.
-
-When cross building guile, you first need to configure, build and
-install guile for your build host.
-
-Then, you may configure guile for cross building, eg:
-
- ./configure --host=i686-pc-cygwin --disable-shared
-
-Two special options for cross building are available:
-
---with-cc-for-build --- native C compiler, to be used during build
- defaults to: `PATH=/usr/bin:$PATH cc'
-
---with-guile-for-build --- native Guile executable, to be used during build
- defaults to: `guile', assuming you just
- installed this guile natively.
-
-
-Using Guile Without Installing It =========================================
-
-If you want to run Guile without installing it, set the environment
-variable `GUILE_LOAD_PATH' to a colon-separated list of directories,
-including the directory containing this INSTALL file. If you used a
-separate build directory, you'll need to include the build directory
-in the path as well.
-
-For example, suppose the Guile distribution unpacked into a directory
-called `/home/jimb/guile-snap' (so the full name of this INSTALL file
-would be `/home/jimb/guile-snap/INSTALL'). Then you might say, if
-you're using Bash or any other Bourne shell variant,
-
- export GUILE_LOAD_PATH=/home/jimb/guile-snap
-
-or if you're using CSH or one of its variants:
-
- setenv GUILE_LOAD_PATH /home/jimb/guile-snap
-
-You will additionally need to set your `LTDL_LIBRARY_PATH' environment
-variable to the directory in which the compiled SRFI support modules
-are created if you want to use the modules for SRFI-4, SRFI-13 or
-SRFI-14 support. Similar to the example above, this will be,
-
- export LTDL_LIBRARY_PATH=/home/jimb/guile-snap/srfi/.libs
-
-or if you're using CSH or one of its variants:
-
- setenv LTDL_LIBRARY_PATH /home/jimb/guile-snap/srfi/.libs
-
-
-Installing SLIB ===========================================================
-
-In order to use SLIB from Guile you basically only need to put the
-`slib' directory _in_ one of the directories on Guile's load path.
-
-The standard installation is:
-
- 1. Obtain slib from http://www-swiss.ai.mit.edu/~jaffer/SLIB.html
-
- 2. Put it in Guile's data directory, that is the directory printed when
- you type
-
- guile-config info pkgdatadir
-
- at the shell prompt. This is normally `/usr/local/share/guile', so the
- directory will normally have full path `/usr/local/share/guile/slib'.
-
- 3. Start guile as a user with write access to the data directory and type
-
- (use-modules (ice-9 slib))
-
- at the Guile prompt. This will generate the slibcat catalog next to
- the slib directory.
-
-SLIB's `require' is provided by the Guile module (ice-9 slib).
-
-Example:
-
- (use-modules (ice-9 slib))
- (require 'primes)
- (prime? 7)
-
-
-Generic Instructions for Building Auto-Configured Packages ================
-
- The `configure' shell script attempts to guess correct values for
-various system-dependent variables used during compilation. It uses
-those values to create a `Makefile' in each directory of the package.
-It may also create one or more `.h' files containing system-dependent
-definitions. Finally, it creates a shell script `config.status' that
-you can run in the future to recreate the current configuration, a file
-`config.cache' that saves the results of its tests to speed up
-reconfiguring, and a file `config.log' containing compiler output
-(useful mainly for debugging `configure').
-
- If you need to do unusual things to compile the package, please try
-to figure out how `configure' could check whether to do them, and mail
-diffs or instructions to the address given in the `README' so they can
-be considered for the next release. If at some point `config.cache'
-contains results you don't want to keep, you may remove or edit it.
-
- The file `configure.in' is used to create `configure' by a program
-called `autoconf'. You only need `configure.in' if you want to change
-it or regenerate `configure' using a newer version of `autoconf'.
-
-The simplest way to compile this package is:
-
- 1. `cd' to the directory containing the package's source code and type
- `./configure' to configure the package for your system. If you're
- using `csh' on an old version of System V, you might need to type
- `sh ./configure' instead to prevent `csh' from trying to execute
- `configure' itself.
-
- Running `configure' takes awhile. While running, it prints some
- messages telling which features it is checking for.
-
- 2. Type `make' to compile the package.
-
- 3. Optionally, type `make check' to run any self-tests that come with
- the package.
-
- 4. Type `make install' to install the programs and any data files and
- documentation.
-
- 5. You can remove the program binaries and object files from the
- source code directory by typing `make clean'. To also remove the
- files that `configure' created (so you can compile the package for
- a different kind of computer), type `make distclean'. There is
- also a `make maintainer-clean' target, but that is intended mainly
- for the package's developers. If you use it, you may have to get
- all sorts of other programs in order to regenerate files that came
- with the distribution.
-
-Compilers and Options
-=====================
-
- Some systems require unusual options for compilation or linking that
-the `configure' script does not know about. You can give `configure'
-initial values for variables by setting them in the environment. Using
-a Bourne-compatible shell, you can do that on the command line like
-this:
- CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
-
-Or on systems that have the `env' program, you can do it like this:
- env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
-
-Compiling For Multiple Architectures
-====================================
-
- You can compile the package for more than one kind of computer at the
-same time, by placing the object files for each architecture in their
-own directory. To do this, you must use a version of `make' that
-supports the `VPATH' variable, such as GNU `make'. `cd' to the
-directory where you want the object files and executables to go and run
-the `configure' script. `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.
-
- If you have to use a `make' that does not supports the `VPATH'
-variable, you have to compile the package for one architecture at a time
-in the source code directory. After you have installed the package for
-one architecture, use `make distclean' before reconfiguring for another
-architecture.
-
-Installation Names
-==================
-
- By default, `make install' will install the package's files in
-`/usr/local/bin', `/usr/local/man', etc. You can specify an
-installation prefix other than `/usr/local' by giving `configure' the
-option `--prefix=PATH'.
-
- You can specify separate installation prefixes for
-architecture-specific files and architecture-independent files. If you
-give `configure' the option `--exec-prefix=PATH', the package will use
-PATH as the prefix for installing programs and libraries.
-Documentation and other data files will still use the regular prefix.
-
- In addition, if you use an unusual directory layout you can give
-options like `--bindir=PATH' to specify different values for particular
-kinds of files. Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.
-
- If the package supports it, you can cause programs to be installed
-with an extra prefix or suffix on their names by giving `configure' the
-option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-
-Optional Features
-=================
-
- Some packages pay attention to `--enable-FEATURE' options to
-`configure', where FEATURE indicates an optional part of the package.
-They may also pay attention to `--with-PACKAGE' options, where PACKAGE
-is something like `gnu-as' or `x' (for the X Window System). The
-`README' should mention any `--enable-' and `--with-' options that the
-package recognizes.
-
- For packages that use the X Window System, `configure' can usually
-find the X include and library files automatically, but if it doesn't,
-you can use the `configure' options `--x-includes=DIR' and
-`--x-libraries=DIR' to specify their locations.
-
-Specifying the System Type
-==========================
-
- There may be some features `configure' can not figure out
-automatically, but needs to determine by the type of host the package
-will run on. Usually `configure' can figure that out, but if it prints
-a message saying it can not guess the host type, give it the
-`--host=TYPE' option. TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name with three fields:
- CPU-COMPANY-SYSTEM
-
-See the file `config.sub' for the possible values of each field. If
-`config.sub' isn't included in this package, then this package doesn't
-need to know the host type.
-
- If you are building compiler tools for cross-compiling, you can also
-use the `--target=TYPE' option to select the type of system they will
-produce code for and the `--build=TYPE' option to select the type of
-system on which you are compiling the package.
-
-Sharing Defaults
-================
-
- If you want to set default values for `configure' scripts to share,
-you can create a site shell script called `config.site' that gives
-default values for variables like `CC', `cache_file', and `prefix'.
-`configure' looks for `PREFIX/share/config.site' if it exists, then
-`PREFIX/etc/config.site' if it exists. Or, you can set the
-`CONFIG_SITE' environment variable to the location of the site script.
-A warning: not all `configure' scripts look for a site script.
-
-Operation Controls
-==================
-
- `configure' recognizes the following options to control how it
-operates.
-
-`--cache-file=FILE'
- Use and save the results of the tests in FILE instead of
- `./config.cache'. Set FILE to `/dev/null' to disable caching, for
- debugging `configure'.
-
-`--help'
- Print a summary of the options to `configure', and exit.
-
-`--quiet'
-`--silent'
-`-q'
- Do not print messages saying which checks are being made. To
- suppress all normal output, redirect it to `/dev/null' (any error
- messages will still be shown).
-
-`--srcdir=DIR'
- Look for the package's source code in directory DIR. Usually
- `configure' can determine that directory automatically.
-
-`--version'
- Print the version of Autoconf used to generate the `configure'
- script, and exit.
-
-`configure' also accepts some other, not widely useful, options.
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index d40a4b2e8..000000000
--- a/Makefile.am
+++ /dev/null
@@ -1,43 +0,0 @@
-## Process this file with automake to produce Makefile.in.
-##
-## Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-AUTOMAKE_OPTIONS = 1.5
-
-SUBDIRS = oop qt libltdl libguile ice-9 guile-config guile-readline \
- scripts srfi doc examples test-suite benchmark-suite lang am
-
-bin_SCRIPTS = guile-tools
-
-include_HEADERS = libguile.h
-
-# automake sometimes forgets to distribute acconfig.h,
-# apparently depending on the phase of the moon.
-EXTRA_DIST = HACKING GUILE-VERSION ANON-CVS SNAPSHOTS \
- $(ACLOCAL) BUGS
-
-TESTS = check-guile
-
-# The rule will cd to $(top_srcdir).
-ACLOCAL = ./guile-aclocal.sh
-
-DISTCLEANFILES = check-guile.log
-
-# Makefile.am ends here
diff --git a/NEWS b/NEWS
deleted file mode 100644
index 1655989ff..000000000
--- a/NEWS
+++ /dev/null
@@ -1,6167 +0,0 @@
-Guile NEWS --- history of user-visible changes. -*- text -*-
-Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
-See the end for copying conditions.
-
-Please send Guile bug reports to bug-guile@gnu.org.
-
-Changes since the stable branch:
-
-* Changes to the standalone interpreter
-
-** New command line option `--no-debug'.
-
-Specifying `--no-debug' on the command line will keep the debugging
-evaluator turned off, even for interactive sessions.
-
-** User-init file ~/.guile is now loaded with the debugging evaluator.
-
-Previously, the normal evaluator would have been used. Using the
-debugging evaluator gives better error messages.
-
-* Changes to Scheme functions and syntax
-
-** New function 'unsetenv'.
-
-** There is support for Infinity and NaNs.
-
-Following PLT Scheme, Guile can now work with infinite numbers, and
-'not-a-numbers'.
-
-There is new syntax for numbers: "+inf.0" (infinity), "-inf.0"
-(negative infinity), "+nan.0" (not-a-number), and "-nan.0" (same as
-"+nan.0"). These numbers are inexact and have no exact counterpart.
-
-Dividing by an inexact zero returns +inf.0 or -inf.0, depending on the
-sign of the dividend. The infinities are integers, and they answer #t
-for both 'even?' and 'odd?'. The +nan.0 value is not an integer and is
-not '=' to itself, but '+nan.0' is 'eqv?' to itself.
-
-For example
-
- (/ 1 0.0)
- => +inf.0
-
- (/ 0 0.0)
- => +nan.0
-
- (/ 0)
- ERROR: Numerical overflow
-
-Two new predicates 'inf?' and 'nan?' can be used to test for the
-special values.
-
-** Inexact zero can have a sign.
-
-Guile can now distinguish between plus and minus inexact zero, if your
-platform supports this, too. The two zeros are equal according to
-'=', but not according to 'eqv?'. For example
-
- (- 0.0)
- => -0.0
-
- (= 0.0 (- 0.0))
- => #t
-
- (eqv? 0.0 (- 0.0))
- => #f
-
-** We now have uninterned symbols.
-
-The new function 'make-symbol' will return a uninterned symbol. This
-is a symbol that is unique and is guaranteed to remain unique.
-However, uninterned symbols can not yet be read back in.
-
-Use the new function 'symbol-interned?' to check whether a symbol is
-interned or not.
-
-** pretty-print has more options.
-
-The function pretty-print from the (ice-9 pretty-print) module can now
-also be invoked with keyword arguments that control things like
-maximum output width. See its online documentation.
-
-** Variables have no longer a special behavior for `equal?'.
-
-Previously, comparing two variables with `equal?' would recursivly
-compare their values. This is no longer done. Variables are now only
-`equal?' if they are `eq?'.
-
-** `(begin)' is now valid.
-
-You can now use an empty `begin' form. It will yield #<unspecified>
-when evaluated and simply be ignored in a definition context.
-
-** Removed: substring-move-left!, substring-move-right!
-
-Use `substring-move!' instead.
-
-** Deprecated: procedure->macro
-
-Change your code to use either procedure->memoizing-macro or, probably better,
-to use r5rs macros. Also, be aware that macro expansion will not be done
-during evaluation, but prior to evaluation.
-
-* Changes to the C interface
-
-** The struct scm_cell has been renamed to scm_t_cell
-
-This is in accordance to Guile's naming scheme for types. Note that
-the name scm_cell is now used for a function that allocates and
-initializes a new cell (see below).
-
-** New functions for memory management
-
-A new set of functions for memory management has been added since the
-old way (scm_must_malloc, scm_must_free, etc) was error prone and
-indeed, Guile itself contained some long standing bugs that could
-cause aborts in long running programs.
-
-The new functions are more symmetrical and do not need cooperation
-from smob free routines, among other improvements.
-
-The new functions are scm_malloc, scm_realloc, scm_strdup,
-scm_strndup, scm_gc_malloc, scm_gc_realloc, scm_gc_free,
-scm_gc_register_collectable_memory, and
-scm_gc_unregister_collectable_memory. Refer to the manual for more
-details and for upgrading instructions.
-
-The old functions for memory management have been deprecated. They
-are: scm_must_malloc, scm_must_realloc, scm_must_free,
-scm_must_strdup, scm_must_strndup, scm_done_malloc, scm_done_free.
-
-** New function: scm_str2string
-
-This function creates a scheme string from a 0-terminated C string. The input
-string is copied.
-
-** Declarations of exported features are marked with SCM_API.
-
-Every declaration of a feature that belongs to the exported Guile API
-has been marked by adding the macro "SCM_API" to the start of the
-declaration. This macro can expand into different things, the most
-common of which is just "extern" for Unix platforms. On Win32, it can
-be used to control which symbols are exported from a DLL.
-
-If you `#define SCM_IMPORT' before including <libguile.h>, SCM_API
-will expand into "__declspec (dllimport) extern", which is needed for
-linking to the Guile DLL in Windows.
-
-There are also SCM_RL_IMPORT, QT_IMPORT, SCM_SRFI1314_IMPORT, and
-SCM_SRFI4_IMPORT, for the corresponding libraries.
-
-** SCM_NEWCELL and SCM_NEWCELL2 have been deprecated.
-
-Use the new functions scm_cell and scm_double_cell instead. The old macros
-had problems because with them allocation and initialization was separated and
-the GC could sometimes observe half initialized cells. Only careful coding by
-the user of SCM_NEWCELL and SCM_NEWCELL2 could make this safe and efficient.
-
-** CHECK_ENTRY, CHECK_APPLY and CHECK_EXIT have been deprecated.
-
-Use the variables scm_check_entry_p, scm_check_apply_p and scm_check_exit_p
-instead.
-
-** SRCBRKP has been deprecated.
-
-Use scm_c_source_property_breakpoint_p instead.
-
-** Deprecated: scm_makmacro
-
-Change your code to use either scm_makmmacro or, probably better, to use r5rs
-macros. Also, be aware that macro expansion will not be done during
-evaluation, but prior to evaluation.
-
-** Removed from scm_root_state: def_inp, def_outp, def_errp, together
-with corresponding macros scm_def_inp, scm_def_outp and scm_def_errp.
-These were undocumented and unused copies of the standard ports at the
-time that Guile was initialised. Normally the current ports should be
-used instead, obtained from scm_current_input_port () etc. If an
-application needs to retain earlier ports, it should save them in a
-gc-protected location.
-
-** Removed compile time option MEMOIZE_LOCALS
-
-Now, caching of local variable positions during memoization is mandatory.
-However, the option to disable the caching has most probably not been used
-anyway.
-
-** Removed compile time option SCM_RECKLESS
-
-Full number of arguments checking of closures is mandatory now. However, the
-option to disable the checking has most probably not been used anyway.
-
-** Removed compile time option SCM_CAUTIOUS
-
-Full number of arguments checking of closures is mandatory now. However, the
-option to disable the checking has most probably not been used anyway.
-
-** Removed definitions: scm_lisp_nil, scm_lisp_t, s_nil_ify, scm_m_nil_ify,
-s_t_ify, scm_m_t_ify, s_0_cond, scm_m_0_cond, s_0_ify, scm_m_0_ify, s_1_ify,
-scm_m_1_ify, scm_debug_newcell, scm_debug_newcell2, scm_tc16_allocated,
-SCM_SET_SYMBOL_HASH, SCM_IM_NIL_IFY, SCM_IM_T_IFY, SCM_IM_0_COND,
-SCM_IM_0_IFY, SCM_IM_1_IFY, SCM_GC_SET_ALLOCATED, scm_debug_newcell,
-scm_debug_newcell2, scm_substring_move_left_x, scm_substring_move_right_x,
-long_long, ulong_long, scm_sizet, SCM_WNA, SCM_OUTOFRANGE, SCM_NALLOC,
-SCM_HUP_SIGNAL, SCM_INT_SIGNAL, SCM_FPE_SIGNAL, SCM_BUS_SIGNAL,
-SCM_SEGV_SIGNAL, SCM_ALRM_SIGNAL, SCM_GC_SIGNAL, SCM_TICK_SIGNAL,
-SCM_SIG_ORD, SCM_ORD_SIG, SCM_NUM_SIGS, moddata, registered_mods,
-scm_register_module_xxx, scm_registered_modules,
-scm_clear_registered_modules, scm_wta, *top-level-lookup-closure*,
-scm_top_level_lookup_closure_var, scm_system_transformer, scm_eval_3,
-scm_eval2, SCM_SETAND_CAR, SCM_SETOR_CAR, SCM_SETAND_CDR, SCM_SETOR_CDR,
-SCM_FREEP, SCM_NFREEP, SCM_GC8MARKP, SCM_SETGC8MARK, SCM_CLRGC8MARK,
-SCM_GCTYP16, SCM_GCCDR, scm_remember, scm_protect_object,
-scm_unprotect_object, root_module_lookup_closure, scm_sym_app,
-scm_sym_modules, module_prefix, make_modules_in_var,
-beautify_user_module_x_var, try_module_autoload_var, scm_module_full_name,
-scm_the_root_module, scm_make_module, scm_ensure_user_module,
-scm_load_scheme_module, scm_port, scm_ptob_descriptor, scm_port_rw_active,
-scm_close_all_ports_except, scm_rstate, scm_rng, scm_i_rstate,
-SCM_SLOPPY_STRINGP, SCM_RWSTRINGP, SCM_STRING_UCHARS, SCM_STRING_CHARS,
-scm_read_only_string_p, scm_makstr, scm_makfromstr,
-scm_make_shared_substring, scm_tc7_substring, SCM_SLOPPY_CONSP,
-SCM_SLOPPY_NCONSP, scm_tc7_ssymbol, scm_tc7_msymbol, scm_tcs_symbols,
-sym_huh, scm_variable_set_name_hint, scm_builtin_variable, SCM_VARVCELL,
-SCM_UDVARIABLEP, SCM_DEFVARIABLEP, scm_internal_with_fluids,
-scm_make_gsubr, scm_make_gsubr_with_generic, scm_create_hook, list*,
-SCM_LIST0, SCM_LIST1, SCM_LIST2, SCM_LIST3, SCM_LIST4, SCM_LIST5,
-SCM_LIST6, SCM_LIST7, SCM_LIST8, SCM_LIST9, scm_listify, scm_sloppy_memq,
-scm_sloppy_memv, scm_sloppy_member, scm_end_of_file_key,
-scm_read_and_eval_x, scm_mkbig, scm_big2inum, scm_adjbig, scm_normbig,
-scm_copybig, scm_2ulong2big, scm_dbl2big, scm_big2dbl, SCM_FIXNUM_BIT,
-scm_subr_entry, SCM_SUBR_DOC, scm_make_subr_opt, scm_make_subr,
-scm_make_subr_with_generic, setjmp_type, setjmp_type,
-scm_call_catching_errors, scm_make_smob_type_mfpe, scm_set_smob_mfpe,
-scm_strprint_obj, scm_read_0str, scm_eval_0str, SCM_CHARS, SCM_UCHARS,
-SCM_SETCHARS, SCM_SLOPPY_SUBSTRP, SCM_SUBSTR_STR, SCM_SUBSTR_OFFSET,
-SCM_LENGTH_MAX, SCM_LENGTH, SCM_SETLENGTH, SCM_ROSTRINGP, SCM_ROLENGTH,
-SCM_ROCHARS, SCM_ROUCHARS, SCM_SUBSTRP, SCM_COERCE_SUBSTR, scm_strhash,
-scm_sym2vcell, scm_sym2ovcell_soft, scm_sym2ovcell,
-scm_intern_obarray_soft, scm_intern_obarray, scm_intern, scm_intern0,
-scm_sysintern, scm_sysintern0, scm_sysintern0_no_module_lookup,
-scm_symbol_value0, scm_string_to_obarray_symbol, scm_intern_symbol,
-scm_unintern_symbol, scm_symbol_binding, scm_symbol_interned_p,
-scm_symbol_bound_p, scm_symbol_set_x, scm_gentemp,
-scm_init_symbols_deprecated, s_vector_set_length_x, scm_vector_set_length_x,
-scm_contregs, scm_debug_info, scm_debug_frame, SCM_DSIDEVAL, SCM_OPDIRP,
-scm_fport, scm_option, SCM_CONST_LONG, SCM_VCELL, SCM_GLOBAL_VCELL,
-SCM_VCELL_INIT, SCM_GLOBAL_VCELL_INIT, scm_srcprops, scm_srcprops_chunk,
-scm_info_frame, scm_stack, scm_array, scm_array_dim, SCM_ARRAY_CONTIGUOUS,
-SCM_HUGE_LENGTH, SCM_FUNC_NAME, SCM_WTA, RETURN_SCM_WTA,
-SCM_VALIDATE_NUMBER_COPY, SCM_VALIDATE_NUMBER_DEF_COPY,
-SCM_VALIDATE_STRINGORSUBSTR, SCM_VALIDATE_ROSTRING,
-SCM_VALIDATE_ROSTRING_COPY, SCM_VALIDATE_NULLORROSTRING_COPY,
-SCM_VALIDATE_RWSTRING, SCM_VALIDATE_OPDIR, DIGITS, scm_small_istr2int,
-scm_istr2int, scm_istr2flo, scm_istring2number, scm_istr2int,
-scm_istr2flo, scm_istring2number, scm_vtable_index_vcell, scm_si_vcell,
-SCM_ECONSP, SCM_NECONSP, SCM_GLOC_VAR, SCM_GLOC_VAL, SCM_GLOC_SET_VAL,
-SCM_GLOC_VAL_LOC, scm_make_gloc, scm_gloc_p, scm_tc16_variable
-
-Changes since Guile 1.4:
-
-* Changes to the distribution
-
-** A top-level TODO file is included.
-
-** Guile now uses a versioning scheme similar to that of the Linux kernel.
-
-Guile now always uses three numbers to represent the version,
-i.e. "1.6.5". The first number, 1, is the major version number, the
-second number, 6, is the minor version number, and the third number,
-5, is the micro version number. Changes in major version number
-indicate major changes in Guile.
-
-Minor version numbers that are even denote stable releases, and odd
-minor version numbers denote development versions (which may be
-unstable). The micro version number indicates a minor sub-revision of
-a given MAJOR.MINOR release.
-
-In keeping with the new scheme, (minor-version) and scm_minor_version
-no longer return everything but the major version number. They now
-just return the minor version number. Two new functions
-(micro-version) and scm_micro_version have been added to report the
-micro version number.
-
-In addition, ./GUILE-VERSION now defines GUILE_MICRO_VERSION.
-
-** New preprocessor definitions are available for checking versions.
-
-version.h now #defines SCM_MAJOR_VERSION, SCM_MINOR_VERSION, and
-SCM_MICRO_VERSION to the appropriate integer values.
-
-** Guile now actively warns about deprecated features.
-
-The new configure option `--enable-deprecated=LEVEL' and the
-environment variable GUILE_WARN_DEPRECATED control this mechanism.
-See INSTALL and README for more information.
-
-** Guile is much more likely to work on 64-bit architectures.
-
-Guile now compiles and passes "make check" with only two UNRESOLVED GC
-cases on Alpha and ia64 based machines now. Thanks to John Goerzen
-for the use of a test machine, and thanks to Stefan Jahn for ia64
-patches.
-
-** New functions: setitimer and getitimer.
-
-These implement a fairly direct interface to the libc functions of the
-same name.
-
-** The #. reader extension is now disabled by default.
-
-For safety reasons, #. evaluation is disabled by default. To
-re-enable it, set the fluid read-eval? to #t. For example:
-
- (fluid-set! read-eval? #t)
-
-but make sure you realize the potential security risks involved. With
-read-eval? enabled, reading a data file from an untrusted source can
-be dangerous.
-
-** New SRFI modules have been added:
-
-SRFI-0 `cond-expand' is now supported in Guile, without requiring
-using a module.
-
-(srfi srfi-1) is a library containing many useful pair- and list-processing
- procedures.
-
-(srfi srfi-2) exports and-let*.
-
-(srfi srfi-4) implements homogeneous numeric vector datatypes.
-
-(srfi srfi-6) is a dummy module for now, since guile already provides
- all of the srfi-6 procedures by default: open-input-string,
- open-output-string, get-output-string.
-
-(srfi srfi-8) exports receive.
-
-(srfi srfi-9) exports define-record-type.
-
-(srfi srfi-10) exports define-reader-ctor and implements the reader
- extension #,().
-
-(srfi srfi-11) exports let-values and let*-values.
-
-(srfi srfi-13) implements the SRFI String Library.
-
-(srfi srfi-14) implements the SRFI Character-Set Library.
-
-(srfi srfi-17) implements setter and getter-with-setter and redefines
- some accessor procedures as procedures with getters. (such as car,
- cdr, vector-ref etc.)
-
-(srfi srfi-19) implements the SRFI Time/Date Library.
-
-** New scripts / "executable modules"
-
-Subdirectory "scripts" contains Scheme modules that are packaged to
-also be executable as scripts. At this time, these scripts are available:
-
- display-commentary
- doc-snarf
- generate-autoload
- punify
- read-scheme-source
- use2dot
-
-See README there for more info.
-
-These scripts can be invoked from the shell with the new program
-"guile-tools", which keeps track of installation directory for you.
-For example:
-
- $ guile-tools display-commentary srfi/*.scm
-
-guile-tools is copied to the standard $bindir on "make install".
-
-** New module (ice-9 stack-catch):
-
-stack-catch is like catch, but saves the current state of the stack in
-the fluid the-last-stack. This fluid can be useful when using the
-debugger and when re-throwing an error.
-
-** The module (ice-9 and-let*) has been renamed to (ice-9 and-let-star)
-
-This has been done to prevent problems on lesser operating systems
-that can't tolerate `*'s in file names. The exported macro continues
-to be named `and-let*', of course.
-
-On systems that support it, there is also a compatibility module named
-(ice-9 and-let*). It will go away in the next release.
-
-** New modules (oop goops) etc.:
-
- (oop goops)
- (oop goops describe)
- (oop goops save)
- (oop goops active-slot)
- (oop goops composite-slot)
-
-The Guile Object Oriented Programming System (GOOPS) has been
-integrated into Guile. For further information, consult the GOOPS
-manual and tutorial in the `doc' directory.
-
-** New module (ice-9 rdelim).
-
-This exports the following procedures which were previously defined
-in the default environment:
-
-read-line read-line! read-delimited read-delimited! %read-delimited!
-%read-line write-line
-
-For backwards compatibility the definitions are still imported into the
-default environment in this version of Guile. However you should add:
-
-(use-modules (ice-9 rdelim))
-
-to any program which uses the definitions, since this may change in
-future.
-
-Alternatively, if guile-scsh is installed, the (scsh rdelim) module
-can be used for similar functionality.
-
-** New module (ice-9 rw)
-
-This is a subset of the (scsh rw) module from guile-scsh. Currently
-it defines two procedures:
-
-*** New function: read-string!/partial str [port_or_fdes [start [end]]]
-
- Read characters from a port or file descriptor into a string STR.
- A port must have an underlying file descriptor -- a so-called
- fport. This procedure is scsh-compatible and can efficiently read
- large strings.
-
-*** New function: write-string/partial str [port_or_fdes [start [end]]]
-
- Write characters from a string STR to a port or file descriptor.
- A port must have an underlying file descriptor -- a so-called
- fport. This procedure is mostly compatible and can efficiently
- write large strings.
-
-** New module (ice-9 match)
-
-This module includes Andrew K. Wright's pattern matcher. See
-ice-9/match.scm for brief description or
-
- http://www.star-lab.com/wright/code.html
-
-for complete documentation.
-
-** New module (ice-9 buffered-input)
-
-This module provides procedures to construct an input port from an
-underlying source of input that reads and returns its input in chunks.
-The underlying input source is a Scheme procedure, specified by the
-caller, which the port invokes whenever it needs more input.
-
-This is useful when building an input port whose back end is Readline
-or a UI element such as the GtkEntry widget.
-
-** Documentation
-
-The reference and tutorial documentation that was previously
-distributed separately, as `guile-doc', is now included in the core
-Guile distribution. The documentation consists of the following
-manuals.
-
-- The Guile Tutorial (guile-tut.texi) contains a tutorial introduction
- to using Guile.
-
-- The Guile Reference Manual (guile.texi) contains (or is intended to
- contain) reference documentation on all aspects of Guile.
-
-- The GOOPS Manual (goops.texi) contains both tutorial-style and
- reference documentation for using GOOPS, Guile's Object Oriented
- Programming System.
-
-- The Revised^5 Report on the Algorithmic Language Scheme
- (r5rs.texi).
-
-See the README file in the `doc' directory for more details.
-
-** There are a couple of examples in the examples/ directory now.
-
-* Changes to the stand-alone interpreter
-
-** New command line option `--use-srfi'
-
-Using this option, SRFI modules can be loaded on startup and be
-available right from the beginning. This makes programming portable
-Scheme programs easier.
-
-The option `--use-srfi' expects a comma-separated list of numbers,
-each representing a SRFI number to be loaded into the interpreter
-before starting evaluating a script file or the REPL. Additionally,
-the feature identifier for the loaded SRFIs is recognized by
-`cond-expand' when using this option.
-
-Example:
-$ guile --use-srfi=8,13
-guile> (receive (x z) (values 1 2) (+ 1 2))
-3
-guile> (string-pad "bla" 20)
-" bla"
-
-** Guile now always starts up in the `(guile-user)' module.
-
-Previously, scripts executed via the `-s' option would run in the
-`(guile)' module and the repl would run in the `(guile-user)' module.
-Now every user action takes place in the `(guile-user)' module by
-default.
-
-* Changes to Scheme functions and syntax
-
-** Character classifiers work for non-ASCII characters.
-
-The predicates `char-alphabetic?', `char-numeric?',
-`char-whitespace?', `char-lower?', `char-upper?' and `char-is-both?'
-no longer check whether their arguments are ASCII characters.
-Previously, a character would only be considered alphabetic when it
-was also ASCII, for example.
-
-** Previously deprecated Scheme functions have been removed:
-
- tag - no replacement.
- fseek - replaced by seek.
- list* - replaced by cons*.
-
-** It's now possible to create modules with controlled environments
-
-Example:
-
-(use-modules (ice-9 safe))
-(define m (make-safe-module))
-;;; m will now be a module containing only a safe subset of R5RS
-(eval '(+ 1 2) m) --> 3
-(eval 'load m) --> ERROR: Unbound variable: load
-
-** Evaluation of "()", the empty list, is now an error.
-
-Previously, the expression "()" evaluated to the empty list. This has
-been changed to signal a "missing expression" error. The correct way
-to write the empty list as a literal constant is to use quote: "'()".
-
-** New concept of `Guile Extensions'.
-
-A Guile Extension is just a ordinary shared library that can be linked
-at run-time. We found it advantageous to give this simple concept a
-dedicated name to distinguish the issues related to shared libraries
-from the issues related to the module system.
-
-*** New function: load-extension
-
-Executing (load-extension lib init) is mostly equivalent to
-
- (dynamic-call init (dynamic-link lib))
-
-except when scm_register_extension has been called previously.
-Whenever appropriate, you should use `load-extension' instead of
-dynamic-link and dynamic-call.
-
-*** New C function: scm_c_register_extension
-
-This function registers a initialization function for use by
-`load-extension'. Use it when you don't want specific extensions to
-be loaded as shared libraries (for example on platforms that don't
-support dynamic linking).
-
-** Auto-loading of compiled-code modules is deprecated.
-
-Guile used to be able to automatically find and link a shared
-library to satisfy requests for a module. For example, the module
-`(foo bar)' could be implemented by placing a shared library named
-"foo/libbar.so" (or with a different extension) in a directory on the
-load path of Guile.
-
-This has been found to be too tricky, and is no longer supported. The
-shared libraries are now called "extensions". You should now write a
-small Scheme file that calls `load-extension' to load the shared
-library and initialize it explicitely.
-
-The shared libraries themselves should be installed in the usual
-places for shared libraries, with names like "libguile-foo-bar".
-
-For example, place this into a file "foo/bar.scm"
-
- (define-module (foo bar))
-
- (load-extension "libguile-foo-bar" "foobar_init")
-
-** Backward incompatible change: eval EXP ENVIRONMENT-SPECIFIER
-
-`eval' is now R5RS, that is it takes two arguments.
-The second argument is an environment specifier, i.e. either
-
- (scheme-report-environment 5)
- (null-environment 5)
- (interaction-environment)
-
-or
-
- any module.
-
-** The module system has been made more disciplined.
-
-The function `eval' will save and restore the current module around
-the evaluation of the specified expression. While this expression is
-evaluated, `(current-module)' will now return the right module, which
-is the module specified as the second argument to `eval'.
-
-A consequence of this change is that `eval' is not particularly
-useful when you want allow the evaluated code to change what module is
-designated as the current module and have this change persist from one
-call to `eval' to the next. The read-eval-print-loop is an example
-where `eval' is now inadequate. To compensate, there is a new
-function `primitive-eval' that does not take a module specifier and
-that does not save/restore the current module. You should use this
-function together with `set-current-module', `current-module', etc
-when you want to have more control over the state that is carried from
-one eval to the next.
-
-Additionally, it has been made sure that forms that are evaluated at
-the top level are always evaluated with respect to the current module.
-Previously, subforms of top-level forms such as `begin', `case',
-etc. did not respect changes to the current module although these
-subforms are at the top-level as well.
-
-To prevent strange behavior, the forms `define-module',
-`use-modules', `use-syntax', and `export' have been restricted to only
-work on the top level. The forms `define-public' and
-`defmacro-public' only export the new binding on the top level. They
-behave just like `define' and `defmacro', respectively, when they are
-used in a lexical environment.
-
-Also, `export' will no longer silently re-export bindings imported
-from a used module. It will emit a `deprecation' warning and will
-cease to perform any re-export in the next version. If you actually
-want to re-export bindings, use the new `re-export' in place of
-`export'. The new `re-export' will not make copies of variables when
-rexporting them, as `export' did wrongly.
-
-** Module system now allows selection and renaming of imported bindings
-
-Previously, when using `use-modules' or the `#:use-module' clause in
-the `define-module' form, all the bindings (association of symbols to
-values) for imported modules were added to the "current module" on an
-as-is basis. This has been changed to allow finer control through two
-new facilities: selection and renaming.
-
-You can now select which of the imported module's bindings are to be
-visible in the current module by using the `:select' clause. This
-clause also can be used to rename individual bindings. For example:
-
- ;; import all bindings no questions asked
- (use-modules (ice-9 common-list))
-
- ;; import four bindings, renaming two of them;
- ;; the current module sees: every some zonk-y zonk-n
- (use-modules ((ice-9 common-list)
- :select (every some
- (remove-if . zonk-y)
- (remove-if-not . zonk-n))))
-
-You can also programmatically rename all selected bindings using the
-`:renamer' clause, which specifies a proc that takes a symbol and
-returns another symbol. Because it is common practice to use a prefix,
-we now provide the convenience procedure `symbol-prefix-proc'. For
-example:
-
- ;; import four bindings, renaming two of them specifically,
- ;; and all four w/ prefix "CL:";
- ;; the current module sees: CL:every CL:some CL:zonk-y CL:zonk-n
- (use-modules ((ice-9 common-list)
- :select (every some
- (remove-if . zonk-y)
- (remove-if-not . zonk-n))
- :renamer (symbol-prefix-proc 'CL:)))
-
- ;; import four bindings, renaming two of them specifically,
- ;; and all four by upcasing.
- ;; the current module sees: EVERY SOME ZONK-Y ZONK-N
- (define (upcase-symbol sym)
- (string->symbol (string-upcase (symbol->string sym))))
-
- (use-modules ((ice-9 common-list)
- :select (every some
- (remove-if . zonk-y)
- (remove-if-not . zonk-n))
- :renamer upcase-symbol))
-
-Note that programmatic renaming is done *after* individual renaming.
-Also, the above examples show `use-modules', but the same facilities are
-available for the `#:use-module' clause of `define-module'.
-
-See manual for more info.
-
-** The semantics of guardians have changed.
-
-The changes are for the most part compatible. An important criterion
-was to keep the typical usage of guardians as simple as before, but to
-make the semantics safer and (as a result) more useful.
-
-*** All objects returned from guardians are now properly alive.
-
-It is now guaranteed that any object referenced by an object returned
-from a guardian is alive. It's now impossible for a guardian to
-return a "contained" object before its "containing" object.
-
-One incompatible (but probably not very important) change resulting
-from this is that it is no longer possible to guard objects that
-indirectly reference themselves (i.e. are parts of cycles). If you do
-so accidentally, you'll get a warning.
-
-*** There are now two types of guardians: greedy and sharing.
-
-If you call (make-guardian #t) or just (make-guardian), you'll get a
-greedy guardian, and for (make-guardian #f) a sharing guardian.
-
-Greedy guardians are the default because they are more "defensive".
-You can only greedily guard an object once. If you guard an object
-more than once, once in a greedy guardian and the rest of times in
-sharing guardians, then it is guaranteed that the object won't be
-returned from sharing guardians as long as it is greedily guarded
-and/or alive.
-
-Guardians returned by calls to `make-guardian' can now take one more
-optional parameter, which says whether to throw an error in case an
-attempt is made to greedily guard an object that is already greedily
-guarded. The default is true, i.e. throw an error. If the parameter
-is false, the guardian invocation returns #t if guarding was
-successful and #f if it wasn't.
-
-Also, since greedy guarding is, in effect, a side-effecting operation
-on objects, a new function is introduced: `destroy-guardian!'.
-Invoking this function on a guardian renders it unoperative and, if
-the guardian is greedy, clears the "greedily guarded" property of the
-objects that were guarded by it, thus undoing the side effect.
-
-Note that all this hair is hardly very important, since guardian
-objects are usually permanent.
-
-** Continuations created by call-with-current-continuation now accept
-any number of arguments, as required by R5RS.
-
-** New function `issue-deprecation-warning'
-
-This function is used to display the deprecation messages that are
-controlled by GUILE_WARN_DEPRECATION as explained in the README.
-
- (define (id x)
- (issue-deprecation-warning "`id' is deprecated. Use `identity' instead.")
- (identity x))
-
- guile> (id 1)
- ;; `id' is deprecated. Use `identity' instead.
- 1
- guile> (id 1)
- 1
-
-** New syntax `begin-deprecated'
-
-When deprecated features are included (as determined by the configure
-option --enable-deprecated), `begin-deprecated' is identical to
-`begin'. When deprecated features are excluded, it always evaluates
-to `#f', ignoring the body forms.
-
-** New function `make-object-property'
-
-This function returns a new `procedure with setter' P that can be used
-to attach a property to objects. When calling P as
-
- (set! (P obj) val)
-
-where `obj' is any kind of object, it attaches `val' to `obj' in such
-a way that it can be retrieved by calling P as
-
- (P obj)
-
-This function will replace procedure properties, symbol properties and
-source properties eventually.
-
-** Module (ice-9 optargs) now uses keywords instead of `#&'.
-
-Instead of #&optional, #&key, etc you should now use #:optional,
-#:key, etc. Since #:optional is a keyword, you can write it as just
-:optional when (read-set! keywords 'prefix) is active.
-
-The old reader syntax `#&' is still supported, but deprecated. It
-will be removed in the next release.
-
-** New define-module option: pure
-
-Tells the module system not to include any bindings from the root
-module.
-
-Example:
-
-(define-module (totally-empty-module)
- :pure)
-
-** New define-module option: export NAME1 ...
-
-Export names NAME1 ...
-
-This option is required if you want to be able to export bindings from
-a module which doesn't import one of `define-public' or `export'.
-
-Example:
-
- (define-module (foo)
- :pure
- :use-module (ice-9 r5rs)
- :export (bar))
-
- ;;; Note that we're pure R5RS below this point!
-
- (define (bar)
- ...)
-
-** New function: object->string OBJ
-
-Return a Scheme string obtained by printing a given object.
-
-** New function: port? X
-
-Returns a boolean indicating whether X is a port. Equivalent to
-`(or (input-port? X) (output-port? X))'.
-
-** New function: file-port?
-
-Determines whether a given object is a port that is related to a file.
-
-** New function: port-for-each proc
-
-Apply PROC to each port in the Guile port table in turn. The return
-value is unspecified. More specifically, PROC is applied exactly once
-to every port that exists in the system at the time PORT-FOR-EACH is
-invoked. Changes to the port table while PORT-FOR-EACH is running
-have no effect as far as PORT-FOR-EACH is concerned.
-
-** New function: dup2 oldfd newfd
-
-A simple wrapper for the `dup2' system call. Copies the file
-descriptor OLDFD to descriptor number NEWFD, replacing the
-previous meaning of NEWFD. Both OLDFD and NEWFD must be integers.
-Unlike for dup->fdes or primitive-move->fdes, no attempt is made
-to move away ports which are using NEWFD. The return value is
-unspecified.
-
-** New function: close-fdes fd
-
-A simple wrapper for the `close' system call. Close file
-descriptor FD, which must be an integer. Unlike close (*note
-close: Ports and File Descriptors.), the file descriptor will be
-closed even if a port is using it. The return value is
-unspecified.
-
-** New function: crypt password salt
-
-Encrypts `password' using the standard unix password encryption
-algorithm.
-
-** New function: chroot path
-
-Change the root directory of the running process to `path'.
-
-** New functions: getlogin, cuserid
-
-Return the login name or the user name of the current effective user
-id, respectively.
-
-** New functions: getpriority which who, setpriority which who prio
-
-Get or set the priority of the running process.
-
-** New function: getpass prompt
-
-Read a password from the terminal, first displaying `prompt' and
-disabling echoing.
-
-** New function: flock file operation
-
-Set/remove an advisory shared or exclusive lock on `file'.
-
-** New functions: sethostname name, gethostname
-
-Set or get the hostname of the machine the current process is running
-on.
-
-** New function: mkstemp! tmpl
-
-mkstemp creates a new unique file in the file system and returns a
-new buffered port open for reading and writing to the file. TMPL
-is a string specifying where the file should be created: it must
-end with `XXXXXX' and will be changed in place to return the name
-of the temporary file.
-
-** New function: open-input-string string
-
-Return an input string port which delivers the characters from
-`string'. This procedure, together with `open-output-string' and
-`get-output-string' implements SRFI-6.
-
-** New function: open-output-string
-
-Return an output string port which collects all data written to it.
-The data can then be retrieved by `get-output-string'.
-
-** New function: get-output-string
-
-Return the contents of an output string port.
-
-** New function: identity
-
-Return the argument.
-
-** socket, connect, accept etc., now have support for IPv6. IPv6 addresses
- are represented in Scheme as integers with normal host byte ordering.
-
-** New function: inet-pton family address
-
-Convert a printable string network address into an integer. Note that
-unlike the C version of this function, the result is an integer with
-normal host byte ordering. FAMILY can be `AF_INET' or `AF_INET6'.
-e.g.,
-
- (inet-pton AF_INET "127.0.0.1") => 2130706433
- (inet-pton AF_INET6 "::1") => 1
-
-** New function: inet-ntop family address
-
-Convert an integer network address into a printable string. Note that
-unlike the C version of this function, the input is an integer with
-normal host byte ordering. FAMILY can be `AF_INET' or `AF_INET6'.
-e.g.,
-
- (inet-ntop AF_INET 2130706433) => "127.0.0.1"
- (inet-ntop AF_INET6 (- (expt 2 128) 1)) =>
- ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
-
-** Deprecated: id
-
-Use `identity' instead.
-
-** Deprecated: -1+
-
-Use `1-' instead.
-
-** Deprecated: return-it
-
-Do without it.
-
-** Deprecated: string-character-length
-
-Use `string-length' instead.
-
-** Deprecated: flags
-
-Use `logior' instead.
-
-** Deprecated: close-all-ports-except.
-
-This was intended for closing ports in a child process after a fork,
-but it has the undesirable side effect of flushing buffers.
-port-for-each is more flexible.
-
-** The (ice-9 popen) module now attempts to set up file descriptors in
-the child process from the current Scheme ports, instead of using the
-current values of file descriptors 0, 1, and 2 in the parent process.
-
-** Removed function: builtin-weak-bindings
-
-There is no such concept as a weak binding any more.
-
-** Removed constants: bignum-radix, scm-line-incrementors
-
-** define-method: New syntax mandatory.
-
-The new method syntax is now mandatory:
-
-(define-method (NAME ARG-SPEC ...) BODY ...)
-(define-method (NAME ARG-SPEC ... . REST-ARG) BODY ...)
-
- ARG-SPEC ::= ARG-NAME | (ARG-NAME TYPE)
- REST-ARG ::= ARG-NAME
-
-If you have old code using the old syntax, import
-(oop goops old-define-method) before (oop goops) as in:
-
- (use-modules (oop goops old-define-method) (oop goops))
-
-** Deprecated function: builtin-variable
- Removed function: builtin-bindings
-
-There is no longer a distinction between builtin or other variables.
-Use module system operations for all variables.
-
-** Lazy-catch handlers are no longer allowed to return.
-
-That is, a call to `throw', `error', etc is now guaranteed to not
-return.
-
-** Bugfixes for (ice-9 getopt-long)
-
-This module is now tested using test-suite/tests/getopt-long.test.
-The following bugs have been fixed:
-
-*** Parsing for options that are specified to have `optional' args now checks
-if the next element is an option instead of unconditionally taking it as the
-option arg.
-
-*** An error is now thrown for `--opt=val' when the option description
-does not specify `(value #t)' or `(value optional)'. This condition used to
-be accepted w/o error, contrary to the documentation.
-
-*** The error message for unrecognized options is now more informative.
-It used to be "not a record", an artifact of the implementation.
-
-*** The error message for `--opt' terminating the arg list (no value), when
-`(value #t)' is specified, is now more informative. It used to be "not enough
-args".
-
-*** "Clumped" single-char args now preserve trailing string, use it as arg.
-The expansion used to be like so:
-
- ("-abc5d" "--xyz") => ("-a" "-b" "-c" "--xyz")
-
-Note that the "5d" is dropped. Now it is like so:
-
- ("-abc5d" "--xyz") => ("-a" "-b" "-c" "5d" "--xyz")
-
-This enables single-char options to have adjoining arguments as long as their
-constituent characters are not potential single-char options.
-
-** (ice-9 session) procedure `arity' now works with (ice-9 optargs) `lambda*'
-
-The `lambda*' and derivative forms in (ice-9 optargs) now set a procedure
-property `arglist', which can be retrieved by `arity'. The result is that
-`arity' can give more detailed information than before:
-
-Before:
-
- guile> (use-modules (ice-9 optargs))
- guile> (define* (foo #:optional a b c) a)
- guile> (arity foo)
- 0 or more arguments in `lambda*:G0'.
-
-After:
-
- guile> (arity foo)
- 3 optional arguments: `a', `b' and `c'.
- guile> (define* (bar a b #:key c d #:allow-other-keys) a)
- guile> (arity bar)
- 2 required arguments: `a' and `b', 2 keyword arguments: `c'
- and `d', other keywords allowed.
- guile> (define* (baz a b #:optional c #:rest r) a)
- guile> (arity baz)
- 2 required arguments: `a' and `b', 1 optional argument: `c',
- the rest in `r'.
-
-* Changes to the C interface
-
-** Types have been renamed from scm_*_t to scm_t_*.
-
-This has been done for POSIX sake. It reserves identifiers ending
-with "_t". What a concept.
-
-The old names are still available with status `deprecated'.
-
-** scm_t_bits (former scm_bits_t) is now a unsigned type.
-
-** Deprecated features have been removed.
-
-*** Macros removed
-
- SCM_INPORTP, SCM_OUTPORTP SCM_ICHRP, SCM_ICHR, SCM_MAKICHR
- SCM_SETJMPBUF SCM_NSTRINGP SCM_NRWSTRINGP SCM_NVECTORP SCM_DOUBLE_CELLP
-
-*** C Functions removed
-
- scm_sysmissing scm_tag scm_tc16_flo scm_tc_flo
- scm_fseek - replaced by scm_seek.
- gc-thunk - replaced by after-gc-hook.
- gh_int2scmb - replaced by gh_bool2scm.
- scm_tc_dblr - replaced by scm_tc16_real.
- scm_tc_dblc - replaced by scm_tc16_complex.
- scm_list_star - replaced by scm_cons_star.
-
-** Deprecated: scm_makfromstr
-
-Use scm_mem2string instead.
-
-** Deprecated: scm_make_shared_substring
-
-Explicit shared substrings will disappear from Guile.
-
-Instead, "normal" strings will be implemented using sharing
-internally, combined with a copy-on-write strategy.
-
-** Deprecated: scm_read_only_string_p
-
-The concept of read-only strings will disappear in next release of
-Guile.
-
-** Deprecated: scm_sloppy_memq, scm_sloppy_memv, scm_sloppy_member
-
-Instead, use scm_c_memq or scm_memq, scm_memv, scm_member.
-
-** New functions: scm_call_0, scm_call_1, scm_call_2, scm_call_3
-
-Call a procedure with the indicated number of arguments.
-
-Example:
-
- scm_call_1 (proc, arg1);
-
-** New functions: scm_apply_0, scm_apply_1, scm_apply_2, scm_apply_3
-
-Call a procedure with the indicated number of arguments and a list
-of arguments.
-
-Example:
-
- scm_apply_1 (proc, arg1, args);
-
-** New functions: scm_list_1, scm_list_2, scm_list_3, scm_list_4, scm_list_5
-
-Create a list of the given number of elements.
-
-** Renamed function: scm_listify has been replaced by scm_list_n.
-
-** Deprecated macros: SCM_LIST0, SCM_LIST1, SCM_LIST2, SCM_LIST3, SCM_LIST4,
-SCM_LIST5, SCM_LIST6, SCM_LIST7, SCM_LIST8, SCM_LIST9.
-
-Use functions scm_list_N instead.
-
-** New function: scm_c_read (SCM port, void *buffer, scm_sizet size)
-
-Used by an application to read arbitrary number of bytes from a port.
-Same semantics as libc read, except that scm_c_read only returns less
-than SIZE bytes if at end-of-file.
-
-Warning: Doesn't update port line and column counts!
-
-** New function: scm_c_write (SCM port, const void *ptr, scm_sizet size)
-
-Used by an application to write arbitrary number of bytes to an SCM
-port. Similar semantics as libc write. However, unlike libc
-write, scm_c_write writes the requested number of bytes and has no
-return value.
-
-Warning: Doesn't update port line and column counts!
-
-** New function: scm_init_guile ()
-
-In contrast to scm_boot_guile, scm_init_guile will return normally
-after initializing Guile. It is not available on all systems, tho.
-
-** New functions: scm_str2symbol, scm_mem2symbol
-
-The function scm_str2symbol takes a const char* pointing to a zero-terminated
-field of characters and creates a scheme symbol object from that C string.
-The function scm_mem2symbol takes a const char* and a number of characters and
-creates a symbol from the characters in that memory area.
-
-** New functions: scm_primitive_make_property
- scm_primitive_property_ref
- scm_primitive_property_set_x
- scm_primitive_property_del_x
-
-These functions implement a new way to deal with object properties.
-See libguile/properties.c for their documentation.
-
-** New function: scm_done_free (long size)
-
-This function is the inverse of scm_done_malloc. Use it to report the
-amount of smob memory you free. The previous method, which involved
-calling scm_done_malloc with negative argument, was somewhat
-unintuitive (and is still available, of course).
-
-** New function: scm_c_memq (SCM obj, SCM list)
-
-This function provides a fast C level alternative for scm_memq for the case
-that the list parameter is known to be a proper list. The function is a
-replacement for scm_sloppy_memq, but is stricter in its requirements on its
-list input parameter, since for anything else but a proper list the function's
-behaviour is undefined - it may even crash or loop endlessly. Further, for
-the case that the object is not found in the list, scm_c_memq returns #f which
-is similar to scm_memq, but different from scm_sloppy_memq's behaviour.
-
-** New functions: scm_remember_upto_here_1, scm_remember_upto_here_2,
-scm_remember_upto_here
-
-These functions replace the function scm_remember.
-
-** Deprecated function: scm_remember
-
-Use one of the new functions scm_remember_upto_here_1,
-scm_remember_upto_here_2 or scm_remember_upto_here instead.
-
-** New function: scm_allocate_string
-
-This function replaces the function scm_makstr.
-
-** Deprecated function: scm_makstr
-
-Use the new function scm_allocate_string instead.
-
-** New global variable scm_gc_running_p introduced.
-
-Use this variable to find out if garbage collection is being executed. Up to
-now applications have used scm_gc_heap_lock to test if garbage collection was
-running, which also works because of the fact that up to know only the garbage
-collector has set this variable. But, this is an implementation detail that
-may change. Further, scm_gc_heap_lock is not set throughout gc, thus the use
-of this variable is (and has been) not fully safe anyway.
-
-** New macros: SCM_BITVECTOR_MAX_LENGTH, SCM_UVECTOR_MAX_LENGTH
-
-Use these instead of SCM_LENGTH_MAX.
-
-** New macros: SCM_CONTINUATION_LENGTH, SCM_CCLO_LENGTH, SCM_STACK_LENGTH,
-SCM_STRING_LENGTH, SCM_SYMBOL_LENGTH, SCM_UVECTOR_LENGTH,
-SCM_BITVECTOR_LENGTH, SCM_VECTOR_LENGTH.
-
-Use these instead of SCM_LENGTH.
-
-** New macros: SCM_SET_CONTINUATION_LENGTH, SCM_SET_STRING_LENGTH,
-SCM_SET_SYMBOL_LENGTH, SCM_SET_VECTOR_LENGTH, SCM_SET_UVECTOR_LENGTH,
-SCM_SET_BITVECTOR_LENGTH
-
-Use these instead of SCM_SETLENGTH
-
-** New macros: SCM_STRING_CHARS, SCM_SYMBOL_CHARS, SCM_CCLO_BASE,
-SCM_VECTOR_BASE, SCM_UVECTOR_BASE, SCM_BITVECTOR_BASE, SCM_COMPLEX_MEM,
-SCM_ARRAY_MEM
-
-Use these instead of SCM_CHARS, SCM_UCHARS, SCM_ROCHARS, SCM_ROUCHARS or
-SCM_VELTS.
-
-** New macros: SCM_SET_BIGNUM_BASE, SCM_SET_STRING_CHARS,
-SCM_SET_SYMBOL_CHARS, SCM_SET_UVECTOR_BASE, SCM_SET_BITVECTOR_BASE,
-SCM_SET_VECTOR_BASE
-
-Use these instead of SCM_SETCHARS.
-
-** New macro: SCM_BITVECTOR_P
-
-** New macro: SCM_STRING_COERCE_0TERMINATION_X
-
-Use instead of SCM_COERCE_SUBSTR.
-
-** New macros: SCM_DIR_OPEN_P, SCM_DIR_FLAG_OPEN
-
-For directory objects, use these instead of SCM_OPDIRP and SCM_OPN.
-
-** Deprecated macros: SCM_OUTOFRANGE, SCM_NALLOC, SCM_HUP_SIGNAL,
-SCM_INT_SIGNAL, SCM_FPE_SIGNAL, SCM_BUS_SIGNAL, SCM_SEGV_SIGNAL,
-SCM_ALRM_SIGNAL, SCM_GC_SIGNAL, SCM_TICK_SIGNAL, SCM_SIG_ORD,
-SCM_ORD_SIG, SCM_NUM_SIGS, SCM_SYMBOL_SLOTS, SCM_SLOTS, SCM_SLOPPY_STRINGP,
-SCM_VALIDATE_STRINGORSUBSTR, SCM_FREEP, SCM_NFREEP, SCM_CHARS, SCM_UCHARS,
-SCM_VALIDATE_ROSTRING, SCM_VALIDATE_ROSTRING_COPY,
-SCM_VALIDATE_NULLORROSTRING_COPY, SCM_ROLENGTH, SCM_LENGTH, SCM_HUGE_LENGTH,
-SCM_SUBSTRP, SCM_SUBSTR_STR, SCM_SUBSTR_OFFSET, SCM_COERCE_SUBSTR,
-SCM_ROSTRINGP, SCM_RWSTRINGP, SCM_VALIDATE_RWSTRING, SCM_ROCHARS,
-SCM_ROUCHARS, SCM_SETLENGTH, SCM_SETCHARS, SCM_LENGTH_MAX, SCM_GC8MARKP,
-SCM_SETGC8MARK, SCM_CLRGC8MARK, SCM_GCTYP16, SCM_GCCDR, SCM_SUBR_DOC,
-SCM_OPDIRP, SCM_VALIDATE_OPDIR, SCM_WTA, RETURN_SCM_WTA, SCM_CONST_LONG,
-SCM_WNA, SCM_FUNC_NAME, SCM_VALIDATE_NUMBER_COPY,
-SCM_VALIDATE_NUMBER_DEF_COPY, SCM_SLOPPY_CONSP, SCM_SLOPPY_NCONSP,
-SCM_SETAND_CDR, SCM_SETOR_CDR, SCM_SETAND_CAR, SCM_SETOR_CAR
-
-Use SCM_ASSERT_RANGE or SCM_VALIDATE_XXX_RANGE instead of SCM_OUTOFRANGE.
-Use scm_memory_error instead of SCM_NALLOC.
-Use SCM_STRINGP instead of SCM_SLOPPY_STRINGP.
-Use SCM_VALIDATE_STRING instead of SCM_VALIDATE_STRINGORSUBSTR.
-Use SCM_FREE_CELL_P instead of SCM_FREEP/SCM_NFREEP
-Use a type specific accessor macro instead of SCM_CHARS/SCM_UCHARS.
-Use a type specific accessor instead of SCM(_|_RO|_HUGE_)LENGTH.
-Use SCM_VALIDATE_(SYMBOL|STRING) instead of SCM_VALIDATE_ROSTRING.
-Use SCM_STRING_COERCE_0TERMINATION_X instead of SCM_COERCE_SUBSTR.
-Use SCM_STRINGP or SCM_SYMBOLP instead of SCM_ROSTRINGP.
-Use SCM_STRINGP instead of SCM_RWSTRINGP.
-Use SCM_VALIDATE_STRING instead of SCM_VALIDATE_RWSTRING.
-Use SCM_STRING_CHARS instead of SCM_ROCHARS.
-Use SCM_STRING_UCHARS instead of SCM_ROUCHARS.
-Use a type specific setter macro instead of SCM_SETLENGTH.
-Use a type specific setter macro instead of SCM_SETCHARS.
-Use a type specific length macro instead of SCM_LENGTH_MAX.
-Use SCM_GCMARKP instead of SCM_GC8MARKP.
-Use SCM_SETGCMARK instead of SCM_SETGC8MARK.
-Use SCM_CLRGCMARK instead of SCM_CLRGC8MARK.
-Use SCM_TYP16 instead of SCM_GCTYP16.
-Use SCM_CDR instead of SCM_GCCDR.
-Use SCM_DIR_OPEN_P instead of SCM_OPDIRP.
-Use SCM_MISC_ERROR or SCM_WRONG_TYPE_ARG instead of SCM_WTA.
-Use SCM_MISC_ERROR or SCM_WRONG_TYPE_ARG instead of RETURN_SCM_WTA.
-Use SCM_VCELL_INIT instead of SCM_CONST_LONG.
-Use SCM_WRONG_NUM_ARGS instead of SCM_WNA.
-Use SCM_CONSP instead of SCM_SLOPPY_CONSP.
-Use !SCM_CONSP instead of SCM_SLOPPY_NCONSP.
-
-** Removed function: scm_struct_init
-
-** Removed variable: scm_symhash_dim
-
-** Renamed function: scm_make_cont has been replaced by
-scm_make_continuation, which has a different interface.
-
-** Deprecated function: scm_call_catching_errors
-
-Use scm_catch or scm_lazy_catch from throw.[ch] instead.
-
-** Deprecated function: scm_strhash
-
-Use scm_string_hash instead.
-
-** Deprecated function: scm_vector_set_length_x
-
-Instead, create a fresh vector of the desired size and copy the contents.
-
-** scm_gensym has changed prototype
-
-scm_gensym now only takes one argument.
-
-** Deprecated type tags: scm_tc7_ssymbol, scm_tc7_msymbol, scm_tcs_symbols,
-scm_tc7_lvector
-
-There is now only a single symbol type scm_tc7_symbol.
-The tag scm_tc7_lvector was not used anyway.
-
-** Deprecated function: scm_make_smob_type_mfpe, scm_set_smob_mfpe.
-
-Use scm_make_smob_type and scm_set_smob_XXX instead.
-
-** New function scm_set_smob_apply.
-
-This can be used to set an apply function to a smob type.
-
-** Deprecated function: scm_strprint_obj
-
-Use scm_object_to_string instead.
-
-** Deprecated function: scm_wta
-
-Use scm_wrong_type_arg, or another appropriate error signalling function
-instead.
-
-** Explicit support for obarrays has been deprecated.
-
-Use `scm_str2symbol' and the generic hashtable functions instead.
-
-** The concept of `vcells' has been deprecated.
-
-The data type `variable' is now used exclusively. `Vcells' have been
-a low-level concept so you are likely not affected by this change.
-
-*** Deprecated functions: scm_sym2vcell, scm_sysintern,
- scm_sysintern0, scm_symbol_value0, scm_intern, scm_intern0.
-
-Use scm_c_define or scm_c_lookup instead, as appropriate.
-
-*** New functions: scm_c_module_lookup, scm_c_lookup,
- scm_c_module_define, scm_c_define, scm_module_lookup, scm_lookup,
- scm_module_define, scm_define.
-
-These functions work with variables instead of with vcells.
-
-** New functions for creating and defining `subr's and `gsubr's.
-
-The new functions more clearly distinguish between creating a subr (or
-gsubr) object and adding it to the current module.
-
-These new functions are available: scm_c_make_subr, scm_c_define_subr,
-scm_c_make_subr_with_generic, scm_c_define_subr_with_generic,
-scm_c_make_gsubr, scm_c_define_gsubr, scm_c_make_gsubr_with_generic,
-scm_c_define_gsubr_with_generic.
-
-** Deprecated functions: scm_make_subr, scm_make_subr_opt,
- scm_make_subr_with_generic, scm_make_gsubr,
- scm_make_gsubr_with_generic.
-
-Use the new ones from above instead.
-
-** C interface to the module system has changed.
-
-While we suggest that you avoid as many explicit module system
-operations from C as possible for the time being, the C interface has
-been made more similar to the high-level Scheme module system.
-
-*** New functions: scm_c_define_module, scm_c_use_module,
- scm_c_export, scm_c_resolve_module.
-
-They mostly work like their Scheme namesakes. scm_c_define_module
-takes a function that is called a context where the new module is
-current.
-
-*** Deprecated functions: scm_the_root_module, scm_make_module,
- scm_ensure_user_module, scm_load_scheme_module.
-
-Use the new functions instead.
-
-** Renamed function: scm_internal_with_fluids becomes
- scm_c_with_fluids.
-
-scm_internal_with_fluids is available as a deprecated function.
-
-** New function: scm_c_with_fluid.
-
-Just like scm_c_with_fluids, but takes one fluid and one value instead
-of lists of same.
-
-** Deprecated typedefs: long_long, ulong_long.
-
-They are of questionable utility and they pollute the global
-namespace.
-
-** Deprecated typedef: scm_sizet
-
-It is of questionable utility now that Guile requires ANSI C, and is
-oddly named.
-
-** Deprecated typedefs: scm_port_rw_active, scm_port,
- scm_ptob_descriptor, scm_debug_info, scm_debug_frame, scm_fport,
- scm_option, scm_rstate, scm_rng, scm_array, scm_array_dim.
-
-Made more compliant with the naming policy by adding a _t at the end.
-
-** Deprecated functions: scm_mkbig, scm_big2num, scm_adjbig,
- scm_normbig, scm_copybig, scm_2ulong2big, scm_dbl2big, scm_big2dbl
-
-With the exception of the mysterious scm_2ulong2big, they are still
-available under new names (scm_i_mkbig etc). These functions are not
-intended to be used in user code. You should avoid dealing with
-bignums directly, and should deal with numbers in general (which can
-be bignums).
-
-** Change in behavior: scm_num2long, scm_num2ulong
-
-The scm_num2[u]long functions don't any longer accept an inexact
-argument. This change in behavior is motivated by concordance with
-R5RS: It is more common that a primitive doesn't want to accept an
-inexact for an exact.
-
-** New functions: scm_short2num, scm_ushort2num, scm_int2num,
- scm_uint2num, scm_size2num, scm_ptrdiff2num, scm_num2short,
- scm_num2ushort, scm_num2int, scm_num2uint, scm_num2ptrdiff,
- scm_num2size.
-
-These are conversion functions between the various ANSI C integral
-types and Scheme numbers. NOTE: The scm_num2xxx functions don't
-accept an inexact argument.
-
-** New functions: scm_float2num, scm_double2num,
- scm_num2float, scm_num2double.
-
-These are conversion functions between the two ANSI C float types and
-Scheme numbers.
-
-** New number validation macros:
- SCM_NUM2{SIZE,PTRDIFF,SHORT,USHORT,INT,UINT}[_DEF]
-
-See above.
-
-** New functions: scm_gc_protect_object, scm_gc_unprotect_object
-
-These are just nicer-named old scm_protect_object and
-scm_unprotect_object.
-
-** Deprecated functions: scm_protect_object, scm_unprotect_object
-
-** New functions: scm_gc_[un]register_root, scm_gc_[un]register_roots
-
-These functions can be used to register pointers to locations that
-hold SCM values.
-
-** Deprecated function: scm_create_hook.
-
-Its sins are: misleading name, non-modularity and lack of general
-usefulness.
-
-
-Changes since Guile 1.3.4:
-
-* Changes to the distribution
-
-** Trees from nightly snapshots and CVS now require you to run autogen.sh.
-
-We've changed the way we handle generated files in the Guile source
-repository. As a result, the procedure for building trees obtained
-from the nightly FTP snapshots or via CVS has changed:
-- You must have appropriate versions of autoconf, automake, and
- libtool installed on your system. See README for info on how to
- obtain these programs.
-- Before configuring the tree, you must first run the script
- `autogen.sh' at the top of the source tree.
-
-The Guile repository used to contain not only source files, written by
-humans, but also some generated files, like configure scripts and
-Makefile.in files. Even though the contents of these files could be
-derived mechanically from other files present, we thought it would
-make the tree easier to build if we checked them into CVS.
-
-However, this approach means that minor differences between
-developer's installed tools and habits affected the whole team.
-So we have removed the generated files from the repository, and
-added the autogen.sh script, which will reconstruct them
-appropriately.
-
-
-** configure now has experimental options to remove support for certain
-features:
-
---disable-arrays omit array and uniform array support
---disable-posix omit posix interfaces
---disable-networking omit networking interfaces
---disable-regex omit regular expression interfaces
-
-These are likely to become separate modules some day.
-
-** New configure option --enable-debug-freelist
-
-This enables a debugging version of SCM_NEWCELL(), and also registers
-an extra primitive, the setter `gc-set-debug-check-freelist!'.
-
-Configure with the --enable-debug-freelist option to enable
-the gc-set-debug-check-freelist! primitive, and then use:
-
-(gc-set-debug-check-freelist! #t) # turn on checking of the freelist
-(gc-set-debug-check-freelist! #f) # turn off checking
-
-Checking of the freelist forces a traversal of the freelist and
-a garbage collection before each allocation of a cell. This can
-slow down the interpreter dramatically, so the setter should be used to
-turn on this extra processing only when necessary.
-
-** New configure option --enable-debug-malloc
-
-Include code for debugging of calls to scm_must_malloc/realloc/free.
-
-Checks that
-
-1. objects freed by scm_must_free has been mallocated by scm_must_malloc
-2. objects reallocated by scm_must_realloc has been allocated by
- scm_must_malloc
-3. reallocated objects are reallocated with the same what string
-
-But, most importantly, it records the number of allocated objects of
-each kind. This is useful when searching for memory leaks.
-
-A Guile compiled with this option provides the primitive
-`malloc-stats' which returns an alist with pairs of kind and the
-number of objects of that kind.
-
-** All includes are now referenced relative to the root directory
-
-Since some users have had problems with mixups between Guile and
-system headers, we have decided to always refer to Guile headers via
-their parent directories. This essentially creates a "private name
-space" for Guile headers. This means that the compiler only is given
--I options for the root build and root source directory.
-
-** Header files kw.h and genio.h have been removed.
-
-** The module (ice-9 getopt-gnu-style) has been removed.
-
-** New module (ice-9 documentation)
-
-Implements the interface to documentation strings associated with
-objects.
-
-** New module (ice-9 time)
-
-Provides a macro `time', which displays execution time of a given form.
-
-** New module (ice-9 history)
-
-Loading this module enables value history in the repl.
-
-* Changes to the stand-alone interpreter
-
-** New command line option --debug
-
-Start Guile with debugging evaluator and backtraces enabled.
-
-This is useful when debugging your .guile init file or scripts.
-
-** New help facility
-
-Usage: (help NAME) gives documentation about objects named NAME (a symbol)
- (help REGEXP) ditto for objects with names matching REGEXP (a string)
- (help 'NAME) gives documentation for NAME, even if it is not an object
- (help ,EXPR) gives documentation for object returned by EXPR
- (help (my module)) gives module commentary for `(my module)'
- (help) gives this text
-
-`help' searches among bindings exported from loaded modules, while
-`apropos' searches among bindings visible from the "current" module.
-
-Examples: (help help)
- (help cons)
- (help "output-string")
-
-** `help' and `apropos' now prints full module names
-
-** Dynamic linking now uses libltdl from the libtool package.
-
-The old system dependent code for doing dynamic linking has been
-replaced with calls to the libltdl functions which do all the hairy
-details for us.
-
-The major improvement is that you can now directly pass libtool
-library names like "libfoo.la" to `dynamic-link' and `dynamic-link'
-will be able to do the best shared library job you can get, via
-libltdl.
-
-The way dynamic libraries are found has changed and is not really
-portable across platforms, probably. It is therefore recommended to
-use absolute filenames when possible.
-
-If you pass a filename without an extension to `dynamic-link', it will
-try a few appropriate ones. Thus, the most platform ignorant way is
-to specify a name like "libfoo", without any directories and
-extensions.
-
-** Guile COOP threads are now compatible with LinuxThreads
-
-Previously, COOP threading wasn't possible in applications linked with
-Linux POSIX threads due to their use of the stack pointer to find the
-thread context. This has now been fixed with a workaround which uses
-the pthreads to allocate the stack.
-
-** New primitives: `pkgdata-dir', `site-dir', `library-dir'
-
-** Positions of erring expression in scripts
-
-With version 1.3.4, the location of the erring expression in Guile
-scipts is no longer automatically reported. (This should have been
-documented before the 1.3.4 release.)
-
-You can get this information by enabling recording of positions of
-source expressions and running the debugging evaluator. Put this at
-the top of your script (or in your "site" file):
-
- (read-enable 'positions)
- (debug-enable 'debug)
-
-** Backtraces in scripts
-
-It is now possible to get backtraces in scripts.
-
-Put
-
- (debug-enable 'debug 'backtrace)
-
-at the top of the script.
-
-(The first options enables the debugging evaluator.
- The second enables backtraces.)
-
-** Part of module system symbol lookup now implemented in C
-
-The eval closure of most modules is now implemented in C. Since this
-was one of the bottlenecks for loading speed, Guile now loads code
-substantially faster than before.
-
-** Attempting to get the value of an unbound variable now produces
-an exception with a key of 'unbound-variable instead of 'misc-error.
-
-** The initial default output port is now unbuffered if it's using a
-tty device. Previously in this situation it was line-buffered.
-
-** New hook: after-gc-hook
-
-after-gc-hook takes over the role of gc-thunk. This hook is run at
-the first SCM_TICK after a GC. (Thus, the code is run at the same
-point during evaluation as signal handlers.)
-
-Note that this hook should be used only for diagnostic and debugging
-purposes. It is not certain that it will continue to be well-defined
-when this hook is run in the future.
-
-C programmers: Note the new C level hooks scm_before_gc_c_hook,
-scm_before_sweep_c_hook, scm_after_gc_c_hook.
-
-** Improvements to garbage collector
-
-Guile 1.4 has a new policy for triggering heap allocation and
-determining the sizes of heap segments. It fixes a number of problems
-in the old GC.
-
-1. The new policy can handle two separate pools of cells
- (2-word/4-word) better. (The old policy would run wild, allocating
- more and more memory for certain programs.)
-
-2. The old code would sometimes allocate far too much heap so that the
- Guile process became gigantic. The new code avoids this.
-
-3. The old code would sometimes allocate too little so that few cells
- were freed at GC so that, in turn, too much time was spent in GC.
-
-4. The old code would often trigger heap allocation several times in a
- row. (The new scheme predicts how large the segments needs to be
- in order not to need further allocation.)
-
-All in all, the new GC policy will make larger applications more
-efficient.
-
-The new GC scheme also is prepared for POSIX threading. Threads can
-allocate private pools of cells ("clusters") with just a single
-function call. Allocation of single cells from such a cluster can
-then proceed without any need of inter-thread synchronization.
-
-** New environment variables controlling GC parameters
-
-GUILE_MAX_SEGMENT_SIZE Maximal segment size
- (default = 2097000)
-
-Allocation of 2-word cell heaps:
-
-GUILE_INIT_SEGMENT_SIZE_1 Size of initial heap segment in bytes
- (default = 360000)
-
-GUILE_MIN_YIELD_1 Minimum number of freed cells at each
- GC in percent of total heap size
- (default = 40)
-
-Allocation of 4-word cell heaps
-(used for real numbers and misc other objects):
-
-GUILE_INIT_SEGMENT_SIZE_2, GUILE_MIN_YIELD_2
-
-(See entry "Way for application to customize GC parameters" under
- section "Changes to the scm_ interface" below.)
-
-** Guile now implements reals using 4-word cells
-
-This speeds up computation with reals. (They were earlier allocated
-with `malloc'.) There is still some room for optimizations, however.
-
-** Some further steps toward POSIX thread support have been taken
-
-*** Guile's critical sections (SCM_DEFER/ALLOW_INTS)
-don't have much effect any longer, and many of them will be removed in
-next release.
-
-*** Signals
-are only handled at the top of the evaluator loop, immediately after
-I/O, and in scm_equalp.
-
-*** The GC can allocate thread private pools of pairs.
-
-* Changes to Scheme functions and syntax
-
-** close-input-port and close-output-port are now R5RS
-
-These procedures have been turned into primitives and have R5RS behaviour.
-
-** New procedure: simple-format PORT MESSAGE ARG1 ...
-
-(ice-9 boot) makes `format' an alias for `simple-format' until possibly
-extended by the more sophisticated version in (ice-9 format)
-
-(simple-format port message . args)
-Write MESSAGE to DESTINATION, defaulting to `current-output-port'.
-MESSAGE can contain ~A (was %s) and ~S (was %S) escapes. When printed,
-the escapes are replaced with corresponding members of ARGS:
-~A formats using `display' and ~S formats using `write'.
-If DESTINATION is #t, then use the `current-output-port',
-if DESTINATION is #f, then return a string containing the formatted text.
-Does not add a trailing newline."
-
-** string-ref: the second argument is no longer optional.
-
-** string, list->string: no longer accept strings in their arguments,
-only characters, for compatibility with R5RS.
-
-** New procedure: port-closed? PORT
-Returns #t if PORT is closed or #f if it is open.
-
-** Deprecated: list*
-
-The list* functionality is now provided by cons* (SRFI-1 compliant)
-
-** New procedure: cons* ARG1 ARG2 ... ARGn
-
-Like `list', but the last arg provides the tail of the constructed list,
-returning (cons ARG1 (cons ARG2 (cons ... ARGn))).
-
-Requires at least one argument. If given one argument, that argument
-is returned as result.
-
-This function is called `list*' in some other Schemes and in Common LISP.
-
-** Removed deprecated: serial-map, serial-array-copy!, serial-array-map!
-
-** New procedure: object-documentation OBJECT
-
-Returns the documentation string associated with OBJECT. The
-procedure uses a caching mechanism so that subsequent lookups are
-faster.
-
-Exported by (ice-9 documentation).
-
-** module-name now returns full names of modules
-
-Previously, only the last part of the name was returned (`session' for
-`(ice-9 session)'). Ex: `(ice-9 session)'.
-
-* Changes to the gh_ interface
-
-** Deprecated: gh_int2scmb
-
-Use gh_bool2scm instead.
-
-* Changes to the scm_ interface
-
-** Guile primitives now carry docstrings!
-
-Thanks to Greg Badros!
-
-** Guile primitives are defined in a new way: SCM_DEFINE/SCM_DEFINE1/SCM_PROC
-
-Now Guile primitives are defined using the SCM_DEFINE/SCM_DEFINE1/SCM_PROC
-macros and must contain a docstring that is extracted into foo.doc using a new
-guile-doc-snarf script (that uses guile-doc-snarf.awk).
-
-However, a major overhaul of these macros is scheduled for the next release of
-guile.
-
-** Guile primitives use a new technique for validation of arguments
-
-SCM_VALIDATE_* macros are defined to ease the redundancy and improve
-the readability of argument checking.
-
-** All (nearly?) K&R prototypes for functions replaced with ANSI C equivalents.
-
-** New macros: SCM_PACK, SCM_UNPACK
-
-Compose/decompose an SCM value.
-
-The SCM type is now treated as an abstract data type and may be defined as a
-long, a void* or as a struct, depending on the architecture and compile time
-options. This makes it easier to find several types of bugs, for example when
-SCM values are treated as integers without conversion. Values of the SCM type
-should be treated as "atomic" values. These macros are used when
-composing/decomposing an SCM value, either because you want to access
-individual bits, or because you want to treat it as an integer value.
-
-E.g., in order to set bit 7 in an SCM value x, use the expression
-
- SCM_PACK (SCM_UNPACK (x) | 0x80)
-
-** The name property of hooks is deprecated.
-Thus, the use of SCM_HOOK_NAME and scm_make_hook_with_name is deprecated.
-
-You can emulate this feature by using object properties.
-
-** Deprecated macros: SCM_INPORTP, SCM_OUTPORTP, SCM_CRDY, SCM_ICHRP,
-SCM_ICHR, SCM_MAKICHR, SCM_SETJMPBUF, SCM_NSTRINGP, SCM_NRWSTRINGP,
-SCM_NVECTORP
-
-These macros will be removed in a future release of Guile.
-
-** The following types, functions and macros from numbers.h are deprecated:
-scm_dblproc, SCM_UNEGFIXABLE, SCM_FLOBUFLEN, SCM_INEXP, SCM_CPLXP, SCM_REAL,
-SCM_IMAG, SCM_REALPART, scm_makdbl, SCM_SINGP, SCM_NUM2DBL, SCM_NO_BIGDIG
-
-Further, it is recommended not to rely on implementation details for guile's
-current implementation of bignums. It is planned to replace this
-implementation with gmp in the future.
-
-** Port internals: the rw_random variable in the scm_port structure
-must be set to non-zero in any random access port. In recent Guile
-releases it was only set for bidirectional random-access ports.
-
-** Port internals: the seek ptob procedure is now responsible for
-resetting the buffers if required. The change was made so that in the
-special case of reading the current position (i.e., seek p 0 SEEK_CUR)
-the fport and strport ptobs can avoid resetting the buffers,
-in particular to avoid discarding unread chars. An existing port
-type can be fixed by adding something like the following to the
-beginning of the ptob seek procedure:
-
- if (pt->rw_active == SCM_PORT_READ)
- scm_end_input (object);
- else if (pt->rw_active == SCM_PORT_WRITE)
- ptob->flush (object);
-
-although to actually avoid resetting the buffers and discard unread
-chars requires further hacking that depends on the characteristics
-of the ptob.
-
-** Deprecated functions: scm_fseek, scm_tag
-
-These functions are no longer used and will be removed in a future version.
-
-** The scm_sysmissing procedure is no longer used in libguile.
-Unless it turns out to be unexpectedly useful to somebody, it will be
-removed in a future version.
-
-** The format of error message strings has changed
-
-The two C procedures: scm_display_error and scm_error, as well as the
-primitive `scm-error', now use scm_simple_format to do their work.
-This means that the message strings of all code must be updated to use
-~A where %s was used before, and ~S where %S was used before.
-
-During the period when there still are a lot of old Guiles out there,
-you might want to support both old and new versions of Guile.
-
-There are basically two methods to achieve this. Both methods use
-autoconf. Put
-
- AC_CHECK_FUNCS(scm_simple_format)
-
-in your configure.in.
-
-Method 1: Use the string concatenation features of ANSI C's
- preprocessor.
-
-In C:
-
-#ifdef HAVE_SCM_SIMPLE_FORMAT
-#define FMT_S "~S"
-#else
-#define FMT_S "%S"
-#endif
-
-Then represent each of your error messages using a preprocessor macro:
-
-#define E_SPIDER_ERROR "There's a spider in your " ## FMT_S ## "!!!"
-
-In Scheme:
-
-(define fmt-s (if (defined? 'simple-format) "~S" "%S"))
-(define make-message string-append)
-
-(define e-spider-error (make-message "There's a spider in your " fmt-s "!!!"))
-
-Method 2: Use the oldfmt function found in doc/oldfmt.c.
-
-In C:
-
-scm_misc_error ("picnic", scm_c_oldfmt0 ("There's a spider in your ~S!!!"),
- ...);
-
-In Scheme:
-
-(scm-error 'misc-error "picnic" (oldfmt "There's a spider in your ~S!!!")
- ...)
-
-
-** Deprecated: coop_mutex_init, coop_condition_variable_init
-
-Don't use the functions coop_mutex_init and
-coop_condition_variable_init. They will change.
-
-Use scm_mutex_init and scm_cond_init instead.
-
-** New function: int scm_cond_timedwait (scm_cond_t *COND, scm_mutex_t *MUTEX, const struct timespec *ABSTIME)
- `scm_cond_timedwait' atomically unlocks MUTEX and waits on
- COND, as `scm_cond_wait' does, but it also bounds the duration
- of the wait. If COND has not been signaled before time ABSTIME,
- the mutex MUTEX is re-acquired and `scm_cond_timedwait'
- returns the error code `ETIMEDOUT'.
-
- The ABSTIME parameter specifies an absolute time, with the same
- origin as `time' and `gettimeofday': an ABSTIME of 0 corresponds
- to 00:00:00 GMT, January 1, 1970.
-
-** New function: scm_cond_broadcast (scm_cond_t *COND)
- `scm_cond_broadcast' restarts all the threads that are waiting
- on the condition variable COND. Nothing happens if no threads are
- waiting on COND.
-
-** New function: scm_key_create (scm_key_t *KEY, void (*destr_function) (void *))
- `scm_key_create' allocates a new TSD key. The key is stored in
- the location pointed to by KEY. There is no limit on the number
- of keys allocated at a given time. The value initially associated
- with the returned key is `NULL' in all currently executing threads.
-
- The DESTR_FUNCTION argument, if not `NULL', specifies a destructor
- function associated with the key. When a thread terminates,
- DESTR_FUNCTION is called on the value associated with the key in
- that thread. The DESTR_FUNCTION is not called if a key is deleted
- with `scm_key_delete' or a value is changed with
- `scm_setspecific'. The order in which destructor functions are
- called at thread termination time is unspecified.
-
- Destructors are not yet implemented.
-
-** New function: scm_setspecific (scm_key_t KEY, const void *POINTER)
- `scm_setspecific' changes the value associated with KEY in the
- calling thread, storing the given POINTER instead.
-
-** New function: scm_getspecific (scm_key_t KEY)
- `scm_getspecific' returns the value currently associated with
- KEY in the calling thread.
-
-** New function: scm_key_delete (scm_key_t KEY)
- `scm_key_delete' deallocates a TSD key. It does not check
- whether non-`NULL' values are associated with that key in the
- currently executing threads, nor call the destructor function
- associated with the key.
-
-** New function: scm_c_hook_init (scm_c_hook_t *HOOK, void *HOOK_DATA, scm_c_hook_type_t TYPE)
-
-Initialize a C level hook HOOK with associated HOOK_DATA and type
-TYPE. (See scm_c_hook_run ().)
-
-** New function: scm_c_hook_add (scm_c_hook_t *HOOK, scm_c_hook_function_t FUNC, void *FUNC_DATA, int APPENDP)
-
-Add hook function FUNC with associated FUNC_DATA to HOOK. If APPENDP
-is true, add it last, otherwise first. The same FUNC can be added
-multiple times if FUNC_DATA differ and vice versa.
-
-** New function: scm_c_hook_remove (scm_c_hook_t *HOOK, scm_c_hook_function_t FUNC, void *FUNC_DATA)
-
-Remove hook function FUNC with associated FUNC_DATA from HOOK. A
-function is only removed if both FUNC and FUNC_DATA matches.
-
-** New function: void *scm_c_hook_run (scm_c_hook_t *HOOK, void *DATA)
-
-Run hook HOOK passing DATA to the hook functions.
-
-If TYPE is SCM_C_HOOK_NORMAL, all hook functions are run. The value
-returned is undefined.
-
-If TYPE is SCM_C_HOOK_OR, hook functions are run until a function
-returns a non-NULL value. This value is returned as the result of
-scm_c_hook_run. If all functions return NULL, NULL is returned.
-
-If TYPE is SCM_C_HOOK_AND, hook functions are run until a function
-returns a NULL value, and NULL is returned. If all functions returns
-a non-NULL value, the last value is returned.
-
-** New C level GC hooks
-
-Five new C level hooks has been added to the garbage collector.
-
- scm_before_gc_c_hook
- scm_after_gc_c_hook
-
-are run before locking and after unlocking the heap. The system is
-thus in a mode where evaluation can take place. (Except that
-scm_before_gc_c_hook must not allocate new cells.)
-
- scm_before_mark_c_hook
- scm_before_sweep_c_hook
- scm_after_sweep_c_hook
-
-are run when the heap is locked. These are intended for extension of
-the GC in a modular fashion. Examples are the weaks and guardians
-modules.
-
-** Way for application to customize GC parameters
-
-The application can set up other default values for the GC heap
-allocation parameters
-
- GUILE_INIT_HEAP_SIZE_1, GUILE_MIN_YIELD_1,
- GUILE_INIT_HEAP_SIZE_2, GUILE_MIN_YIELD_2,
- GUILE_MAX_SEGMENT_SIZE,
-
-by setting
-
- scm_default_init_heap_size_1, scm_default_min_yield_1,
- scm_default_init_heap_size_2, scm_default_min_yield_2,
- scm_default_max_segment_size
-
-respectively before callong scm_boot_guile.
-
-(See entry "New environment variables ..." in section
-"Changes to the stand-alone interpreter" above.)
-
-** scm_protect_object/scm_unprotect_object now nest
-
-This means that you can call scm_protect_object multiple times on an
-object and count on the object being protected until
-scm_unprotect_object has been call the same number of times.
-
-The functions also have better time complexity.
-
-Still, it is usually possible to structure the application in a way
-that you don't need to use these functions. For example, if you use a
-protected standard Guile list to keep track of live objects rather
-than some custom data type, objects will die a natural death when they
-are no longer needed.
-
-** Deprecated type tags: scm_tc16_flo, scm_tc_flo, scm_tc_dblr, scm_tc_dblc
-
-Guile does not provide the float representation for inexact real numbers any
-more. Now, only doubles are used to represent inexact real numbers. Further,
-the tag names scm_tc_dblr and scm_tc_dblc have been changed to scm_tc16_real
-and scm_tc16_complex, respectively.
-
-** Removed deprecated type scm_smobfuns
-
-** Removed deprecated function scm_newsmob
-
-** Warning: scm_make_smob_type_mfpe might become deprecated in a future release
-
-There is an ongoing discussion among the developers whether to
-deprecate `scm_make_smob_type_mfpe' or not. Please use the current
-standard interface (scm_make_smob_type, scm_set_smob_XXX) in new code
-until this issue has been settled.
-
-** Removed deprecated type tag scm_tc16_kw
-
-** Added type tag scm_tc16_keyword
-
-(This was introduced already in release 1.3.4 but was not documented
- until now.)
-
-** gdb_print now prints "*** Guile not initialized ***" until Guile initialized
-
-* Changes to system call interfaces:
-
-** The "select" procedure now tests port buffers for the ability to
-provide input or accept output. Previously only the underlying file
-descriptors were checked.
-
-** New variable PIPE_BUF: the maximum number of bytes that can be
-atomically written to a pipe.
-
-** If a facility is not available on the system when Guile is
-compiled, the corresponding primitive procedure will not be defined.
-Previously it would have been defined but would throw a system-error
-exception if called. Exception handlers which catch this case may
-need minor modification: an error will be thrown with key
-'unbound-variable instead of 'system-error. Alternatively it's
-now possible to use `defined?' to check whether the facility is
-available.
-
-** Procedures which depend on the timezone should now give the correct
-result on systems which cache the TZ environment variable, even if TZ
-is changed without calling tzset.
-
-* Changes to the networking interfaces:
-
-** New functions: htons, ntohs, htonl, ntohl: for converting short and
-long integers between network and host format. For now, it's not
-particularly convenient to do this kind of thing, but consider:
-
-(define write-network-long
- (lambda (value port)
- (let ((v (make-uniform-vector 1 1 0)))
- (uniform-vector-set! v 0 (htonl value))
- (uniform-vector-write v port))))
-
-(define read-network-long
- (lambda (port)
- (let ((v (make-uniform-vector 1 1 0)))
- (uniform-vector-read! v port)
- (ntohl (uniform-vector-ref v 0)))))
-
-** If inet-aton fails, it now throws an error with key 'misc-error
-instead of 'system-error, since errno is not relevant.
-
-** Certain gethostbyname/gethostbyaddr failures now throw errors with
-specific keys instead of 'system-error. The latter is inappropriate
-since errno will not have been set. The keys are:
-'host-not-found, 'try-again, 'no-recovery and 'no-data.
-
-** sethostent, setnetent, setprotoent, setservent: now take an
-optional argument STAYOPEN, which specifies whether the database
-remains open after a database entry is accessed randomly (e.g., using
-gethostbyname for the hosts database.) The default is #f. Previously
-#t was always used.
-
-
-Changes since Guile 1.3.2:
-
-* Changes to the stand-alone interpreter
-
-** Debugger
-
-An initial version of the Guile debugger written by Chris Hanson has
-been added. The debugger is still under development but is included
-in the distribution anyway since it is already quite useful.
-
-Type
-
- (debug)
-
-after an error to enter the debugger. Type `help' inside the debugger
-for a description of available commands.
-
-If you prefer to have stack frames numbered and printed in
-anti-chronological order and prefer up in the stack to be down on the
-screen as is the case in gdb, you can put
-
- (debug-enable 'backwards)
-
-in your .guile startup file. (However, this means that Guile can't
-use indentation to indicate stack level.)
-
-The debugger is autoloaded into Guile at the first use.
-
-** Further enhancements to backtraces
-
-There is a new debug option `width' which controls the maximum width
-on the screen of printed stack frames. Fancy printing parameters
-("level" and "length" as in Common LISP) are adaptively adjusted for
-each stack frame to give maximum information while still fitting
-within the bounds. If the stack frame can't be made to fit by
-adjusting parameters, it is simply cut off at the end. This is marked
-with a `$'.
-
-** Some modules are now only loaded when the repl is started
-
-The modules (ice-9 debug), (ice-9 session), (ice-9 threads) and (ice-9
-regex) are now loaded into (guile-user) only if the repl has been
-started. The effect is that the startup time for scripts has been
-reduced to 30% of what it was previously.
-
-Correctly written scripts load the modules they require at the top of
-the file and should not be affected by this change.
-
-** Hooks are now represented as smobs
-
-* Changes to Scheme functions and syntax
-
-** Readline support has changed again.
-
-The old (readline-activator) module is gone. Use (ice-9 readline)
-instead, which now contains all readline functionality. So the code
-to activate readline is now
-
- (use-modules (ice-9 readline))
- (activate-readline)
-
-This should work at any time, including from the guile prompt.
-
-To avoid confusion about the terms of Guile's license, please only
-enable readline for your personal use; please don't make it the
-default for others. Here is why we make this rather odd-sounding
-request:
-
-Guile is normally licensed under a weakened form of the GNU General
-Public License, which allows you to link code with Guile without
-placing that code under the GPL. This exception is important to some
-people.
-
-However, since readline is distributed under the GNU General Public
-License, when you link Guile with readline, either statically or
-dynamically, you effectively change Guile's license to the strict GPL.
-Whenever you link any strictly GPL'd code into Guile, uses of Guile
-which are normally permitted become forbidden. This is a rather
-non-obvious consequence of the licensing terms.
-
-So, to make sure things remain clear, please let people choose for
-themselves whether to link GPL'd libraries like readline with Guile.
-
-** regexp-substitute/global has changed slightly, but incompatibly.
-
-If you include a function in the item list, the string of the match
-object it receives is the same string passed to
-regexp-substitute/global, not some suffix of that string.
-Correspondingly, the match's positions are relative to the entire
-string, not the suffix.
-
-If the regexp can match the empty string, the way matches are chosen
-from the string has changed. regexp-substitute/global recognizes the
-same set of matches that list-matches does; see below.
-
-** New function: list-matches REGEXP STRING [FLAGS]
-
-Return a list of match objects, one for every non-overlapping, maximal
-match of REGEXP in STRING. The matches appear in left-to-right order.
-list-matches only reports matches of the empty string if there are no
-other matches which begin on, end at, or include the empty match's
-position.
-
-If present, FLAGS is passed as the FLAGS argument to regexp-exec.
-
-** New function: fold-matches REGEXP STRING INIT PROC [FLAGS]
-
-For each match of REGEXP in STRING, apply PROC to the match object,
-and the last value PROC returned, or INIT for the first call. Return
-the last value returned by PROC. We apply PROC to the matches as they
-appear from left to right.
-
-This function recognizes matches according to the same criteria as
-list-matches.
-
-Thus, you could define list-matches like this:
-
- (define (list-matches regexp string . flags)
- (reverse! (apply fold-matches regexp string '() cons flags)))
-
-If present, FLAGS is passed as the FLAGS argument to regexp-exec.
-
-** Hooks
-
-*** New function: hook? OBJ
-
-Return #t if OBJ is a hook, otherwise #f.
-
-*** New function: make-hook-with-name NAME [ARITY]
-
-Return a hook with name NAME and arity ARITY. The default value for
-ARITY is 0. The only effect of NAME is that it will appear when the
-hook object is printed to ease debugging.
-
-*** New function: hook-empty? HOOK
-
-Return #t if HOOK doesn't contain any procedures, otherwise #f.
-
-*** New function: hook->list HOOK
-
-Return a list of the procedures that are called when run-hook is
-applied to HOOK.
-
-** `map' signals an error if its argument lists are not all the same length.
-
-This is the behavior required by R5RS, so this change is really a bug
-fix. But it seems to affect a lot of people's code, so we're
-mentioning it here anyway.
-
-** Print-state handling has been made more transparent
-
-Under certain circumstances, ports are represented as a port with an
-associated print state. Earlier, this pair was represented as a pair
-(see "Some magic has been added to the printer" below). It is now
-indistinguishable (almost; see `get-print-state') from a port on the
-user level.
-
-*** New function: port-with-print-state OUTPUT-PORT PRINT-STATE
-
-Return a new port with the associated print state PRINT-STATE.
-
-*** New function: get-print-state OUTPUT-PORT
-
-Return the print state associated with this port if it exists,
-otherwise return #f.
-
-*** New function: directory-stream? OBJECT
-
-Returns true iff OBJECT is a directory stream --- the sort of object
-returned by `opendir'.
-
-** New function: using-readline?
-
-Return #t if readline is in use in the current repl.
-
-** structs will be removed in 1.4
-
-Structs will be replaced in Guile 1.4. We will merge GOOPS into Guile
-and use GOOPS objects as the fundamental record type.
-
-* Changes to the scm_ interface
-
-** structs will be removed in 1.4
-
-The entire current struct interface (struct.c, struct.h) will be
-replaced in Guile 1.4. We will merge GOOPS into libguile and use
-GOOPS objects as the fundamental record type.
-
-** The internal representation of subr's has changed
-
-Instead of giving a hint to the subr name, the CAR field of the subr
-now contains an index to a subr entry in scm_subr_table.
-
-*** New variable: scm_subr_table
-
-An array of subr entries. A subr entry contains the name, properties
-and documentation associated with the subr. The properties and
-documentation slots are not yet used.
-
-** A new scheme for "forwarding" calls to a builtin to a generic function
-
-It is now possible to extend the functionality of some Guile
-primitives by letting them defer a call to a GOOPS generic function on
-argument mismatch. This means that there is no loss of efficiency in
-normal evaluation.
-
-Example:
-
- (use-modules (oop goops)) ; Must be GOOPS version 0.2.
- (define-method + ((x <string>) (y <string>))
- (string-append x y))
-
-+ will still be as efficient as usual in numerical calculations, but
-can also be used for concatenating strings.
-
-Who will be the first one to extend Guile's numerical tower to
-rationals? :) [OK, there a few other things to fix before this can
-be made in a clean way.]
-
-*** New snarf macros for defining primitives: SCM_GPROC, SCM_GPROC1
-
- New macro: SCM_GPROC (CNAME, SNAME, REQ, OPT, VAR, CFUNC, GENERIC)
-
- New macro: SCM_GPROC1 (CNAME, SNAME, TYPE, CFUNC, GENERIC)
-
-These do the same job as SCM_PROC and SCM_PROC1, but they also define
-a variable GENERIC which can be used by the dispatch macros below.
-
-[This is experimental code which may change soon.]
-
-*** New macros for forwarding control to a generic on arg type error
-
- New macro: SCM_WTA_DISPATCH_1 (GENERIC, ARG1, POS, SUBR)
-
- New macro: SCM_WTA_DISPATCH_2 (GENERIC, ARG1, ARG2, POS, SUBR)
-
-These correspond to the scm_wta function call, and have the same
-behaviour until the user has called the GOOPS primitive
-`enable-primitive-generic!'. After that, these macros will apply the
-generic function GENERIC to the argument(s) instead of calling
-scm_wta.
-
-[This is experimental code which may change soon.]
-
-*** New macros for argument testing with generic dispatch
-
- New macro: SCM_GASSERT1 (COND, GENERIC, ARG1, POS, SUBR)
-
- New macro: SCM_GASSERT2 (COND, GENERIC, ARG1, ARG2, POS, SUBR)
-
-These correspond to the SCM_ASSERT macro, but will defer control to
-GENERIC on error after `enable-primitive-generic!' has been called.
-
-[This is experimental code which may change soon.]
-
-** New function: SCM scm_eval_body (SCM body, SCM env)
-
-Evaluates the body of a special form.
-
-** The internal representation of struct's has changed
-
-Previously, four slots were allocated for the procedure(s) of entities
-and operators. The motivation for this representation had to do with
-the structure of the evaluator, the wish to support tail-recursive
-generic functions, and efficiency. Since the generic function
-dispatch mechanism has changed, there is no longer a need for such an
-expensive representation, and the representation has been simplified.
-
-This should not make any difference for most users.
-
-** GOOPS support has been cleaned up.
-
-Some code has been moved from eval.c to objects.c and code in both of
-these compilation units has been cleaned up and better structured.
-
-*** New functions for applying generic functions
-
- New function: SCM scm_apply_generic (GENERIC, ARGS)
- New function: SCM scm_call_generic_0 (GENERIC)
- New function: SCM scm_call_generic_1 (GENERIC, ARG1)
- New function: SCM scm_call_generic_2 (GENERIC, ARG1, ARG2)
- New function: SCM scm_call_generic_3 (GENERIC, ARG1, ARG2, ARG3)
-
-** Deprecated function: scm_make_named_hook
-
-It is now replaced by:
-
-** New function: SCM scm_create_hook (const char *name, int arity)
-
-Creates a hook in the same way as make-hook above but also
-binds a variable named NAME to it.
-
-This is the typical way of creating a hook from C code.
-
-Currently, the variable is created in the "current" module.
-This might change when we get the new module system.
-
-[The behaviour is identical to scm_make_named_hook.]
-
-
-
-Changes since Guile 1.3:
-
-* Changes to mailing lists
-
-** Some of the Guile mailing lists have moved to sourceware.cygnus.com.
-
-See the README file to find current addresses for all the Guile
-mailing lists.
-
-* Changes to the distribution
-
-** Readline support is no longer included with Guile by default.
-
-Based on the different license terms of Guile and Readline, we
-concluded that Guile should not *by default* cause the linking of
-Readline into an application program. Readline support is now offered
-as a separate module, which is linked into an application only when
-you explicitly specify it.
-
-Although Guile is GNU software, its distribution terms add a special
-exception to the usual GNU General Public License (GPL). Guile's
-license includes a clause that allows you to link Guile with non-free
-programs. We add this exception so as not to put Guile at a
-disadvantage vis-a-vis other extensibility packages that support other
-languages.
-
-In contrast, the GNU Readline library is distributed under the GNU
-General Public License pure and simple. This means that you may not
-link Readline, even dynamically, into an application unless it is
-distributed under a free software license that is compatible the GPL.
-
-Because of this difference in distribution terms, an application that
-can use Guile may not be able to use Readline. Now users will be
-explicitly offered two independent decisions about the use of these
-two packages.
-
-You can activate the readline support by issuing
-
- (use-modules (readline-activator))
- (activate-readline)
-
-from your ".guile" file, for example.
-
-* Changes to the stand-alone interpreter
-
-** All builtins now print as primitives.
-Previously builtin procedures not belonging to the fundamental subr
-types printed as #<compiled closure #<primitive-procedure gsubr-apply>>.
-Now, they print as #<primitive-procedure NAME>.
-
-** Backtraces slightly more intelligible.
-gsubr-apply and macro transformer application frames no longer appear
-in backtraces.
-
-* Changes to Scheme functions and syntax
-
-** Guile now correctly handles internal defines by rewriting them into
-their equivalent letrec. Previously, internal defines would
-incrementally add to the innermost environment, without checking
-whether the restrictions specified in RnRS were met. This lead to the
-correct behaviour when these restriction actually were met, but didn't
-catch all illegal uses. Such an illegal use could lead to crashes of
-the Guile interpreter or or other unwanted results. An example of
-incorrect internal defines that made Guile behave erratically:
-
- (let ()
- (define a 1)
- (define (b) a)
- (define c (1+ (b)))
- (define d 3)
-
- (b))
-
- => 2
-
-The problem with this example is that the definition of `c' uses the
-value of `b' directly. This confuses the meoization machine of Guile
-so that the second call of `b' (this time in a larger environment that
-also contains bindings for `c' and `d') refers to the binding of `c'
-instead of `a'. You could also make Guile crash with a variation on
-this theme:
-
- (define (foo flag)
- (define a 1)
- (define (b flag) (if flag a 1))
- (define c (1+ (b flag)))
- (define d 3)
-
- (b #t))
-
- (foo #f)
- (foo #t)
-
-From now on, Guile will issue an `Unbound variable: b' error message
-for both examples.
-
-** Hooks
-
-A hook contains a list of functions which should be called on
-particular occasions in an existing program. Hooks are used for
-customization.
-
-A window manager might have a hook before-window-map-hook. The window
-manager uses the function run-hooks to call all functions stored in
-before-window-map-hook each time a window is mapped. The user can
-store functions in the hook using add-hook!.
-
-In Guile, hooks are first class objects.
-
-*** New function: make-hook [N_ARGS]
-
-Return a hook for hook functions which can take N_ARGS arguments.
-The default value for N_ARGS is 0.
-
-(See also scm_make_named_hook below.)
-
-*** New function: add-hook! HOOK PROC [APPEND_P]
-
-Put PROC at the beginning of the list of functions stored in HOOK.
-If APPEND_P is supplied, and non-false, put PROC at the end instead.
-
-PROC must be able to take the number of arguments specified when the
-hook was created.
-
-If PROC already exists in HOOK, then remove it first.
-
-*** New function: remove-hook! HOOK PROC
-
-Remove PROC from the list of functions in HOOK.
-
-*** New function: reset-hook! HOOK
-
-Clear the list of hook functions stored in HOOK.
-
-*** New function: run-hook HOOK ARG1 ...
-
-Run all hook functions stored in HOOK with arguments ARG1 ... .
-The number of arguments supplied must correspond to the number given
-when the hook was created.
-
-** The function `dynamic-link' now takes optional keyword arguments.
- The only keyword argument that is currently defined is `:global
- BOOL'. With it, you can control whether the shared library will be
- linked in global mode or not. In global mode, the symbols from the
- linked library can be used to resolve references from other
- dynamically linked libraries. In non-global mode, the linked
- library is essentially invisible and can only be accessed via
- `dynamic-func', etc. The default is now to link in global mode.
- Previously, the default has been non-global mode.
-
- The `#:global' keyword is only effective on platforms that support
- the dlopen family of functions.
-
-** New function `provided?'
-
- - Function: provided? FEATURE
- Return true iff FEATURE is supported by this installation of
- Guile. FEATURE must be a symbol naming a feature; the global
- variable `*features*' is a list of available features.
-
-** Changes to the module (ice-9 expect):
-
-*** The expect-strings macro now matches `$' in a regular expression
- only at a line-break or end-of-file by default. Previously it would
- match the end of the string accumulated so far. The old behaviour
- can be obtained by setting the variable `expect-strings-exec-flags'
- to 0.
-
-*** The expect-strings macro now uses a variable `expect-strings-exec-flags'
- for the regexp-exec flags. If `regexp/noteol' is included, then `$'
- in a regular expression will still match before a line-break or
- end-of-file. The default is `regexp/noteol'.
-
-*** The expect-strings macro now uses a variable
- `expect-strings-compile-flags' for the flags to be supplied to
- `make-regexp'. The default is `regexp/newline', which was previously
- hard-coded.
-
-*** The expect macro now supplies two arguments to a match procedure:
- the current accumulated string and a flag to indicate whether
- end-of-file has been reached. Previously only the string was supplied.
- If end-of-file is reached, the match procedure will be called an
- additional time with the same accumulated string as the previous call
- but with the flag set.
-
-** New module (ice-9 format), implementing the Common Lisp `format' function.
-
-This code, and the documentation for it that appears here, was
-borrowed from SLIB, with minor adaptations for Guile.
-
- - Function: format DESTINATION FORMAT-STRING . ARGUMENTS
- An almost complete implementation of Common LISP format description
- according to the CL reference book `Common LISP' from Guy L.
- Steele, Digital Press. Backward compatible to most of the
- available Scheme format implementations.
-
- Returns `#t', `#f' or a string; has side effect of printing
- according to FORMAT-STRING. If DESTINATION is `#t', the output is
- to the current output port and `#t' is returned. If DESTINATION
- is `#f', a formatted string is returned as the result of the call.
- NEW: If DESTINATION is a string, DESTINATION is regarded as the
- format string; FORMAT-STRING is then the first argument and the
- output is returned as a string. If DESTINATION is a number, the
- output is to the current error port if available by the
- implementation. Otherwise DESTINATION must be an output port and
- `#t' is returned.
-
- FORMAT-STRING must be a string. In case of a formatting error
- format returns `#f' and prints a message on the current output or
- error port. Characters are output as if the string were output by
- the `display' function with the exception of those prefixed by a
- tilde (~). For a detailed description of the FORMAT-STRING syntax
- please consult a Common LISP format reference manual. For a test
- suite to verify this format implementation load `formatst.scm'.
- Please send bug reports to `lutzeb@cs.tu-berlin.de'.
-
- Note: `format' is not reentrant, i.e. only one `format'-call may
- be executed at a time.
-
-
-*** Format Specification (Format version 3.0)
-
- Please consult a Common LISP format reference manual for a detailed
-description of the format string syntax. For a demonstration of the
-implemented directives see `formatst.scm'.
-
- This implementation supports directive parameters and modifiers (`:'
-and `@' characters). Multiple parameters must be separated by a comma
-(`,'). Parameters can be numerical parameters (positive or negative),
-character parameters (prefixed by a quote character (`''), variable
-parameters (`v'), number of rest arguments parameter (`#'), empty and
-default parameters. Directive characters are case independent. The
-general form of a directive is:
-
-DIRECTIVE ::= ~{DIRECTIVE-PARAMETER,}[:][@]DIRECTIVE-CHARACTER
-
-DIRECTIVE-PARAMETER ::= [ [-|+]{0-9}+ | 'CHARACTER | v | # ]
-
-*** Implemented CL Format Control Directives
-
- Documentation syntax: Uppercase characters represent the
-corresponding control directive characters. Lowercase characters
-represent control directive parameter descriptions.
-
-`~A'
- Any (print as `display' does).
- `~@A'
- left pad.
-
- `~MINCOL,COLINC,MINPAD,PADCHARA'
- full padding.
-
-`~S'
- S-expression (print as `write' does).
- `~@S'
- left pad.
-
- `~MINCOL,COLINC,MINPAD,PADCHARS'
- full padding.
-
-`~D'
- Decimal.
- `~@D'
- print number sign always.
-
- `~:D'
- print comma separated.
-
- `~MINCOL,PADCHAR,COMMACHARD'
- padding.
-
-`~X'
- Hexadecimal.
- `~@X'
- print number sign always.
-
- `~:X'
- print comma separated.
-
- `~MINCOL,PADCHAR,COMMACHARX'
- padding.
-
-`~O'
- Octal.
- `~@O'
- print number sign always.
-
- `~:O'
- print comma separated.
-
- `~MINCOL,PADCHAR,COMMACHARO'
- padding.
-
-`~B'
- Binary.
- `~@B'
- print number sign always.
-
- `~:B'
- print comma separated.
-
- `~MINCOL,PADCHAR,COMMACHARB'
- padding.
-
-`~NR'
- Radix N.
- `~N,MINCOL,PADCHAR,COMMACHARR'
- padding.
-
-`~@R'
- print a number as a Roman numeral.
-
-`~:@R'
- print a number as an "old fashioned" Roman numeral.
-
-`~:R'
- print a number as an ordinal English number.
-
-`~:@R'
- print a number as a cardinal English number.
-
-`~P'
- Plural.
- `~@P'
- prints `y' and `ies'.
-
- `~:P'
- as `~P but jumps 1 argument backward.'
-
- `~:@P'
- as `~@P but jumps 1 argument backward.'
-
-`~C'
- Character.
- `~@C'
- prints a character as the reader can understand it (i.e. `#\'
- prefixing).
-
- `~:C'
- prints a character as emacs does (eg. `^C' for ASCII 03).
-
-`~F'
- Fixed-format floating-point (prints a flonum like MMM.NNN).
- `~WIDTH,DIGITS,SCALE,OVERFLOWCHAR,PADCHARF'
- `~@F'
- If the number is positive a plus sign is printed.
-
-`~E'
- Exponential floating-point (prints a flonum like MMM.NNN`E'EE).
- `~WIDTH,DIGITS,EXPONENTDIGITS,SCALE,OVERFLOWCHAR,PADCHAR,EXPONENTCHARE'
- `~@E'
- If the number is positive a plus sign is printed.
-
-`~G'
- General floating-point (prints a flonum either fixed or
- exponential).
- `~WIDTH,DIGITS,EXPONENTDIGITS,SCALE,OVERFLOWCHAR,PADCHAR,EXPONENTCHARG'
- `~@G'
- If the number is positive a plus sign is printed.
-
-`~$'
- Dollars floating-point (prints a flonum in fixed with signs
- separated).
- `~DIGITS,SCALE,WIDTH,PADCHAR$'
- `~@$'
- If the number is positive a plus sign is printed.
-
- `~:@$'
- A sign is always printed and appears before the padding.
-
- `~:$'
- The sign appears before the padding.
-
-`~%'
- Newline.
- `~N%'
- print N newlines.
-
-`~&'
- print newline if not at the beginning of the output line.
- `~N&'
- prints `~&' and then N-1 newlines.
-
-`~|'
- Page Separator.
- `~N|'
- print N page separators.
-
-`~~'
- Tilde.
- `~N~'
- print N tildes.
-
-`~'<newline>
- Continuation Line.
- `~:'<newline>
- newline is ignored, white space left.
-
- `~@'<newline>
- newline is left, white space ignored.
-
-`~T'
- Tabulation.
- `~@T'
- relative tabulation.
-
- `~COLNUM,COLINCT'
- full tabulation.
-
-`~?'
- Indirection (expects indirect arguments as a list).
- `~@?'
- extracts indirect arguments from format arguments.
-
-`~(STR~)'
- Case conversion (converts by `string-downcase').
- `~:(STR~)'
- converts by `string-capitalize'.
-
- `~@(STR~)'
- converts by `string-capitalize-first'.
-
- `~:@(STR~)'
- converts by `string-upcase'.
-
-`~*'
- Argument Jumping (jumps 1 argument forward).
- `~N*'
- jumps N arguments forward.
-
- `~:*'
- jumps 1 argument backward.
-
- `~N:*'
- jumps N arguments backward.
-
- `~@*'
- jumps to the 0th argument.
-
- `~N@*'
- jumps to the Nth argument (beginning from 0)
-
-`~[STR0~;STR1~;...~;STRN~]'
- Conditional Expression (numerical clause conditional).
- `~N['
- take argument from N.
-
- `~@['
- true test conditional.
-
- `~:['
- if-else-then conditional.
-
- `~;'
- clause separator.
-
- `~:;'
- default clause follows.
-
-`~{STR~}'
- Iteration (args come from the next argument (a list)).
- `~N{'
- at most N iterations.
-
- `~:{'
- args from next arg (a list of lists).
-
- `~@{'
- args from the rest of arguments.
-
- `~:@{'
- args from the rest args (lists).
-
-`~^'
- Up and out.
- `~N^'
- aborts if N = 0
-
- `~N,M^'
- aborts if N = M
-
- `~N,M,K^'
- aborts if N <= M <= K
-
-*** Not Implemented CL Format Control Directives
-
-`~:A'
- print `#f' as an empty list (see below).
-
-`~:S'
- print `#f' as an empty list (see below).
-
-`~<~>'
- Justification.
-
-`~:^'
- (sorry I don't understand its semantics completely)
-
-*** Extended, Replaced and Additional Control Directives
-
-`~MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHD'
-`~MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHX'
-`~MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHO'
-`~MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHB'
-`~N,MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHR'
- COMMAWIDTH is the number of characters between two comma
- characters.
-
-`~I'
- print a R4RS complex number as `~F~@Fi' with passed parameters for
- `~F'.
-
-`~Y'
- Pretty print formatting of an argument for scheme code lists.
-
-`~K'
- Same as `~?.'
-
-`~!'
- Flushes the output if format DESTINATION is a port.
-
-`~_'
- Print a `#\space' character
- `~N_'
- print N `#\space' characters.
-
-`~/'
- Print a `#\tab' character
- `~N/'
- print N `#\tab' characters.
-
-`~NC'
- Takes N as an integer representation for a character. No arguments
- are consumed. N is converted to a character by `integer->char'. N
- must be a positive decimal number.
-
-`~:S'
- Print out readproof. Prints out internal objects represented as
- `#<...>' as strings `"#<...>"' so that the format output can always
- be processed by `read'.
-
-`~:A'
- Print out readproof. Prints out internal objects represented as
- `#<...>' as strings `"#<...>"' so that the format output can always
- be processed by `read'.
-
-`~Q'
- Prints information and a copyright notice on the format
- implementation.
- `~:Q'
- prints format version.
-
-`~F, ~E, ~G, ~$'
- may also print number strings, i.e. passing a number as a string
- and format it accordingly.
-
-*** Configuration Variables
-
- The format module exports some configuration variables to suit the
-systems and users needs. There should be no modification necessary for
-the configuration that comes with Guile. Format detects automatically
-if the running scheme system implements floating point numbers and
-complex numbers.
-
-format:symbol-case-conv
- Symbols are converted by `symbol->string' so the case type of the
- printed symbols is implementation dependent.
- `format:symbol-case-conv' is a one arg closure which is either
- `#f' (no conversion), `string-upcase', `string-downcase' or
- `string-capitalize'. (default `#f')
-
-format:iobj-case-conv
- As FORMAT:SYMBOL-CASE-CONV but applies for the representation of
- implementation internal objects. (default `#f')
-
-format:expch
- The character prefixing the exponent value in `~E' printing.
- (default `#\E')
-
-*** Compatibility With Other Format Implementations
-
-SLIB format 2.x:
- See `format.doc'.
-
-SLIB format 1.4:
- Downward compatible except for padding support and `~A', `~S',
- `~P', `~X' uppercase printing. SLIB format 1.4 uses C-style
- `printf' padding support which is completely replaced by the CL
- `format' padding style.
-
-MIT C-Scheme 7.1:
- Downward compatible except for `~', which is not documented
- (ignores all characters inside the format string up to a newline
- character). (7.1 implements `~a', `~s', ~NEWLINE, `~~', `~%',
- numerical and variable parameters and `:/@' modifiers in the CL
- sense).
-
-Elk 1.5/2.0:
- Downward compatible except for `~A' and `~S' which print in
- uppercase. (Elk implements `~a', `~s', `~~', and `~%' (no
- directive parameters or modifiers)).
-
-Scheme->C 01nov91:
- Downward compatible except for an optional destination parameter:
- S2C accepts a format call without a destination which returns a
- formatted string. This is equivalent to a #f destination in S2C.
- (S2C implements `~a', `~s', `~c', `~%', and `~~' (no directive
- parameters or modifiers)).
-
-
-** Changes to string-handling functions.
-
-These functions were added to support the (ice-9 format) module, above.
-
-*** New function: string-upcase STRING
-*** New function: string-downcase STRING
-
-These are non-destructive versions of the existing string-upcase! and
-string-downcase! functions.
-
-*** New function: string-capitalize! STRING
-*** New function: string-capitalize STRING
-
-These functions convert the first letter of each word in the string to
-upper case. Thus:
-
- (string-capitalize "howdy there")
- => "Howdy There"
-
-As with the other functions, string-capitalize! modifies the string in
-place, while string-capitalize returns a modified copy of its argument.
-
-*** New function: string-ci->symbol STRING
-
-Return a symbol whose name is STRING, but having the same case as if
-the symbol had be read by `read'.
-
-Guile can be configured to be sensitive or insensitive to case
-differences in Scheme identifiers. If Guile is case-insensitive, all
-symbols are converted to lower case on input. The `string-ci->symbol'
-function returns a symbol whose name in STRING, transformed as Guile
-would if STRING were input.
-
-*** New function: substring-move! STRING1 START END STRING2 START
-
-Copy the substring of STRING1 from START (inclusive) to END
-(exclusive) to STRING2 at START. STRING1 and STRING2 may be the same
-string, and the source and destination areas may overlap; in all
-cases, the function behaves as if all the characters were copied
-simultanously.
-
-*** Extended functions: substring-move-left! substring-move-right!
-
-These functions now correctly copy arbitrarily overlapping substrings;
-they are both synonyms for substring-move!.
-
-
-** New module (ice-9 getopt-long), with the function `getopt-long'.
-
-getopt-long is a function for parsing command-line arguments in a
-manner consistent with other GNU programs.
-
-(getopt-long ARGS GRAMMAR)
-Parse the arguments ARGS according to the argument list grammar GRAMMAR.
-
-ARGS should be a list of strings. Its first element should be the
-name of the program; subsequent elements should be the arguments
-that were passed to the program on the command line. The
-`program-arguments' procedure returns a list of this form.
-
-GRAMMAR is a list of the form:
-((OPTION (PROPERTY VALUE) ...) ...)
-
-Each OPTION should be a symbol. `getopt-long' will accept a
-command-line option named `--OPTION'.
-Each option can have the following (PROPERTY VALUE) pairs:
-
- (single-char CHAR) --- Accept `-CHAR' as a single-character
- equivalent to `--OPTION'. This is how to specify traditional
- Unix-style flags.
- (required? BOOL) --- If BOOL is true, the option is required.
- getopt-long will raise an error if it is not found in ARGS.
- (value BOOL) --- If BOOL is #t, the option accepts a value; if
- it is #f, it does not; and if it is the symbol
- `optional', the option may appear in ARGS with or
- without a value.
- (predicate FUNC) --- If the option accepts a value (i.e. you
- specified `(value #t)' for this option), then getopt
- will apply FUNC to the value, and throw an exception
- if it returns #f. FUNC should be a procedure which
- accepts a string and returns a boolean value; you may
- need to use quasiquotes to get it into GRAMMAR.
-
-The (PROPERTY VALUE) pairs may occur in any order, but each
-property may occur only once. By default, options do not have
-single-character equivalents, are not required, and do not take
-values.
-
-In ARGS, single-character options may be combined, in the usual
-Unix fashion: ("-x" "-y") is equivalent to ("-xy"). If an option
-accepts values, then it must be the last option in the
-combination; the value is the next argument. So, for example, using
-the following grammar:
- ((apples (single-char #\a))
- (blimps (single-char #\b) (value #t))
- (catalexis (single-char #\c) (value #t)))
-the following argument lists would be acceptable:
- ("-a" "-b" "bang" "-c" "couth") ("bang" and "couth" are the values
- for "blimps" and "catalexis")
- ("-ab" "bang" "-c" "couth") (same)
- ("-ac" "couth" "-b" "bang") (same)
- ("-abc" "couth" "bang") (an error, since `-b' is not the
- last option in its combination)
-
-If an option's value is optional, then `getopt-long' decides
-whether it has a value by looking at what follows it in ARGS. If
-the next element is a string, and it does not appear to be an
-option itself, then that string is the option's value.
-
-The value of a long option can appear as the next element in ARGS,
-or it can follow the option name, separated by an `=' character.
-Thus, using the same grammar as above, the following argument lists
-are equivalent:
- ("--apples" "Braeburn" "--blimps" "Goodyear")
- ("--apples=Braeburn" "--blimps" "Goodyear")
- ("--blimps" "Goodyear" "--apples=Braeburn")
-
-If the option "--" appears in ARGS, argument parsing stops there;
-subsequent arguments are returned as ordinary arguments, even if
-they resemble options. So, in the argument list:
- ("--apples" "Granny Smith" "--" "--blimp" "Goodyear")
-`getopt-long' will recognize the `apples' option as having the
-value "Granny Smith", but it will not recognize the `blimp'
-option; it will return the strings "--blimp" and "Goodyear" as
-ordinary argument strings.
-
-The `getopt-long' function returns the parsed argument list as an
-assocation list, mapping option names --- the symbols from GRAMMAR
---- onto their values, or #t if the option does not accept a value.
-Unused options do not appear in the alist.
-
-All arguments that are not the value of any option are returned
-as a list, associated with the empty list.
-
-`getopt-long' throws an exception if:
-- it finds an unrecognized option in ARGS
-- a required option is omitted
-- an option that requires an argument doesn't get one
-- an option that doesn't accept an argument does get one (this can
- only happen using the long option `--opt=value' syntax)
-- an option predicate fails
-
-So, for example:
-
-(define grammar
- `((lockfile-dir (required? #t)
- (value #t)
- (single-char #\k)
- (predicate ,file-is-directory?))
- (verbose (required? #f)
- (single-char #\v)
- (value #f))
- (x-includes (single-char #\x))
- (rnet-server (single-char #\y)
- (predicate ,string?))))
-
-(getopt-long '("my-prog" "-vk" "/tmp" "foo1" "--x-includes=/usr/include"
- "--rnet-server=lamprod" "--" "-fred" "foo2" "foo3")
- grammar)
-=> ((() "foo1" "-fred" "foo2" "foo3")
- (rnet-server . "lamprod")
- (x-includes . "/usr/include")
- (lockfile-dir . "/tmp")
- (verbose . #t))
-
-** The (ice-9 getopt-gnu-style) module is obsolete; use (ice-9 getopt-long).
-
-It will be removed in a few releases.
-
-** New syntax: lambda*
-** New syntax: define*
-** New syntax: define*-public
-** New syntax: defmacro*
-** New syntax: defmacro*-public
-Guile now supports optional arguments.
-
-`lambda*', `define*', `define*-public', `defmacro*' and
-`defmacro*-public' are identical to the non-* versions except that
-they use an extended type of parameter list that has the following BNF
-syntax (parentheses are literal, square brackets indicate grouping,
-and `*', `+' and `?' have the usual meaning):
-
- ext-param-list ::= ( [identifier]* [#&optional [ext-var-decl]+]?
- [#&key [ext-var-decl]+ [#&allow-other-keys]?]?
- [[#&rest identifier]|[. identifier]]? ) | [identifier]
-
- ext-var-decl ::= identifier | ( identifier expression )
-
-The semantics are best illustrated with the following documentation
-and examples for `lambda*':
-
- lambda* args . body
- lambda extended for optional and keyword arguments
-
- lambda* creates a procedure that takes optional arguments. These
- are specified by putting them inside brackets at the end of the
- paramater list, but before any dotted rest argument. For example,
- (lambda* (a b #&optional c d . e) '())
- creates a procedure with fixed arguments a and b, optional arguments c
- and d, and rest argument e. If the optional arguments are omitted
- in a call, the variables for them are unbound in the procedure. This
- can be checked with the bound? macro.
-
- lambda* can also take keyword arguments. For example, a procedure
- defined like this:
- (lambda* (#&key xyzzy larch) '())
- can be called with any of the argument lists (#:xyzzy 11)
- (#:larch 13) (#:larch 42 #:xyzzy 19) (). Whichever arguments
- are given as keywords are bound to values.
-
- Optional and keyword arguments can also be given default values
- which they take on when they are not present in a call, by giving a
- two-item list in place of an optional argument, for example in:
- (lambda* (foo #&optional (bar 42) #&key (baz 73)) (list foo bar baz))
- foo is a fixed argument, bar is an optional argument with default
- value 42, and baz is a keyword argument with default value 73.
- Default value expressions are not evaluated unless they are needed
- and until the procedure is called.
-
- lambda* now supports two more special parameter list keywords.
-
- lambda*-defined procedures now throw an error by default if a
- keyword other than one of those specified is found in the actual
- passed arguments. However, specifying #&allow-other-keys
- immediately after the kyword argument declarations restores the
- previous behavior of ignoring unknown keywords. lambda* also now
- guarantees that if the same keyword is passed more than once, the
- last one passed is the one that takes effect. For example,
- ((lambda* (#&key (heads 0) (tails 0)) (display (list heads tails)))
- #:heads 37 #:tails 42 #:heads 99)
- would result in (99 47) being displayed.
-
- #&rest is also now provided as a synonym for the dotted syntax rest
- argument. The argument lists (a . b) and (a #&rest b) are equivalent in
- all respects to lambda*. This is provided for more similarity to DSSSL,
- MIT-Scheme and Kawa among others, as well as for refugees from other
- Lisp dialects.
-
-Further documentation may be found in the optargs.scm file itself.
-
-The optional argument module also exports the macros `let-optional',
-`let-optional*', `let-keywords', `let-keywords*' and `bound?'. These
-are not documented here because they may be removed in the future, but
-full documentation is still available in optargs.scm.
-
-** New syntax: and-let*
-Guile now supports the `and-let*' form, described in the draft SRFI-2.
-
-Syntax: (land* (<clause> ...) <body> ...)
-Each <clause> should have one of the following forms:
- (<variable> <expression>)
- (<expression>)
- <bound-variable>
-Each <variable> or <bound-variable> should be an identifier. Each
-<expression> should be a valid expression. The <body> should be a
-possibly empty sequence of expressions, like the <body> of a
-lambda form.
-
-Semantics: A LAND* expression is evaluated by evaluating the
-<expression> or <bound-variable> of each of the <clause>s from
-left to right. The value of the first <expression> or
-<bound-variable> that evaluates to a false value is returned; the
-remaining <expression>s and <bound-variable>s are not evaluated.
-The <body> forms are evaluated iff all the <expression>s and
-<bound-variable>s evaluate to true values.
-
-The <expression>s and the <body> are evaluated in an environment
-binding each <variable> of the preceding (<variable> <expression>)
-clauses to the value of the <expression>. Later bindings
-shadow earlier bindings.
-
-Guile's and-let* macro was contributed by Michael Livshin.
-
-** New sorting functions
-
-*** New function: sorted? SEQUENCE LESS?
-Returns `#t' when the sequence argument is in non-decreasing order
-according to LESS? (that is, there is no adjacent pair `... x y
-...' for which `(less? y x)').
-
-Returns `#f' when the sequence contains at least one out-of-order
-pair. It is an error if the sequence is neither a list nor a
-vector.
-
-*** New function: merge LIST1 LIST2 LESS?
-LIST1 and LIST2 are sorted lists.
-Returns the sorted list of all elements in LIST1 and LIST2.
-
-Assume that the elements a and b1 in LIST1 and b2 in LIST2 are "equal"
-in the sense that (LESS? x y) --> #f for x, y in {a, b1, b2},
-and that a < b1 in LIST1. Then a < b1 < b2 in the result.
-(Here "<" should read "comes before".)
-
-*** New procedure: merge! LIST1 LIST2 LESS?
-Merges two lists, re-using the pairs of LIST1 and LIST2 to build
-the result. If the code is compiled, and LESS? constructs no new
-pairs, no pairs at all will be allocated. The first pair of the
-result will be either the first pair of LIST1 or the first pair of
-LIST2.
-
-*** New function: sort SEQUENCE LESS?
-Accepts either a list or a vector, and returns a new sequence
-which is sorted. The new sequence is the same type as the input.
-Always `(sorted? (sort sequence less?) less?)'. The original
-sequence is not altered in any way. The new sequence shares its
-elements with the old one; no elements are copied.
-
-*** New procedure: sort! SEQUENCE LESS
-Returns its sorted result in the original boxes. No new storage is
-allocated at all. Proper usage: (set! slist (sort! slist <))
-
-*** New function: stable-sort SEQUENCE LESS?
-Similar to `sort' but stable. That is, if "equal" elements are
-ordered a < b in the original sequence, they will have the same order
-in the result.
-
-*** New function: stable-sort! SEQUENCE LESS?
-Similar to `sort!' but stable.
-Uses temporary storage when sorting vectors.
-
-*** New functions: sort-list, sort-list!
-Added for compatibility with scsh.
-
-** New built-in random number support
-
-*** New function: random N [STATE]
-Accepts a positive integer or real N and returns a number of the
-same type between zero (inclusive) and N (exclusive). The values
-returned have a uniform distribution.
-
-The optional argument STATE must be of the type produced by
-`copy-random-state' or `seed->random-state'. It defaults to the value
-of the variable `*random-state*'. This object is used to maintain the
-state of the pseudo-random-number generator and is altered as a side
-effect of the `random' operation.
-
-*** New variable: *random-state*
-Holds a data structure that encodes the internal state of the
-random-number generator that `random' uses by default. The nature
-of this data structure is implementation-dependent. It may be
-printed out and successfully read back in, but may or may not
-function correctly as a random-number state object in another
-implementation.
-
-*** New function: copy-random-state [STATE]
-Returns a new object of type suitable for use as the value of the
-variable `*random-state*' and as a second argument to `random'.
-If argument STATE is given, a copy of it is returned. Otherwise a
-copy of `*random-state*' is returned.
-
-*** New function: seed->random-state SEED
-Returns a new object of type suitable for use as the value of the
-variable `*random-state*' and as a second argument to `random'.
-SEED is a string or a number. A new state is generated and
-initialized using SEED.
-
-*** New function: random:uniform [STATE]
-Returns an uniformly distributed inexact real random number in the
-range between 0 and 1.
-
-*** New procedure: random:solid-sphere! VECT [STATE]
-Fills VECT with inexact real random numbers the sum of whose
-squares is less than 1.0. Thinking of VECT as coordinates in
-space of dimension N = `(vector-length VECT)', the coordinates are
-uniformly distributed within the unit N-shere. The sum of the
-squares of the numbers is returned. VECT can be either a vector
-or a uniform vector of doubles.
-
-*** New procedure: random:hollow-sphere! VECT [STATE]
-Fills VECT with inexact real random numbers the sum of whose squares
-is equal to 1.0. Thinking of VECT as coordinates in space of
-dimension n = `(vector-length VECT)', the coordinates are uniformly
-distributed over the surface of the unit n-shere. VECT can be either
-a vector or a uniform vector of doubles.
-
-*** New function: random:normal [STATE]
-Returns an inexact real in a normal distribution with mean 0 and
-standard deviation 1. For a normal distribution with mean M and
-standard deviation D use `(+ M (* D (random:normal)))'.
-
-*** New procedure: random:normal-vector! VECT [STATE]
-Fills VECT with inexact real random numbers which are independent and
-standard normally distributed (i.e., with mean 0 and variance 1).
-VECT can be either a vector or a uniform vector of doubles.
-
-*** New function: random:exp STATE
-Returns an inexact real in an exponential distribution with mean 1.
-For an exponential distribution with mean U use (* U (random:exp)).
-
-** The range of logand, logior, logxor, logtest, and logbit? have changed.
-
-These functions now operate on numbers in the range of a C unsigned
-long.
-
-These functions used to operate on numbers in the range of a C signed
-long; however, this seems inappropriate, because Guile integers don't
-overflow.
-
-** New function: make-guardian
-This is an implementation of guardians as described in
-R. Kent Dybvig, Carl Bruggeman, and David Eby (1993) "Guardians in a
-Generation-Based Garbage Collector" ACM SIGPLAN Conference on
-Programming Language Design and Implementation, June 1993
-ftp://ftp.cs.indiana.edu/pub/scheme-repository/doc/pubs/guardians.ps.gz
-
-** New functions: delq1!, delv1!, delete1!
-These procedures behave similar to delq! and friends but delete only
-one object if at all.
-
-** New function: unread-string STRING PORT
-Unread STRING to PORT, that is, push it back onto the port so that
-next read operation will work on the pushed back characters.
-
-** unread-char can now be called multiple times
-If unread-char is called multiple times, the unread characters will be
-read again in last-in first-out order.
-
-** the procedures uniform-array-read! and uniform-array-write! now
-work on any kind of port, not just ports which are open on a file.
-
-** Now 'l' in a port mode requests line buffering.
-
-** The procedure truncate-file now works on string ports as well
-as file ports. If the size argument is omitted, the current
-file position is used.
-
-** new procedure: seek PORT/FDES OFFSET WHENCE
-The arguments are the same as for the old fseek procedure, but it
-works on string ports as well as random-access file ports.
-
-** the fseek procedure now works on string ports, since it has been
-redefined using seek.
-
-** the setvbuf procedure now uses a default size if mode is _IOFBF and
-size is not supplied.
-
-** the newline procedure no longer flushes the port if it's not
-line-buffered: previously it did if it was the current output port.
-
-** open-pipe and close-pipe are no longer primitive procedures, but
-an emulation can be obtained using `(use-modules (ice-9 popen))'.
-
-** the freopen procedure has been removed.
-
-** new procedure: drain-input PORT
-Drains PORT's read buffers (including any pushed-back characters)
-and returns the contents as a single string.
-
-** New function: map-in-order PROC LIST1 LIST2 ...
-Version of `map' which guarantees that the procedure is applied to the
-lists in serial order.
-
-** Renamed `serial-array-copy!' and `serial-array-map!' to
-`array-copy-in-order!' and `array-map-in-order!'. The old names are
-now obsolete and will go away in release 1.5.
-
-** New syntax: collect BODY1 ...
-Version of `begin' which returns a list of the results of the body
-forms instead of the result of the last body form. In contrast to
-`begin', `collect' allows an empty body.
-
-** New functions: read-history FILENAME, write-history FILENAME
-Read/write command line history from/to file. Returns #t on success
-and #f if an error occured.
-
-** `ls' and `lls' in module (ice-9 ls) now handle no arguments.
-
-These procedures return a list of definitions available in the specified
-argument, a relative module reference. In the case of no argument,
-`(current-module)' is now consulted for definitions to return, instead
-of simply returning #f, the former behavior.
-
-** The #/ syntax for lists is no longer supported.
-
-Earlier versions of Scheme accepted this syntax, but printed a
-warning.
-
-** Guile no longer consults the SCHEME_LOAD_PATH environment variable.
-
-Instead, you should set GUILE_LOAD_PATH to tell Guile where to find
-modules.
-
-* Changes to the gh_ interface
-
-** gh_scm2doubles
-
-Now takes a second argument which is the result array. If this
-pointer is NULL, a new array is malloced (the old behaviour).
-
-** gh_chars2byvect, gh_shorts2svect, gh_floats2fvect, gh_scm2chars,
- gh_scm2shorts, gh_scm2longs, gh_scm2floats
-
-New functions.
-
-* Changes to the scm_ interface
-
-** Function: scm_make_named_hook (char* name, int n_args)
-
-Creates a hook in the same way as make-hook above but also
-binds a variable named NAME to it.
-
-This is the typical way of creating a hook from C code.
-
-Currently, the variable is created in the "current" module. This
-might change when we get the new module system.
-
-** The smob interface
-
-The interface for creating smobs has changed. For documentation, see
-data-rep.info (made from guile-core/doc/data-rep.texi).
-
-*** Deprecated function: SCM scm_newsmob (scm_smobfuns *)
-
->>> This function will be removed in 1.3.4. <<<
-
-It is replaced by:
-
-*** Function: SCM scm_make_smob_type (const char *name, scm_sizet size)
-This function adds a new smob type, named NAME, with instance size
-SIZE to the system. The return value is a tag that is used in
-creating instances of the type. If SIZE is 0, then no memory will
-be allocated when instances of the smob are created, and nothing
-will be freed by the default free function.
-
-*** Function: void scm_set_smob_mark (long tc, SCM (*mark) (SCM))
-This function sets the smob marking procedure for the smob type
-specified by the tag TC. TC is the tag returned by
-`scm_make_smob_type'.
-
-*** Function: void scm_set_smob_free (long tc, SCM (*mark) (SCM))
-This function sets the smob freeing procedure for the smob type
-specified by the tag TC. TC is the tag returned by
-`scm_make_smob_type'.
-
-*** Function: void scm_set_smob_print (tc, print)
-
- - Function: void scm_set_smob_print (long tc,
- scm_sizet (*print) (SCM,
- SCM,
- scm_print_state *))
-
-This function sets the smob printing procedure for the smob type
-specified by the tag TC. TC is the tag returned by
-`scm_make_smob_type'.
-
-*** Function: void scm_set_smob_equalp (long tc, SCM (*equalp) (SCM, SCM))
-This function sets the smob equality-testing predicate for the
-smob type specified by the tag TC. TC is the tag returned by
-`scm_make_smob_type'.
-
-*** Macro: void SCM_NEWSMOB (SCM var, long tc, void *data)
-Make VALUE contain a smob instance of the type with type code TC and
-smob data DATA. VALUE must be previously declared as C type `SCM'.
-
-*** Macro: fn_returns SCM_RETURN_NEWSMOB (long tc, void *data)
-This macro expands to a block of code that creates a smob instance
-of the type with type code TC and smob data DATA, and returns that
-`SCM' value. It should be the last piece of code in a block.
-
-** The interfaces for using I/O ports and implementing port types
-(ptobs) have changed significantly. The new interface is based on
-shared access to buffers and a new set of ptob procedures.
-
-*** scm_newptob has been removed
-
-It is replaced by:
-
-*** Function: SCM scm_make_port_type (type_name, fill_buffer, write_flush)
-
-- Function: SCM scm_make_port_type (char *type_name,
- int (*fill_buffer) (SCM port),
- void (*write_flush) (SCM port));
-
-Similarly to the new smob interface, there is a set of function
-setters by which the user can customize the behaviour of his port
-type. See ports.h (scm_set_port_XXX).
-
-** scm_strport_to_string: New function: creates a new string from
-a string port's buffer.
-
-** Plug in interface for random number generators
-The variable `scm_the_rng' in random.c contains a value and three
-function pointers which together define the current random number
-generator being used by the Scheme level interface and the random
-number library functions.
-
-The user is free to replace the default generator with the generator
-of his own choice.
-
-*** Variable: size_t scm_the_rng.rstate_size
-The size of the random state type used by the current RNG
-measured in chars.
-
-*** Function: unsigned long scm_the_rng.random_bits (scm_rstate *STATE)
-Given the random STATE, return 32 random bits.
-
-*** Function: void scm_the_rng.init_rstate (scm_rstate *STATE, chars *S, int N)
-Seed random state STATE using string S of length N.
-
-*** Function: scm_rstate *scm_the_rng.copy_rstate (scm_rstate *STATE)
-Given random state STATE, return a malloced copy.
-
-** Default RNG
-The default RNG is the MWC (Multiply With Carry) random number
-generator described by George Marsaglia at the Department of
-Statistics and Supercomputer Computations Research Institute, The
-Florida State University (http://stat.fsu.edu/~geo).
-
-It uses 64 bits, has a period of 4578426017172946943 (4.6e18), and
-passes all tests in the DIEHARD test suite
-(http://stat.fsu.edu/~geo/diehard.html). The generation of 32 bits
-costs one multiply and one add on platforms which either supports long
-longs (gcc does this on most systems) or have 64 bit longs. The cost
-is four multiply on other systems but this can be optimized by writing
-scm_i_uniform32 in assembler.
-
-These functions are provided through the scm_the_rng interface for use
-by libguile and the application.
-
-*** Function: unsigned long scm_i_uniform32 (scm_i_rstate *STATE)
-Given the random STATE, return 32 random bits.
-Don't use this function directly. Instead go through the plugin
-interface (see "Plug in interface" above).
-
-*** Function: void scm_i_init_rstate (scm_i_rstate *STATE, char *SEED, int N)
-Initialize STATE using SEED of length N.
-
-*** Function: scm_i_rstate *scm_i_copy_rstate (scm_i_rstate *STATE)
-Return a malloc:ed copy of STATE. This function can easily be re-used
-in the interfaces to other RNGs.
-
-** Random number library functions
-These functions use the current RNG through the scm_the_rng interface.
-It might be a good idea to use these functions from your C code so
-that only one random generator is used by all code in your program.
-
-The default random state is stored in:
-
-*** Variable: SCM scm_var_random_state
-Contains the vcell of the Scheme variable "*random-state*" which is
-used as default state by all random number functions in the Scheme
-level interface.
-
-Example:
-
- double x = scm_c_uniform01 (SCM_RSTATE (SCM_CDR (scm_var_random_state)));
-
-*** Function: scm_rstate *scm_c_default_rstate (void)
-This is a convenience function which returns the value of
-scm_var_random_state. An error message is generated if this value
-isn't a random state.
-
-*** Function: scm_rstate *scm_c_make_rstate (char *SEED, int LENGTH)
-Make a new random state from the string SEED of length LENGTH.
-
-It is generally not a good idea to use multiple random states in a
-program. While subsequent random numbers generated from one random
-state are guaranteed to be reasonably independent, there is no such
-guarantee for numbers generated from different random states.
-
-*** Macro: unsigned long scm_c_uniform32 (scm_rstate *STATE)
-Return 32 random bits.
-
-*** Function: double scm_c_uniform01 (scm_rstate *STATE)
-Return a sample from the uniform(0,1) distribution.
-
-*** Function: double scm_c_normal01 (scm_rstate *STATE)
-Return a sample from the normal(0,1) distribution.
-
-*** Function: double scm_c_exp1 (scm_rstate *STATE)
-Return a sample from the exp(1) distribution.
-
-*** Function: unsigned long scm_c_random (scm_rstate *STATE, unsigned long M)
-Return a sample from the discrete uniform(0,M) distribution.
-
-*** Function: SCM scm_c_random_bignum (scm_rstate *STATE, SCM M)
-Return a sample from the discrete uniform(0,M) distribution.
-M must be a bignum object. The returned value may be an INUM.
-
-
-
-Changes in Guile 1.3 (released Monday, October 19, 1998):
-
-* Changes to the distribution
-
-** We renamed the SCHEME_LOAD_PATH environment variable to GUILE_LOAD_PATH.
-To avoid conflicts, programs should name environment variables after
-themselves, except when there's a common practice establishing some
-other convention.
-
-For now, Guile supports both GUILE_LOAD_PATH and SCHEME_LOAD_PATH,
-giving the former precedence, and printing a warning message if the
-latter is set. Guile 1.4 will not recognize SCHEME_LOAD_PATH at all.
-
-** The header files related to multi-byte characters have been removed.
-They were: libguile/extchrs.h and libguile/mbstrings.h. Any C code
-which referred to these explicitly will probably need to be rewritten,
-since the support for the variant string types has been removed; see
-below.
-
-** The header files append.h and sequences.h have been removed. These
-files implemented non-R4RS operations which would encourage
-non-portable programming style and less easy-to-read code.
-
-* Changes to the stand-alone interpreter
-
-** New procedures have been added to implement a "batch mode":
-
-*** Function: batch-mode?
-
- Returns a boolean indicating whether the interpreter is in batch
- mode.
-
-*** Function: set-batch-mode?! ARG
-
- If ARG is true, switches the interpreter to batch mode. The `#f'
- case has not been implemented.
-
-** Guile now provides full command-line editing, when run interactively.
-To use this feature, you must have the readline library installed.
-The Guile build process will notice it, and automatically include
-support for it.
-
-The readline library is available via anonymous FTP from any GNU
-mirror site; the canonical location is "ftp://prep.ai.mit.edu/pub/gnu".
-
-** the-last-stack is now a fluid.
-
-* Changes to the procedure for linking libguile with your programs
-
-** You can now use the `guile-config' utility to build programs that use Guile.
-
-Guile now includes a command-line utility called `guile-config', which
-can provide information about how to compile and link programs that
-use Guile.
-
-*** `guile-config compile' prints any C compiler flags needed to use Guile.
-You should include this command's output on the command line you use
-to compile C or C++ code that #includes the Guile header files. It's
-usually just a `-I' flag to help the compiler find the Guile headers.
-
-
-*** `guile-config link' prints any linker flags necessary to link with Guile.
-
-This command writes to its standard output a list of flags which you
-must pass to the linker to link your code against the Guile library.
-The flags include '-lguile' itself, any other libraries the Guile
-library depends upon, and any `-L' flags needed to help the linker
-find those libraries.
-
-For example, here is a Makefile rule that builds a program named 'foo'
-from the object files ${FOO_OBJECTS}, and links them against Guile:
-
- foo: ${FOO_OBJECTS}
- ${CC} ${CFLAGS} ${FOO_OBJECTS} `guile-config link` -o foo
-
-Previous Guile releases recommended that you use autoconf to detect
-which of a predefined set of libraries were present on your system.
-It is more robust to use `guile-config', since it records exactly which
-libraries the installed Guile library requires.
-
-This was originally called `build-guile', but was renamed to
-`guile-config' before Guile 1.3 was released, to be consistent with
-the analogous script for the GTK+ GUI toolkit, which is called
-`gtk-config'.
-
-
-** Use the GUILE_FLAGS macro in your configure.in file to find Guile.
-
-If you are using the GNU autoconf package to configure your program,
-you can use the GUILE_FLAGS autoconf macro to call `guile-config'
-(described above) and gather the necessary values for use in your
-Makefiles.
-
-The GUILE_FLAGS macro expands to configure script code which runs the
-`guile-config' script, to find out where Guile's header files and
-libraries are installed. It sets two variables, marked for
-substitution, as by AC_SUBST.
-
- GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
- code that uses Guile header files. This is almost always just a
- -I flag.
-
- GUILE_LDFLAGS --- flags to pass to the linker to link a
- program against Guile. This includes `-lguile' for the Guile
- library itself, any libraries that Guile itself requires (like
- -lqthreads), and so on. It may also include a -L flag to tell the
- compiler where to find the libraries.
-
-GUILE_FLAGS is defined in the file guile.m4, in the top-level
-directory of the Guile distribution. You can copy it into your
-package's aclocal.m4 file, and then use it in your configure.in file.
-
-If you are using the `aclocal' program, distributed with GNU automake,
-to maintain your aclocal.m4 file, the Guile installation process
-installs guile.m4 where aclocal will find it. All you need to do is
-use GUILE_FLAGS in your configure.in file, and then run `aclocal';
-this will copy the definition of GUILE_FLAGS into your aclocal.m4
-file.
-
-
-* Changes to Scheme functions and syntax
-
-** Multi-byte strings have been removed, as have multi-byte and wide
-ports. We felt that these were the wrong approach to
-internationalization support.
-
-** New function: readline [PROMPT]
-Read a line from the terminal, and allow the user to edit it,
-prompting with PROMPT. READLINE provides a large set of Emacs-like
-editing commands, lets the user recall previously typed lines, and
-works on almost every kind of terminal, including dumb terminals.
-
-READLINE assumes that the cursor is at the beginning of the line when
-it is invoked. Thus, you can't print a prompt yourself, and then call
-READLINE; you need to package up your prompt as a string, pass it to
-the function, and let READLINE print the prompt itself. This is
-because READLINE needs to know the prompt's screen width.
-
-For Guile to provide this function, you must have the readline
-library, version 2.1 or later, installed on your system. Readline is
-available via anonymous FTP from prep.ai.mit.edu in pub/gnu, or from
-any GNU mirror site.
-
-See also ADD-HISTORY function.
-
-** New function: add-history STRING
-Add STRING as the most recent line in the history used by the READLINE
-command. READLINE does not add lines to the history itself; you must
-call ADD-HISTORY to make previous input available to the user.
-
-** The behavior of the read-line function has changed.
-
-This function now uses standard C library functions to read the line,
-for speed. This means that it doesn not respect the value of
-scm-line-incrementors; it assumes that lines are delimited with
-#\newline.
-
-(Note that this is read-line, the function that reads a line of text
-from a port, not readline, the function that reads a line from a
-terminal, providing full editing capabilities.)
-
-** New module (ice-9 getopt-gnu-style): Parse command-line arguments.
-
-This module provides some simple argument parsing. It exports one
-function:
-
-Function: getopt-gnu-style ARG-LS
- Parse a list of program arguments into an alist of option
- descriptions.
-
- Each item in the list of program arguments is examined to see if
- it meets the syntax of a GNU long-named option. An argument like
- `--MUMBLE' produces an element of the form (MUMBLE . #t) in the
- returned alist, where MUMBLE is a keyword object with the same
- name as the argument. An argument like `--MUMBLE=FROB' produces
- an element of the form (MUMBLE . FROB), where FROB is a string.
-
- As a special case, the returned alist also contains a pair whose
- car is the symbol `rest'. The cdr of this pair is a list
- containing all the items in the argument list that are not options
- of the form mentioned above.
-
- The argument `--' is treated specially: all items in the argument
- list appearing after such an argument are not examined, and are
- returned in the special `rest' list.
-
- This function does not parse normal single-character switches.
- You will need to parse them out of the `rest' list yourself.
-
-** The read syntax for byte vectors and short vectors has changed.
-
-Instead of #bytes(...), write #y(...).
-
-Instead of #short(...), write #h(...).
-
-This may seem nutty, but, like the other uniform vectors, byte vectors
-and short vectors want to have the same print and read syntax (and,
-more basic, want to have read syntax!). Changing the read syntax to
-use multiple characters after the hash sign breaks with the
-conventions used in R5RS and the conventions used for the other
-uniform vectors. It also introduces complexity in the current reader,
-both on the C and Scheme levels. (The Right solution is probably to
-change the syntax and prototypes for uniform vectors entirely.)
-
-
-** The new module (ice-9 session) provides useful interactive functions.
-
-*** New procedure: (apropos REGEXP OPTION ...)
-
-Display a list of top-level variables whose names match REGEXP, and
-the modules they are imported from. Each OPTION should be one of the
-following symbols:
-
- value --- Show the value of each matching variable.
- shadow --- Show bindings shadowed by subsequently imported modules.
- full --- Same as both `shadow' and `value'.
-
-For example:
-
- guile> (apropos "trace" 'full)
- debug: trace #<procedure trace args>
- debug: untrace #<procedure untrace args>
- the-scm-module: display-backtrace #<compiled-closure #<primitive-procedure gsubr-apply>>
- the-scm-module: before-backtrace-hook ()
- the-scm-module: backtrace #<primitive-procedure backtrace>
- the-scm-module: after-backtrace-hook ()
- the-scm-module: has-shown-backtrace-hint? #f
- guile>
-
-** There are new functions and syntax for working with macros.
-
-Guile implements macros as a special object type. Any variable whose
-top-level binding is a macro object acts as a macro. The macro object
-specifies how the expression should be transformed before evaluation.
-
-*** Macro objects now print in a reasonable way, resembling procedures.
-
-*** New function: (macro? OBJ)
-True iff OBJ is a macro object.
-
-*** New function: (primitive-macro? OBJ)
-Like (macro? OBJ), but true only if OBJ is one of the Guile primitive
-macro transformers, implemented in eval.c rather than Scheme code.
-
-Why do we have this function?
-- For symmetry with procedure? and primitive-procedure?,
-- to allow custom print procedures to tell whether a macro is
- primitive, and display it differently, and
-- to allow compilers and user-written evaluators to distinguish
- builtin special forms from user-defined ones, which could be
- compiled.
-
-*** New function: (macro-type OBJ)
-Return a value indicating what kind of macro OBJ is. Possible return
-values are:
-
- The symbol `syntax' --- a macro created by procedure->syntax.
- The symbol `macro' --- a macro created by procedure->macro.
- The symbol `macro!' --- a macro created by procedure->memoizing-macro.
- The boolean #f --- if OBJ is not a macro object.
-
-*** New function: (macro-name MACRO)
-Return the name of the macro object MACRO's procedure, as returned by
-procedure-name.
-
-*** New function: (macro-transformer MACRO)
-Return the transformer procedure for MACRO.
-
-*** New syntax: (use-syntax MODULE ... TRANSFORMER)
-
-Specify a new macro expander to use in the current module. Each
-MODULE is a module name, with the same meaning as in the `use-modules'
-form; each named module's exported bindings are added to the current
-top-level environment. TRANSFORMER is an expression evaluated in the
-resulting environment which must yield a procedure to use as the
-module's eval transformer: every expression evaluated in this module
-is passed to this function, and the result passed to the Guile
-interpreter.
-
-*** macro-eval! is removed. Use local-eval instead.
-
-** Some magic has been added to the printer to better handle user
-written printing routines (like record printers, closure printers).
-
-The problem is that these user written routines must have access to
-the current `print-state' to be able to handle fancy things like
-detection of circular references. These print-states have to be
-passed to the builtin printing routines (display, write, etc) to
-properly continue the print chain.
-
-We didn't want to change all existing print code so that it
-explicitly passes thru a print state in addition to a port. Instead,
-we extented the possible values that the builtin printing routines
-accept as a `port'. In addition to a normal port, they now also take
-a pair of a normal port and a print-state. Printing will go to the
-port and the print-state will be used to control the detection of
-circular references, etc. If the builtin function does not care for a
-print-state, it is simply ignored.
-
-User written callbacks are now called with such a pair as their
-`port', but because every function now accepts this pair as a PORT
-argument, you don't have to worry about that. In fact, it is probably
-safest to not check for these pairs.
-
-However, it is sometimes necessary to continue a print chain on a
-different port, for example to get a intermediate string
-representation of the printed value, mangle that string somehow, and
-then to finally print the mangled string. Use the new function
-
- inherit-print-state OLD-PORT NEW-PORT
-
-for this. It constructs a new `port' that prints to NEW-PORT but
-inherits the print-state of OLD-PORT.
-
-** struct-vtable-offset renamed to vtable-offset-user
-
-** New constants: vtable-index-layout, vtable-index-vtable, vtable-index-printer
-
-** There is now a third optional argument to make-vtable-vtable
- (and fourth to make-struct) when constructing new types (vtables).
- This argument initializes field vtable-index-printer of the vtable.
-
-** The detection of circular references has been extended to structs.
-That is, a structure that -- in the process of being printed -- prints
-itself does not lead to infinite recursion.
-
-** There is now some basic support for fluids. Please read
-"libguile/fluid.h" to find out more. It is accessible from Scheme with
-the following functions and macros:
-
-Function: make-fluid
-
- Create a new fluid object. Fluids are not special variables or
- some other extension to the semantics of Scheme, but rather
- ordinary Scheme objects. You can store them into variables (that
- are still lexically scoped, of course) or into any other place you
- like. Every fluid has a initial value of `#f'.
-
-Function: fluid? OBJ
-
- Test whether OBJ is a fluid.
-
-Function: fluid-ref FLUID
-Function: fluid-set! FLUID VAL
-
- Access/modify the fluid FLUID. Modifications are only visible
- within the current dynamic root (that includes threads).
-
-Function: with-fluids* FLUIDS VALUES THUNK
-
- FLUIDS is a list of fluids and VALUES a corresponding list of
- values for these fluids. Before THUNK gets called the values are
- installed in the fluids and the old values of the fluids are
- saved in the VALUES list. When the flow of control leaves THUNK
- or reenters it, the values get swapped again. You might think of
- this as a `safe-fluid-excursion'. Note that the VALUES list is
- modified by `with-fluids*'.
-
-Macro: with-fluids ((FLUID VALUE) ...) FORM ...
-
- The same as `with-fluids*' but with a different syntax. It looks
- just like `let', but both FLUID and VALUE are evaluated. Remember,
- fluids are not special variables but ordinary objects. FLUID
- should evaluate to a fluid.
-
-** Changes to system call interfaces:
-
-*** close-port, close-input-port and close-output-port now return a
-boolean instead of an `unspecified' object. #t means that the port
-was successfully closed, while #f means it was already closed. It is
-also now possible for these procedures to raise an exception if an
-error occurs (some errors from write can be delayed until close.)
-
-*** the first argument to chmod, fcntl, ftell and fseek can now be a
-file descriptor.
-
-*** the third argument to fcntl is now optional.
-
-*** the first argument to chown can now be a file descriptor or a port.
-
-*** the argument to stat can now be a port.
-
-*** The following new procedures have been added (most use scsh
-interfaces):
-
-*** procedure: close PORT/FD
- Similar to close-port (*note close-port: Closing Ports.), but also
- works on file descriptors. A side effect of closing a file
- descriptor is that any ports using that file descriptor are moved
- to a different file descriptor and have their revealed counts set
- to zero.
-
-*** procedure: port->fdes PORT
- Returns the integer file descriptor underlying PORT. As a side
- effect the revealed count of PORT is incremented.
-
-*** procedure: fdes->ports FDES
- Returns a list of existing ports which have FDES as an underlying
- file descriptor, without changing their revealed counts.
-
-*** procedure: fdes->inport FDES
- Returns an existing input port which has FDES as its underlying
- file descriptor, if one exists, and increments its revealed count.
- Otherwise, returns a new input port with a revealed count of 1.
-
-*** procedure: fdes->outport FDES
- Returns an existing output port which has FDES as its underlying
- file descriptor, if one exists, and increments its revealed count.
- Otherwise, returns a new output port with a revealed count of 1.
-
- The next group of procedures perform a `dup2' system call, if NEWFD
-(an integer) is supplied, otherwise a `dup'. The file descriptor to be
-duplicated can be supplied as an integer or contained in a port. The
-type of value returned varies depending on which procedure is used.
-
- All procedures also have the side effect when performing `dup2' that
-any ports using NEWFD are moved to a different file descriptor and have
-their revealed counts set to zero.
-
-*** procedure: dup->fdes PORT/FD [NEWFD]
- Returns an integer file descriptor.
-
-*** procedure: dup->inport PORT/FD [NEWFD]
- Returns a new input port using the new file descriptor.
-
-*** procedure: dup->outport PORT/FD [NEWFD]
- Returns a new output port using the new file descriptor.
-
-*** procedure: dup PORT/FD [NEWFD]
- Returns a new port if PORT/FD is a port, with the same mode as the
- supplied port, otherwise returns an integer file descriptor.
-
-*** procedure: dup->port PORT/FD MODE [NEWFD]
- Returns a new port using the new file descriptor. MODE supplies a
- mode string for the port (*note open-file: File Ports.).
-
-*** procedure: setenv NAME VALUE
- Modifies the environment of the current process, which is also the
- default environment inherited by child processes.
-
- If VALUE is `#f', then NAME is removed from the environment.
- Otherwise, the string NAME=VALUE is added to the environment,
- replacing any existing string with name matching NAME.
-
- The return value is unspecified.
-
-*** procedure: truncate-file OBJ SIZE
- Truncates the file referred to by OBJ to at most SIZE bytes. OBJ
- can be a string containing a file name or an integer file
- descriptor or port open for output on the file. The underlying
- system calls are `truncate' and `ftruncate'.
-
- The return value is unspecified.
-
-*** procedure: setvbuf PORT MODE [SIZE]
- Set the buffering mode for PORT. MODE can be:
- `_IONBF'
- non-buffered
-
- `_IOLBF'
- line buffered
-
- `_IOFBF'
- block buffered, using a newly allocated buffer of SIZE bytes.
- However if SIZE is zero or unspecified, the port will be made
- non-buffered.
-
- This procedure should not be used after I/O has been performed with
- the port.
-
- Ports are usually block buffered by default, with a default buffer
- size. Procedures e.g., *Note open-file: File Ports, which accept a
- mode string allow `0' to be added to request an unbuffered port.
-
-*** procedure: fsync PORT/FD
- Copies any unwritten data for the specified output file descriptor
- to disk. If PORT/FD is a port, its buffer is flushed before the
- underlying file descriptor is fsync'd. The return value is
- unspecified.
-
-*** procedure: open-fdes PATH FLAGS [MODES]
- Similar to `open' but returns a file descriptor instead of a port.
-
-*** procedure: execle PATH ENV [ARG] ...
- Similar to `execl', but the environment of the new process is
- specified by ENV, which must be a list of strings as returned by
- the `environ' procedure.
-
- This procedure is currently implemented using the `execve' system
- call, but we call it `execle' because of its Scheme calling
- interface.
-
-*** procedure: strerror ERRNO
- Returns the Unix error message corresponding to ERRNO, an integer.
-
-*** procedure: primitive-exit [STATUS]
- Terminate the current process without unwinding the Scheme stack.
- This is would typically be useful after a fork. The exit status
- is STATUS if supplied, otherwise zero.
-
-*** procedure: times
- Returns an object with information about real and processor time.
- The following procedures accept such an object as an argument and
- return a selected component:
-
- `tms:clock'
- The current real time, expressed as time units relative to an
- arbitrary base.
-
- `tms:utime'
- The CPU time units used by the calling process.
-
- `tms:stime'
- The CPU time units used by the system on behalf of the
- calling process.
-
- `tms:cutime'
- The CPU time units used by terminated child processes of the
- calling process, whose status has been collected (e.g., using
- `waitpid').
-
- `tms:cstime'
- Similarly, the CPU times units used by the system on behalf of
- terminated child processes.
-
-** Removed: list-length
-** Removed: list-append, list-append!
-** Removed: list-reverse, list-reverse!
-
-** array-map renamed to array-map!
-
-** serial-array-map renamed to serial-array-map!
-
-** catch doesn't take #f as first argument any longer
-
-Previously, it was possible to pass #f instead of a key to `catch'.
-That would cause `catch' to pass a jump buffer object to the procedure
-passed as second argument. The procedure could then use this jump
-buffer objekt as an argument to throw.
-
-This mechanism has been removed since its utility doesn't motivate the
-extra complexity it introduces.
-
-** The `#/' notation for lists now provokes a warning message from Guile.
-This syntax will be removed from Guile in the near future.
-
-To disable the warning message, set the GUILE_HUSH environment
-variable to any non-empty value.
-
-** The newline character now prints as `#\newline', following the
-normal Scheme notation, not `#\nl'.
-
-* Changes to the gh_ interface
-
-** The gh_enter function now takes care of loading the Guile startup files.
-gh_enter works by calling scm_boot_guile; see the remarks below.
-
-** Function: void gh_write (SCM x)
-
-Write the printed representation of the scheme object x to the current
-output port. Corresponds to the scheme level `write'.
-
-** gh_list_length renamed to gh_length.
-
-** vector handling routines
-
-Several major changes. In particular, gh_vector() now resembles
-(vector ...) (with a caveat -- see manual), and gh_make_vector() now
-exists and behaves like (make-vector ...). gh_vset() and gh_vref()
-have been renamed gh_vector_set_x() and gh_vector_ref(). Some missing
-vector-related gh_ functions have been implemented.
-
-** pair and list routines
-
-Implemented several of the R4RS pair and list functions that were
-missing.
-
-** gh_scm2doubles, gh_doubles2scm, gh_doubles2dvect
-
-New function. Converts double arrays back and forth between Scheme
-and C.
-
-* Changes to the scm_ interface
-
-** The function scm_boot_guile now takes care of loading the startup files.
-
-Guile's primary initialization function, scm_boot_guile, now takes
-care of loading `boot-9.scm', in the `ice-9' module, to initialize
-Guile, define the module system, and put together some standard
-bindings. It also loads `init.scm', which is intended to hold
-site-specific initialization code.
-
-Since Guile cannot operate properly until boot-9.scm is loaded, there
-is no reason to separate loading boot-9.scm from Guile's other
-initialization processes.
-
-This job used to be done by scm_compile_shell_switches, which didn't
-make much sense; in particular, it meant that people using Guile for
-non-shell-like applications had to jump through hoops to get Guile
-initialized properly.
-
-** The function scm_compile_shell_switches no longer loads the startup files.
-Now, Guile always loads the startup files, whenever it is initialized;
-see the notes above for scm_boot_guile and scm_load_startup_files.
-
-** Function: scm_load_startup_files
-This new function takes care of loading Guile's initialization file
-(`boot-9.scm'), and the site initialization file, `init.scm'. Since
-this is always called by the Guile initialization process, it's
-probably not too useful to call this yourself, but it's there anyway.
-
-** The semantics of smob marking have changed slightly.
-
-The smob marking function (the `mark' member of the scm_smobfuns
-structure) is no longer responsible for setting the mark bit on the
-smob. The generic smob handling code in the garbage collector will
-set this bit. The mark function need only ensure that any other
-objects the smob refers to get marked.
-
-Note that this change means that the smob's GC8MARK bit is typically
-already set upon entry to the mark function. Thus, marking functions
-which look like this:
-
- {
- if (SCM_GC8MARKP (ptr))
- return SCM_BOOL_F;
- SCM_SETGC8MARK (ptr);
- ... mark objects to which the smob refers ...
- }
-
-are now incorrect, since they will return early, and fail to mark any
-other objects the smob refers to. Some code in the Guile library used
-to work this way.
-
-** The semantics of the I/O port functions in scm_ptobfuns have changed.
-
-If you have implemented your own I/O port type, by writing the
-functions required by the scm_ptobfuns and then calling scm_newptob,
-you will need to change your functions slightly.
-
-The functions in a scm_ptobfuns structure now expect the port itself
-as their argument; they used to expect the `stream' member of the
-port's scm_port_table structure. This allows functions in an
-scm_ptobfuns structure to easily access the port's cell (and any flags
-it its CAR), and the port's scm_port_table structure.
-
-Guile now passes the I/O port itself as the `port' argument in the
-following scm_ptobfuns functions:
-
- int (*free) (SCM port);
- int (*fputc) (int, SCM port);
- int (*fputs) (char *, SCM port);
- scm_sizet (*fwrite) SCM_P ((char *ptr,
- scm_sizet size,
- scm_sizet nitems,
- SCM port));
- int (*fflush) (SCM port);
- int (*fgetc) (SCM port);
- int (*fclose) (SCM port);
-
-The interfaces to the `mark', `print', `equalp', and `fgets' methods
-are unchanged.
-
-If you have existing code which defines its own port types, it is easy
-to convert your code to the new interface; simply apply SCM_STREAM to
-the port argument to yield the value you code used to expect.
-
-Note that since both the port and the stream have the same type in the
-C code --- they are both SCM values --- the C compiler will not remind
-you if you forget to update your scm_ptobfuns functions.
-
-
-** Function: int scm_internal_select (int fds,
- SELECT_TYPE *rfds,
- SELECT_TYPE *wfds,
- SELECT_TYPE *efds,
- struct timeval *timeout);
-
-This is a replacement for the `select' function provided by the OS.
-It enables I/O blocking and sleeping to happen for one cooperative
-thread without blocking other threads. It also avoids busy-loops in
-these situations. It is intended that all I/O blocking and sleeping
-will finally go through this function. Currently, this function is
-only available on systems providing `gettimeofday' and `select'.
-
-** Function: SCM scm_internal_stack_catch (SCM tag,
- scm_catch_body_t body,
- void *body_data,
- scm_catch_handler_t handler,
- void *handler_data)
-
-A new sibling to the other two C level `catch' functions
-scm_internal_catch and scm_internal_lazy_catch. Use it if you want
-the stack to be saved automatically into the variable `the-last-stack'
-(scm_the_last_stack_var) on error. This is necessary if you want to
-use advanced error reporting, such as calling scm_display_error and
-scm_display_backtrace. (They both take a stack object as argument.)
-
-** Function: SCM scm_spawn_thread (scm_catch_body_t body,
- void *body_data,
- scm_catch_handler_t handler,
- void *handler_data)
-
-Spawns a new thread. It does a job similar to
-scm_call_with_new_thread but takes arguments more suitable when
-spawning threads from application C code.
-
-** The hook scm_error_callback has been removed. It was originally
-intended as a way for the user to install his own error handler. But
-that method works badly since it intervenes between throw and catch,
-thereby changing the semantics of expressions like (catch #t ...).
-The correct way to do it is to use one of the C level catch functions
-in throw.c: scm_internal_catch/lazy_catch/stack_catch.
-
-** Removed functions:
-
-scm_obj_length, scm_list_length, scm_list_append, scm_list_append_x,
-scm_list_reverse, scm_list_reverse_x
-
-** New macros: SCM_LISTn where n is one of the integers 0-9.
-
-These can be used for pretty list creation from C. The idea is taken
-from Erick Gallesio's STk.
-
-** scm_array_map renamed to scm_array_map_x
-
-** mbstrings are now removed
-
-This means that the type codes scm_tc7_mb_string and
-scm_tc7_mb_substring has been removed.
-
-** scm_gen_putc, scm_gen_puts, scm_gen_write, and scm_gen_getc have changed.
-
-Since we no longer support multi-byte strings, these I/O functions
-have been simplified, and renamed. Here are their old names, and
-their new names and arguments:
-
-scm_gen_putc -> void scm_putc (int c, SCM port);
-scm_gen_puts -> void scm_puts (char *s, SCM port);
-scm_gen_write -> void scm_lfwrite (char *ptr, scm_sizet size, SCM port);
-scm_gen_getc -> void scm_getc (SCM port);
-
-
-** The macros SCM_TYP7D and SCM_TYP7SD has been removed.
-
-** The macro SCM_TYP7S has taken the role of the old SCM_TYP7D
-
-SCM_TYP7S now masks away the bit which distinguishes substrings from
-strings.
-
-** scm_catch_body_t: Backward incompatible change!
-
-Body functions to scm_internal_catch and friends do not any longer
-take a second argument. This is because it is no longer possible to
-pass a #f arg to catch.
-
-** Calls to scm_protect_object and scm_unprotect now nest properly.
-
-The function scm_protect_object protects its argument from being freed
-by the garbage collector. scm_unprotect_object removes that
-protection.
-
-These functions now nest properly. That is, for every object O, there
-is a counter which scm_protect_object(O) increments and
-scm_unprotect_object(O) decrements, if the counter is greater than
-zero. Every object's counter is zero when it is first created. If an
-object's counter is greater than zero, the garbage collector will not
-reclaim its storage.
-
-This allows you to use scm_protect_object in your code without
-worrying that some other function you call will call
-scm_unprotect_object, and allow it to be freed. Assuming that the
-functions you call are well-behaved, and unprotect only those objects
-they protect, you can follow the same rule and have confidence that
-objects will be freed only at appropriate times.
-
-
-Changes in Guile 1.2 (released Tuesday, June 24 1997):
-
-* Changes to the distribution
-
-** Nightly snapshots are now available from ftp.red-bean.com.
-The old server, ftp.cyclic.com, has been relinquished to its rightful
-owner.
-
-Nightly snapshots of the Guile development sources are now available via
-anonymous FTP from ftp.red-bean.com, as /pub/guile/guile-snap.tar.gz.
-
-Via the web, that's: ftp://ftp.red-bean.com/pub/guile/guile-snap.tar.gz
-For getit, that's: ftp.red-bean.com:/pub/guile/guile-snap.tar.gz
-
-** To run Guile without installing it, the procedure has changed a bit.
-
-If you used a separate build directory to compile Guile, you'll need
-to include the build directory in SCHEME_LOAD_PATH, as well as the
-source directory. See the `INSTALL' file for examples.
-
-* Changes to the procedure for linking libguile with your programs
-
-** The standard Guile load path for Scheme code now includes
-$(datadir)/guile (usually /usr/local/share/guile). This means that
-you can install your own Scheme files there, and Guile will find them.
-(Previous versions of Guile only checked a directory whose name
-contained the Guile version number, so you had to re-install or move
-your Scheme sources each time you installed a fresh version of Guile.)
-
-The load path also includes $(datadir)/guile/site; we recommend
-putting individual Scheme files there. If you want to install a
-package with multiple source files, create a directory for them under
-$(datadir)/guile.
-
-** Guile 1.2 will now use the Rx regular expression library, if it is
-installed on your system. When you are linking libguile into your own
-programs, this means you will have to link against -lguile, -lqt (if
-you configured Guile with thread support), and -lrx.
-
-If you are using autoconf to generate configuration scripts for your
-application, the following lines should suffice to add the appropriate
-libraries to your link command:
-
-### Find Rx, quickthreads and libguile.
-AC_CHECK_LIB(rx, main)
-AC_CHECK_LIB(qt, main)
-AC_CHECK_LIB(guile, scm_shell)
-
-The Guile 1.2 distribution does not contain sources for the Rx
-library, as Guile 1.0 did. If you want to use Rx, you'll need to
-retrieve it from a GNU FTP site and install it separately.
-
-* Changes to Scheme functions and syntax
-
-** The dynamic linking features of Guile are now enabled by default.
-You can disable them by giving the `--disable-dynamic-linking' option
-to configure.
-
- (dynamic-link FILENAME)
-
- Find the object file denoted by FILENAME (a string) and link it
- into the running Guile application. When everything works out,
- return a Scheme object suitable for representing the linked object
- file. Otherwise an error is thrown. How object files are
- searched is system dependent.
-
- (dynamic-object? VAL)
-
- Determine whether VAL represents a dynamically linked object file.
-
- (dynamic-unlink DYNOBJ)
-
- Unlink the indicated object file from the application. DYNOBJ
- should be one of the values returned by `dynamic-link'.
-
- (dynamic-func FUNCTION DYNOBJ)
-
- Search the C function indicated by FUNCTION (a string or symbol)
- in DYNOBJ and return some Scheme object that can later be used
- with `dynamic-call' to actually call this function. Right now,
- these Scheme objects are formed by casting the address of the
- function to `long' and converting this number to its Scheme
- representation.
-
- (dynamic-call FUNCTION DYNOBJ)
-
- Call the C function indicated by FUNCTION and DYNOBJ. The
- function is passed no arguments and its return value is ignored.
- When FUNCTION is something returned by `dynamic-func', call that
- function and ignore DYNOBJ. When FUNCTION is a string (or symbol,
- etc.), look it up in DYNOBJ; this is equivalent to
-
- (dynamic-call (dynamic-func FUNCTION DYNOBJ) #f)
-
- Interrupts are deferred while the C function is executing (with
- SCM_DEFER_INTS/SCM_ALLOW_INTS).
-
- (dynamic-args-call FUNCTION DYNOBJ ARGS)
-
- Call the C function indicated by FUNCTION and DYNOBJ, but pass it
- some arguments and return its return value. The C function is
- expected to take two arguments and return an `int', just like
- `main':
-
- int c_func (int argc, char **argv);
-
- ARGS must be a list of strings and is converted into an array of
- `char *'. The array is passed in ARGV and its size in ARGC. The
- return value is converted to a Scheme number and returned from the
- call to `dynamic-args-call'.
-
-When dynamic linking is disabled or not supported on your system,
-the above functions throw errors, but they are still available.
-
-Here is a small example that works on GNU/Linux:
-
- (define libc-obj (dynamic-link "libc.so"))
- (dynamic-args-call 'rand libc-obj '())
-
-See the file `libguile/DYNAMIC-LINKING' for additional comments.
-
-** The #/ syntax for module names is depreciated, and will be removed
-in a future version of Guile. Instead of
-
- #/foo/bar/baz
-
-instead write
-
- (foo bar baz)
-
-The latter syntax is more consistent with existing Lisp practice.
-
-** Guile now does fancier printing of structures. Structures are the
-underlying implementation for records, which in turn are used to
-implement modules, so all of these object now print differently and in
-a more informative way.
-
-The Scheme printer will examine the builtin variable *struct-printer*
-whenever it needs to print a structure object. When this variable is
-not `#f' it is deemed to be a procedure and will be applied to the
-structure object and the output port. When *struct-printer* is `#f'
-or the procedure return `#f' the structure object will be printed in
-the boring #<struct 80458270> form.
-
-This hook is used by some routines in ice-9/boot-9.scm to implement
-type specific printing routines. Please read the comments there about
-"printing structs".
-
-One of the more specific uses of structs are records. The printing
-procedure that could be passed to MAKE-RECORD-TYPE is now actually
-called. It should behave like a *struct-printer* procedure (described
-above).
-
-** Guile now supports a new R4RS-compliant syntax for keywords. A
-token of the form #:NAME, where NAME has the same syntax as a Scheme
-symbol, is the external representation of the keyword named NAME.
-Keyword objects print using this syntax as well, so values containing
-keyword objects can be read back into Guile. When used in an
-expression, keywords are self-quoting objects.
-
-Guile suports this read syntax, and uses this print syntax, regardless
-of the current setting of the `keyword' read option. The `keyword'
-read option only controls whether Guile recognizes the `:NAME' syntax,
-which is incompatible with R4RS. (R4RS says such token represent
-symbols.)
-
-** Guile has regular expression support again. Guile 1.0 included
-functions for matching regular expressions, based on the Rx library.
-In Guile 1.1, the Guile/Rx interface was removed to simplify the
-distribution, and thus Guile had no regular expression support. Guile
-1.2 again supports the most commonly used functions, and supports all
-of SCSH's regular expression functions.
-
-If your system does not include a POSIX regular expression library,
-and you have not linked Guile with a third-party regexp library such as
-Rx, these functions will not be available. You can tell whether your
-Guile installation includes regular expression support by checking
-whether the `*features*' list includes the `regex' symbol.
-
-*** regexp functions
-
-By default, Guile supports POSIX extended regular expressions. That
-means that the characters `(', `)', `+' and `?' are special, and must
-be escaped if you wish to match the literal characters.
-
-This regular expression interface was modeled after that implemented
-by SCSH, the Scheme Shell. It is intended to be upwardly compatible
-with SCSH regular expressions.
-
-**** Function: string-match PATTERN STR [START]
- Compile the string PATTERN into a regular expression and compare
- it with STR. The optional numeric argument START specifies the
- position of STR at which to begin matching.
-
- `string-match' returns a "match structure" which describes what,
- if anything, was matched by the regular expression. *Note Match
- Structures::. If STR does not match PATTERN at all,
- `string-match' returns `#f'.
-
- Each time `string-match' is called, it must compile its PATTERN
-argument into a regular expression structure. This operation is
-expensive, which makes `string-match' inefficient if the same regular
-expression is used several times (for example, in a loop). For better
-performance, you can compile a regular expression in advance and then
-match strings against the compiled regexp.
-
-**** Function: make-regexp STR [FLAGS]
- Compile the regular expression described by STR, and return the
- compiled regexp structure. If STR does not describe a legal
- regular expression, `make-regexp' throws a
- `regular-expression-syntax' error.
-
- FLAGS may be the bitwise-or of one or more of the following:
-
-**** Constant: regexp/extended
- Use POSIX Extended Regular Expression syntax when interpreting
- STR. If not set, POSIX Basic Regular Expression syntax is used.
- If the FLAGS argument is omitted, we assume regexp/extended.
-
-**** Constant: regexp/icase
- Do not differentiate case. Subsequent searches using the
- returned regular expression will be case insensitive.
-
-**** Constant: regexp/newline
- Match-any-character operators don't match a newline.
-
- A non-matching list ([^...]) not containing a newline matches a
- newline.
-
- Match-beginning-of-line operator (^) matches the empty string
- immediately after a newline, regardless of whether the FLAGS
- passed to regexp-exec contain regexp/notbol.
-
- Match-end-of-line operator ($) matches the empty string
- immediately before a newline, regardless of whether the FLAGS
- passed to regexp-exec contain regexp/noteol.
-
-**** Function: regexp-exec REGEXP STR [START [FLAGS]]
- Match the compiled regular expression REGEXP against `str'. If
- the optional integer START argument is provided, begin matching
- from that position in the string. Return a match structure
- describing the results of the match, or `#f' if no match could be
- found.
-
- FLAGS may be the bitwise-or of one or more of the following:
-
-**** Constant: regexp/notbol
- The match-beginning-of-line operator always fails to match (but
- see the compilation flag regexp/newline above) This flag may be
- used when different portions of a string are passed to
- regexp-exec and the beginning of the string should not be
- interpreted as the beginning of the line.
-
-**** Constant: regexp/noteol
- The match-end-of-line operator always fails to match (but see the
- compilation flag regexp/newline above)
-
-**** Function: regexp? OBJ
- Return `#t' if OBJ is a compiled regular expression, or `#f'
- otherwise.
-
- Regular expressions are commonly used to find patterns in one string
-and replace them with the contents of another string.
-
-**** Function: regexp-substitute PORT MATCH [ITEM...]
- Write to the output port PORT selected contents of the match
- structure MATCH. Each ITEM specifies what should be written, and
- may be one of the following arguments:
-
- * A string. String arguments are written out verbatim.
-
- * An integer. The submatch with that number is written.
-
- * The symbol `pre'. The portion of the matched string preceding
- the regexp match is written.
-
- * The symbol `post'. The portion of the matched string
- following the regexp match is written.
-
- PORT may be `#f', in which case nothing is written; instead,
- `regexp-substitute' constructs a string from the specified ITEMs
- and returns that.
-
-**** Function: regexp-substitute/global PORT REGEXP TARGET [ITEM...]
- Similar to `regexp-substitute', but can be used to perform global
- substitutions on STR. Instead of taking a match structure as an
- argument, `regexp-substitute/global' takes two string arguments: a
- REGEXP string describing a regular expression, and a TARGET string
- which should be matched against this regular expression.
-
- Each ITEM behaves as in REGEXP-SUBSTITUTE, with the following
- exceptions:
-
- * A function may be supplied. When this function is called, it
- will be passed one argument: a match structure for a given
- regular expression match. It should return a string to be
- written out to PORT.
-
- * The `post' symbol causes `regexp-substitute/global' to recurse
- on the unmatched portion of STR. This *must* be supplied in
- order to perform global search-and-replace on STR; if it is
- not present among the ITEMs, then `regexp-substitute/global'
- will return after processing a single match.
-
-*** Match Structures
-
- A "match structure" is the object returned by `string-match' and
-`regexp-exec'. It describes which portion of a string, if any, matched
-the given regular expression. Match structures include: a reference to
-the string that was checked for matches; the starting and ending
-positions of the regexp match; and, if the regexp included any
-parenthesized subexpressions, the starting and ending positions of each
-submatch.
-
- In each of the regexp match functions described below, the `match'
-argument must be a match structure returned by a previous call to
-`string-match' or `regexp-exec'. Most of these functions return some
-information about the original target string that was matched against a
-regular expression; we will call that string TARGET for easy reference.
-
-**** Function: regexp-match? OBJ
- Return `#t' if OBJ is a match structure returned by a previous
- call to `regexp-exec', or `#f' otherwise.
-
-**** Function: match:substring MATCH [N]
- Return the portion of TARGET matched by subexpression number N.
- Submatch 0 (the default) represents the entire regexp match. If
- the regular expression as a whole matched, but the subexpression
- number N did not match, return `#f'.
-
-**** Function: match:start MATCH [N]
- Return the starting position of submatch number N.
-
-**** Function: match:end MATCH [N]
- Return the ending position of submatch number N.
-
-**** Function: match:prefix MATCH
- Return the unmatched portion of TARGET preceding the regexp match.
-
-**** Function: match:suffix MATCH
- Return the unmatched portion of TARGET following the regexp match.
-
-**** Function: match:count MATCH
- Return the number of parenthesized subexpressions from MATCH.
- Note that the entire regular expression match itself counts as a
- subexpression, and failed submatches are included in the count.
-
-**** Function: match:string MATCH
- Return the original TARGET string.
-
-*** Backslash Escapes
-
- Sometimes you will want a regexp to match characters like `*' or `$'
-exactly. For example, to check whether a particular string represents
-a menu entry from an Info node, it would be useful to match it against
-a regexp like `^* [^:]*::'. However, this won't work; because the
-asterisk is a metacharacter, it won't match the `*' at the beginning of
-the string. In this case, we want to make the first asterisk un-magic.
-
- You can do this by preceding the metacharacter with a backslash
-character `\'. (This is also called "quoting" the metacharacter, and
-is known as a "backslash escape".) When Guile sees a backslash in a
-regular expression, it considers the following glyph to be an ordinary
-character, no matter what special meaning it would ordinarily have.
-Therefore, we can make the above example work by changing the regexp to
-`^\* [^:]*::'. The `\*' sequence tells the regular expression engine
-to match only a single asterisk in the target string.
-
- Since the backslash is itself a metacharacter, you may force a
-regexp to match a backslash in the target string by preceding the
-backslash with itself. For example, to find variable references in a
-TeX program, you might want to find occurrences of the string `\let\'
-followed by any number of alphabetic characters. The regular expression
-`\\let\\[A-Za-z]*' would do this: the double backslashes in the regexp
-each match a single backslash in the target string.
-
-**** Function: regexp-quote STR
- Quote each special character found in STR with a backslash, and
- return the resulting string.
-
- *Very important:* Using backslash escapes in Guile source code (as
-in Emacs Lisp or C) can be tricky, because the backslash character has
-special meaning for the Guile reader. For example, if Guile encounters
-the character sequence `\n' in the middle of a string while processing
-Scheme code, it replaces those characters with a newline character.
-Similarly, the character sequence `\t' is replaced by a horizontal tab.
-Several of these "escape sequences" are processed by the Guile reader
-before your code is executed. Unrecognized escape sequences are
-ignored: if the characters `\*' appear in a string, they will be
-translated to the single character `*'.
-
- This translation is obviously undesirable for regular expressions,
-since we want to be able to include backslashes in a string in order to
-escape regexp metacharacters. Therefore, to make sure that a backslash
-is preserved in a string in your Guile program, you must use *two*
-consecutive backslashes:
-
- (define Info-menu-entry-pattern (make-regexp "^\\* [^:]*"))
-
- The string in this example is preprocessed by the Guile reader before
-any code is executed. The resulting argument to `make-regexp' is the
-string `^\* [^:]*', which is what we really want.
-
- This also means that in order to write a regular expression that
-matches a single backslash character, the regular expression string in
-the source code must include *four* backslashes. Each consecutive pair
-of backslashes gets translated by the Guile reader to a single
-backslash, and the resulting double-backslash is interpreted by the
-regexp engine as matching a single backslash character. Hence:
-
- (define tex-variable-pattern (make-regexp "\\\\let\\\\=[A-Za-z]*"))
-
- The reason for the unwieldiness of this syntax is historical. Both
-regular expression pattern matchers and Unix string processing systems
-have traditionally used backslashes with the special meanings described
-above. The POSIX regular expression specification and ANSI C standard
-both require these semantics. Attempting to abandon either convention
-would cause other kinds of compatibility problems, possibly more severe
-ones. Therefore, without extending the Scheme reader to support
-strings with different quoting conventions (an ungainly and confusing
-extension when implemented in other languages), we must adhere to this
-cumbersome escape syntax.
-
-* Changes to the gh_ interface
-
-* Changes to the scm_ interface
-
-* Changes to system call interfaces:
-
-** The value returned by `raise' is now unspecified. It throws an exception
-if an error occurs.
-
-*** A new procedure `sigaction' can be used to install signal handlers
-
-(sigaction signum [action] [flags])
-
-signum is the signal number, which can be specified using the value
-of SIGINT etc.
-
-If action is omitted, sigaction returns a pair: the CAR is the current
-signal hander, which will be either an integer with the value SIG_DFL
-(default action) or SIG_IGN (ignore), or the Scheme procedure which
-handles the signal, or #f if a non-Scheme procedure handles the
-signal. The CDR contains the current sigaction flags for the handler.
-
-If action is provided, it is installed as the new handler for signum.
-action can be a Scheme procedure taking one argument, or the value of
-SIG_DFL (default action) or SIG_IGN (ignore), or #f to restore
-whatever signal handler was installed before sigaction was first used.
-Flags can optionally be specified for the new handler (SA_RESTART is
-always used if the system provides it, so need not be specified.) The
-return value is a pair with information about the old handler as
-described above.
-
-This interface does not provide access to the "signal blocking"
-facility. Maybe this is not needed, since the thread support may
-provide solutions to the problem of consistent access to data
-structures.
-
-*** A new procedure `flush-all-ports' is equivalent to running
-`force-output' on every port open for output.
-
-** Guile now provides information on how it was built, via the new
-global variable, %guile-build-info. This variable records the values
-of the standard GNU makefile directory variables as an assocation
-list, mapping variable names (symbols) onto directory paths (strings).
-For example, to find out where the Guile link libraries were
-installed, you can say:
-
-guile -c "(display (assq-ref %guile-build-info 'libdir)) (newline)"
-
-
-* Changes to the scm_ interface
-
-** The new function scm_handle_by_message_noexit is just like the
-existing scm_handle_by_message function, except that it doesn't call
-exit to terminate the process. Instead, it prints a message and just
-returns #f. This might be a more appropriate catch-all handler for
-new dynamic roots and threads.
-
-
-Changes in Guile 1.1 (released Friday, May 16 1997):
-
-* Changes to the distribution.
-
-The Guile 1.0 distribution has been split up into several smaller
-pieces:
-guile-core --- the Guile interpreter itself.
-guile-tcltk --- the interface between the Guile interpreter and
- Tcl/Tk; Tcl is an interpreter for a stringy language, and Tk
- is a toolkit for building graphical user interfaces.
-guile-rgx-ctax --- the interface between Guile and the Rx regular
- expression matcher, and the translator for the Ctax
- programming language. These are packaged together because the
- Ctax translator uses Rx to parse Ctax source code.
-
-This NEWS file describes the changes made to guile-core since the 1.0
-release.
-
-We no longer distribute the documentation, since it was either out of
-date, or incomplete. As soon as we have current documentation, we
-will distribute it.
-
-
-
-* Changes to the stand-alone interpreter
-
-** guile now accepts command-line arguments compatible with SCSH, Olin
-Shivers' Scheme Shell.
-
-In general, arguments are evaluated from left to right, but there are
-exceptions. The following switches stop argument processing, and
-stash all remaining command-line arguments as the value returned by
-the (command-line) function.
- -s SCRIPT load Scheme source code from FILE, and exit
- -c EXPR evalute Scheme expression EXPR, and exit
- -- stop scanning arguments; run interactively
-
-The switches below are processed as they are encountered.
- -l FILE load Scheme source code from FILE
- -e FUNCTION after reading script, apply FUNCTION to
- command line arguments
- -ds do -s script at this point
- --emacs enable Emacs protocol (experimental)
- -h, --help display this help and exit
- -v, --version display version information and exit
- \ read arguments from following script lines
-
-So, for example, here is a Guile script named `ekko' (thanks, Olin)
-which re-implements the traditional "echo" command:
-
-#!/usr/local/bin/guile -s
-!#
-(define (main args)
- (map (lambda (arg) (display arg) (display " "))
- (cdr args))
- (newline))
-
-(main (command-line))
-
-Suppose we invoke this script as follows:
-
- ekko a speckled gecko
-
-Through the magic of Unix script processing (triggered by the `#!'
-token at the top of the file), /usr/local/bin/guile receives the
-following list of command-line arguments:
-
- ("-s" "./ekko" "a" "speckled" "gecko")
-
-Unix inserts the name of the script after the argument specified on
-the first line of the file (in this case, "-s"), and then follows that
-with the arguments given to the script. Guile loads the script, which
-defines the `main' function, and then applies it to the list of
-remaining command-line arguments, ("a" "speckled" "gecko").
-
-In Unix, the first line of a script file must take the following form:
-
-#!INTERPRETER ARGUMENT
-
-where INTERPRETER is the absolute filename of the interpreter
-executable, and ARGUMENT is a single command-line argument to pass to
-the interpreter.
-
-You may only pass one argument to the interpreter, and its length is
-limited. These restrictions can be annoying to work around, so Guile
-provides a general mechanism (borrowed from, and compatible with,
-SCSH) for circumventing them.
-
-If the ARGUMENT in a Guile script is a single backslash character,
-`\', Guile will open the script file, parse arguments from its second
-and subsequent lines, and replace the `\' with them. So, for example,
-here is another implementation of the `ekko' script:
-
-#!/usr/local/bin/guile \
--e main -s
-!#
-(define (main args)
- (for-each (lambda (arg) (display arg) (display " "))
- (cdr args))
- (newline))
-
-If the user invokes this script as follows:
-
- ekko a speckled gecko
-
-Unix expands this into
-
- /usr/local/bin/guile \ ekko a speckled gecko
-
-When Guile sees the `\' argument, it replaces it with the arguments
-read from the second line of the script, producing:
-
- /usr/local/bin/guile -e main -s ekko a speckled gecko
-
-This tells Guile to load the `ekko' script, and apply the function
-`main' to the argument list ("a" "speckled" "gecko").
-
-Here is how Guile parses the command-line arguments:
-- Each space character terminates an argument. This means that two
- spaces in a row introduce an empty-string argument.
-- The tab character is not permitted (unless you quote it with the
- backslash character, as described below), to avoid confusion.
-- The newline character terminates the sequence of arguments, and will
- also terminate a final non-empty argument. (However, a newline
- following a space will not introduce a final empty-string argument;
- it only terminates the argument list.)
-- The backslash character is the escape character. It escapes
- backslash, space, tab, and newline. The ANSI C escape sequences
- like \n and \t are also supported. These produce argument
- constituents; the two-character combination \n doesn't act like a
- terminating newline. The escape sequence \NNN for exactly three
- octal digits reads as the character whose ASCII code is NNN. As
- above, characters produced this way are argument constituents.
- Backslash followed by other characters is not allowed.
-
-* Changes to the procedure for linking libguile with your programs
-
-** Guile now builds and installs a shared guile library, if your
-system support shared libraries. (It still builds a static library on
-all systems.) Guile automatically detects whether your system
-supports shared libraries. To prevent Guile from buildisg shared
-libraries, pass the `--disable-shared' flag to the configure script.
-
-Guile takes longer to compile when it builds shared libraries, because
-it must compile every file twice --- once to produce position-
-independent object code, and once to produce normal object code.
-
-** The libthreads library has been merged into libguile.
-
-To link a program against Guile, you now need only link against
--lguile and -lqt; -lthreads is no longer needed. If you are using
-autoconf to generate configuration scripts for your application, the
-following lines should suffice to add the appropriate libraries to
-your link command:
-
-### Find quickthreads and libguile.
-AC_CHECK_LIB(qt, main)
-AC_CHECK_LIB(guile, scm_shell)
-
-* Changes to Scheme functions
-
-** Guile Scheme's special syntax for keyword objects is now optional,
-and disabled by default.
-
-The syntax variation from R4RS made it difficult to port some
-interesting packages to Guile. The routines which accepted keyword
-arguments (mostly in the module system) have been modified to also
-accept symbols whose names begin with `:'.
-
-To change the keyword syntax, you must first import the (ice-9 debug)
-module:
- (use-modules (ice-9 debug))
-
-Then you can enable the keyword syntax as follows:
- (read-set! keywords 'prefix)
-
-To disable keyword syntax, do this:
- (read-set! keywords #f)
-
-** Many more primitive functions accept shared substrings as
-arguments. In the past, these functions required normal, mutable
-strings as arguments, although they never made use of this
-restriction.
-
-** The uniform array functions now operate on byte vectors. These
-functions are `array-fill!', `serial-array-copy!', `array-copy!',
-`serial-array-map', `array-map', `array-for-each', and
-`array-index-map!'.
-
-** The new functions `trace' and `untrace' implement simple debugging
-support for Scheme functions.
-
-The `trace' function accepts any number of procedures as arguments,
-and tells the Guile interpreter to display each procedure's name and
-arguments each time the procedure is invoked. When invoked with no
-arguments, `trace' returns the list of procedures currently being
-traced.
-
-The `untrace' function accepts any number of procedures as arguments,
-and tells the Guile interpreter not to trace them any more. When
-invoked with no arguments, `untrace' untraces all curretly traced
-procedures.
-
-The tracing in Guile has an advantage over most other systems: we
-don't create new procedure objects, but mark the procedure objects
-themselves. This means that anonymous and internal procedures can be
-traced.
-
-** The function `assert-repl-prompt' has been renamed to
-`set-repl-prompt!'. It takes one argument, PROMPT.
-- If PROMPT is #f, the Guile read-eval-print loop will not prompt.
-- If PROMPT is a string, we use it as a prompt.
-- If PROMPT is a procedure accepting no arguments, we call it, and
- display the result as a prompt.
-- Otherwise, we display "> ".
-
-** The new function `eval-string' reads Scheme expressions from a
-string and evaluates them, returning the value of the last expression
-in the string. If the string contains no expressions, it returns an
-unspecified value.
-
-** The new function `thunk?' returns true iff its argument is a
-procedure of zero arguments.
-
-** `defined?' is now a builtin function, instead of syntax. This
-means that its argument should be quoted. It returns #t iff its
-argument is bound in the current module.
-
-** The new syntax `use-modules' allows you to add new modules to your
-environment without re-typing a complete `define-module' form. It
-accepts any number of module names as arguments, and imports their
-public bindings into the current module.
-
-** The new function (module-defined? NAME MODULE) returns true iff
-NAME, a symbol, is defined in MODULE, a module object.
-
-** The new function `builtin-bindings' creates and returns a hash
-table containing copies of all the root module's bindings.
-
-** The new function `builtin-weak-bindings' does the same as
-`builtin-bindings', but creates a doubly-weak hash table.
-
-** The `equal?' function now considers variable objects to be
-equivalent if they have the same name and the same value.
-
-** The new function `command-line' returns the command-line arguments
-given to Guile, as a list of strings.
-
-When using guile as a script interpreter, `command-line' returns the
-script's arguments; those processed by the interpreter (like `-s' or
-`-c') are omitted. (In other words, you get the normal, expected
-behavior.) Any application that uses scm_shell to process its
-command-line arguments gets this behavior as well.
-
-** The new function `load-user-init' looks for a file called `.guile'
-in the user's home directory, and loads it if it exists. This is
-mostly for use by the code generated by scm_compile_shell_switches,
-but we thought it might also be useful in other circumstances.
-
-** The new function `log10' returns the base-10 logarithm of its
-argument.
-
-** Changes to I/O functions
-
-*** The functions `read', `primitive-load', `read-and-eval!', and
-`primitive-load-path' no longer take optional arguments controlling
-case insensitivity and a `#' parser.
-
-Case sensitivity is now controlled by a read option called
-`case-insensitive'. The user can add new `#' syntaxes with the
-`read-hash-extend' function (see below).
-
-*** The new function `read-hash-extend' allows the user to change the
-syntax of Guile Scheme in a somewhat controlled way.
-
-(read-hash-extend CHAR PROC)
- When parsing S-expressions, if we read a `#' character followed by
- the character CHAR, use PROC to parse an object from the stream.
- If PROC is #f, remove any parsing procedure registered for CHAR.
-
- The reader applies PROC to two arguments: CHAR and an input port.
-
-*** The new functions read-delimited and read-delimited! provide a
-general mechanism for doing delimited input on streams.
-
-(read-delimited DELIMS [PORT HANDLE-DELIM])
- Read until we encounter one of the characters in DELIMS (a string),
- or end-of-file. PORT is the input port to read from; it defaults to
- the current input port. The HANDLE-DELIM parameter determines how
- the terminating character is handled; it should be one of the
- following symbols:
-
- 'trim omit delimiter from result
- 'peek leave delimiter character in input stream
- 'concat append delimiter character to returned value
- 'split return a pair: (RESULT . TERMINATOR)
-
- HANDLE-DELIM defaults to 'peek.
-
-(read-delimited! DELIMS BUF [PORT HANDLE-DELIM START END])
- A side-effecting variant of `read-delimited'.
-
- The data is written into the string BUF at the indices in the
- half-open interval [START, END); the default interval is the whole
- string: START = 0 and END = (string-length BUF). The values of
- START and END must specify a well-defined interval in BUF, i.e.
- 0 <= START <= END <= (string-length BUF).
-
- It returns NBYTES, the number of bytes read. If the buffer filled
- up without a delimiter character being found, it returns #f. If the
- port is at EOF when the read starts, it returns the EOF object.
-
- If an integer is returned (i.e., the read is successfully terminated
- by reading a delimiter character), then the HANDLE-DELIM parameter
- determines how to handle the terminating character. It is described
- above, and defaults to 'peek.
-
-(The descriptions of these functions were borrowed from the SCSH
-manual, by Olin Shivers and Brian Carlstrom.)
-
-*** The `%read-delimited!' function is the primitive used to implement
-`read-delimited' and `read-delimited!'.
-
-(%read-delimited! DELIMS BUF GOBBLE? [PORT START END])
-
-This returns a pair of values: (TERMINATOR . NUM-READ).
-- TERMINATOR describes why the read was terminated. If it is a
- character or the eof object, then that is the value that terminated
- the read. If it is #f, the function filled the buffer without finding
- a delimiting character.
-- NUM-READ is the number of characters read into BUF.
-
-If the read is successfully terminated by reading a delimiter
-character, then the gobble? parameter determines what to do with the
-terminating character. If true, the character is removed from the
-input stream; if false, the character is left in the input stream
-where a subsequent read operation will retrieve it. In either case,
-the character is also the first value returned by the procedure call.
-
-(The descriptions of this function was borrowed from the SCSH manual,
-by Olin Shivers and Brian Carlstrom.)
-
-*** The `read-line' and `read-line!' functions have changed; they now
-trim the terminator by default; previously they appended it to the
-returned string. For the old behavior, use (read-line PORT 'concat).
-
-*** The functions `uniform-array-read!' and `uniform-array-write!' now
-take new optional START and END arguments, specifying the region of
-the array to read and write.
-
-*** The `ungetc-char-ready?' function has been removed. We feel it's
-inappropriate for an interface to expose implementation details this
-way.
-
-** Changes to the Unix library and system call interface
-
-*** The new fcntl function provides access to the Unix `fcntl' system
-call.
-
-(fcntl PORT COMMAND VALUE)
- Apply COMMAND to PORT's file descriptor, with VALUE as an argument.
- Values for COMMAND are:
-
- F_DUPFD duplicate a file descriptor
- F_GETFD read the descriptor's close-on-exec flag
- F_SETFD set the descriptor's close-on-exec flag to VALUE
- F_GETFL read the descriptor's flags, as set on open
- F_SETFL set the descriptor's flags, as set on open to VALUE
- F_GETOWN return the process ID of a socket's owner, for SIGIO
- F_SETOWN set the process that owns a socket to VALUE, for SIGIO
- FD_CLOEXEC not sure what this is
-
-For details, see the documentation for the fcntl system call.
-
-*** The arguments to `select' have changed, for compatibility with
-SCSH. The TIMEOUT parameter may now be non-integral, yielding the
-expected behavior. The MILLISECONDS parameter has been changed to
-MICROSECONDS, to more closely resemble the underlying system call.
-The RVEC, WVEC, and EVEC arguments can now be vectors; the type of the
-corresponding return set will be the same.
-
-*** The arguments to the `mknod' system call have changed. They are
-now:
-
-(mknod PATH TYPE PERMS DEV)
- Create a new file (`node') in the file system. PATH is the name of
- the file to create. TYPE is the kind of file to create; it should
- be 'fifo, 'block-special, or 'char-special. PERMS specifies the
- permission bits to give the newly created file. If TYPE is
- 'block-special or 'char-special, DEV specifies which device the
- special file refers to; its interpretation depends on the kind of
- special file being created.
-
-*** The `fork' function has been renamed to `primitive-fork', to avoid
-clashing with various SCSH forks.
-
-*** The `recv' and `recvfrom' functions have been renamed to `recv!'
-and `recvfrom!'. They no longer accept a size for a second argument;
-you must pass a string to hold the received value. They no longer
-return the buffer. Instead, `recv' returns the length of the message
-received, and `recvfrom' returns a pair containing the packet's length
-and originating address.
-
-*** The file descriptor datatype has been removed, as have the
-`read-fd', `write-fd', `close', `lseek', and `dup' functions.
-We plan to replace these functions with a SCSH-compatible interface.
-
-*** The `create' function has been removed; it's just a special case
-of `open'.
-
-*** There are new functions to break down process termination status
-values. In the descriptions below, STATUS is a value returned by
-`waitpid'.
-
-(status:exit-val STATUS)
- If the child process exited normally, this function returns the exit
- code for the child process (i.e., the value passed to exit, or
- returned from main). If the child process did not exit normally,
- this function returns #f.
-
-(status:stop-sig STATUS)
- If the child process was suspended by a signal, this function
- returns the signal that suspended the child. Otherwise, it returns
- #f.
-
-(status:term-sig STATUS)
- If the child process terminated abnormally, this function returns
- the signal that terminated the child. Otherwise, this function
- returns false.
-
-POSIX promises that exactly one of these functions will return true on
-a valid STATUS value.
-
-These functions are compatible with SCSH.
-
-*** There are new accessors and setters for the broken-out time vectors
-returned by `localtime', `gmtime', and that ilk. They are:
-
- Component Accessor Setter
- ========================= ============ ============
- seconds tm:sec set-tm:sec
- minutes tm:min set-tm:min
- hours tm:hour set-tm:hour
- day of the month tm:mday set-tm:mday
- month tm:mon set-tm:mon
- year tm:year set-tm:year
- day of the week tm:wday set-tm:wday
- day in the year tm:yday set-tm:yday
- daylight saving time tm:isdst set-tm:isdst
- GMT offset, seconds tm:gmtoff set-tm:gmtoff
- name of time zone tm:zone set-tm:zone
-
-*** There are new accessors for the vectors returned by `uname',
-describing the host system:
-
- Component Accessor
- ============================================== ================
- name of the operating system implementation utsname:sysname
- network name of this machine utsname:nodename
- release level of the operating system utsname:release
- version level of the operating system utsname:version
- machine hardware platform utsname:machine
-
-*** There are new accessors for the vectors returned by `getpw',
-`getpwnam', `getpwuid', and `getpwent', describing entries from the
-system's user database:
-
- Component Accessor
- ====================== =================
- user name passwd:name
- user password passwd:passwd
- user id passwd:uid
- group id passwd:gid
- real name passwd:gecos
- home directory passwd:dir
- shell program passwd:shell
-
-*** There are new accessors for the vectors returned by `getgr',
-`getgrnam', `getgrgid', and `getgrent', describing entries from the
-system's group database:
-
- Component Accessor
- ======================= ============
- group name group:name
- group password group:passwd
- group id group:gid
- group members group:mem
-
-*** There are new accessors for the vectors returned by `gethost',
-`gethostbyaddr', `gethostbyname', and `gethostent', describing
-internet hosts:
-
- Component Accessor
- ========================= ===============
- official name of host hostent:name
- alias list hostent:aliases
- host address type hostent:addrtype
- length of address hostent:length
- list of addresses hostent:addr-list
-
-*** There are new accessors for the vectors returned by `getnet',
-`getnetbyaddr', `getnetbyname', and `getnetent', describing internet
-networks:
-
- Component Accessor
- ========================= ===============
- official name of net netent:name
- alias list netent:aliases
- net number type netent:addrtype
- net number netent:net
-
-*** There are new accessors for the vectors returned by `getproto',
-`getprotobyname', `getprotobynumber', and `getprotoent', describing
-internet protocols:
-
- Component Accessor
- ========================= ===============
- official protocol name protoent:name
- alias list protoent:aliases
- protocol number protoent:proto
-
-*** There are new accessors for the vectors returned by `getserv',
-`getservbyname', `getservbyport', and `getservent', describing
-internet protocols:
-
- Component Accessor
- ========================= ===============
- official service name servent:name
- alias list servent:aliases
- port number servent:port
- protocol to use servent:proto
-
-*** There are new accessors for the sockaddr structures returned by
-`accept', `getsockname', `getpeername', `recvfrom!':
-
- Component Accessor
- ======================================== ===============
- address format (`family') sockaddr:fam
- path, for file domain addresses sockaddr:path
- address, for internet domain addresses sockaddr:addr
- TCP or UDP port, for internet sockaddr:port
-
-*** The `getpwent', `getgrent', `gethostent', `getnetent',
-`getprotoent', and `getservent' functions now return #f at the end of
-the user database. (They used to throw an exception.)
-
-Note that calling MUMBLEent function is equivalent to calling the
-corresponding MUMBLE function with no arguments.
-
-*** The `setpwent', `setgrent', `sethostent', `setnetent',
-`setprotoent', and `setservent' routines now take no arguments.
-
-*** The `gethost', `getproto', `getnet', and `getserv' functions now
-provide more useful information when they throw an exception.
-
-*** The `lnaof' function has been renamed to `inet-lnaof'.
-
-*** Guile now claims to have the `current-time' feature.
-
-*** The `mktime' function now takes an optional second argument ZONE,
-giving the time zone to use for the conversion. ZONE should be a
-string, in the same format as expected for the "TZ" environment variable.
-
-*** The `strptime' function now returns a pair (TIME . COUNT), where
-TIME is the parsed time as a vector, and COUNT is the number of
-characters from the string left unparsed. This function used to
-return the remaining characters as a string.
-
-*** The `gettimeofday' function has replaced the old `time+ticks' function.
-The return value is now (SECONDS . MICROSECONDS); the fractional
-component is no longer expressed in "ticks".
-
-*** The `ticks/sec' constant has been removed, in light of the above change.
-
-* Changes to the gh_ interface
-
-** gh_eval_str() now returns an SCM object which is the result of the
-evaluation
-
-** gh_scm2str() now copies the Scheme data to a caller-provided C
-array
-
-** gh_scm2newstr() now makes a C array, copies the Scheme data to it,
-and returns the array
-
-** gh_scm2str0() is gone: there is no need to distinguish
-null-terminated from non-null-terminated, since gh_scm2newstr() allows
-the user to interpret the data both ways.
-
-* Changes to the scm_ interface
-
-** The new function scm_symbol_value0 provides an easy way to get a
-symbol's value from C code:
-
-SCM scm_symbol_value0 (char *NAME)
- Return the value of the symbol named by the null-terminated string
- NAME in the current module. If the symbol named NAME is unbound in
- the current module, return SCM_UNDEFINED.
-
-** The new function scm_sysintern0 creates new top-level variables,
-without assigning them a value.
-
-SCM scm_sysintern0 (char *NAME)
- Create a new Scheme top-level variable named NAME. NAME is a
- null-terminated string. Return the variable's value cell.
-
-** The function scm_internal_catch is the guts of catch. It handles
-all the mechanics of setting up a catch target, invoking the catch
-body, and perhaps invoking the handler if the body does a throw.
-
-The function is designed to be usable from C code, but is general
-enough to implement all the semantics Guile Scheme expects from throw.
-
-TAG is the catch tag. Typically, this is a symbol, but this function
-doesn't actually care about that.
-
-BODY is a pointer to a C function which runs the body of the catch;
-this is the code you can throw from. We call it like this:
- BODY (BODY_DATA, JMPBUF)
-where:
- BODY_DATA is just the BODY_DATA argument we received; we pass it
- through to BODY as its first argument. The caller can make
- BODY_DATA point to anything useful that BODY might need.
- JMPBUF is the Scheme jmpbuf object corresponding to this catch,
- which we have just created and initialized.
-
-HANDLER is a pointer to a C function to deal with a throw to TAG,
-should one occur. We call it like this:
- HANDLER (HANDLER_DATA, THROWN_TAG, THROW_ARGS)
-where
- HANDLER_DATA is the HANDLER_DATA argument we recevied; it's the
- same idea as BODY_DATA above.
- THROWN_TAG is the tag that the user threw to; usually this is
- TAG, but it could be something else if TAG was #t (i.e., a
- catch-all), or the user threw to a jmpbuf.
- THROW_ARGS is the list of arguments the user passed to the THROW
- function.
-
-BODY_DATA is just a pointer we pass through to BODY. HANDLER_DATA
-is just a pointer we pass through to HANDLER. We don't actually
-use either of those pointers otherwise ourselves. The idea is
-that, if our caller wants to communicate something to BODY or
-HANDLER, it can pass a pointer to it as MUMBLE_DATA, which BODY and
-HANDLER can then use. Think of it as a way to make BODY and
-HANDLER closures, not just functions; MUMBLE_DATA points to the
-enclosed variables.
-
-Of course, it's up to the caller to make sure that any data a
-MUMBLE_DATA needs is protected from GC. A common way to do this is
-to make MUMBLE_DATA a pointer to data stored in an automatic
-structure variable; since the collector must scan the stack for
-references anyway, this assures that any references in MUMBLE_DATA
-will be found.
-
-** The new function scm_internal_lazy_catch is exactly like
-scm_internal_catch, except:
-
-- It does not unwind the stack (this is the major difference).
-- If handler returns, its value is returned from the throw.
-- BODY always receives #f as its JMPBUF argument (since there's no
- jmpbuf associated with a lazy catch, because we don't unwind the
- stack.)
-
-** scm_body_thunk is a new body function you can pass to
-scm_internal_catch if you want the body to be like Scheme's `catch'
---- a thunk, or a function of one argument if the tag is #f.
-
-BODY_DATA is a pointer to a scm_body_thunk_data structure, which
-contains the Scheme procedure to invoke as the body, and the tag
-we're catching. If the tag is #f, then we pass JMPBUF (created by
-scm_internal_catch) to the body procedure; otherwise, the body gets
-no arguments.
-
-** scm_handle_by_proc is a new handler function you can pass to
-scm_internal_catch if you want the handler to act like Scheme's catch
---- call a procedure with the tag and the throw arguments.
-
-If the user does a throw to this catch, this function runs a handler
-procedure written in Scheme. HANDLER_DATA is a pointer to an SCM
-variable holding the Scheme procedure object to invoke. It ought to
-be a pointer to an automatic variable (i.e., one living on the stack),
-or the procedure object should be otherwise protected from GC.
-
-** scm_handle_by_message is a new handler function to use with
-`scm_internal_catch' if you want Guile to print a message and die.
-It's useful for dealing with throws to uncaught keys at the top level.
-
-HANDLER_DATA, if non-zero, is assumed to be a char * pointing to a
-message header to print; if zero, we use "guile" instead. That
-text is followed by a colon, then the message described by ARGS.
-
-** The return type of scm_boot_guile is now void; the function does
-not return a value, and indeed, never returns at all.
-
-** The new function scm_shell makes it easy for user applications to
-process command-line arguments in a way that is compatible with the
-stand-alone guile interpreter (which is in turn compatible with SCSH,
-the Scheme shell).
-
-To use the scm_shell function, first initialize any guile modules
-linked into your application, and then call scm_shell with the values
-of ARGC and ARGV your `main' function received. scm_shell will add
-any SCSH-style meta-arguments from the top of the script file to the
-argument vector, and then process the command-line arguments. This
-generally means loading a script file or starting up an interactive
-command interpreter. For details, see "Changes to the stand-alone
-interpreter" above.
-
-** The new functions scm_get_meta_args and scm_count_argv help you
-implement the SCSH-style meta-argument, `\'.
-
-char **scm_get_meta_args (int ARGC, char **ARGV)
- If the second element of ARGV is a string consisting of a single
- backslash character (i.e. "\\" in Scheme notation), open the file
- named by the following argument, parse arguments from it, and return
- the spliced command line. The returned array is terminated by a
- null pointer.
-
- For details of argument parsing, see above, under "guile now accepts
- command-line arguments compatible with SCSH..."
-
-int scm_count_argv (char **ARGV)
- Count the arguments in ARGV, assuming it is terminated by a null
- pointer.
-
-For an example of how these functions might be used, see the source
-code for the function scm_shell in libguile/script.c.
-
-You will usually want to use scm_shell instead of calling this
-function yourself.
-
-** The new function scm_compile_shell_switches turns an array of
-command-line arguments into Scheme code to carry out the actions they
-describe. Given ARGC and ARGV, it returns a Scheme expression to
-evaluate, and calls scm_set_program_arguments to make any remaining
-command-line arguments available to the Scheme code. For example,
-given the following arguments:
-
- -e main -s ekko a speckled gecko
-
-scm_set_program_arguments will return the following expression:
-
- (begin (load "ekko") (main (command-line)) (quit))
-
-You will usually want to use scm_shell instead of calling this
-function yourself.
-
-** The function scm_shell_usage prints a usage message appropriate for
-an interpreter that uses scm_compile_shell_switches to handle its
-command-line arguments.
-
-void scm_shell_usage (int FATAL, char *MESSAGE)
- Print a usage message to the standard error output. If MESSAGE is
- non-zero, write it before the usage message, followed by a newline.
- If FATAL is non-zero, exit the process, using FATAL as the
- termination status. (If you want to be compatible with Guile,
- always use 1 as the exit status when terminating due to command-line
- usage problems.)
-
-You will usually want to use scm_shell instead of calling this
-function yourself.
-
-** scm_eval_0str now returns SCM_UNSPECIFIED if the string contains no
-expressions. It used to return SCM_EOL. Earth-shattering.
-
-** The macros for declaring scheme objects in C code have been
-rearranged slightly. They are now:
-
-SCM_SYMBOL (C_NAME, SCHEME_NAME)
- Declare a static SCM variable named C_NAME, and initialize it to
- point to the Scheme symbol whose name is SCHEME_NAME. C_NAME should
- be a C identifier, and SCHEME_NAME should be a C string.
-
-SCM_GLOBAL_SYMBOL (C_NAME, SCHEME_NAME)
- Just like SCM_SYMBOL, but make C_NAME globally visible.
-
-SCM_VCELL (C_NAME, SCHEME_NAME)
- Create a global variable at the Scheme level named SCHEME_NAME.
- Declare a static SCM variable named C_NAME, and initialize it to
- point to the Scheme variable's value cell.
-
-SCM_GLOBAL_VCELL (C_NAME, SCHEME_NAME)
- Just like SCM_VCELL, but make C_NAME globally visible.
-
-The `guile-snarf' script writes initialization code for these macros
-to its standard output, given C source code as input.
-
-The SCM_GLOBAL macro is gone.
-
-** The scm_read_line and scm_read_line_x functions have been replaced
-by Scheme code based on the %read-delimited! procedure (known to C
-code as scm_read_delimited_x). See its description above for more
-information.
-
-** The function scm_sys_open has been renamed to scm_open. It now
-returns a port instead of an FD object.
-
-* The dynamic linking support has changed. For more information, see
-libguile/DYNAMIC-LINKING.
-
-
-Guile 1.0b3
-
-User-visible changes from Thursday, September 5, 1996 until Guile 1.0
-(Sun 5 Jan 1997):
-
-* Changes to the 'guile' program:
-
-** Guile now loads some new files when it starts up. Guile first
-searches the load path for init.scm, and loads it if found. Then, if
-Guile is not being used to execute a script, and the user's home
-directory contains a file named `.guile', Guile loads that.
-
-** You can now use Guile as a shell script interpreter.
-
-To paraphrase the SCSH manual:
-
- When Unix tries to execute an executable file whose first two
- characters are the `#!', it treats the file not as machine code to
- be directly executed by the native processor, but as source code
- to be executed by some interpreter. The interpreter to use is
- specified immediately after the #! sequence on the first line of
- the source file. The kernel reads in the name of the interpreter,
- and executes that instead. It passes the interpreter the source
- filename as its first argument, with the original arguments
- following. Consult the Unix man page for the `exec' system call
- for more information.
-
-Now you can use Guile as an interpreter, using a mechanism which is a
-compatible subset of that provided by SCSH.
-
-Guile now recognizes a '-s' command line switch, whose argument is the
-name of a file of Scheme code to load. It also treats the two
-characters `#!' as the start of a comment, terminated by `!#'. Thus,
-to make a file of Scheme code directly executable by Unix, insert the
-following two lines at the top of the file:
-
-#!/usr/local/bin/guile -s
-!#
-
-Guile treats the argument of the `-s' command-line switch as the name
-of a file of Scheme code to load, and treats the sequence `#!' as the
-start of a block comment, terminated by `!#'.
-
-For example, here's a version of 'echo' written in Scheme:
-
-#!/usr/local/bin/guile -s
-!#
-(let loop ((args (cdr (program-arguments))))
- (if (pair? args)
- (begin
- (display (car args))
- (if (pair? (cdr args))
- (display " "))
- (loop (cdr args)))))
-(newline)
-
-Why does `#!' start a block comment terminated by `!#', instead of the
-end of the line? That is the notation SCSH uses, and although we
-don't yet support the other SCSH features that motivate that choice,
-we would like to be backward-compatible with any existing Guile
-scripts once we do. Furthermore, if the path to Guile on your system
-is too long for your kernel, you can start the script with this
-horrible hack:
-
-#!/bin/sh
-exec /really/long/path/to/guile -s "$0" ${1+"$@"}
-!#
-
-Note that some very old Unix systems don't support the `#!' syntax.
-
-
-** You can now run Guile without installing it.
-
-Previous versions of the interactive Guile interpreter (`guile')
-couldn't start up unless Guile's Scheme library had been installed;
-they used the value of the environment variable `SCHEME_LOAD_PATH'
-later on in the startup process, but not to find the startup code
-itself. Now Guile uses `SCHEME_LOAD_PATH' in all searches for Scheme
-code.
-
-To run Guile without installing it, build it in the normal way, and
-then set the environment variable `SCHEME_LOAD_PATH' to a
-colon-separated list of directories, including the top-level directory
-of the Guile sources. For example, if you unpacked Guile so that the
-full filename of this NEWS file is /home/jimb/guile-1.0b3/NEWS, then
-you might say
-
- export SCHEME_LOAD_PATH=/home/jimb/my-scheme:/home/jimb/guile-1.0b3
-
-
-** Guile's read-eval-print loop no longer prints #<unspecified>
-results. If the user wants to see this, she can evaluate the
-expression (assert-repl-print-unspecified #t), perhaps in her startup
-file.
-
-** Guile no longer shows backtraces by default when an error occurs;
-however, it does display a message saying how to get one, and how to
-request that they be displayed by default. After an error, evaluate
- (backtrace)
-to see a backtrace, and
- (debug-enable 'backtrace)
-to see them by default.
-
-
-
-* Changes to Guile Scheme:
-
-** Guile now distinguishes between #f and the empty list.
-
-This is for compatibility with the IEEE standard, the (possibly)
-upcoming Revised^5 Report on Scheme, and many extant Scheme
-implementations.
-
-Guile used to have #f and '() denote the same object, to make Scheme's
-type system more compatible with Emacs Lisp's. However, the change
-caused too much trouble for Scheme programmers, and we found another
-way to reconcile Emacs Lisp with Scheme that didn't require this.
-
-
-** Guile's delq, delv, delete functions, and their destructive
-counterparts, delq!, delv!, and delete!, now remove all matching
-elements from the list, not just the first. This matches the behavior
-of the corresponding Emacs Lisp functions, and (I believe) the Maclisp
-functions which inspired them.
-
-I recognize that this change may break code in subtle ways, but it
-seems best to make the change before the FSF's first Guile release,
-rather than after.
-
-
-** The compiled-library-path function has been deleted from libguile.
-
-** The facilities for loading Scheme source files have changed.
-
-*** The variable %load-path now tells Guile which directories to search
-for Scheme code. Its value is a list of strings, each of which names
-a directory.
-
-*** The variable %load-extensions now tells Guile which extensions to
-try appending to a filename when searching the load path. Its value
-is a list of strings. Its default value is ("" ".scm").
-
-*** (%search-load-path FILENAME) searches the directories listed in the
-value of the %load-path variable for a Scheme file named FILENAME,
-with all the extensions listed in %load-extensions. If it finds a
-match, then it returns its full filename. If FILENAME is absolute, it
-returns it unchanged. Otherwise, it returns #f.
-
-%search-load-path will not return matches that refer to directories.
-
-*** (primitive-load FILENAME :optional CASE-INSENSITIVE-P SHARP)
-uses %seach-load-path to find a file named FILENAME, and loads it if
-it finds it. If it can't read FILENAME for any reason, it throws an
-error.
-
-The arguments CASE-INSENSITIVE-P and SHARP are interpreted as by the
-`read' function.
-
-*** load uses the same searching semantics as primitive-load.
-
-*** The functions %try-load, try-load-with-path, %load, load-with-path,
-basic-try-load-with-path, basic-load-with-path, try-load-module-with-
-path, and load-module-with-path have been deleted. The functions
-above should serve their purposes.
-
-*** If the value of the variable %load-hook is a procedure,
-`primitive-load' applies its value to the name of the file being
-loaded (without the load path directory name prepended). If its value
-is #f, it is ignored. Otherwise, an error occurs.
-
-This is mostly useful for printing load notification messages.
-
-
-** The function `eval!' is no longer accessible from the scheme level.
-We can't allow operations which introduce glocs into the scheme level,
-because Guile's type system can't handle these as data. Use `eval' or
-`read-and-eval!' (see below) as replacement.
-
-** The new function read-and-eval! reads an expression from PORT,
-evaluates it, and returns the result. This is more efficient than
-simply calling `read' and `eval', since it is not necessary to make a
-copy of the expression for the evaluator to munge.
-
-Its optional arguments CASE_INSENSITIVE_P and SHARP are interpreted as
-for the `read' function.
-
-
-** The function `int?' has been removed; its definition was identical
-to that of `integer?'.
-
-** The functions `<?', `<?', `<=?', `=?', `>?', and `>=?'. Code should
-use the R4RS names for these functions.
-
-** The function object-properties no longer returns the hash handle;
-it simply returns the object's property list.
-
-** Many functions have been changed to throw errors, instead of
-returning #f on failure. The point of providing exception handling in
-the language is to simplify the logic of user code, but this is less
-useful if Guile's primitives don't throw exceptions.
-
-** The function `fileno' has been renamed from `%fileno'.
-
-** The function primitive-mode->fdes returns #t or #f now, not 1 or 0.
-
-
-* Changes to Guile's C interface:
-
-** The library's initialization procedure has been simplified.
-scm_boot_guile now has the prototype:
-
-void scm_boot_guile (int ARGC,
- char **ARGV,
- void (*main_func) (),
- void *closure);
-
-scm_boot_guile calls MAIN_FUNC, passing it CLOSURE, ARGC, and ARGV.
-MAIN_FUNC should do all the work of the program (initializing other
-packages, reading user input, etc.) before returning. When MAIN_FUNC
-returns, call exit (0); this function never returns. If you want some
-other exit value, MAIN_FUNC may call exit itself.
-
-scm_boot_guile arranges for program-arguments to return the strings
-given by ARGC and ARGV. If MAIN_FUNC modifies ARGC/ARGV, should call
-scm_set_program_arguments with the final list, so Scheme code will
-know which arguments have been processed.
-
-scm_boot_guile establishes a catch-all catch handler which prints an
-error message and exits the process. This means that Guile exits in a
-coherent way when system errors occur and the user isn't prepared to
-handle it. If the user doesn't like this behavior, they can establish
-their own universal catcher in MAIN_FUNC to shadow this one.
-
-Why must the caller do all the real work from MAIN_FUNC? The garbage
-collector assumes that all local variables of type SCM will be above
-scm_boot_guile's stack frame on the stack. If you try to manipulate
-SCM values after this function returns, it's the luck of the draw
-whether the GC will be able to find the objects you allocate. So,
-scm_boot_guile function exits, rather than returning, to discourage
-people from making that mistake.
-
-The IN, OUT, and ERR arguments were removed; there are other
-convenient ways to override these when desired.
-
-The RESULT argument was deleted; this function should never return.
-
-The BOOT_CMD argument was deleted; the MAIN_FUNC argument is more
-general.
-
-
-** Guile's header files should no longer conflict with your system's
-header files.
-
-In order to compile code which #included <libguile.h>, previous
-versions of Guile required you to add a directory containing all the
-Guile header files to your #include path. This was a problem, since
-Guile's header files have names which conflict with many systems'
-header files.
-
-Now only <libguile.h> need appear in your #include path; you must
-refer to all Guile's other header files as <libguile/mumble.h>.
-Guile's installation procedure puts libguile.h in $(includedir), and
-the rest in $(includedir)/libguile.
-
-
-** Two new C functions, scm_protect_object and scm_unprotect_object,
-have been added to the Guile library.
-
-scm_protect_object (OBJ) protects OBJ from the garbage collector.
-OBJ will not be freed, even if all other references are dropped,
-until someone does scm_unprotect_object (OBJ). Both functions
-return OBJ.
-
-Note that calls to scm_protect_object do not nest. You can call
-scm_protect_object any number of times on a given object, and the
-next call to scm_unprotect_object will unprotect it completely.
-
-Basically, scm_protect_object and scm_unprotect_object just
-maintain a list of references to things. Since the GC knows about
-this list, all objects it mentions stay alive. scm_protect_object
-adds its argument to the list; scm_unprotect_object remove its
-argument from the list.
-
-
-** scm_eval_0str now returns the value of the last expression
-evaluated.
-
-** The new function scm_read_0str reads an s-expression from a
-null-terminated string, and returns it.
-
-** The new function `scm_stdio_to_port' converts a STDIO file pointer
-to a Scheme port object.
-
-** The new function `scm_set_program_arguments' allows C code to set
-the value returned by the Scheme `program-arguments' function.
-
-
-Older changes:
-
-* Guile no longer includes sophisticated Tcl/Tk support.
-
-The old Tcl/Tk support was unsatisfying to us, because it required the
-user to link against the Tcl library, as well as Tk and Guile. The
-interface was also un-lispy, in that it preserved Tcl/Tk's practice of
-referring to widgets by names, rather than exporting widgets to Scheme
-code as a special datatype.
-
-In the Usenix Tk Developer's Workshop held in July 1996, the Tcl/Tk
-maintainers described some very interesting changes in progress to the
-Tcl/Tk internals, which would facilitate clean interfaces between lone
-Tk and other interpreters --- even for garbage-collected languages
-like Scheme. They expected the new Tk to be publicly available in the
-fall of 1996.
-
-Since it seems that Guile might soon have a new, cleaner interface to
-lone Tk, and that the old Guile/Tk glue code would probably need to be
-completely rewritten, we (Jim Blandy and Richard Stallman) have
-decided not to support the old code. We'll spend the time instead on
-a good interface to the newer Tk, as soon as it is available.
-
-Until then, gtcltk-lib provides trivial, low-maintenance functionality.
-
-
-Copyright information:
-
-Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
-
- Permission is granted to anyone to make or distribute verbatim copies
- of this document as received, in any medium, provided that the
- copyright notice and this permission notice are preserved,
- thus giving the recipient permission to redistribute in turn.
-
- Permission is granted to distribute modified versions
- of this document, or of portions of it,
- under the above conditions, provided also that they
- carry prominent notices stating who last changed them.
-
-
-Local variables:
-mode: outline
-paragraph-separate: "[ ]*$"
-end:
-
diff --git a/README b/README
deleted file mode 100644
index 6151d0d8c..000000000
--- a/README
+++ /dev/null
@@ -1,248 +0,0 @@
-!!! This is not a Guile release; it is a source tree retrieved via
-anonymous CVS or as a nightly snapshot at some random time after the
-Guile 1.4 release. If this were a Guile release, you would not see
-this message. !!! [fixme: zonk on release]
-
-This is a 1.7 development version of Guile, Project GNU's extension
-language library. Guile is an interpreter for Scheme, packaged as a
-library that you can link into your applications to give them their
-own scripting language. Guile will eventually support other languages
-as well, giving users of Guile-based applications a choice of
-languages.
-
-Guile versions with an odd middle number, i.e. 1.5.* are unstable
-development versions. Even middle numbers indicate stable versions.
-This has been the case since the 1.3.* series.
-
-The next stable release will be version 1.8.0.
-
-Please send bug reports to bug-guile@gnu.org.
-
-Guile Documentation ==================================================
-
-The doc directory contains a few articles on specific topics and some
-examples, including data-rep.texi which describes the internal
-representation of data types in Guile. The example-smob directory
-contains example source code for the "Defining New Types (Smobs)" chapter.
-
-The incomplete Guile reference manual is available at
-
- ftp://ftp.red-bean.com/pub/guile/snapshots/guile-doc-snap.tar.gz
-
-Neil Jerram is working on the new reference manual, which will be
-distributed with guile-core. The new manual will be synchronized with
-the docstrings in the sources. Until then, please be aware that the
-docstrings are likely to be more up-to-date than the old reference
-manual (use `(help)' or see libguile/guile-procedures.txt which is
-generated by the build process).
-
-The Guile WWW page is at
-
- http://www.gnu.org/software/guile/guile.html
-
-It contains a link to the Guile FAQ.
-
-Guile License ==================================================
-
-The license of Guile 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 GUILE.
-
- The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
- code from other Free Software Foundation releases into a copy of
- GUILE, 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 GUILE, it is your choice
- whether to permit this exception to apply to your modifications.
- If you do not wish that, delete this exception notice.
-
-Handling of Deprecated Features ======================================
-
-Guile may contain features that are `deprecated'. When a feature is
-deprecated, it means that it is still there and fully functional, but
-that there is a better way of achieving the same thing, and we'd
-rather have you use this better way. This allows us to eventually
-remove the old implementation and helps to keep Guile reasonably clean
-of historic baggage.
-
-See the file NEWS for a list of features that are currently
-deprecated. Each entry will also tell you what you should replace
-your code with.
-
-To give you some help with this process, and to encourage (OK, nudge)
-people to switch to the newer methods, Guile can emit warnings or
-errors when you use a deprecated feature. There is quite a range of
-possibilities, from being completely silent to giving errors at link
-time. What exactly happens is determined both by the value of the
-`--enable-deprecated' configuration option when Guile was built, and
-by the GUILE_WARN_DEPRECATED environment variable.
-
-It works like this:
-
- When Guile has been configured with `--enable-deprecated=no' (or,
- equivalently, with `--disable-deprecated') then all deprecated
- features are omitted from Guile. You will get "undefined
- reference", "variable unbound" or similar errors when you try to use
- them.
-
- When `--enable-deprecated=LEVEL' has been specified (for LEVEL not
- "no"), LEVEL will be used as the default value of the environment
- variable GUILE_WARN_DEPRECATED. A value of "yes" is changed to
- "summary" and "shutup" is changed to "no", however.
-
- When GUILE_WARN_DEPRECATED has the value "no", nothing special will
- happen when a deprecated feature is used.
-
- When GUILE_WARN_DEPRECATED has the value "summary", and a deprecated
- feature has been used, Guile will print this message at exit:
-
- Some deprecated features have been used. Set the environment
- variable GUILE_WARN_DEPRECATED to "detailed" and rerun the program
- to get more information. Set it to "no" to suppress this message.
-
- When GUILE_WARN_DEPRECATED has the value "detailed", a detailed
- warning is emitted immediatly for the first use of a deprecated
- feature.
-
-The default is `--enable-deprecated=yes'.
-
-About This Distribution ==============================================
-
-Interesting files include:
-
-- INSTALL, which contains instructions on building and installing Guile.
-- NEWS, which describes user-visible changes since the last release of Guile.
-
-Files are usually installed according to the prefix specified to
-configure, /usr/local by default. Building and installing gives you:
-
-Executables, in ${prefix}/bin:
-
- guile --- a stand-alone interpreter for Guile. With no arguments, this
- is a simple interactive Scheme interpreter. It can also be used
- as an interpreter for script files; see the NEWS file for details.
- guile-config --- a Guile script which provides the information necessary
- to link your programs against the Guile library.
- guile-snarf --- a script to parse declarations in your C code for
- Scheme-visible C functions, Scheme objects to be used by C code,
- etc.
- guile-tools --- a wrapper to invoke the executable modules in
- subdirectory `scripts' (also installed).
-
-Libraries, in ${prefix}/lib. Depending on the platform and options
- given to configure, you may get shared libraries in addition
- to or instead of these static libraries:
-
- libguile.a --- an object library containing the Guile interpreter,
- You can use Guile in your own programs by linking against this.
- libqthreads.a --- an object library containing the QuickThreads
- primitives. If you enabled thread support when you configured
- Guile, you will need to link your code against this too.
- libguilereadline.a --- an object library containing glue code for the
- GNU readline library. See NEWS for instructions on how to enable
- readline for your personal use.
- libguile-srfi-*.a --- various SRFI support libraries
-
-Header files, in ${prefix}/include:
-
- libguile.h, guile/gh.h, libguile/*.h --- for libguile.
- guile-readline/readline.h --- for guile-readline.
-
-Support files, in ${prefix}/share/guile/<version>:
-
- ice-9/* --- run-time support for Guile: the module system,
- read-eval-print loop, some R4RS code and other infrastructure.
- oop/* --- the Guile Object-Oriented Programming System (GOOPS)
- scripts/* --- executable modules, i.e., scheme programs that can be both
- called as an executable from the shell, and loaded and used as a
- module from scheme code. See scripts/README for more info.
- srfi/* --- SRFI support modules. See srfi/README for more info.
-
-Automake macros, in ${prefix}/share/aclocal:
-
- guile.m4
-
-Documentation in Info format, in ${prefix}/info:
-
- guile --- Guile reference manual.
-
- guile-tut --- Guile tutorial.
-
- GOOPS --- GOOPS reference manual.
-
- r5rs --- Revised(5) Report on the Algorithmic Language Scheme.
-
-
-The Guile source tree is laid out as follows:
-
-libguile:
- The Guile Scheme interpreter --- both the object library
- for you to link with your programs, and the executable you can run.
-ice-9: Guile's module system, initialization code, and other infrastructure.
-guile-config:
- Source for the guile-config script.
-qt: A cooperative threads package from the University of Washington,
- which Guile can use. If you configure Guile with the
- --with-threads flag, you will need to link against the -lqt
- library, found in this directory. Qt is under a separate
- copyright; see `qt/README' for more details.
-guile-readline:
- The glue code for using GNU readline with Guile. This
- will be build when configure can find a recent enough readline
- library on your system.
-doc: Documentation (see above).
-
-Anonymous CVS Access and FTP snapshots ===============================
-
-We make the developers' working Guile sources available via anonymous
-CVS, and by nightly snapshots, accessible via FTP. See the files
-`ANON-CVS' and `SNAPSHOTS' for details.
-
-If you would like to receive mail when people commit changes to the
-Guile CVS repository, you can subscribe to guile-cvs@gnu.org by the
-Mailman mailing list interface at
-
- <http://mail.gnu.org/mailman/listinfo/guile-cvs>
-
-
-Obtaining Guile ======================================================
-
-The latest official Guile release is available via anonymous FTP from
-
-ftp://ftp.gnu.org/pub/gnu/guile/guile-1.4.tar.gz
-
-The mailing list `guile-user@gnu.org' carries discussions, questions,
-and often answers, about Guile. To subscribe, use the Mailman mailing
-list interface at <http://mail.gnu.org/mailman/listinfo/guile-user>
-Of course, please send bug reports (and fixes!) to bug-guile@gnu.org.
diff --git a/THANKS b/THANKS
deleted file mode 100644
index 947c1e615..000000000
--- a/THANKS
+++ /dev/null
@@ -1,36 +0,0 @@
-Contributors since the last release:
-
- Rob Browning
- Stefan Jahn
- Thien-Thi Nguyen
-
-Sponsors since the last release:
-
- The Linux Developers Group
-
-For fixes or providing information which led to a fix:
-
- Martin Baulig
- Fabrice Bauzac
- Rob Browning
- Michael Carmack
- Brian Crowder
- Christopher Cramer
- Alexandre Duret-Lutz
- John W Eaton
- Clinton Ebadi
- Aubrey Jaffer
- Eric Gillespie, Jr
- John Goerzen
- Richard Kim
- Matthias Köppe
- Han-Wen Nienhuys
- Jan Nieuwenhuizen
- Ron Peterson
- David Pirotte
- Ken Raeburn
- Bill Schottstaedt
- Greg Troxel
- Momchil Velikov
- Panagiotis Vossos
- Keith Wright
diff --git a/acinclude.m4 b/acinclude.m4
deleted file mode 100644
index ac7544b27..000000000
--- a/acinclude.m4
+++ /dev/null
@@ -1,109 +0,0 @@
-dnl On the NeXT, #including <utime.h> doesn't give you a definition for
-dnl struct utime, unless you #define _POSIX_SOURCE.
-
-AC_DEFUN(GUILE_STRUCT_UTIMBUF, [
- AC_CACHE_CHECK([whether we need POSIX to get struct utimbuf],
- guile_cv_struct_utimbuf_needs_posix,
- [AC_TRY_CPP([
-#ifdef __EMX__
-#include <sys/utime.h>
-#else
-#include <utime.h>
-#endif
-struct utime blah;
-],
- guile_cv_struct_utimbuf_needs_posix=no,
- guile_cv_struct_utimbuf_needs_posix=yes)])
- if test "$guile_cv_struct_utimbuf_needs_posix" = yes; then
- AC_DEFINE([UTIMBUF_NEEDS_POSIX], 1,
- [Define this if <utime.h> doesn't define struct utimbuf unless
- _POSIX_SOURCE is defined. See GUILE_STRUCT_UTIMBUF in aclocal.m4.])
- fi])
-
-
-
-
-dnl
-dnl Apparently, at CMU they have a weird version of libc.h that is
-dnl installed in /usr/local/include and conflicts with unistd.h.
-dnl In these situations, we should not #include libc.h.
-dnl This test arranges to #define LIBC_H_WITH_UNISTD_H iff libc.h is
-dnl present on the system, and is safe to #include.
-dnl
-AC_DEFUN([GUILE_HEADER_LIBC_WITH_UNISTD],
- [
- AC_CHECK_HEADERS(libc.h unistd.h)
- AC_CACHE_CHECK(
- [whether libc.h and unistd.h can be included together],
- guile_cv_header_libc_with_unistd,
- [
- if test "$ac_cv_header_libc_h" = "no"; then
- guile_cv_header_libc_with_unistd="no"
- elif test "$ac_cv_header_unistd_h" = "no"; then
- guile_cv_header_libc_with_unistd="yes"
- else
- AC_TRY_COMPILE(
- [
-# include <libc.h>
-# include <unistd.h>
- ],
- [],
- [guile_cv_header_libc_with_unistd=yes],
- [guile_cv_header_libc_with_unistd=no]
- )
- fi
- ]
- )
- if test "$guile_cv_header_libc_with_unistd" = yes; then
- AC_DEFINE(LIBC_H_WITH_UNISTD_H, 1,
- [Define this if we should include <libc.h> when we've already
- included <unistd.h>. On some systems, they conflict, and libc.h
- should be omitted. See GUILE_HEADER_LIBC_WITH_UNISTD in
- aclocal.m4.])
- fi
- ]
-)
-
-
-
-dnl This is needed when we want to check for the same function repeatedly
-dnl with other parameters, such as libraries, varying.
-dnl
-dnl GUILE_NAMED_CHECK_FUNC(FUNCTION, TESTNAME,
-dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
-AC_DEFUN(GUILE_NAMED_CHECK_FUNC,
-[AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(ac_cv_func_$1_$2,
-[AC_TRY_LINK(
-dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
-dnl which includes <sys/select.h> which contains a prototype for
-dnl select. Similarly for bzero.
-[/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $1(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $1();
-], [
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$1) || defined (__stub___$1)
-choke me
-#else
-$1();
-#endif
-], eval "ac_cv_func_$1_$2=yes", eval "ac_cv_func_$1_$2=no")])
-if eval "test \"`echo '$ac_cv_func_'$1'_'$2`\" = yes"; then
- AC_MSG_RESULT(yes)
- ifelse([$3], , :, [$3])
-else
- AC_MSG_RESULT(no)
-ifelse([$4], , , [$4
-])dnl
-fi
-])
diff --git a/am/.cvsignore b/am/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/am/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/am/ChangeLog b/am/ChangeLog
deleted file mode 100644
index 3b0cdcdb8..000000000
--- a/am/ChangeLog
+++ /dev/null
@@ -1,18 +0,0 @@
-2002-04-10 Rob Browning <rlb@defaultvalue.org>
-
- * .cvsignore: add Makefile and Makefile.in.
-
-2002-04-01 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * maintainer-dirs: Remove "if MAINTAINER_MODE" conditional.
-
-2002-03-30 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * maintainer-dirs: New file.
-
- * Makefile.am (am_frags): Add "maintainer-dirs".
-
-2002-02-26 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * pre-inst-guile, Makefile.am, README: New files.
-
diff --git a/am/Makefile.am b/am/Makefile.am
deleted file mode 100644
index f8fd41ae4..000000000
--- a/am/Makefile.am
+++ /dev/null
@@ -1,28 +0,0 @@
-## Process this file with Automake to create Makefile.in
-##
-## Copyright (C) 2002 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-AUTOMAKE_OPTIONS = gnu
-
-am_frags = pre-inst-guile maintainer-dirs
-
-EXTRA_DIST = $(am_frags)
-
-## Makefile.am ends here
diff --git a/am/README b/am/README
deleted file mode 100644
index c7883c37c..000000000
--- a/am/README
+++ /dev/null
@@ -1,3 +0,0 @@
-data directory: automake frags
-
-do not name files using extension ".am", as automake is overzealous sometimes.
diff --git a/am/maintainer-dirs b/am/maintainer-dirs
deleted file mode 100644
index 1733ae2d7..000000000
--- a/am/maintainer-dirs
+++ /dev/null
@@ -1,34 +0,0 @@
-## am/maintainer-dirs --- define workbook and mscripts vars
-
-## Copyright (C) 2002 Free Software Foundation
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-## Commentary:
-
-## This fragment defines two variables: workbook and mscripts.
-## It can be included in any Makefile.am by adding the line:
-## include $(top_srcdir)/am/maintainer-dirs
-## See $(workbook)/build/maintainer-dirs.text for more info.
-
-## Code:
-
-workbook = $(top_srcdir_absolute)/../workbook
-mscripts = $(top_srcdir_absolute)/../scripts
-
-## am/maintainer-dirs ends here
diff --git a/am/pre-inst-guile b/am/pre-inst-guile
deleted file mode 100644
index 2cf240104..000000000
--- a/am/pre-inst-guile
+++ /dev/null
@@ -1,34 +0,0 @@
-## am/pre-inst-guile --- define preinstguile and preinstguiletool vars
-
-## Copyright (C) 2002 Free Software Foundation
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-## Commentary:
-
-## This fragment defines two variables: preinstguile, preinstguiletool.
-## It can be included in any Makefile.am by adding the line:
-## include $(top_srcdir)/am/pre-inst-guile
-## See devel/build/pre-inst-guile.text (CVS only) for more info.
-
-## Code:
-
-preinstguile = $(top_builddir_absolute)/pre-inst-guile
-preinstguiletool = GUILE="$(preinstguile)" $(top_srcdir)/scripts
-
-## am/pre-inst-guile ends here
diff --git a/autogen.sh b/autogen.sh
deleted file mode 100755
index f06a127ac..000000000
--- a/autogen.sh
+++ /dev/null
@@ -1,147 +0,0 @@
-#!/bin/sh
-# Usage: sh -x ./autogen.sh [WORKBOOK]
-
-set -e
-
-[ -f GUILE-VERSION ] || {
- echo "autogen.sh: run this command only at the top of guile-core."
- exit 1
-}
-
-######################################################################
-### Find workbook and make symlinks.
-
-workbook=../workbook # assume "cvs co hack"
-test x$1 = x || workbook=$1
-if [ ! -d $workbook ] ; then
- echo "ERROR: could not find workbook dir"
- echo " re-run like so: $0 WORKBOOK"
- exit 1
-fi
-: found workbook at $workbook
-workbook=`(cd $workbook ; pwd)`
-
-workbookdistfiles="ANON-CVS HACKING SNAPSHOTS"
-for f in $workbookdistfiles ; do
- rm -f $f
- ln -s $workbook/build/dist-files/$f $f
-done
-rm -f examples/example.gdbinit
-ln -s $workbook/build/dist-files/.gdbinit examples/example.gdbinit
-
-# TODO: This should be moved to dist-guile
-mscripts=../guile-scripts
-rm -f BUGS
-$mscripts/render-bugs > BUGS
-
-######################################################################
-
-# Make sure this matches the ACLOCAL invokation in Makefile.am
-
-./guile-aclocal.sh
-
-######################################################################
-### Libtool setup.
-
-# Get a clean version.
-rm -rf libltdl
-libtoolize --force --copy --automake --ltdl
-
-# Fix older versions of libtool.
-# Make sure we use a ./configure.in compatible autoconf in ./libltdl/
-if [ -f libltdl/configure.in ]; then
- mv libltdl/configure.in libltdl/configure.tmp
- echo 'AC_PREREQ(2.50)' > libltdl/configure.in
- cat libltdl/configure.tmp >> libltdl/configure.in
- rm libltdl/configure.tmp
-fi
-
-# Maybe patch ltdl.c. This is only needed for 1.4.2 and earlier.
-if patch libltdl/ltdl.c <<EOP
---- ltdl.c~ Fri Apr 12 18:52:48 2002
-+++ ltdl.c Tue Jul 9 14:12:47 2002
-@@ -2246,15 +2246,15 @@
- static int
- find_handle_callback (filename, data, ignored)
- char *filename;
- lt_ptr data;
- lt_ptr ignored;
- {
- lt_dlhandle *handle = (lt_dlhandle *) data;
-- int found = access (filename, R_OK);
-+ int found = !access (filename, F_OK);
-
- /* Bail out if file cannot be read... */
- if (!found)
- return 0;
-
- /* Try to dlopen the file, but do not continue searching in any
- case. */
-EOP
-then true
-else
- echo "WARNING: could not patch libltdl, but this is probably OK."
-fi
-
-######################################################################
-
-
-# configure.in reqs autoconf-2.53; try to find it
-for suf in "-2.53" "2.53" "" false; do
- version=`autoconf$suf --version 2>/dev/null | head -1 | awk '{print $NF}' | awk -F. '{print $1 * 100 + $2}'`
- if test "0$version" -eq 253; then
- autoconf=autoconf$suf
- autoheader=autoheader$suf
- break
- fi
-done
-
-if test -z "$autoconf"; then
- echo "ERROR: Please install autoconf 2.53"
- exit 1
-fi
-################################################################
-
-#detect automake version
-
-
-# configure.in reqs autoconf-2.53; try to find it
-for suf in "-1.6" "1.6" "" false; do
- version=`automake$suf --version 2>/dev/null | head -1 | awk '{print $NF}' | awk -F. '{print $1 * 10 + $2}'`
- if test "0$version" -eq 16; then
- automake=automake$suf
- break
- fi
-done
-
-if test -z "$automake"; then
- echo "ERROR: Please install automake 1.6.x"
- exit 1
-fi
-
-
-################################################################
-$autoheader
-$autoconf
-
-# Automake has a bug that will let it only add one copy of a missing
-# file. We need two mdate-sh, tho, one in doc/ref/ and one in
-# doc/tutorial/. We run automake twice as a workaround.
-
-$automake --add-missing
-$automake --add-missing
-
-# Make sure that libltdl uses the same autoconf version as the rest.
-#
-echo "libltdl..."
-(cd libltdl && aclocal)
-(cd libltdl && autoconf)
-(cd libltdl && $automake --gnu --add-missing)
-
-echo "guile-readline..."
-(cd guile-readline && ./autogen.sh)
-
-echo "Now run configure and make."
-echo "You must pass the \`--enable-maintainer-mode' option to configure."
-
-# autogen.sh ends here
diff --git a/benchmark-guile.in b/benchmark-guile.in
deleted file mode 100644
index af1ade616..000000000
--- a/benchmark-guile.in
+++ /dev/null
@@ -1,48 +0,0 @@
-#! /bin/sh
-# Usage: benchmark-guile [-i GUILE-INTERPRETER] [GUILE-BENCHMARK-ARGS]
-# If `-i GUILE-INTERPRETER' is omitted, use ${top_builddir}/pre-inst-guile.
-# See ${top_srcdir}/benchmark-suite/guile-benchmark for documentation on GUILE-BENCHMARK-ARGS.
-#
-# Example invocations:
-# ./benchmark-guile
-# ./benchmark-guile numbers.bm
-# ./benchmark-guile -i /usr/local/bin/guile
-# ./benchmark-guile -i /usr/local/bin/guile numbers.bm
-
-set -e
-
-top_builddir=@top_builddir_absolute@
-top_srcdir=@top_srcdir_absolute@
-
-BENCHMARK_SUITE_DIR=${top_srcdir}/benchmark-suite
-
-if [ x"$1" = x-i ] ; then
- guile=$2
- shift
- shift
-else
- guile=${top_builddir}/pre-inst-guile
-fi
-
-GUILE_LOAD_PATH=$BENCHMARK_SUITE_DIR
-export GUILE_LOAD_PATH
-
-if [ -f "$guile" -a -x "$guile" ] ; then
- echo Benchmarking $guile ... "$@"
- echo with GUILE_LOAD_PATH=$GUILE_LOAD_PATH
-else
- echo ERROR: Cannot execute $guile
- exit 1
-fi
-
-# documentation searching ignores GUILE_LOAD_PATH.
-if [ ! -f guile-procedures.txt ] ; then
- @LN_S@ libguile/guile-procedures.txt .
-fi
-
-exec $guile \
- -e main -s "$BENCHMARK_SUITE_DIR/guile-benchmark" \
- --benchmark-suite "$BENCHMARK_SUITE_DIR/benchmarks" \
- --log-file benchmark-guile.log "$@"
-
-# benchmark-guile ends here
diff --git a/benchmark-suite/COPYING b/benchmark-suite/COPYING
deleted file mode 100644
index eeb586b39..000000000
--- a/benchmark-suite/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED 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.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
-
- 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 of the License, 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 program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) 19yy name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/benchmark-suite/ChangeLog b/benchmark-suite/ChangeLog
deleted file mode 100644
index a7d17d1ec..000000000
--- a/benchmark-suite/ChangeLog
+++ /dev/null
@@ -1,52 +0,0 @@
-2002-07-26 Marius Vollmer <marius.vollmer@uni-dortmund.de>
-
- * Makefile.am (SCM_BENCHMARKS): List the real benchmarks, not foo
- and bar.
- (SCM_BENCHMARKS_DIRS): Uncommented, with an empty value.
- (dist-hook): Use quotes so that an empty SCM_BENCHMARKS_DIRS works.
-
-2002-07-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * lib.scm (print-result, print-user-result): Changed the
- reporter's outputs to use symbols rather than strings to document
- the individual values. Thanks to Neil Jerram for the suggestion.
-
-2002-07-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * benchmarks/0-reference.bm: Added as a reference benchmark to be
- used to calibrate iteration counts.
-
- * lib.scm: Added documentation. Added some initialization
- messages.
-
- (benchmark-time-base, benchmark-total-time, benchmark-user-time,
- benchmark-system-time, benchmark-frame-time, benchmark-core-time,
- benchmark-user-time\interpreter, benchmark-core-time\interpreter):
- Exported.
-
- (benchmark-time-base, time-base): Renamed time-base to
- benchmark-time-base and introduced new time-base as a short-cut.
-
- (total-time, benchmark-total-time, user-time, benchmark-user-time,
- system-time, benchmark-system-time, frame-time,
- benchmark-frame-time, benchmark-time, benchmark-core-time,
- user-time\interpreter, benchmark-user-time\interpreter,
- benchmark-time\interpreter, benchmark-core-time\interpreter,
- print-result, print-user-result): Renamed <foo>-time to
- benchmark-<foo>-time. Exceptions: benchmark-time and
- benchmark-time\interpreter were renamed to benchmark-core-time and
- benchmark-core-time\interpreter, respectively.
-
-2002-07-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * COPYING, README, Makefile.am, lib.scm, guile-benchmark: Copied
- from the test-suite directory, renamed and adapted for use with
- benchmarks.
-
- * benchmarks/logand.bm, benchmarks/continuations.bm,
- benchmarks/if.bm: Added as initial fairly stupid examples for
- benchmarks.
-
-2002-07-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * Log begins.
diff --git a/benchmark-suite/Makefile.am b/benchmark-suite/Makefile.am
deleted file mode 100644
index db7674ccf..000000000
--- a/benchmark-suite/Makefile.am
+++ /dev/null
@@ -1,16 +0,0 @@
-SCM_BENCHMARKS = benchmarks/0-reference.bm \
- benchmarks/continuations.bm \
- benchmarks/if.bm \
- benchmarks/logand.bm
-
-SCM_BENCHMARKS_DIRS =
-
-EXTRA_DIST = guile-benchmark lib.scm $(SCM_BENCHMARKS)
-
-## Automake should be able to handle the distribution of benchmarks/dirfoo
-## etc without any help, but not all version can handle 'deep'
-## directories. So we do it on our own.
-dist-hook:
- for d in "$(SCM_BENCHMARKS_DIRS)"; do \
- cp -pR $(srcdir)/$$d $(distdir)/$$d; \
- done
diff --git a/benchmark-suite/README b/benchmark-suite/README
deleted file mode 100644
index 186a74351..000000000
--- a/benchmark-suite/README
+++ /dev/null
@@ -1,18 +0,0 @@
-This directory contains some benchmarks for Guile, and some generic
-benchmarking support code.
-
-To run these benchmarks, you will need a version of Guile more recent
-than 15 Feb 1999 --- the benchmarks use the (ice-9 and-let*) and
-(ice-9 getopt-long) modules, which were added to Guile around then.
-
-For information about how to run the benchmark suite, read the usage
-instructions in the comments at the top of the guile-benchmark script.
-
-You can reference the file `lib.scm' from your own code as the module
-(benchmark-suite lib); it also has comments at the top and before each
-function explaining what's going on.
-
-Please write more Guile benchmarks, and send them to bug-guile@gnu.org.
-We'll merge them into the distribution. All benchmark suites must be
-licensed for our use under the GPL, but I don't think we're going to
-collect assignment papers for them.
diff --git a/benchmark-suite/benchmarks/0-reference.bm b/benchmark-suite/benchmarks/0-reference.bm
deleted file mode 100644
index 65085a8d7..000000000
--- a/benchmark-suite/benchmarks/0-reference.bm
+++ /dev/null
@@ -1,2 +0,0 @@
-(benchmark "reference benchmark for iteration counts" 330000
- #t)
diff --git a/benchmark-suite/benchmarks/continuations.bm b/benchmark-suite/benchmarks/continuations.bm
deleted file mode 100644
index 7c44300f7..000000000
--- a/benchmark-suite/benchmarks/continuations.bm
+++ /dev/null
@@ -1,5 +0,0 @@
-(define (callee continuation)
- (continuation #t))
-
-(benchmark "call/cc" 300
- (call-with-current-continuation callee))
diff --git a/benchmark-suite/benchmarks/if.bm b/benchmark-suite/benchmarks/if.bm
deleted file mode 100644
index 30c22c9c3..000000000
--- a/benchmark-suite/benchmarks/if.bm
+++ /dev/null
@@ -1,51 +0,0 @@
-(with-benchmark-prefix "if-<expr>-then-else"
-
- (benchmark "executing then" 330000
- (if (quote #t) #t #f))
-
- (benchmark "executing else" 330000
- (if (quote #f) #t #f)))
-
-(with-benchmark-prefix "if-<expr>-then"
-
- (benchmark "executing then" 330000
- (if (quote #t) #t))
-
- (benchmark "executing else" 330000
- (if (quote #f) #t)))
-
-(with-benchmark-prefix "if-<iloc>-then-else"
-
- (let ((x #t))
- (benchmark "executing then" 330000
- (if x #t #f)))
-
- (let ((x #f))
- (benchmark "executing else" 330000
- (if x #t #f))))
-
-(with-benchmark-prefix "if-<iloc>-then"
-
- (let ((x #t))
- (benchmark "executing then" 330000
- (if x #t)))
-
- (let ((x #f))
- (benchmark "executing else" 330000
- (if x #t))))
-
-(with-benchmark-prefix "if-<bool>-then-else"
-
- (benchmark "executing then" 330000
- (if #t #t #f))
-
- (benchmark "executing else" 330000
- (if #f #t #f)))
-
-(with-benchmark-prefix "if-<bool>-then"
-
- (benchmark "executing then" 330000
- (if #t #t))
-
- (benchmark "executing else" 330000
- (if #f #t)))
diff --git a/benchmark-suite/benchmarks/logand.bm b/benchmark-suite/benchmarks/logand.bm
deleted file mode 100644
index cdb05e88d..000000000
--- a/benchmark-suite/benchmarks/logand.bm
+++ /dev/null
@@ -1,6 +0,0 @@
-(define bignum (1- (expt 2 128)))
-
-(let* ((i 0))
- (benchmark "bignum" 130000
- (logand i bignum)
- (set! i (+ i 1))))
diff --git a/benchmark-suite/guile-benchmark b/benchmark-suite/guile-benchmark
deleted file mode 100755
index 58f061749..000000000
--- a/benchmark-suite/guile-benchmark
+++ /dev/null
@@ -1,220 +0,0 @@
-#!../libguile/guile \
--e main -s
-!#
-
-;;;; guile-benchmark --- run the Guile benchmark suite
-;;;; Adapted from code by Jim Blandy <jimb@red-bean.com> --- May 1999
-;;;;
-;;;; Copyright (C) 2002 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-
-;;;; Usage: [guile -e main -s] guile-benchmark [OPTIONS] [BENCHMARK ...]
-;;;;
-;;;; Run benchmarks from the Guile benchmark suite. Report timing
-;;;; results to the standard output, along with a summary of all
-;;;; the results. Record each reported benchmark outcome in the log
-;;;; file, `benchmarks.log'.
-;;;;
-;;;; Normally, guile-benchmark scans the benchmark directory, and
-;;;; executes all files whose names end in `.bm'. (It assumes they contain
-;;;; Scheme code.) However, you can have it execute specific benchmarks by
-;;;; listing their filenames on the command line.
-;;;;
-;;;; The option `--benchmark-suite' can be given to specify the benchmark
-;;;; directory. If no such option is given, the benchmark directory is
-;;;; taken from the environment variable BENCHMARK_SUITE_DIR (if defined),
-;;;; otherwise a default directory that is hardcoded in this file is
-;;;; used (see "Installation" below).
-;;;;
-;;;; If present, the `--iteration-factor FACTOR' option tells
-;;;; `guile-benchmark' to multiply the number of iterations given with
-;;;; each single benchmark by the value of FACTOR. This allows to
-;;;; reduce or increase the total time for benchmarking.
-;;;;
-;;;; If present, the `--log-file LOG' option tells `guile-benchmark' to put
-;;;; the log output in a file named LOG.
-;;;;
-;;;; If present, the `--debug' option will enable a debugging mode.
-;;;;
-;;;;
-;;;; Installation:
-;;;;
-;;;; If you change the #! line at the top of this script to point at
-;;;; the Guile interpreter you want to run, you can call this script
-;;;; as an executable instead of having to pass it as a parameter to
-;;;; guile via "guile -e main -s guile-benchmark". Further, you can edit
-;;;; the definition of default-benchmark-suite to point to the parent
-;;;; directory of the `benchmarks' tree, which makes it unnecessary to set
-;;;; the environment variable `BENCHMARK_SUITE_DIR'.
-;;;;
-;;;;
-;;;; Shortcomings:
-;;;;
-;;;; At the moment, due to a simple-minded implementation, benchmark files
-;;;; must live in the benchmark directory, and you must specify their names
-;;;; relative to the top of the benchmark directory. If you want to send
-;;;; me a patch that fixes this, but still leaves sane benchmark names in
-;;;; the log file, that would be great. At the moment, all the benchmarks
-;;;; I care about are in the benchmark directory, though.
-;;;;
-;;;; It would be nice if you could specify the Guile interpreter you
-;;;; want to benchmark on the command line. As it stands, if you want to
-;;;; change which Guile interpreter you're benchmarking, you need to edit
-;;;; the #! line at the top of this file, which is stupid.
-
-
-;;; User configurable settings:
-(define default-benchmark-suite
- (string-append (getenv "HOME") "/bogus-path/benchmark-suite"))
-
-
-(use-modules (benchmark-suite lib)
- (ice-9 getopt-long)
- (ice-9 and-let-star)
- (ice-9 rdelim))
-
-
-;;; Variables that will receive their actual values later.
-(define benchmark-suite default-benchmark-suite)
-
-(define tmp-dir #f)
-
-
-;;; General utilities, that probably should be in a library somewhere.
-
-;;; Enable debugging
-(define (enable-debug-mode)
- (write-line %load-path)
- (set! %load-verbosely #t)
- (debug-enable 'backtrace 'debug))
-
-;;; Traverse the directory tree at ROOT, applying F to the name of
-;;; each file in the tree, including ROOT itself. For a subdirectory
-;;; SUB, if (F SUB) is true, we recurse into SUB. Do not follow
-;;; symlinks.
-(define (for-each-file f root)
-
- ;; A "hard directory" is a path that denotes a directory and is not a
- ;; symlink.
- (define (file-is-hard-directory? filename)
- (eq? (stat:type (lstat filename)) 'directory))
-
- (let visit ((root root))
- (let ((should-recur (f root)))
- (if (and should-recur (file-is-hard-directory? root))
- (let ((dir (opendir root)))
- (let loop ()
- (let ((entry (readdir dir)))
- (cond
- ((eof-object? entry) #f)
- ((or (string=? entry ".")
- (string=? entry "..")
- (string=? entry "CVS")
- (string=? entry "RCS"))
- (loop))
- (else
- (visit (string-append root "/" entry))
- (loop))))))))))
-
-
-;;; The benchmark driver.
-
-
-;;; Localizing benchmark files and temporary data files.
-
-(define (data-file-name filename)
- (in-vicinity tmp-dir filename))
-
-(define (benchmark-file-name benchmark)
- (in-vicinity benchmark-suite benchmark))
-
-;;; Return a list of all the benchmark files in the benchmark tree.
-(define (enumerate-benchmarks benchmark-dir)
- (let ((root-len (+ 1 (string-length benchmark-dir)))
- (benchmarks '()))
- (for-each-file (lambda (file)
- (if (has-suffix? file ".bm")
- (let ((short-name
- (substring file root-len)))
- (set! benchmarks (cons short-name benchmarks))))
- #t)
- benchmark-dir)
-
- ;; for-each-file presents the files in whatever order it finds
- ;; them in the directory. We sort them here, so they'll always
- ;; appear in the same order. This makes it easier to compare benchmark
- ;; log files mechanically.
- (sort benchmarks string<?)))
-
-(define (main args)
- (let ((options (getopt-long args
- `((benchmark-suite
- (single-char #\t)
- (value #t))
- (iteration-factor
- (single-char #\t)
- (value #t))
- (log-file
- (single-char #\l)
- (value #t))
- (debug
- (single-char #\d))))))
- (define (opt tag default)
- (let ((pair (assq tag options)))
- (if pair (cdr pair) default)))
-
- (if (opt 'debug #f)
- (enable-debug-mode))
-
- (set! benchmark-suite
- (or (opt 'benchmark-suite #f)
- (getenv "BENCHMARK_SUITE_DIR")
- default-benchmark-suite))
-
- (set! iteration-factor
- (string->number (opt 'iteration-factor "1")))
-
- ;; directory where temporary files are created.
- (set! tmp-dir (getcwd))
-
- (let* ((benchmarks
- (let ((foo (opt '() '())))
- (if (null? foo)
- (enumerate-benchmarks benchmark-suite)
- foo)))
- (log-file
- (opt 'log-file "benchmarks.log")))
-
- ;; Open the log file.
- (let ((log-port (open-output-file log-file)))
-
- ;; Register some reporters.
- (register-reporter (make-log-reporter log-port))
- (register-reporter user-reporter)
-
- ;; Run the benchmarks.
- (for-each (lambda (benchmark)
- (with-benchmark-prefix benchmark
- (load (benchmark-file-name benchmark))))
- benchmarks)
- (close-port log-port)))))
-
-
-;;; Local Variables:
-;;; mode: scheme
-;;; End:
diff --git a/benchmark-suite/lib.scm b/benchmark-suite/lib.scm
deleted file mode 100644
index 7dfc8b48c..000000000
--- a/benchmark-suite/lib.scm
+++ /dev/null
@@ -1,520 +0,0 @@
-;;;; benchmark-suite/lib.scm --- generic support for benchmarking
-;;;; Copyright (C) 2002 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-(define-module (benchmark-suite lib)
- :export (
-
- ;; Controlling the execution.
- iteration-factor
- scale-iterations
-
- ;; Running benchmarks.
- run-benchmark
- benchmark
-
- ;; Naming groups of benchmarks in a regular fashion.
- with-benchmark-prefix with-benchmark-prefix* current-benchmark-prefix
- format-benchmark-name
-
- ;; Computing timing results
- benchmark-time-base
- benchmark-total-time benchmark-user-time benchmark-system-time
- benchmark-frame-time benchmark-core-time
- benchmark-user-time\interpreter benchmark-core-time\interpreter
-
- ;; Reporting results in various ways.
- register-reporter unregister-reporter reporter-registered?
- make-log-reporter
- full-reporter
- user-reporter))
-
-
-;;;; If you're using Emacs's Scheme mode:
-;;;; (put 'with-benchmark-prefix 'scheme-indent-function 1)
-;;;; (put 'benchmark 'scheme-indent-function 1)
-
-
-;;;; CORE FUNCTIONS
-;;;;
-;;;; The function (run-benchmark name iterations thunk) is the heart of the
-;;;; benchmarking environment. The first parameter NAME is a unique name for
-;;;; the benchmark to be executed (for an explanation of this parameter see
-;;;; below under ;;;; NAMES. The second parameter ITERATIONS is a positive
-;;;; integer value that indicates how often the thunk shall be executed (for
-;;;; an explanation of how iteration counts should be used, see below under
-;;;; ;;;; ITERATION COUNTS). For example:
-;;;;
-;;;; (run-benchmark "small integer addition" 100000 (lambda () (+ 1 1)))
-;;;;
-;;;; This will run the function (lambda () (+ 1 1)) a 100000 times (the
-;;;; iteration count can, however be scaled. See below for details). Some
-;;;; different time data for running the thunk for the given number of
-;;;; iterations is measured and reported.
-;;;;
-;;;; Convenience macro
-;;;;
-;;;; * (benchmark name iterations body) is a short form for
-;;;; (run-benchmark name iterations (lambda () body))
-
-
-;;;; NAMES
-;;;;
-;;;; Every benchmark in the benchmark suite has a unique name to be able to
-;;;; compare the results of individual benchmarks across several runs of the
-;;;; benchmark suite.
-;;;;
-;;;; A benchmark name is a list of printable objects. For example:
-;;;; ("ports.scm" "file" "read and write back list of strings")
-;;;; ("ports.scm" "pipe" "read")
-;;;;
-;;;; Benchmark names may contain arbitrary objects, but they always have
-;;;; the following properties:
-;;;; - Benchmark names can be compared with EQUAL?.
-;;;; - Benchmark names can be reliably stored and retrieved with the standard
-;;;; WRITE and READ procedures; doing so preserves their identity.
-;;;;
-;;;; For example:
-;;;;
-;;;; (benchmark "simple addition" 100000 (+ 2 2))
-;;;;
-;;;; In that case, the benchmark name is the list ("simple addition").
-;;;;
-;;;; The WITH-BENCHMARK-PREFIX syntax and WITH-BENCHMARK-PREFIX* procedure
-;;;; establish a prefix for the names of all benchmarks whose results are
-;;;; reported within their dynamic scope. For example:
-;;;;
-;;;; (begin
-;;;; (with-benchmark-prefix "basic arithmetic"
-;;;; (benchmark "addition" 100000 (+ 2 2))
-;;;; (benchmark "subtraction" 100000 (- 4 2)))
-;;;; (benchmark "multiplication" 100000 (* 2 2))))
-;;;;
-;;;; In that example, the three benchmark names are:
-;;;; ("basic arithmetic" "addition"),
-;;;; ("basic arithmetic" "subtraction"), and
-;;;; ("multiplication").
-;;;;
-;;;; WITH-BENCHMARK-PREFIX can be nested. Each WITH-BENCHMARK-PREFIX
-;;;; postpends a new element to the current prefix:
-;;;;
-;;;; (with-benchmark-prefix "arithmetic"
-;;;; (with-benchmark-prefix "addition"
-;;;; (benchmark "integer" 100000 (+ 2 2))
-;;;; (benchmark "complex" 100000 (+ 2+3i 4+5i)))
-;;;; (with-benchmark-prefix "subtraction"
-;;;; (benchmark "integer" 100000 (- 2 2))
-;;;; (benchmark "complex" 100000 (- 2+3i 1+2i))))
-;;;;
-;;;; The four benchmark names here are:
-;;;; ("arithmetic" "addition" "integer")
-;;;; ("arithmetic" "addition" "complex")
-;;;; ("arithmetic" "subtraction" "integer")
-;;;; ("arithmetic" "subtraction" "complex")
-;;;;
-;;;; To print a name for a human reader, we DISPLAY its elements,
-;;;; separated by ": ". So, the last set of benchmark names would be
-;;;; reported as:
-;;;;
-;;;; arithmetic: addition: integer
-;;;; arithmetic: addition: complex
-;;;; arithmetic: subtraction: integer
-;;;; arithmetic: subtraction: complex
-;;;;
-;;;; The Guile benchmarks use with-benchmark-prefix to include the name of
-;;;; the source file containing the benchmark in the benchmark name, to
-;;;; provide each file with its own namespace.
-
-
-;;;; ITERATION COUNTS
-;;;;
-;;;; Every benchmark has to be given an iteration count that indicates how
-;;;; often it should be executed. The reason is, that in most cases a single
-;;;; execution of the benchmark code would not deliver usable timing results:
-;;;; The resolution of the system time is not arbitrarily fine. Thus, some
-;;;; benchmarks would be executed too quickly to be measured at all. A rule
-;;;; of thumb is, that the longer a benchmark runs, be more exact is the
-;;;; information about the execution time.
-;;;;
-;;;; However, execution time depends on several influences: First, the
-;;;; machine you are running the benchmark on. Second, the compiler you use.
-;;;; Third, which compiler options you use. Fourth, which version of guile
-;;;; you are using. Fifth, which guile options you are using (for example if
-;;;; you are using the debugging evaluator or not). There are even more
-;;;; influences.
-;;;;
-;;;; For this reason, the same number of iterations for a single benchmark may
-;;;; lead to completely different execution times in different
-;;;; constellations. For someone working on a slow machine, the default
-;;;; execution counts may lead to an inacceptable execution time of the
-;;;; benchmark suite. For someone on a very fast machine, however, it may be
-;;;; desireable to increase the number of iterations in order to increase the
-;;;; accuracy of the time data.
-;;;;
-;;;; For this reason, the benchmark suite allows to scale the number of
-;;;; executions by a global factor, stored in the exported variable
-;;;; iteration-factor. The default for iteration-factor is 1. A number of 2
-;;;; means, that all benchmarks are executed twice as often, which will also
-;;;; roughly double the execution time for the benchmark suite. Similarly, if
-;;;; iteration-factor holds a value of 0.5, only about half the execution time
-;;;; will be required.
-;;;;
-;;;; It is probably a good idea to choose the iteration count for each
-;;;; benchmark such that all benchmarks will take about the same time, for
-;;;; example one second. To achieve this, the benchmark suite holds an empty
-;;;; benchmark in the file 0-reference.bm named "reference benchmark for
-;;;; iteration counts". It's iteration count is calibrated to make the
-;;;; benchmark run about one second on Dirk's laptop :-) If you are adding
-;;;; benchmarks to the suite, it would be nice if you could calibrate the
-;;;; number of iterations such that each of your added benchmarks takes about
-;;;; as long to run as the reference benchmark. But: Don't be too accurate
-;;;; to figure out the correct iteration count.
-
-
-;;;; REPORTERS
-;;;;
-;;;; A reporter is a function which we apply to each benchmark outcome.
-;;;; Reporters can log results, print interesting results to the standard
-;;;; output, collect statistics, etc.
-;;;;
-;;;; A reporter function takes the following arguments: NAME ITERATIONS
-;;;; BEFORE AFTER GC-TIME. The argument NAME holds the name of the benchmark,
-;;;; ITERATIONS holds the actual number of iterations that were performed.
-;;;; BEFORE holds the result of the function (times) at the very beginning of
-;;;; the excution of the benchmark, AFTER holds the result of the function
-;;;; (times) after the execution of the benchmark. GC-TIME, finally, holds
-;;;; the difference of calls to (gc-run-time) before and after the execution
-;;;; of the benchmark.
-;;;;
-;;;; This library provides some standard reporters for logging results
-;;;; to a file, reporting interesting results to the user, (FIXME: and
-;;;; collecting totals).
-;;;;
-;;;; You can use the REGISTER-REPORTER function and friends to add whatever
-;;;; reporting functions you like. See under ;;;; TIMING DATA to see how the
-;;;; library helps you to extract relevant timing information from the values
-;;;; ITERATIONS, BEFORE, AFTER and GC-TIME. If you don't register any
-;;;; reporters, the library uses USER-REPORTER, which writes the most
-;;;; interesting results to the standard output.
-
-
-;;;; TIME CALCULATION
-;;;;
-;;;; The library uses the guile functions (times) and (gc-run-time) to
-;;;; determine the execution time for a single benchmark. Based on these
-;;;; functions, the values of BEFORE, AFTER and GC-TIME are computed, which
-;;;; are then passed to the reporter functions. All three values BEFORE,
-;;;; AFTER and GC-TIME include the time needed to executed the benchmark code
-;;;; itself, but also the surrounding code that implements the loop to run the
-;;;; benchmark code for the given number of times. This is undesirable, since
-;;;; one would prefer to only get the timing data for the benchmarking code.
-;;;;
-;;;; To cope with this, the benchmarking framework uses a trick: During
-;;;; initialization of the library, the time for executing an empty benchmark
-;;;; is measured and stored. This is an estimate for the time needed by the
-;;;; benchmarking framework itself. For later benchmarks, this time can then
-;;;; be subtracted from the measured execution times.
-;;;;
-;;;; In order to simplify the time calculation for users who want to write
-;;;; their own reporters, benchmarking framework provides the following
-;;;; definitions:
-;;;;
-;;;; benchmark-time-base : This variable holds the number of time units that
-;;;; make up a second. By deviding the results of each of the functions
-;;;; below by this value, you get the corresponding time in seconds. For
-;;;; example (/ (benchmark-total-time before after) benchmark-time-base)
-;;;; will give you the total time in seconds.
-;;;; benchmark-total-time : this function takes two arguments BEFORE and AFTER
-;;;; and computes the total time between the two timestamps. The result
-;;;; of this function is what the time command of the unix command line
-;;;; would report as real time.
-;;;; benchmark-user-time : this function takes two arguments BEFORE and AFTER
-;;;; and computes the time spent in the benchmarking process between the
-;;;; two timestamps. That means, the time consumed by other processes
-;;;; running on the same machine is not part of the resulting time,
-;;;; neither is time spent within the operating system. The result of
-;;;; this function is what the time command of the unix command line would
-;;;; report as user time.
-;;;; benchmark-system-time : similar to benchmark-user-time, but here the time
-;;;; spent within the operating system is given. The result of this
-;;;; function is what the time command of the unix command line would
-;;;; report as system time.
-;;;; benchmark-frame-time : this function takes the argument ITERATIONS. It
-;;;; reports the part of the user time that is consumed by the
-;;;; benchmarking framework itself to run some benchmark for the giben
-;;;; number of iterations. You can think of this as the time that would
-;;;; still be consumed, even if the benchmarking code itself was empty.
-;;;; This value does not include any time for garbage collection, even if
-;;;; it is the benchmarking framework which is responsible for causing a
-;;;; garbage collection.
-;;;; benchmark-core-time : this function takes three arguments ITERATIONS,
-;;;; BEFORE and AFTER. It reports the part of the user time that is
-;;;; actually spent within the benchmarking code. That is, the time
-;;;; needed for the benchmarking framework is subtracted from the user
-;;;; time. This value, however, includes all garbage collection times,
-;;;; even if some part of the gc-time had actually to be attributed to the
-;;;; benchmarking framework.
-;;;; benchmark-user-time\interpreter : this function takes three arguments
-;;;; BEFORE AFTER and GC-TIME. It reports the part of the user time that
-;;;; is spent in the interpreter (and not in garbage collection).
-;;;; benchmark-core-time\interpreter : this function takes four arguments
-;;;; ITERATIONS, BEFORE, AFTER. and GC-TIME. It reports the part of the
-;;;; benchmark-core-time that is spent in the interpreter (and not in
-;;;; garbage collection). This value is most probably the one you are
-;;;; interested in, except if you are doing some garbage collection
-;;;; checks.
-;;;;
-;;;; There is not function to calculate the garbage-collection time, since the
-;;;; garbage collection time is already passed as an argument GC-TIME to the
-;;;; reporter functions.
-
-
-;;;; MISCELLANEOUS
-;;;;
-
-;;; Scale the number of iterations according to the given scaling factor.
-(define iteration-factor 1)
-(define (scale-iterations iterations)
- (let* ((i (inexact->exact (round (* iterations iteration-factor)))))
- (if (< i 1) 1 i)))
-
-;;;; CORE FUNCTIONS
-;;;;
-
-;;; The central routine for executing benchmarks.
-;;; The idea is taken from Greg, the GNUstep regression test environment.
-(define run-benchmark #f)
-(let ((benchmark-running #f))
- (define (local-run-benchmark name iterations thunk)
- (if benchmark-running
- (error "Nested calls to run-benchmark are not permitted.")
- (let ((benchmark-name (full-name name))
- (iterations (scale-iterations iterations)))
- (set! benchmark-running #t)
- (let ((before #f) (after #f) (gc-time #f))
- (gc)
- (set! gc-time (gc-run-time))
- (set! before (times))
- (do ((i 0 (+ i 1)))
- ((= i iterations))
- (thunk))
- (set! after (times))
- (set! gc-time (- (gc-run-time) gc-time))
- (report benchmark-name iterations before after gc-time))
- (set! benchmark-running #f))))
- (set! run-benchmark local-run-benchmark))
-
-;;; A short form for benchmarks.
-(defmacro benchmark (name iterations body . rest)
- `(,run-benchmark ,name ,iterations (lambda () ,body ,@rest)))
-
-
-;;;; BENCHMARK NAMES
-;;;;
-
-;;;; Turn a benchmark name into a nice human-readable string.
-(define (format-benchmark-name name)
- (call-with-output-string
- (lambda (port)
- (let loop ((name name)
- (separator ""))
- (if (pair? name)
- (begin
- (display separator port)
- (display (car name) port)
- (loop (cdr name) ": ")))))))
-
-;;;; For a given benchmark-name, deliver the full name including all prefixes.
-(define (full-name name)
- (append (current-benchmark-prefix) (list name)))
-
-;;; A fluid containing the current benchmark prefix, as a list.
-(define prefix-fluid (make-fluid))
-(fluid-set! prefix-fluid '())
-(define (current-benchmark-prefix)
- (fluid-ref prefix-fluid))
-
-;;; Postpend PREFIX to the current name prefix while evaluting THUNK.
-;;; The name prefix is only changed within the dynamic scope of the
-;;; call to with-benchmark-prefix*. Return the value returned by THUNK.
-(define (with-benchmark-prefix* prefix thunk)
- (with-fluids ((prefix-fluid
- (append (fluid-ref prefix-fluid) (list prefix))))
- (thunk)))
-
-;;; (with-benchmark-prefix PREFIX BODY ...)
-;;; Postpend PREFIX to the current name prefix while evaluating BODY ...
-;;; The name prefix is only changed within the dynamic scope of the
-;;; with-benchmark-prefix expression. Return the value returned by the last
-;;; BODY expression.
-(defmacro with-benchmark-prefix (prefix . body)
- `(with-benchmark-prefix* ,prefix (lambda () ,@body)))
-
-
-;;;; TIME CALCULATION
-;;;;
-
-(define benchmark-time-base
- internal-time-units-per-second)
-
-(define time-base ;; short-cut, not exported
- benchmark-time-base)
-
-(define frame-time/iteration
- "<will be set during initialization>")
-
-(define (benchmark-total-time before after)
- (- (tms:clock after) (tms:clock before)))
-
-(define (benchmark-user-time before after)
- (- (tms:utime after) (tms:utime before)))
-
-(define (benchmark-system-time before after)
- (- (tms:stime after) (tms:stime before)))
-
-(define (benchmark-frame-time iterations)
- (* iterations frame-time/iteration))
-
-(define (benchmark-core-time iterations before after)
- (- (benchmark-user-time before after) (benchmark-frame-time iterations)))
-
-(define (benchmark-user-time\interpreter before after gc-time)
- (- (benchmark-user-time before after) gc-time))
-
-(define (benchmark-core-time\interpreter iterations before after gc-time)
- (- (benchmark-core-time iterations before after) gc-time))
-
-
-;;;; REPORTERS
-;;;;
-
-;;; The global list of reporters.
-(define reporters '())
-
-;;; The default reporter, to be used only if no others exist.
-(define default-reporter #f)
-
-;;; Add the procedure REPORTER to the current set of reporter functions.
-;;; Signal an error if that reporter procedure object is already registered.
-(define (register-reporter reporter)
- (if (memq reporter reporters)
- (error "register-reporter: reporter already registered: " reporter))
- (set! reporters (cons reporter reporters)))
-
-;;; Remove the procedure REPORTER from the current set of reporter
-;;; functions. Signal an error if REPORTER is not currently registered.
-(define (unregister-reporter reporter)
- (if (memq reporter reporters)
- (set! reporters (delq! reporter reporters))
- (error "unregister-reporter: reporter not registered: " reporter)))
-
-;;; Return true iff REPORTER is in the current set of reporter functions.
-(define (reporter-registered? reporter)
- (if (memq reporter reporters) #t #f))
-
-;;; Send RESULT to all currently registered reporter functions.
-(define (report . args)
- (if (pair? reporters)
- (for-each (lambda (reporter) (apply reporter args))
- reporters)
- (apply default-reporter args)))
-
-
-;;;; Some useful standard reporters:
-;;;; Log reporters write all benchmark results to a given log file.
-;;;; Full reporters write all benchmark results to the standard output.
-;;;; User reporters write some interesting results to the standard output.
-
-;;; Display a single benchmark result to the given port
-(define (print-result port name iterations before after gc-time)
- (let* ((name (format-benchmark-name name))
- (total-time (benchmark-total-time before after))
- (user-time (benchmark-user-time before after))
- (system-time (benchmark-system-time before after))
- (frame-time (benchmark-frame-time iterations))
- (benchmark-time (benchmark-core-time iterations before after))
- (user-time\interpreter
- (benchmark-user-time\interpreter before after gc-time))
- (benchmark-core-time\interpreter
- (benchmark-core-time\interpreter iterations before after gc-time)))
- (write (list name iterations
- 'total (/ total-time time-base)
- 'user (/ user-time time-base)
- 'system (/ system-time time-base)
- 'frame (/ frame-time time-base)
- 'benchmark (/ benchmark-time time-base)
- 'user/interp (/ user-time\interpreter time-base)
- 'bench/interp (/ benchmark-core-time\interpreter time-base)
- 'gc (/ gc-time time-base))
- port)
- (newline port)))
-
-;;; Return a reporter procedure which prints all results to the file
-;;; FILE, in human-readable form. FILE may be a filename, or a port.
-(define (make-log-reporter file)
- (let ((port (if (output-port? file) file
- (open-output-file file))))
- (lambda args
- (apply print-result port args)
- (force-output port))))
-
-;;; A reporter that reports all results to the user.
-(define (full-reporter . args)
- (apply print-result (current-output-port) args))
-
-;;; Display interesting results of a single benchmark to the given port
-(define (print-user-result port name iterations before after gc-time)
- (let* ((name (format-benchmark-name name))
- (user-time (benchmark-user-time before after))
- (benchmark-time (benchmark-core-time iterations before after))
- (benchmark-core-time\interpreter
- (benchmark-core-time\interpreter iterations before after gc-time)))
- (write (list name iterations
- 'user (/ user-time time-base)
- 'benchmark (/ benchmark-time time-base)
- 'bench/interp (/ benchmark-core-time\interpreter time-base)
- 'gc (/ gc-time time-base))
- port)
- (newline port)))
-
-;;; A reporter that reports interesting results to the user.
-(define (user-reporter . args)
- (apply print-user-result (current-output-port) args))
-
-
-;;;; Initialize the benchmarking system:
-;;;;
-
-;;; First, make sure the benchmarking routines are compiled.
-(define (null-reporter . args) #t)
-(set! default-reporter null-reporter)
-(benchmark "empty initialization benchmark" 2 #t)
-
-;;; Second, initialize the system constants
-(display ";; calibrating the benchmarking framework..." (current-output-port))
-(newline (current-output-port))
-(define (initialization-reporter name iterations before after gc-time)
- (let* ((frame-time (- (tms:utime after) (tms:utime before) gc-time 3)))
- (set! frame-time/iteration (/ frame-time iterations))
- (display ";; framework time per iteration: " (current-output-port))
- (display (/ frame-time/iteration time-base) (current-output-port))
- (newline (current-output-port))))
-(set! default-reporter initialization-reporter)
-(benchmark "empty initialization benchmark" 524288 #t)
-
-;;; Finally, set the default reporter
-(set! default-reporter user-reporter)
diff --git a/check-guile.in b/check-guile.in
deleted file mode 100644
index f66bf13be..000000000
--- a/check-guile.in
+++ /dev/null
@@ -1,48 +0,0 @@
-#! /bin/sh
-# Usage: check-guile [-i GUILE-INTERPRETER] [GUILE-TEST-ARGS]
-# If `-i GUILE-INTERPRETER' is omitted, use ${top_builddir}/pre-inst-guile.
-# See ${top_srcdir}/test-suite/guile-test for documentation on GUILE-TEST-ARGS.
-#
-# Example invocations:
-# ./check-guile
-# ./check-guile numbers.test
-# ./check-guile -i /usr/local/bin/guile
-# ./check-guile -i /usr/local/bin/guile numbers.test
-
-set -e
-
-top_builddir=@top_builddir_absolute@
-top_srcdir=@top_srcdir_absolute@
-
-TEST_SUITE_DIR=${top_srcdir}/test-suite
-
-if [ x"$1" = x-i ] ; then
- guile=$2
- shift
- shift
-else
- guile=${top_builddir}/pre-inst-guile
-fi
-
-GUILE_LOAD_PATH=$TEST_SUITE_DIR
-export GUILE_LOAD_PATH
-
-if [ -f "$guile" -a -x "$guile" ] ; then
- echo Testing $guile ... "$@"
- echo with GUILE_LOAD_PATH=$GUILE_LOAD_PATH
-else
- echo ERROR: Cannot execute $guile
- exit 1
-fi
-
-# documentation searching ignores GUILE_LOAD_PATH.
-if [ ! -f guile-procedures.txt ] ; then
- @LN_S@ libguile/guile-procedures.txt .
-fi
-
-exec $guile \
- -e main -s "$TEST_SUITE_DIR/guile-test" \
- --test-suite "$TEST_SUITE_DIR/tests" \
- --log-file check-guile.log "$@"
-
-# check-guile ends here
diff --git a/configure.in b/configure.in
deleted file mode 100644
index e052141cc..000000000
--- a/configure.in
+++ /dev/null
@@ -1,864 +0,0 @@
-dnl configuration script for Guile
-dnl Process this file with autoconf to produce configure.
-dnl
-dnl Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
-dnl
-dnl This file is part of GUILE
-dnl
-dnl GUILE is free software; you can redistribute it and/or modify it
-dnl under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2, or (at your
-dnl option) any later version.
-dnl
-dnl GUILE is distributed in the hope that it will be useful, but
-dnl WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with GUILE; see the file COPYING. If not, write to the
-dnl Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-dnl Boston, MA 02111-1307, USA.
-
-AC_PREREQ(2.53)
-
-AC_INIT
-AC_CONFIG_SRCDIR([Makefile.in])
-. $srcdir/GUILE-VERSION
-AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
-AM_MAINTAINER_MODE
-AM_CONFIG_HEADER(libguile/scmconfig.h)
-
-#--------------------------------------------------------------------
-#
-# Independent Subdirectories
-#
-#--------------------------------------------------------------------
-
-AC_CONFIG_SUBDIRS(guile-readline)
-
-#--------------------------------------------------------------------
-#
-# User options
-#
-#--------------------------------------------------------------------
-
-AC_ARG_ENABLE(error-on-warning,
- [ --enable-error-on-warning treat compile warnings as errors],
- [case "${enableval}" in
- yes | y) CFLAGS="${CFLAGS} -Werror"; enable_compile_warnings=no ;;
- no | n) ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --enable-error-on-warning) ;;
- esac])
-
-
-AC_ARG_ENABLE(debug-freelist,
- [ --enable-debug-freelist include garbage collector freelist debugging code],
- if test "$enable_debug_freelist" = y || test "$enable_debug_freelist" = yes; then
- AC_DEFINE(GUILE_DEBUG_FREELIST, 1,
- [Define this if you want to debug the free list (helps w/ GC bugs).])
- fi)
-
-AC_ARG_ENABLE(debug-malloc,
- [ --enable-debug-malloc include malloc debugging code],
- if test "$enable_debug_malloc" = y || test "$enable_debug_malloc" = yes; then
- AC_DEFINE(GUILE_DEBUG_MALLOC, 1,
- [Define this if you want to debug scm_must_malloc/realloc/free calls.])
- fi)
-
-AC_ARG_ENABLE(guile-debug,
- [ --enable-guile-debug include internal debugging functions],
- if test "$enable_guile_debug" = y || test "$enable_guile_debug" = yes; then
- AC_DEFINE(GUILE_DEBUG, 1,
- [Define this to include various undocumented functions used to debug.])
- fi)
-
-AC_ARG_ENABLE(arrays,
- [ --disable-arrays omit array and uniform array support],,
- enable_arrays=yes)
-
-AC_ARG_ENABLE(posix,
- [ --disable-posix omit posix interfaces],,
- enable_posix=yes)
-
-AC_ARG_ENABLE(networking,
- [ --disable-networking omit networking interfaces],,
- enable_networking=yes)
-
-AC_ARG_ENABLE(regex,
- [ --disable-regex omit regular expression interfaces],,
- enable_regex=yes)
-
-AC_ARG_ENABLE(htmldoc,
- [ --enable-htmldoc build HTML documentation as well as Info],
- [if test "$enable_htmldoc" = "" || test "$enable_htmldoc" = y || test "$enable_htmldoc" = yes; then
- htmldoc_enabled=yes
- AC_PATH_PROG(TEXI2HTML, texi2html, not found)
- if test "$TEXI2HTML" = "not found"; then
- echo
- echo Building HTML documentation requires the \`texi2html\' program,
- echo which appears not to be present on your machine.
- echo
- echo \`texi2html\' is available from
- echo 'http://www.mathematik.uni-kl.de/~obachman/Texi2html/.'
- echo
- echo In the meantime, to build the guile-doc distribution
- echo without HTML enabled, please rerun \`./configure\' without
- echo the \`--enable-htmldoc\' option.
- exit -1
- fi
- fi])
-
-AM_CONDITIONAL(HTMLDOC, test x$htmldoc_enabled = xyes)
-
-AC_ARG_ENABLE(deprecated,
- [ --disable-deprecated omit deprecated features [no]])
-
-AH_TEMPLATE([SCM_ENABLE_DEPRECATED],
- [Define this to 1 if you want to include deprecated features.])
-
-if test "$enable_deprecated" = no; then
- AC_DEFINE(SCM_ENABLE_DEPRECATED, 0)
-else
- if test "$enable_deprecated" = yes || test "$enable_deprecated" = ""; then
- warn_default=summary
- elif test "$enable_deprecated" = shutup; then
- warn_default=no
- else
- warn_default=$enable_deprecated
- fi
- AC_DEFINE(SCM_ENABLE_DEPRECATED, 1)
- AC_DEFINE_UNQUOTED(SCM_WARN_DEPRECATED_DEFAULT, "$warn_default",
- [Define this to control the default warning level for deprecated features.])
-fi
-
-dnl The --disable-debug used to control these two. But now they are
-dnl a required part of the distribution.
-AC_DEFINE(DEBUG_EXTENSIONS, 1,
- [Define if you want support for debugging Scheme programs.])
-AC_DEFINE(READER_EXTENSIONS, 1,
- [Define if you want support for debugging Scheme programs.])
-
-AC_ARG_ENABLE(elisp,
- [ --disable-elisp omit Emacs Lisp support],,
- enable_elisp=yes)
-
-#--------------------------------------------------------------------
-
-dnl Some more checks for Win32
-AC_CYGWIN
-AC_MINGW32
-AC_LIBTOOL_WIN32_DLL
-
-AC_LIBLTDL_INSTALLABLE
-AC_CONFIG_SUBDIRS(libltdl)
-
-AC_PROG_INSTALL
-AC_PROG_CC
-AC_PROG_CPP
-AC_LIBTOOL_DLOPEN
-
-AC_AIX
-AC_ISC_POSIX
-AC_MINIX
-
-AM_PROG_CC_STDC
-
-## Needed for building DLLs on Cygwin, before AM_PROG_LIBTOOL
-AC_LIBTOOL_WIN32_DLL
-AM_PROG_LIBTOOL
-
-AC_CHECK_PROG(have_makeinfo, makeinfo, yes, no)
-AM_CONDITIONAL(HAVE_MAKEINFO, test "$have_makeinfo" = yes)
-
-dnl Check for dynamic linking
-
-use_modules=yes
-AC_ARG_WITH(modules,
-[ --with-modules[=FILES] Add support for dynamic modules],
-use_modules="$withval")
-test -z "$use_modules" && use_modules=yes
-DLPREOPEN=
-if test "$use_modules" != no; then
- AC_DEFINE(DYNAMIC_LINKING, 1,
- [Define if you want support for dynamic linking.])
- if test "$use_modules" = yes; then
- DLPREOPEN="-dlpreopen force"
- else
- DLPREOPEN="-export-dynamic"
- for module in $use_modules; do
- DLPREOPEN="$DLPREOPEN -dlopen $module"
- done
- fi
-fi
-
-dnl files which are destined for separate modules.
-
-if test "$use_modules" != no; then
- AC_LIBOBJ([dynl])
-fi
-
-if test "$enable_arrays" = yes; then
- AC_LIBOBJ([ramap])
- AC_LIBOBJ([unif])
- AC_DEFINE(HAVE_ARRAYS, 1,
- [Define this if you want support for arrays and uniform arrays.])
-fi
-
-if test "$enable_posix" = yes; then
- AC_LIBOBJ([filesys])
- AC_LIBOBJ([posix])
- AC_DEFINE(HAVE_POSIX, 1,
- [Define this if you want support for POSIX system calls in Guile.])
-fi
-
-if test "$enable_networking" = yes; then
- AC_LIBOBJ([net_db])
- AC_LIBOBJ([socket])
- AC_DEFINE(HAVE_NETWORKING, 1,
- [Define this if you want support for networking in Guile.])
-fi
-
-if test "$enable_debug_malloc" = yes; then
- AC_LIBOBJ([debug-malloc])
-fi
-
-if test "$enable_elisp" = yes; then
- AC_DEFINE(SCM_ENABLE_ELISP, 1,
- [Define this if you want Elisp support (in addition to Scheme).])
-fi
-
-
-AC_C_CONST
-AC_C_INLINE
-AC_C_BIGENDIAN
-
-if test "$ac_cv_c_inline" != no; then
- AC_DEFINE(HAVE_INLINE, 1,
- [Define if the compiler supports inline functions.])
-fi
-
-AC_CHECK_SIZEOF(short)
-AC_CHECK_SIZEOF(int)
-AC_CHECK_SIZEOF(long)
-AC_CHECK_SIZEOF(size_t)
-
-dnl Check for integral types that can represent the range of pointers.
-dnl If these types don't exist on this platform, they are replaced by
-dnl "unsigned long" and "long", respectively.
-
-AC_CHECK_HEADERS(stdint.h)
-AC_CHECK_HEADERS(inttypes.h)
-AC_CHECK_SIZEOF(uintptr_t)
-AC_CHECK_SIZEOF(ptrdiff_t)
-
-AC_CHECK_SIZEOF(long long)
-
-AC_CHECK_SIZEOF(void *)
-
-if test "$ac_cv_sizeof_long" -ne "$ac_cv_sizeof_void_p"; then
- AC_MSG_ERROR(sizes of long and void* are not identical)
-fi
-
-AC_HEADER_STDC
-AC_HEADER_DIRENT
-AC_HEADER_TIME
-AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(io.h libc.h limits.h malloc.h memory.h string.h regex.h rxposix.h rx/rxposix.h sys/ioctl.h sys/select.h sys/time.h sys/timeb.h sys/times.h sys/stdtypes.h sys/types.h sys/utime.h time.h unistd.h utime.h pwd.h grp.h sys/utsname.h direct.h)
-GUILE_HEADER_LIBC_WITH_UNISTD
-
-AC_TYPE_GETGROUPS
-AC_TYPE_SIGNAL
-AC_TYPE_MODE_T
-
-AC_CHECK_LIB(m, main)
-AC_CHECK_FUNCS(gethostbyname)
-if test $ac_cv_func_gethostbyname = no; then
- AC_CHECK_LIB(nsl, gethostbyname)
-fi
-AC_CHECK_FUNCS(connect)
-if test $ac_cv_func_connect = no; then
- AC_CHECK_LIB(socket, connect)
-fi
-
-dnl
-dnl Check for Winsock and other functionality on Win32 (*not* CygWin)
-dnl
-EXTRA_DEFS=""
-if test "$MINGW32" = "yes" ; then
- AC_CHECK_HEADER(winsock2.h, [AC_DEFINE([HAVE_WINSOCK2_H], 1,
- [Define if you have the <winsock2.h> header file.])])
- AC_CHECK_LIB(ws2_32, main)
- AC_LIBOBJ([win32-uname])
- AC_LIBOBJ([win32-dirent])
- if test "$enable_networking" = yes ; then
- AC_LIBOBJ([win32-socket])
- fi
- if test "$enable_shared" = yes ; then
- EXTRA_DEFS="-DSCM_IMPORT"
- AC_DEFINE(USE_DLL_IMPORT, 1,
- [Define if you need additional CPP macros on Win32 platforms.])
- fi
- if test x"$enable_ltdl_install" = x"yes" ; then
- INCLTDL="-DLIBLTDL_DLL_IMPORT $INCLTDL"
- fi
-fi
-AC_SUBST(EXTRA_DEFS)
-
-AC_SUBST(INCLTDL)
-AC_SUBST(LIBLTDL)
-AC_SUBST(DLPREOPEN)
-
-AC_CHECK_FUNCS(ctermid ftime fchown getcwd geteuid gettimeofday lstat mkdir mknod nice readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction siginterrupt strftime strptime symlink sync tcgetpgrp tcsetpgrp times uname waitpid strdup system usleep atexit on_exit chown link fcntl ttyname getpwent getgrent kill getppid getpgrp fork setitimer getitimer)
-
-AC_CHECK_HEADERS(crypt.h sys/resource.h sys/file.h)
-AC_CHECK_FUNCS(chroot flock getlogin cuserid getpriority setpriority getpass sethostname gethostname)
-AC_CHECK_LIB(crypt, crypt)
-
-### Some systems don't declare some functions. On such systems, we
-### need to at least provide our own K&R-style declarations.
-
-### GUILE_FUNC_DECLARED(function, headerfile)
-
-### Check for a declaration of FUNCTION in HEADERFILE; if it is
-### not there, #define MISSING_FUNCTION_DECL.
-AC_DEFUN(GUILE_FUNC_DECLARED, [
- AC_CACHE_CHECK(for $1 declaration, guile_cv_func_$1_declared,
- AC_EGREP_HEADER($1, $2,
- guile_cv_func_$1_declared=yes,
- guile_cv_func_$1_declared=no))
- if test [x$guile_cv_func_]$1[_declared] = xno; then
- AC_DEFINE([MISSING_]translit($1, [a-z], [A-Z])[_DECL], 1,
- [Define if the operating system supplies $1 without declaring it.])
- fi
-])
-
-GUILE_FUNC_DECLARED(strptime, time.h)
-GUILE_FUNC_DECLARED(sleep, unistd.h)
-GUILE_FUNC_DECLARED(usleep, unistd.h)
-
-### On some systems usleep has no return value. If it does have one,
-### we'd like to return it; otherwise, we'll fake it.
-AC_CACHE_CHECK([return type of usleep], guile_cv_func_usleep_return_type,
- [AC_EGREP_HEADER(changequote(<, >)<void[ ]+usleep>changequote([, ]),
- unistd.h,
- [guile_cv_func_usleep_return_type=void],
- [guile_cv_func_usleep_return_type=int])])
-case "$guile_cv_func_usleep_return_type" in
- "void" )
- AC_DEFINE(USLEEP_RETURNS_VOID, 1,
- [Define if the system headers declare usleep to return void.])
- ;;
-esac
-
-AC_CHECK_HEADER(sys/un.h, have_sys_un_h=1)
-if test -n "$have_sys_un_h" ; then
- AC_DEFINE(HAVE_UNIX_DOMAIN_SOCKETS, 1,
- [Define if the system supports Unix-domain (file-domain) sockets.])
-fi
-
-AC_CHECK_FUNCS(socketpair getgroups setpwent pause tzset)
-
-AC_CHECK_FUNCS(sethostent gethostent endhostent dnl
- setnetent getnetent endnetent dnl
- setprotoent getprotoent endprotoent dnl
- setservent getservent endservent dnl
- getnetbyaddr getnetbyname dnl
- inet_lnaof inet_makeaddr inet_netof hstrerror dnl
- inet_pton inet_ntop)
-
-dnl Some systems do not declare this. Some systems do declare it, as a
-dnl macro. With cygwin it may be in a DLL.
-
-AC_MSG_CHECKING(whether netdb.h declares h_errno)
-AC_CACHE_VAL(guile_cv_have_h_errno,
-[AC_TRY_COMPILE([#include <netdb.h>],
-[int a = h_errno;],
-guile_cv_have_h_errno=yes, guile_cv_have_h_errno=no)])
-AC_MSG_RESULT($guile_cv_have_h_errno)
-if test $guile_cv_have_h_errno = yes; then
- AC_DEFINE(HAVE_H_ERRNO, 1, [Define if h_errno is declared in netdb.h.])
-fi
-
-AC_MSG_CHECKING(whether uint32_t is defined)
-AC_CACHE_VAL(guile_cv_have_uint32_t,
- [AC_TRY_COMPILE([#include <sys/types.h>
- #if HAVE_STDINT_H
- #include <stdint.h>
- #endif
- #ifndef __MINGW32__
- #include <netdb.h>
- #endif],
- [uint32_t a;],
- guile_cv_have_uint32_t=yes, guile_cv_have_uint32_t=no)])
-AC_MSG_RESULT($guile_cv_have_uint32_t)
-if test $guile_cv_have_uint32_t = yes; then
- AC_DEFINE(HAVE_UINT32_T, 1,
- [Define if uint32_t typedef is defined when netdb.h is include.])
-fi
-
-AC_MSG_CHECKING(for working IPv6 support)
-AC_CACHE_VAL(guile_cv_have_ipv6,
-[AC_TRY_COMPILE([
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#include <netinet/in.h>
-#include <sys/socket.h>],
-[struct sockaddr_in6 a; a.sin6_family = AF_INET6;],
-guile_cv_have_ipv6=yes, guile_cv_have_ipv6=no)])
-AC_MSG_RESULT($guile_cv_have_ipv6)
-if test $guile_cv_have_ipv6 = yes; then
- AC_DEFINE(HAVE_IPV6, 1, [Define if you want support for IPv6.])
-fi
-
-# included in rfc2553 but not in older implementations, e.g., glibc 2.1.3.
-AC_MSG_CHECKING(whether sockaddr_in6 has sin6_scope_id)
-AC_CACHE_VAL(guile_cv_have_sin6_scope_id,
-[AC_TRY_COMPILE([
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#include <netinet/in.h>],
-[struct sockaddr_in6 sok; sok.sin6_scope_id = 0;],
-guile_cv_have_sin6_scope_id=yes, guile_cv_have_sin6_scope_id=no)])
-AC_MSG_RESULT($guile_cv_have_sin6_scope_id)
-if test $guile_cv_have_sin6_scope_id = yes; then
- AC_DEFINE(HAVE_SIN6_SCOPE_ID, 1,
- [Define this if your IPv6 has sin6_scope_id in sockaddr_in6 struct.])
-fi
-
-AC_MSG_CHECKING(whether localtime caches TZ)
-AC_CACHE_VAL(guile_cv_localtime_cache,
-[if test x$ac_cv_func_tzset = xyes; then
-AC_TRY_RUN([#include <time.h>
-#if STDC_HEADERS
-# include <stdlib.h>
-#endif
-extern char **environ;
-unset_TZ ()
-{
- char **from, **to;
- for (to = from = environ; (*to = *from); from++)
- if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
- to++;
-}
-char TZ_GMT0[] = "TZ=GMT0";
-char TZ_PST8[] = "TZ=PST8";
-main()
-{
- time_t now = time ((time_t *) 0);
- int hour_GMT0, hour_unset;
- if (putenv (TZ_GMT0) != 0)
- exit (1);
- hour_GMT0 = localtime (&now)->tm_hour;
- unset_TZ ();
- hour_unset = localtime (&now)->tm_hour;
- if (putenv (TZ_PST8) != 0)
- exit (1);
- if (localtime (&now)->tm_hour == hour_GMT0)
- exit (1);
- unset_TZ ();
- if (localtime (&now)->tm_hour != hour_unset)
- exit (1);
- exit (0);
-}], guile_cv_localtime_cache=no, guile_cv_localtime_cache=yes,
-[# If we have tzset, assume the worst when cross-compiling.
-guile_cv_localtime_cache=yes])
-else
- # If we lack tzset, report that localtime does not cache TZ,
- # since we can't invalidate the cache if we don't have tzset.
- guile_cv_localtime_cache=no
-fi])dnl
-AC_MSG_RESULT($guile_cv_localtime_cache)
-if test $guile_cv_localtime_cache = yes; then
- AC_DEFINE(LOCALTIME_CACHE, 1, [Define if localtime caches the TZ setting.])
-fi
-
-dnl Test whether system calls are restartable by default on the
-dnl current system. If they are not, we put a loop around every system
-dnl call to check for EINTR (see SCM_SYSCALL) and do not attempt to
-dnl change from the default behaviour. On the other hand, if signals
-dnl are restartable then the loop is not installed and when libguile
-dnl initialises it also resets the behaviour of each signal to cause a
-dnl restart (in case a different runtime had a different default
-dnl behaviour for some reason: e.g., different versions of linux seem
-dnl to behave differently.)
-
-AC_SYS_RESTARTABLE_SYSCALLS
-
-if test "$enable_regex" = yes; then
- if test "$ac_cv_header_regex_h" = yes ||
- test "$ac_cv_header_rxposix_h" = yes ||
- test "$ac_cv_header_rx_rxposix_h" = yes; then
- GUILE_NAMED_CHECK_FUNC(regcomp, norx, [AC_LIBOBJ([regex-posix])],
- [AC_CHECK_LIB(rx, main)
- GUILE_NAMED_CHECK_FUNC(regcomp, rx, [AC_LIBOBJ([regex-posix])],
- [AC_CHECK_LIB(regex, main)
- GUILE_NAMED_CHECK_FUNC(regcomp, regex, [AC_LIBOBJ([regex-posix])])])]
- )
- dnl The following should not be necessary, but for some reason
- dnl autoheader misses it if we don't include it!
- if test "$ac_cv_func_regcomp_norx" = yes ||
- test "$ac_cv_func_regcomp_regex" = yes ||
- test "$ac_cv_func_regcomp_rx" = yes; then
- AC_DEFINE(HAVE_REGCOMP, 1,
- [This is included as part of a workaround for a autoheader bug.])
- fi
- fi
-fi
-
-AC_REPLACE_FUNCS(inet_aton putenv strerror memmove mkstemp)
-
-AC_CHECK_HEADERS(floatingpoint.h ieeefp.h nan.h)
-
-AC_CHECK_FUNCS(finite isinf isnan copysign)
-
-# When testing for the presence of alloca, we need to add alloca.o
-# explicitly to LIBOBJS to make sure that it is translated to
-# `alloca.lo' for libtool later on. This can and should be done more cleanly.
-AC_FUNC_ALLOCA
-if test "$ALLOCA" = "alloca.o"; then AC_LIBOBJ([alloca]); fi
-
-AC_CHECK_MEMBERS([struct stat.st_rdev])
-AC_CHECK_MEMBERS([struct stat.st_blksize])
-
-AC_STRUCT_ST_BLOCKS
-
-AC_CACHE_CHECK([for S_ISLNK in sys/stat.h], ac_cv_macro_S_ISLNK,
- [AC_TRY_CPP([#include <sys/stat.h>
- #ifndef S_ISLNK
- #error no S_ISLNK
- #endif],
- ac_cv_macro_S_ISLNK=yes,
- ac_cv_macro_S_ISLNK=no)])
-if test $ac_cv_macro_S_ISLNK = yes; then
- AC_DEFINE(HAVE_S_ISLNK, 1,
- [Define this if your system defines S_ISLNK in sys/stat.h.])
-fi
-
-AC_STRUCT_TIMEZONE
-GUILE_STRUCT_UTIMBUF
-
-#--------------------------------------------------------------------
-#
-# Which way does the stack grow?
-#
-#--------------------------------------------------------------------
-
-AC_TRY_RUN(aux (l) unsigned long l;
- { int x; exit (l >= ((unsigned long)&x)); }
- main () { int q; aux((unsigned long)&q); },
- [AC_DEFINE([SCM_STACK_GROWS_UP], 1,
- [Define this if a callee's stack frame has a higher address
- than the caller's stack frame. On most machines, this is
- not the case.])],
- [],
- [AC_MSG_WARN(Guessing that stack grows down -- see scmconfig.h.in)])
-
-AH_TEMPLATE([SCM_SINGLES],
- [Define this if floats are the same size as longs.])
-
-AC_CACHE_CHECK([whether floats fit in longs], guile_cv_type_float_fits_long,
- [AC_TRY_RUN([main () { exit (sizeof(float) > sizeof(long)); }],
- [guile_cv_type_float_fits_long=yes],
- [guile_cv_type_float_fits_long=no],
- [guile_cv_type_float_fits_long=guess-yes])])
-case $guile_cv_type_float_fits_long in
- "yes" )
- AC_DEFINE(SCM_SINGLES)
- ;;
- "guess-yes" )
- AC_DEFINE(SCM_SINGLES)
- AC_MSG_WARN([guessing that sizeof(long) == sizeof(float)])
- AC_MSG_WARN([see SCM_SINGLES in scmconfig.h.in])
- ;;
-esac
-
-
-AC_MSG_CHECKING(for struct linger)
-AC_CACHE_VAL(scm_cv_struct_linger,
- AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/socket.h>],
- [struct linger lgr; lgr.l_linger = 100],
- scm_cv_struct_linger="yes",
- scm_cv_struct_linger="no"))
-AC_MSG_RESULT($scm_cv_struct_linger)
-if test $scm_cv_struct_linger = yes; then
- AC_DEFINE(HAVE_STRUCT_LINGER, 1,
- [Define this if your system defines struct linger, for use with the
- getsockopt and setsockopt system calls.])
-fi
-
-
-AC_MSG_CHECKING(for struct timespec)
-AC_CACHE_VAL(scm_cv_struct_timespec,
- AC_TRY_COMPILE([
-#include <time.h>],
- [struct timespec t; t.tv_nsec = 100],
- scm_cv_struct_timespec="yes",
- scm_cv_struct_timespec="no"))
-AC_MSG_RESULT($scm_cv_struct_timespec)
-if test $scm_cv_struct_timespec = yes; then
- AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
- [Define this if your system defines struct timespec via <time.h>.])
-fi
-
-#--------------------------------------------------------------------
-#
-# Flags for thread support
-#
-#--------------------------------------------------------------------
-
-### What thread package has the user asked for?
-AC_ARG_WITH(threads, [ --with-threads thread interface],
- , with_threads=no)
-
-### Turn $with_threads into either the name of a threads package, like
-### `qt', or `no', meaning that threads should not be supported.
-AC_MSG_CHECKING(whether to support threads)
-case "$with_threads" in
- "yes" | "qt" | "coop" | "")
- with_threads=qt
- ;;
- "no" )
- ;;
- * )
- AC_MSG_ERROR(invalid value for --with-threads: $with_threads)
- ;;
-esac
-AC_MSG_RESULT($with_threads)
-
-## Make sure the threads package we've chosen is actually supported on
-## the present platform.
-case "${with_threads}" in
- "qt" )
- ## This configures the QuickThreads package, and sets or clears
- ## the THREAD_PACKAGE variable if qthreads don't configure
- ## correctly.
- QTHREADS_CONFIGURE
- ;;
-esac
-
-## If we're using threads, bring in some other parts of Guile which
-## work with them.
-if test "${THREAD_PACKAGE}" != "" ; then
- AC_DEFINE(USE_THREADS, 1, [Define if using any sort of threads.])
-
- ## Include the Guile thread interface in the library...
- AC_LIBOBJ([threads])
-
- ## ... and tell it which package to talk to.
- case "${THREAD_PACKAGE}" in
- "QT" )
- AC_DEFINE(USE_COOP_THREADS, 1,
- [Define if using cooperative multithreading.])
- ;;
- * )
- AC_MSG_ERROR(invalid value for THREAD_PACKAGE: ${THREAD_PACKAGE})
- ;;
- esac
-
- ## Bring in scm_internal_select, if appropriate.
- if test $ac_cv_func_gettimeofday = yes &&
- test $ac_cv_func_select = yes; then
- AC_DEFINE(GUILE_ISELECT, 1, [Define to implement scm_internal_select.])
- fi
-
- AC_ARG_ENABLE(linuxthreads,
- [ --disable-linuxthreads disable linuxthreads workaround],,
- enable_linuxthreads=yes)
-
- ## Workaround for linuxthreads (optionally disabled)
- if test $host_os = linux-gnu -a "$enable_linuxthreads" = yes; then
- AC_DEFINE(GUILE_PTHREAD_COMPAT, 1,
- [Define to enable workaround for COOP-linuxthreads compatibility.])
- AC_CHECK_LIB(pthread, main)
- fi
-fi
-
-## Cross building
-if test "$cross_compiling" = "yes"; then
- AC_MSG_CHECKING(cc for build)
- ## /usr/bin/cc still uses wrong assembler
- ## CC_FOR_BUILD="${CC_FOR_BUILD-/usr/bincc}"
- CC_FOR_BUILD="${CC_FOR_BUILD-PATH=/usr/bin:$PATH cc}"
-else
- CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
-fi
-AC_ARG_WITH(cc-for-build,
- [ --with-cc-for-build=CC native C compiler, to be used during build])
-test -n "$with_cc_for_build" && CC_FOR_BUILD="$with_cc_for_build"
-
-## AC_MSG_CHECKING("if we are cross compiling")
-## AC_MSG_RESULT($cross_compiling)
-if test "$cross_compiling" = "yes"; then
- AC_MSG_RESULT($CC_FOR_BUILD)
-fi
-
-## No need as yet to be more elaborate
-CCLD_FOR_BUILD="$CC_FOR_BUILD"
-
-AC_SUBST(cross_compiling)
-AC_SUBST(CC_FOR_BUILD)
-AC_SUBST(CCLD_FOR_BUILD)
-
-## libtool erroneously calls CC_FOR_BUILD HOST_CC;
-## --HOST is the platform that PACKAGE is compiled for.
-HOST_CC="$CC_FOR_BUILD"
-AC_SUBST(HOST_CC)
-
-if test "$cross_compiling" = "yes"; then
- AC_MSG_CHECKING(guile for build)
- GUILE_FOR_BUILD="${GUILE_FOR_BUILD-guile}"
-else
- GUILE_FOR_BUILD='$(preinstguile)'
-fi
-AC_ARG_WITH(guile-for-build,
- [ --with-guile-for-build=guile native guile executable, to be used during build])
-test -n "$with_guile_for_build" && GUILE_FOR_BUILD="$with_guile_for_build"
-
-## AC_MSG_CHECKING("if we are cross compiling")
-## AC_MSG_RESULT($cross_compiling)
-if test "$cross_compiling" = "yes"; then
- AC_MSG_RESULT($GUILE_FOR_BUILD)
-fi
-AC_SUBST(GUILE_FOR_BUILD)
-
-## If we're using GCC, ask for aggressive warnings.
-case "$GCC" in
- yes )
- ## We had -Wstrict-prototypes in here for a bit, but Guile does too
- ## much stuff with generic function pointers for that to really be
- ## less than exasperating.
- ## -Wpointer-arith was here too, but something changed in gcc/glibc
- ## and it became equally exasperating (gcc 2.95 and/or glibc 2.1.2).
- CFLAGS="$CFLAGS -Wall -Wmissing-prototypes" ;;
-esac
-
-AC_PROG_AWK
-
-## NOTE the code below sets LIBOBJS directly and so is now forbidden
-## -- I'm disabling it for now in the hopes that the newer autoconf
-## will DTRT -- if not, we need to fix up the sed command to match the
-## others...
-##
-## Remove fileblocks.o from the object list. This file gets added by
-## the Autoconf macro AC_STRUCT_ST_BLOCKS. But there is no need.
-#LIBOBJS="`echo ${LIBOBJS} | sed 's/fileblocks\.o//g'`"
-
-## If we're creating a shared library (using libtool!), then we'll
-## need to generate a list of .lo files corresponding to the .o files
-## given in LIBOBJS. We'll call it LIBLOBJS.
-LIBLOBJS="`echo ${LIB@&t@OBJS} | sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`"
-
-## We also need to create corresponding .doc and .x files
-EXTRA_DOT_DOC_FILES="`echo ${LIB@&t@OBJS} | sed 's,\.[[^.]]* ,.doc ,g;s,\.[[^.]]*$,.doc,'`"
-EXTRA_DOT_X_FILES="`echo ${LIB@&t@OBJS} | sed 's,\.[[^.]]* ,.x ,g;s,\.[[^.]]*$,.x,'`"
-
-AC_SUBST(GUILE_MAJOR_VERSION)
-AC_SUBST(GUILE_MINOR_VERSION)
-AC_SUBST(GUILE_MICRO_VERSION)
-AC_SUBST(GUILE_VERSION)
-
-#######################################################################
-# library versioning
-
-AC_SUBST(LIBQTHREADS_INTERFACE_CURRENT)
-AC_SUBST(LIBQTHREADS_INTERFACE_REVISION)
-AC_SUBST(LIBQTHREADS_INTERFACE_AGE)
-AC_SUBST(LIBQTHREADS_INTERFACE)
-
-AC_SUBST(LIBGUILE_INTERFACE_CURRENT)
-AC_SUBST(LIBGUILE_INTERFACE_REVISION)
-AC_SUBST(LIBGUILE_INTERFACE_AGE)
-AC_SUBST(LIBGUILE_INTERFACE)
-
-AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE_CURRENT)
-AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE_REVISION)
-AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE_AGE)
-AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE)
-
-AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_INTERFACE_CURRENT)
-AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_INTERFACE_REVISION)
-AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_INTERFACE_AGE)
-AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_INTERFACE)
-
-#######################################################################
-
-dnl Tell guile-config what flags guile users should link against.
-GUILE_LIBS="$LDFLAGS $THREAD_LIBS_INSTALLED $LIBS"
-AC_SUBST(GUILE_LIBS)
-
-AC_SUBST(AWK)
-AC_SUBST(LIBLOBJS)
-AC_SUBST(EXTRA_DOT_DOC_FILES)
-AC_SUBST(EXTRA_DOT_X_FILES)
-
-dnl See also top_builddir in info node: (libtool)AC_PROG_LIBTOOL
-top_builddir_absolute=`pwd`
-AC_SUBST(top_builddir_absolute)
-top_srcdir_absolute=`(cd $srcdir ; pwd)`
-AC_SUBST(top_srcdir_absolute)
-
-AC_CONFIG_FILES([
- Makefile
- am/Makefile
- libguile/Makefile
- libguile/guile-snarf
- libguile/guile-doc-snarf
- libguile/guile-func-name-check
- libguile/guile-snarf-docs
- libguile/version.h
- ice-9/Makefile
- lang/Makefile
- lang/elisp/Makefile
- lang/elisp/internals/Makefile
- lang/elisp/primitives/Makefile
- oop/Makefile
- oop/goops/Makefile
- scripts/Makefile
- srfi/Makefile
- qt/Makefile
- qt/qt.h
- qt/md/Makefile
- qt/time/Makefile
- guile-config/Makefile
- doc/Makefile
- doc/ref/Makefile
- doc/tutorial/Makefile
- doc/goops/Makefile
- doc/r5rs/Makefile
- examples/Makefile
- examples/scripts/Makefile
- examples/box/Makefile
- examples/box-module/Makefile
- examples/box-dynamic/Makefile
- examples/box-dynamic-module/Makefile
- examples/modules/Makefile
- examples/safe/Makefile
- test-suite/Makefile
- check-guile
- benchmark-suite/Makefile
- benchmark-guile
- guile-tools
- pre-inst-guile])
-
-AC_CONFIG_COMMANDS(default,
- [ chmod +x libguile/guile-snarf \
- libguile/guile-doc-snarf \
- libguile/guile-func-name-check \
- libguile/guile-snarf-docs \
- check-guile \
- benchmark-guile \
- guile-tools \
- pre-inst-guile])
-
-AC_OUTPUT
-
-dnl Local Variables:
-dnl comment-start: "dnl "
-dnl comment-end: ""
-dnl comment-start-skip: "\\bdnl\\b\\s *"
-dnl End:
diff --git a/doc/.cvsignore b/doc/.cvsignore
deleted file mode 100644
index 86d66d588..000000000
--- a/doc/.cvsignore
+++ /dev/null
@@ -1,23 +0,0 @@
-*.aux
-*.cp
-*.cps
-*.dvi
-*.fn
-*.fns
-*.html
-*.info*
-*.ky
-*.log
-*.pg
-*.ps
-*.toc
-*.tp
-*.tps
-*.vr
-*.vrs
-Makefile
-Makefile.in
-stamp-vti
-stamp-vti1
-version-tutorial.texi
-version.texi
diff --git a/doc/BUGS b/doc/BUGS
deleted file mode 100644
index 736edaace..000000000
--- a/doc/BUGS
+++ /dev/null
@@ -1,13 +0,0 @@
-
-Known Guile documentation bugs -*- outline -*-
-
-* The building of HTML docs is dependent on GNU Make
-
-This is because the Makefile.am's for the Guile reference manual and
-tutorial use a $(shell ...) command to list the set of HTML files to
-install.
-
-Probably this will not be fixed until Automake gains proper HTML doc
-support. On the other hand, if we've overlooked a more
-version-independent way of achieving the same thing, please let us
-know.
diff --git a/doc/COPYING b/doc/COPYING
deleted file mode 100644
index eeb586b39..000000000
--- a/doc/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED 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.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
-
- 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 of the License, 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 program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) 19yy name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/doc/ChangeLog b/doc/ChangeLog
deleted file mode 100644
index 6d496a88e..000000000
--- a/doc/ChangeLog
+++ /dev/null
@@ -1,977 +0,0 @@
-2002-05-13 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * Makefile.am (EXTRA_DIST): New var.
-
-2002-05-11 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * Makefile.am: Include ../am/maintainer-dirs (in MAINTAINER_MODE).
- (guile-api.alist, guile-api.alist-FORCE):
- New rules (in MAINTAINER_MODE).
-
-2002-05-09 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * groupings.alist: Add copyright and commentary.
-
- (favorite): Delete this example composite.
- (embedded-libltdl, gdb, coop, gh, g-fdes, r-fdes, scm, k, POSIX,
- guile-C-API): New groups.
-
-2002-05-08 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * groupings.alist: New file.
-
-2002-04-23 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * guile-api.alist: Update.
-
-2002-04-16 Marius Vollmer <mvo@zagadka.ping.de>
-
- * Makefile.am (dist-hook): Simplified to not use "cd"; now it
- works for relative pathnames in $(distdir).
-
-2002-04-10 Rob Browning <rlb@defaultvalue.org>
-
- * .cvsignore: add version-tutorial.texi, version.texi, and
- stamp-vti1.
-
-2002-03-01 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * guile-api.alist: Update.
-
-2001-08-27 Neil Jerram <neil@ossau.uklinux.net>
-
- * mltext.texi (Guile Character Properties): Fix `hexidecimal'
- spelling errors (merge from stable branch).
-
- * AUTHORS: Removed. Authorship information for each manual is now
- in the top-level Texinfo file for that manual.
-
-2001-08-24 Neil Jerram <neil@ossau.uklinux.net>
-
- * Makefile.am: Split documentation into per-manual subdirectories.
-
-2001-08-22 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * scheme-options.texi (Evaluator trap options): Splitted
- section "Evaluator options".
-
- * scheme-evaluation.texi (Evaluator Behaviour): Typo "reader
- options" --> "evaluator options".
-
-2001-08-17 Rob Browning <rlb@defaultvalue.org>
-
- * Makefile.am (guile_tut_TEXINFOS): remove guile-tut.texi. It's
- already in info_TEXINFOS.
-
- * .cvsignore: rename stamp-vti1 to stamp-vti.1. Of course this
- only matters once you fix the bug in automake.
-
-2001-08-02 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-debug.texi (Debugging): Improve `make-stack' doc by
- explaining cutting args.
-
-2001-07-19 Rob Browning <rlb@defaultvalue.org>
-
- * posix.texi (Signals): add docs for setitimer and getitimer.
-
-2001-07-11 Gary Houston <ghouston@arglist.com>
-
- * scheme-evaluation.texi: Added `load-from-path'. Corrected `load':
- it doesn't use the load paths.
-
-2001-07-04 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * scheme-data.texi (Hook Reference): Removed documentation for
- `make-hook-with-name', which does note exist. Added note about
- unspecified return values to all procedure documentation
-
-2001-07-02 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * srfi-modules.texi (SRFI-1 Fold and Map): Documented extended
- versions of `map' and `for-each'.
-
-2001-06-30 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * preface.texi (Manual Conventions): Added description of
- @result{} and @print{}.
-
- * scheme-data.texi (Hash Table Examples): New subsubsection.
-
-2001-06-30 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * scheme-data.texi (Hash Tables): Added docs for
- `make-hash-table'.
-
-2001-06-29 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * misc-modules.texi: New file.
- (Pretty Printing): New chapter.
- (Formatted Output): New chapter.
-
- * Makefile.am (guile_TEXINFOS): Added misc-modules.texi.
-
- * guile.texi (Top): Added inclusion of misc-modules.texi.
-
- * scheme-modules.texi (Included Guile Modules): Added (srfi
- srfi-4) and (ice-9 rw) modules.
- (Module System Quirks): Removed note that `module-export!' must be
- called via gh_eval_str, now that we have scm_c_export.
-
- * repl-modules.texi (Loading Readline Support, Readline Options):
- New nodes.
-
-2001-06-27 Neil Jerram <neil@ossau.uklinux.net>
-
- * posix.texi (Network Sockets and Communication): Grammar fix -
- thanks to Christopher Cramer!
-
-2001-06-27 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * srfi-modules.texi (SRFI-4): Added documentation for the new
- module (srfi srfi-4).
-
-2001-06-26 Neil Jerram <neil@ossau.uklinux.net>
-
- * gh.texi (scm transition summary): Refer to scm_mem2string
- instead of scm_makfromstr.
-
-2001-06-26 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * oldfmt.c (scm_oldfmt): Use scm_mem2string instead of
- scm_makfromstr.
-
-2001-06-25 Neil Jerram <neil@ossau.uklinux.net>
-
- * gh.texi (GH deprecation): Remove paragraph about portability.
-
- * extend.texi (Libguile Intro): Updated following Marius'
- suggestions.
-
-2001-06-25 Marius Vollmer <mvo@zagadka.ping.de>
-
- * Makefile.am (version.texi, version-tutorial.texi): Removed
- kluges to build them unconditionally.
-
-2001-06-22 Neil Jerram <neil@ossau.uklinux.net>
-
- * gh.texi (scm transition summary): New node for summary of how to
- transition from GH to scm interface.
- (GH): Link to new node.
- (Calling Scheme procedures from C): Remove doc for gh_set_car and
- gh_set_cdr, which don't actually exist.
- (Data types and constants defined by gh): Correct
- SCM_UNSPECIFIED/SCM_UNDEFINED confusion.
- (Calling Scheme procedures from C): Correct SCM_EOL/SCM_UNDEFINED
- confusion.
-
-2001-06-20 Neil Jerram <neil@ossau.uklinux.net>
-
- * guile.texi (Top): Move GH chapter to end of Part V.
-
- * extend.texi (Libguile Intro), gh.texi (GH deprecation): Explain
- deprecation of GH and broad plan for documentation of scm
- interface.
-
-2001-06-18 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * srfi-modules.texi (SRFI-1): Completed procedure documentation.
-
- * scheme-data.texi (List Constructors): Added make-list.
- Added type index entries for all data types.
-
-2001-06-15 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * srfi-modules.texi (SRFI-1): New section documenting the SRFI-1
- module.
-
-2001-06-14 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * scheme-modules.texi (Included Guile Modules): Added reference to
- (srfi srfi-1) module.
-
-2001-06-16 Marius Vollmer <mvo@zagadka.ping.de>
-
- * posix.texi (Conventions): Use `system-error-errno' instead of
- explicit code
-
-2001-06-04 Gary Houston <ghouston@arglist.com>
-
- * scheme-io.texi (Block Reading and Writing): added
- write-string/partial, updated read-string!/partial.
-
-2001-05-30 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * General: A lot of typo, texinfo markup and layout corrections.
-
- * scheme-data.texi (Arithmetic): Clarified docs for - and /.
- (String Modification): Removed docs for C functions
- (scm_substring_move_right_x etc.)
- (Keyword Procedures): New section documenting the keyword
- procedures from boot-9.scm.
- (Vectors): Moved the section before the non-standard data types.
-
- * data-rep.texi (Defining New Types (Smobs)): Adapted description
- of smobs and proocedure creation to new terminology.
- (Describing a New Type): Removed mentioning of
- scm_make_smob_type_mfpe from smob function list and added
- deprecation notice for this function.
- (Creating Instances): Added description and macro docs for smobs
- with 2 or 3 data cells.
- (Garbage Collecting Smobs): Removed old docs for SCM_GCTYP16.
- (Garbage Collecting Simple Smobs): Added some clarification about
- usage and usefulness.
- (Non-immediate Datatypes): Changed R4RS reference to R5RS.
- (Vector Data): Document type-specific accessors.
-
-
-2001-05-23 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * guile.texi: Commented out menu entry and inclusion of Tcl/Tk
- stuff.
-
- * indices.texi: Users are advised to look under C and Scheme
- names, xref to transformation rules added.
-
- * intro.texi, scheme-modules.texi, scheme-ideas.texi,
- scheme-evaluation.texi, scheme-data.texi, scheme-procedures.texi:
- Fixed most REFFIXMEs.
-
- * srfi-modules.texi (About SRFI Usage): New node.
- (SRFI-0): Extended.
- Fixed all REFFIXMEs.
-
-2001-05-19 Neil Jerram <neil@ossau.uklinux.net>
-
- * posix.texi (Networking): Split existing material into new nodes
- `Network Address Conversion' and `Network Databases'.
-
- * scheme-control.texi (Lazy Catch): Update doc for new constraint
- that lazy-catch handlers are not allowed to return.
-
-2001-05-16 Rob Browning <rlb@cs.utexas.edu>
-
- * scheme-options.texi (Install Config): fixed minor-version docs
- and added micro-version docs.
-
-2001-05-16 Neil Jerram <neil@ossau.uklinux.net>
-
- * data-rep.texi, srfi-modules.texi (SRFI-14 Iterating Over
- Character Sets), scheme-io.texi (Block Reading and Writing),
- scheme-control.texi (Lazy Catch), scheme-procedures.texi (Internal
- Macros): Add @bullet to @itemize usages. (Thanks for Masao
- Uebayashi for the bug report!)
-
-2001-05-15 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * scripts.texi (Invoking Guile): Added docs for --use-srfi.
-
- * expect.texi, repl-modules.texi: Start the chapters with a new
- page.
-
- * srfi-modules.texi (SRFI-0): Added note about supported feature
- identifiers and an example. Start the chapter with a new page.
-
- * srfi-modules.texi, scheme-data.texi, scheme-control.texi,
- scheme-binding.texi, repl-modules.texi, posix.texi, intro.texi,
- scheme-utility.texi: Change `--' to `-' throughout.
-
-2001-05-14 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * srfi-13-14.texi: Removed.
-
- * srfi-modules.texi (SRFI-13): Merged SRFI-13 docs into SRFI
- chapter.
- (SRFI-14): Merged SRFI-14 too.
-
- * guile.texi (Top): Remove inclusion of obsolete SRFI-13/14 file.
-
- * srfi-modules.texi (SRFI-0): New section.
- (SRFI-16): New section.
-
- Change `--' to `-' throughout.
-
-2001-05-13 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * intro.texi, scheme-modules.texi, scheme-procedures.texi:
- Fixup some module-related references.
-
- * scheme-modules.texi (Modules): Remove "babbling" fixme.
- (The Guile module system): Rewrite intro.
- (General Information about Modules): Rewrite some parts.
- Move problems to "Module System Quirks".
- (Using Guile Modules): Renamed from "Loading Guile Modules".
- Rewrite most parts.
- Remove reivewme comment.
- (Creating Guile Modules): Review, touch up.
- Remove "Tkintr" comment.
- (Module System Quirks): New node/subsection.
-
-2001-05-06 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * intro.texi (Using Guile Modules): Review; remove reviewme
- comment. Expand `GUILE_LOAD_PATH' blurb; add small example.
- (Reporting Bugs): Review; remove reviewme comment.
- Reword some phrases; add texi markup.
- Add suggestion to include `guile-config info' output.
- Update gdb invocation; add fixme question.
-
-2001-05-05 Neil Jerram <neil@ossau.uklinux.net>
-
- * AUTHORS: Added Martin Grabmueller.
-
- * scheme-procedures.texi (Macros, Syntax Rules, Internal Macros):
- New material.
- (Syntax Case): New node, but currently empty.
-
- * scheme-data.texi (Booleans, Symbols): Supply cross-references.
-
-2001-05-04 Neil Jerram <neil@ossau.uklinux.net>
-
- * new-docstrings.texi, posix.texi, scheme-control.texi,
- scheme-data.texi, scheme-debug.texi, scheme-evaluation.texi,
- scheme-io.texi, scheme-memory.texi, scheme-procedures.texi:
- Automatic docstring updates (mostly argument name updates and
- blank lines).
-
- * scheme-modules.texi: Change double hyphens to single.
-
- * scheme-control.texi (Lazy Catch): Completed.
-
- * posix.texi (Network Databases and Address Conversion): New
- subsubsection `IPv6 Address Conversion'.
-
-2001-05-04 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * preface.texi (iff): Use proper texi markup.
- Thanks to Florian Weimer.
-
-2001-05-04 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * scheme-io.texi (Block Reading and Writing): Moved the
- documentation for read-string!/partial from the node `Reading'.
-
- * scheme-data.texi (List/String Conversion): Added docstring for
- `string-split'.
-
-2001-05-02 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * srfi-13-14.texi: Added @bullet to various @itemize lists.
-
- * srfi-modules.texi (SRFI Support): New file and chapter.
-
- * Makefile.am (guile_TEXINFOS): Added repl-modules.texi and
- srfi-modules.texi.
-
- * guile.texi (Top): New menu entries for the new chapters.
- (Top): @includes for the new chapters.
- (Top): New menu entry for `SRFI Support', @include for
- `srfi-modules.texi'.
-
- * repl-modules.texi: New file.
- (Readline Support): New chapter for (ice-9 readline).
- (Value History): New chapter for (ice-9 history).
-
-2001-05-02 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * scheme-modules.texi (Dynamic Libraries): Renamed from `Dynamic
- Linking from Marius''.
- (The Guile module system): Removed obsolete naming convention.
- (Loading Guile Modules, Creating Guile Modules),
- (More Module Procedures, Included Guile Modules): New nodes, split
- from `The Guile module system'.
- (The Guile module system): Changed references to (ice-9 slib) to
- (ice-9 popen), because note everybody has SLIB installed.
- (Included Guile Modules): Added a bunch of modules shipped with
- Guile.
-
- (Dynamic Libraries): (old version) Removed.
-
- * scheme-io.texi (Block Reading and Writing): Corrected
- capitalization, so it builds again.
-
-2001-05-01 Gary Houston <ghouston@arglist.com>
-
- * scheme-io.texi: Removed obsolete section Binary IO. Added
- new section Block Reading and Writing. Updated section
- Line/Delimited with module usage.
-
-2001-04-29 Neil Jerram <neil@ossau.uklinux.net>
-
- * deprecated.texi (Tags): Removed - deprecation expired.
-
- * scheme-io.texi (Random Access): Removed `fseek' - deprecation
- expired.
-
- * guile.texi (Top): Add menu entry for Manual Conventions node.
-
-2001-04-28 Neil Jerram <neil@ossau.uklinux.net>
-
- * THANKS: Move authorship bit into AUTHORS, simplify structure,
- add Dirk Herrmann.
-
- * AUTHORS, guile.texi, guile-tut.texi, goops.texi, Makefile.am:
- Consolidate authorship information in AUTHORS file, and @include
- AUTHORS from the top level source file for each manual.
-
-2001-04-28 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * preface.texi (Manual Conventions): New chapter.
-
-2001-04-26 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * srfi-13-14.texi (Reverse/Append): Updated procedure names for
- string-concatenate-reverse[/shared].
- (Reverse/Append): Document the parameter `end' to
- string-concatenate-reverse.
-
-2001-04-26 Neil Jerram <neil@ossau.uklinux.net>
-
- * data-rep.texi (Defining New Types (Smobs)): Use non-deprecated
- smob interface. Thanks to Masao Uebayashi for the patch!
- (Creating Instances): Don't need SCM_NIMP anymore.
-
-2001-04-25 Marius Vollmer <mvo@zagadka.ping.de>
-
- * guile.1: New file, from Robert Merkel and Rob Browning.
- * Makefile.am (man_MANS, EXTRADIST): Added, but still commented
- out: install and distribute the manpage. It is not yet installed
- or distributed since we don't have Robert's papers yet.
-
-2001-04-24 Neil Jerram <neil@ossau.uklinux.net>
-
- * guile-tut.texi: Include version-tutorial.texi rather than
- version.texi.
-
- * Makefile.am ($(srcdir)/version-tutorial.texi): New target, to
- avoid having two files both include version.texi.
-
-2001-04-24 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * Makefile.am (guile_TEXINFOS): Added srfi-13-14.texi.
-
- * srfi-13-14.texi: New file documenting SRFI-13/14.
-
- * guile.texi (Top): Added the SRFI-13/14 menu entry and @include.
-
-2001-04-22 Neil Jerram <neil@ossau.uklinux.net>
-
- * posix.texi (Network Sockets and Communication): Automatic
- docstring updates for `socket' and `connect'. (For IPV6 support.)
-
- * scheme-io.texi: Remove old docstring comments referring to
- r4rs.scm.
-
- * appendices.texi (The Basic Guile Package, Packages not shipped
- with Guile), env.texi (Switching to Environments), format.texi
- (Format Specification), gh.texi
- (Executing Scheme code, Calling Scheme procedures from C),
- guile-tut.texi (How to characterize Guile), scheme-data.texi
- (Symbols, Keywords, Keyword Read Syntax, Append/Reverse),
- scheme-evaluation.texi (Delayed Evaluation), scheme-modules.texi
- (Scheme and modules), scheme-io.texi (Soft Ports): Change R4RS
- references to R5RS.
-
- * r4rs.texi: Removed.
-
- * Makefile.am (info_TEXINFOS): Remove r4rs.
-
- * README: Note removal of r4rs, and provide a reference.
-
- * scheme-control.texi (Exceptions): Extended documentation.
- (Continuations): Correct "except" typo, and fix reference to
- Exceptions node. Plus minor review changes.
-
-2001-04-20 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-control.texi (Exceptions): Reorganized and extended
- existing documentation; more to come.
-
-2001-04-20 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * scheme-evaluation.texi (Comments): Document normal comments and
- comment conventions.
- (Block Comments): Documented multiline comments.
- (Case Sensitivity): Documented R5RS and Guile behaviour and how to
- switch it off.
-
- * scheme-control.texi (Continuations): Added some documentation
- for call/cc.
- (Exceptions): Added xref to `Continuations'.
-
- * scheme-binding.texi (Binding Reflection): Typo fix.
-
-2001-04-20 Neil Jerram <neil@ossau.uklinux.net>
-
- * gh.texi (Executing Scheme code): gh_eval_file returns
- SCM_UNSPECIFIED. Thanks to Dirk for the report!
-
- * data-rep.texi (Non-immediate Datatypes, Immediates vs
- Non-immediates): Emphasize current rather than pre-1.4 practice
- when talking about not needing to call SCM_NIMP.
-
- * recipe-guidelines.txt: New file: guidelines for contributions to
- the Guile Recipes manual.
-
-2001-04-20 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * intro.texi (Using Guile Modules): Wrote intro to using modules.
- (Writing New Modules): New intro for writing modules.
- (Reporting Bugs): Added info about what is a bug and what to
- include in a bug report (taken and adapted from the Emacs
- Reference Manual).
-
-2001-04-19 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * scheme-control.texi (while do): Added documentation for named
- let.
-
- * scheme-binding.texi (Internal Definitions): New explanation of
- `Internal Definitions'.
- (Top Level): Documented behaviour of top level definitions.
- (Binding Constructs): New introductory text.
- (Local Bindings): Explain concept of local bindings. Document
- let, let* and letrec.
-
-2001-04-18 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * scheme-modules.texi (Modules): Added menu descriptions.
- (Scheme and modules, The Guile module system): Some whitespace
- cleanup
- (The Guile module system): Layout fixes, docstring fix for
- `define-module'.
-
-2001-04-17 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * scheme-control.texi (Multiple Values): Documented concept of
- multiple values, added docs for `receive'.
- (begin): Documented `begin'.
- (if cond case): Documented `if', `cond' and `case'.
- (and or): Documented `and' and `or'.
- (while do): Documented `do' and `while'.
-
- * scheme-procedures.texi (Optional Arguments): Split the node,
- added introductory text, added menu for subsections.
- (let-optional Reference, let-keywords Reference),
- (lambda* Reference, define* Reference): Added syntax documentation
- for all exported procedures from (ice-9 optargs).
-
-2001-04-17 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * scheme-utility.texi (General Conversion): New node, added
- `object->string'.
- (Equality): Added definition and explanation of `sameness'.
-
- * posix.texi (System Identification): Added `gethostname' and
- `sethostname'.
- (Processes): Added `setpriority' and `getpriority'.
- (User Information): Added `cuserid' and `getlogin'.
- (Ports and File Descriptors): Added `flock'.
- (Processes): Added `chroot'.
- (File System): Added `mkstemp!'.
- (Encryption): New node, added `crypt' and `getpass'.
-
- * new-docstrings.texi: Moved several docstrings over to the
- reference manual (see above which).
-
- * scheme-data.texi (Data Types), (Numerical Tower): Add explicit
- @bullet to @itemize to satisfy older `makeinfo'.
-
-2001-04-16 Neil Jerram <neil@ossau.uklinux.net>
-
- * data-rep.texi (Signalling Type Errors): Update SCM_ASSERT doc
- for recent changes to disallow passing a string parameter as the
- `pos'. Thanks to Dirk Herrmann for the patch!
-
-2001-04-13 Neil Jerram <neil@ossau.uklinux.net>
-
- * data-rep.texi (Unpacking the SCM type): New section, taken from
- Dirk Herrmann's description of SCM and scm_bits_t in api.txt.
- (Immediate Datatypes, Non-immediate Datatypes): Remove obsolete
- notes about needing to call SCM_NIMP.
-
-2001-04-11 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-procedures.texi (Procedures with Setters): Fix dvi
- building syntax error. Thanks to Dale P. Smith for the report and
- patch.
-
-2001-04-11 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * scheme-scheduling.texi (Arbiters): New explanatory text.
- (Asyncs): New explanations and documentation.
- (Scheduling): Added menu entry descriptions.
- (Fluids): New documentation.
-
-2001-04-11 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * scheme-procedures.texi (Lambda): Documented the lambda form.
- (Procedure Properties): Concept and usage explanation added.
- (Procedures with Setters): Explain by example, introduce
- definitions.
-
- * scheme-data.texi (Symbols and Variables): Split and reorganized
- this section.
- (Symbols): New introductory text.
- (Characters): Added char-ci* procedures to rn index.
-
-2001-04-10 Neil Jerram <neil@ossau.uklinux.net>
-
- * scm.texi (Handling Errors): Improve Texinfo markup. Thanks to
- Dale P. Smith for the patch!
-
- * api.txt (Accessing Cell Entries): Fix typo.
-
-2001-04-09 Neil Jerram <neil@ossau.uklinux.net>
-
- * deprecated.texi (Shared And Read Only Strings): New section for
- deprecated string stuff. I've also updated the text a bit to
- reflect current usage of "read only" strings.
-
- * scheme-data.texi (Shared Substrings, Read Only Strings): Moved
- to deprecated.texi.
-
- * deprecated.texi, posix.texi, scheme-binding.texi,
- scheme-control.texi, scheme-data.texi, scheme-debug.texi,
- scheme-evaluation.texi, scheme-io.texi, scheme-memory.texi,
- scheme-modules.texi, scheme-options.texi, scheme-procedures.texi,
- scheme-scheduling.texi, scheme-translation.texi,
- scheme-utility.texi: Remove `@c docstring' comments, since they
- aren't used any more by the docstring tracking utilities.
-
-2001-04-09 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * scheme-data.texi (Pairs): New data type and procedure
- description.
- (Lists): Added new subsections for grouping the list procedures.
- (Hooks): Added new nodes for hook subsections.
- (String Syntax): New node, factoring out read syntax.
- (Strings): Some blurb about allowed characters, zero-termination
- etc.
- (Keywords): Added menu descriptions.
-
-2001-04-08 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * scheme-indices.texi (R5RS Index): Print index `rn', not `r5'.
-
- * guile.texi: The index formerly known as `r5' is now called `rn'.
-
- * scheme-utility.texi, scheme-procedures.texi, scheme-io.texi,
- scheme-evaluation.texi, scheme-control.texi, scheme-data.texi:
- Changed all @r5index entries to @rnindex.
-
-2001-04-06 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * scheme-data.texi (Hooks): Added hook description and
- constraints.
-
-2001-04-06 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * scheme-scheduling.texi (Higher level thread
- procedures): Replace some instances of `@var' with `@code'.
-
- * scheme-scheduling.texi (Higher level thread
- procedures): Rewrite.
-
-2001-04-04 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * scheme-data.texi (Alphabetic Case Mapping),
- (String Comparison): Rearranged function order.
- (Vectors): Reorganized, new introductory text, docs about read
- syntax.
-
-2001-04-03 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * scheme-options.texi, scheme-procedures.texi,
- scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
- scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
- scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
- docstrings and C source.
-
- * new-docstrings.texi, scheme-io.texi, scheme-data.texi,
- posix.texi, scheme-control.texi, scheme-evaluation.texi,
- scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
- scheme-scheduling.texi: Automated docstring merging.
-
-2001-04-02 Neil Jerram <neil@ossau.uklinux.net>
-
- * data-rep.texi (Immediates vs. Non-immediates): Update
- out-of-date documentation. (Thanks to Dirk Herrmann for the
- report!)
- (Immediates vs Non-immediates): Renamed without the dot, since the
- dot causes `info' not to be able to display this node!
-
- * Makefile.am (guile_TEXINFOS): Add in a few more source files
- that had got left out.
-
-2001-03-30 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-reading.texi (Further Reading): Add bullets to further
- reading list.
-
- * gh.texi: Insert page break before chapter. Remove page breaks
- within the chapter.
-
- * Makefile.am: Add script-getopt.texi.
-
- * guile.texi (Top): Include and link to new script-getopt.texi
- chapter.
-
- * script-getopt.texi: New chapter on command line handling.
- (Written and contributed by Martin Grabmueller, revised by me.)
-
- * intro.texi (Modules and Extensions): Fix typo.
-
-2001-03-27 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * scheme-data.texi (Strings): Reorganized the whole `Strings'
- section and wrote introductory material for each new subsection.
-
-2001-03-25 Marius Vollmer <mvo@zagadka.ping.de>
-
- * intro.texi (Modules and Extensions): Some short text about
- dynamic libraries and modules.
-
-2001-03-23 Neil Jerram <neil@ossau.uklinux.net>
-
- * intro.texi (Writing Extensions for Guile), scheme-data.texi
- (Lists): Fix typos.
-
- * guile-tut.texi, ChangeLog-guile-doc-tutorial: Added to CVS. It
- seems that I somehow missed these out when I moved everything from
- guile-doc to guile-core.
-
- * posix.texi, scheme-data.texi, scheme-evaluation.texi,
- scheme-io.texi, scheme-memory.texi: Automatic docstring updates.
-
- * new-docstrings.texi: New file. Holds snarfed docstrings that
- have not yet been incorporated into the reference manual.
-
-2001-03-20 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * scheme-options.texi (Evaluator options): Added evaluator
- options, corrected docs for evaluator trap options.
-
- * scheme-evaluation.texi (Scheme Read): New docs for read-options,
- read-enable, read-disable and read-set! and cross references to
- option nodes.
- (Evaluator Options): New docs for eval-options, eval-enable,
- eval-disable and eval-set!, traps, trap-enable, trap-disable and
- trap-set! and cross references to option nodes.
- (Evaluator Behaviour): Renamed node from `Evaluator options' to
- avoid name clash.
-
- * scheme-io.texi (String Ports): Added docs for SRFI-6 procedures.
- (Void Ports): Corrected introductory comment.
-
-2001-03-16 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * scheme-data.texi (Arithmetic): Documented the arithmetic
- procedures.
- (Integer Operations): Added documentation.
- (Comparison): Added documentation.
- (Complex): Added documentation.
- (Symbols and Variables): Comment out `builtin-bindings', which is
- removed according to NEWS.
- (Pairs): Added documentation.
-
- * scheme-io.texi: Added R5RS index entries for all R5RS
- procedures.
- (File Ports): New docs for `call-with-input-file',
- `call-with-output-file', `with-input-from-file',
- `with-output-to-file', `with-error-to-file'.
-
- * scheme-control.texi, scheme-utility.texi,
- * scheme-procedures.texi: Added R5RS index entries for all R5RS
- procedures.
-
- * scheme-evaluation.texi (Fly Evaluation): Added documentation for
- `apply'. Added R5RS index entries for all R5RS procedures.
-
- * scheme-data.texi: Added R5RS index entries for all R5RS
- procedures. Removed R5RS index entries for `ass{q,v,occ}-set!'.
- Removed explicit entries into the function entries. They are
- automagic.
- (Vectors): Added documentation for `make-vector', `vector-ref' and
- `vector-set!'.
-
-2001-03-12 Marius Vollmer <mvo@zagadka.ping.de>
-
- * intro.texi: Changed to reflect current practice better. Added
- stuff about writing Guile Extensions (aka dynamically loaded
- shared libraries).
-
-2001-03-09 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * goops.texi (VERSION): Bumped to version 0.3.
-
- * goops-tutorial.texi, goops.texi: Updated to reflect new
- define-method syntax.
-
-2001-03-09 Neil Jerram <neil@ossau.uklinux.net>
-
- * Makefile.am: Change HTML to HTMLDOC, now that we're part of a
- wider distribution.
-
- Moving documentation files from guile-doc and guile-doc into
- guile-core/doc:
-
- * env.texi, indices.texi, mbapi.texi, mltext.texi, scripts.texi,
- scsh.texi, tcltk.texi, hierarchy.txt, scheme-indices.texi,
- slib.texi, deprecated.texi, scheme-binding.texi, appendices.texi,
- scheme-intro.texi, goops.texi, extend.texi, gh.texi, intro.texi,
- preface.texi, scm.texi, goops-tutorial.texi, hierarchy.eps,
- r4rs.texi, r5rs.texi, texinfo.tex, scheme-reading.texi,
- data-rep.texi, scheme-utility.texi, posix.texi,
- scheme-control.texi, scheme-debug.texi, scheme-evaluation.texi,
- scheme-io.texi, scheme-memory.texi, scheme-modules.texi,
- scheme-options.texi, scheme-procedures.texi,
- scheme-scheduling.texi, scheme-translation.texi, guile.texi,
- scheme-data.texi, scheme-ideas.texi, expect.texi,
- ChangeLog-guile-doc-ref, guile-tut.texi,
- ChangeLog-guile-doc-tutorial, AUTHORS, BUGS, NEWS, THANKS: New
- files.
-
- * .cvsignore, Makefile.am, README: Merged.
-
- * sources: New subdirectory.
-
- Both the following files are about to be replaced by files from
- guile-doc/ref.
-
- * texinfo.tex: Removed.
-
- * data-rep.texi: Removed.
-
-2001-02-15 Neil Jerram <neil@ossau.uklinux.net>
-
- * README: Explain retirement of `data-rep.texi'.
-
- * Makefile.am (info_TEXINFOS, data_rep_TEXINFOS): Removed.
-
- * data-rep.texi: Replace this copy of data-rep.texi with a notice
- indicating that it has been retired. The master copy of
- data-rep.texi is at guile-doc/ref/data-rep.texi.
-
-2001-02-04 Marius Vollmer <mvo@zagadka.ping.de>
-
- * data-rep.texi: Use SCM_SMOB_DATA instead of SCM_CDR. Also
- things like SCM_SMOB_PREDICATE and SCM_NEWSMOB. Thanks to Dale
- P. Smith!
-
-2000-10-25 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * mop.text: Preliminary documentation of the GOOPS meta object
- protocol.
-
-2000-07-28 Neil Jerram <neil@ossau.uklinux.net>
-
- * data-rep.texi (Garbage Collection): Fix "accomodate" spelling
- mistake.
-
-2000-06-30 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * data-rep.tex: Removed documentation for SCM_OUTOFRANGE.
-
-2000-06-20 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * data-rep.texi: Center discussion around the standard interface
- for smob type creation (scm_make_smob_type) and warn about the
- ongoing discussion which may result in deprecating
- scm_make_smob_type_mfpe in next release of Guile.
-
-2000-05-15 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * data-rep.texi: Updated the macro names for operating on
- characters.
-
-2000-03-22 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * api.txt: Added a first attempt for a description of the newly
- designed low level API.
-
-2000-01-31 Marius Vollmer <mvo@zagadka.ping.de>
-
- * Makefile.am (version.texi): Override automake's rule for
- version.texi so that it gets created even in non-maintainer-mode.
-
-Thu Jan 20 13:00:18 2000 Greg J. Badros <gjb@cs.washington.edu>
-
- * version.texi, stamp-vti: Removed -- these are auto-generated.
-
-2000-01-12 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * Makefile.am (dist-hook): Updated to include oldfmt.c in
- distribution archive.
-
- * README: Updated with note about oldfmt.c.
-
- * oldfmt.c: New file: Used by application writers to adapt to
- new-style error format strings.
-
-1999-12-06 Gary Houston <ghouston@freewire.co.uk>
-
- * data-rep.texi: change dircategory to match change in guile-doc
- and scm.
-
-1999-10-05 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * Makefile.in: Deleted from CVS repository. Run the autogen.sh
- script to create generated files like this one.
-
-1999-09-11 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * Makefile.in: Regenerated.
-
-Fri Jun 25 22:21:43 1999 Greg Badros <gjb@cs.washington.edu>
-
- * data-rep.texi: Updated SMOB docs to talk about
- scm_make_smob_type_mfpe, SCM_RETURN_NEWSMOB, SCM_NEWSMOB function
- and macros.
-
-1999-04-17 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * Makefile.in: Regenerated.
-
-1998-10-19 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * COPYING: New file.
- * Makefile.in: Regenerated.
-
- * Makefile.am (EXAMPLE_SMOB_FILES): List example-smob/COPYING.
- * Makefile.in: Regenerated.
-
-1998-10-16 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * Makefile.in: Regenerated, after change to qthreads.m4.
-
-1998-10-15 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * stamp-vti: Regenerated.
-
- * hacks.el: Some handy helper functions for working on the manual.
-
- * data-rep.texi: Extended to accomodate a full running example,
- provided with the manual.
- * example-smob: A new subdirectory, containing example files for
- the manual chapter on smobs.
- * Makefile.am (EXAMPLE_SMOB_FILES, dist-hook): New variable and
- target, to get the example-smob directory into the distribution.
- * Makefile.in: Regenerated.
-
-1998-10-08 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * .cvsignore: New file, containing data-rep.info. I'm not sure
- whether we want to check this file into CVS, because it's
- generated; if you find compelling reasons it should be, let me
- know.
-
-1998-10-07 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * New directory for documentation.
- * README: New file.
- * data-rep.texi: It's not a real manual, but it's better than
- nothing.
- * Makefile.am, Makefile.in, data-rep.info, data-rep.texi,
- mdate-sh, stamp-vti, texinfo.tex, version.texi: The usual support
- files.
diff --git a/doc/ChangeLog-guile-doc b/doc/ChangeLog-guile-doc
deleted file mode 100644
index 74ce49b55..000000000
--- a/doc/ChangeLog-guile-doc
+++ /dev/null
@@ -1,48 +0,0 @@
-2001-02-15 Neil Jerram <neil@ossau.uklinux.net>
-
- * sources/data-rep.texi: Removed. (ref/data-rep.texi is now the
- current version of this essay.)
-
-2001-01-26 Neil Jerram <neil@ossau.uklinux.net>
-
- * configure.in: Only check for `texi2html' program if HTML is
- enabled, and explain where to get `texi2html' from if the check
- fails.
-
- * configure.in, Makefile.am, ref/Makefile.am,
- tutorial/Makefile.am: Clean up Makefile.am's and support
- (configurable) building of HTML documentation in addition to
- Info. Thanks to Steve Tell for the patch on which these changes
- were based.
-
-2000-10-14 Neil Jerram <neil@ossau.uklinux.net>
-
- * sources/data-rep.texi: Merged a lot of changes from
- guile-core/doc/data-rep.texi.
-
-2000-08-07 Neil Jerram <neil@ossau.uklinux.net>
-
- * configure.in, configure: Advance version number to 1.4.
-
-2000-07-28 Neil Jerram <neil@ossau.uklinux.net>
-
- * sources/data-rep.texi (Garbage Collection): Fix "accomodate"
- spelling mistake.
-
-1998-07-27 Mark Galassi <rosalia@cygnus.com>
-
- * simple test
-
-1998-04-13 Marius Vollmer <mvo@zagadka.ping.de>
-
- Have "make dist" include the sources directory:
- * Makefile.am: Added "sources" directory to SUBDIRS.
- * sources/Makefile.am: New file.
- * configure.in: Added "sources/Makefile" to AC_OUTPUT.
-
-Sun Jun 22 18:38:28 1997 Tim Pierce <twp@twp.tezcat.com>
-
- New documentation module.
-
-
-
diff --git a/doc/Makefile.am b/doc/Makefile.am
deleted file mode 100644
index 708899fe0..000000000
--- a/doc/Makefile.am
+++ /dev/null
@@ -1,51 +0,0 @@
-## Process this file with Automake to create Makefile.in
-##
-## Copyright (C) 1998 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-AUTOMAKE_OPTIONS = gnu
-
-SUBDIRS = ref tutorial goops r5rs
-
-# pending the papers from Robert Merkel
-# man_MANS = guile.1
-
-EXAMPLE_SMOB_FILES = \
- ChangeLog Makefile README COPYING image-type.c image-type.h myguile.c
-
-OLDFMT = oldfmt.c
-
-dist-hook:
- cp $(srcdir)/$(OLDFMT) $(distdir)/
- mkdir $(distdir)/example-smob
- for f in $(EXAMPLE_SMOB_FILES); do \
- cp $(srcdir)/example-smob/$$f $(distdir)/example-smob/; \
- done
-
-EXTRA_DIST = groupings.alist guile-api.alist
-
-# pending the papers from Robert Merkel
-# EXTRA_DIST = guile.1
-
-if MAINTAINER_MODE
-include $(top_srcdir)/am/maintainer-dirs
-guile-api.alist: guile-api.alist-FORCE
- ( cd $(top_builddir) ; $(mscripts)/update-guile-api.alist )
-guile-api.alist-FORCE:
-endif
diff --git a/doc/NEWS b/doc/NEWS
deleted file mode 100644
index 2624f28d3..000000000
--- a/doc/NEWS
+++ /dev/null
@@ -1,44 +0,0 @@
-Guile-doc NEWS --- history of user-visible changes. -*- text -*-
-Copyright (C) 1997, 2001 Free Software Foundation, Inc.
-See the end for copying conditions.
-
-
-Changes since Guile 1.3.4:
-
-* It's now possible to build HTML documentation as well as Info
-
-The guile-doc distribution now supports building HTML versions of the
-Guile tutorial and reference manual, in addition to the standard Info
-documentation. To enable this, include the `--enable-html' option
-when you run `./configure':
-
- ./configure --enable-html
-
-HTML documentation is installed in $(prefix)/html/guile-$(VERSION).
-
-
-Changes since Guile 1.0 (Sun 5 Jan 1997):
-
-* The current documentation approach, recommended by Jim Blandy, is to
-have: (*) a tutorial with the pedagogical style of guile-user, and a
-non-dry reference manual in the style of the most excellent GNU libc
-reference manual: the reference manual should be complete, but at the
-same time it should have an introductory screen for each major topic,
-which can be referenced if the user goes "up" a level in the info
-documentation.
-
-
-Copyright information:
-
-Copyright (C) 1996,1997 Free Software Foundation, Inc.
-
- Permission is granted to anyone to make or distribute verbatim copies
- of this document as received, in any medium, provided that the
- copyright notice and this permission notice are preserved,
- thus giving the recipient permission to redistribute in turn.
-
- Permission is granted to distribute modified versions
- of this document, or of portions of it,
- under the above conditions, provided also that they
- carry prominent notices stating who last changed them.
-
diff --git a/doc/README b/doc/README
deleted file mode 100644
index 3ecd329b4..000000000
--- a/doc/README
+++ /dev/null
@@ -1,33 +0,0 @@
-This directory contains documentation on the Guile core. -*-text-*-
-
-The documentation consists of the following manuals.
-
-- The Guile Tutorial (guile-tut.texi) contains a tutorial introduction
- to using Guile.
-
-- The Guile Reference Manual (guile.texi) contains (or is intended to
- contain) reference documentation on all aspects of Guile.
-
-- The GOOPS Manual (goops.texi) contains both tutorial-style and
- reference documentation for using GOOPS, Guile's Object Oriented
- Programming System.
-
-- The Revised^5 Report on the Algorithmic Language Scheme (r5rs.texi).
-
-Please be aware that this is all very much work in progress (apart
-from the Revised^5 Report). Bug reports and contributions are
-welcome!
-
-The file `oldfmt.c' contains a function which can be used by
-application writers to support both old-style and new-style error
-format strings.
-
-The `sources' directory includes some stuff relevant to the Guile
-reference manual, and which may eventually be folded in to it. It's
-not immediately relevant, however, which is why it's not in this
-directory.
-
-The Revised^4 Report (r4rs.texi) is no longer in this distribution, as
-it is completely superseded by the Revised^5 Report. If you need to
-consult R4RS, it is still widely available, for example at
-http://www-swiss.ai.mit.edu/projects/info/SchemeDocs/r4rs/.
diff --git a/doc/THANKS b/doc/THANKS
deleted file mode 100644
index 53cff29f4..000000000
--- a/doc/THANKS
+++ /dev/null
@@ -1,19 +0,0 @@
-Many thanks to the following people for contributing to the Guile
-manuals!
-
-Proofreading, bug reports and patches from:
- Chris Bitmead
-Christopher Cramer
- Marcus Daniels
- Dirk Herrmann
- Dale P. Smith
- Steve Tell
- Lee Thomas
- Masao Uebayashi
- Joel Weber
- Keith Wright
-
-New entries from:
- Per Bothner
- Martin Grabmueller
- Thien Thi Nguyen
diff --git a/doc/example-smob/COPYING b/doc/example-smob/COPYING
deleted file mode 100644
index eeb586b39..000000000
--- a/doc/example-smob/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED 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.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
-
- 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 of the License, 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 program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) 19yy name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/doc/example-smob/ChangeLog b/doc/example-smob/ChangeLog
deleted file mode 100644
index 5e0ea0cfa..000000000
--- a/doc/example-smob/ChangeLog
+++ /dev/null
@@ -1,48 +0,0 @@
-2002-02-28 Marius Vollmer <mvo@zagadka.ping.de>
-
- * image-type.c (image_tag): Changed type to scm_t_bits.
- (make_image): Use scm_gc_malloc instead of scm_must_malloc.
- (free_image): Use scm_gc_free instead of free. Return zero.
-
-2001-05-30 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * image-type.c: Adapted to new typing and naming convention.
-
-2001-04-26 Neil Jerram <neil@ossau.uklinux.net>
-
- * image-type.c (make_image): Don't need to use SCM_NIMP before
- SCM_STRINGP.
- (clear_image): Use SCM_SMOB_PREDICATE.
- (clear_image, mark_image, free_image, print_image): Use
- SCM_SMOB_DATA rather than SCM_CDR.
-
-2000-06-20 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * image-type.c: Removed unused scm_smobfuns structure.
- (init_image_type): Use standard smob type interface.
-
-Fri Jun 25 22:21:04 1999 Greg Badros <gjb@cs.washington.edu>
-
- * image-type.c: Updated example to use scm_make_smob_type_mfpe,
- SCM_RETURN_NEWSMOB, SCM_NEWSMOB function and macros.
-
-1998-10-19 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * image-type.c, myguile.c: Terminate copyright comments.
-
- * COPYING: New file.
- * image-type.c myguile.c: Add copyright notice.
-
-1998-10-16 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * Makefile (myguile): Fix link command, to put the Guile libraries
- after the object files. The old command worked on my machine, but
- I don't see how.
-
-1998-10-15 Jim Blandy <jimb@zwingli.cygnus.com>
-
- Created this directory for the Guile 1.3 release. Thanks to Jay
- Glascoe for suggesting that we provide a complete, buildable
- example!
- * ChangeLog, Makefile, README, image-type.c, image-type.h,
- myguile: New files.
diff --git a/doc/example-smob/Makefile b/doc/example-smob/Makefile
deleted file mode 100644
index 548c5ed83..000000000
--- a/doc/example-smob/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-CFLAGS=`guile-config compile`
-LIBS=`guile-config link`
-
-O_FILES=image-type.o myguile.o
-
-all: myguile
-
-myguile: $(O_FILES)
- $(CC) $(O_FILES) $(LIBS) -o myguile
-
-clean:
- -rm -rf myguile $(O_FILES)
diff --git a/doc/example-smob/README b/doc/example-smob/README
deleted file mode 100644
index 1380db123..000000000
--- a/doc/example-smob/README
+++ /dev/null
@@ -1,6 +0,0 @@
-This is the example code for the ``Defining New Types (Smobs)''
-chapter of the Guile manual.
-
-When you try to execute the code, if the system complains that it
-can't find libguile.so, you need to add the directory containing the
-installed Guile libraries to your LD_LIBRARY_PATH environment variable.
diff --git a/doc/example-smob/image-type.c b/doc/example-smob/image-type.c
deleted file mode 100644
index 1a03c9ce2..000000000
--- a/doc/example-smob/image-type.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/* image-type.c
- *
- * Copyright (C) 1998, 2000 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, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307 USA
- */
-
-#include <stdlib.h>
-#include <libguile.h>
-
-static scm_t_bits image_tag;
-
-struct image {
- int width, height;
- char *pixels;
-
- /* The name of this image */
- SCM name;
-
- /* A function to call when this image is
- modified, e.g., to update the screen,
- or SCM_BOOL_F if no action necessary */
- SCM update_func;
-};
-
-static SCM
-make_image (SCM name, SCM s_width, SCM s_height)
-{
- struct image *image;
- int width, height;
-
- SCM_ASSERT (SCM_STRINGP (name), name, SCM_ARG1, "make-image");
- SCM_ASSERT (SCM_INUMP (s_width), s_width, SCM_ARG2, "make-image");
- SCM_ASSERT (SCM_INUMP (s_height), s_height, SCM_ARG3, "make-image");
-
- width = SCM_INUM (s_width);
- height = SCM_INUM (s_height);
-
- image = (struct image *) scm_gc_malloc (sizeof (struct image), "image");
- image->width = width;
- image->height = height;
- image->pixels = scm_gc_malloc (width * height, "image pixels");
- image->name = name;
- image->update_func = SCM_BOOL_F;
-
- SCM_RETURN_NEWSMOB (image_tag, image);
-}
-
-static SCM
-clear_image (SCM image_smob)
-{
- int area;
- struct image *image;
-
- SCM_ASSERT (SCM_SMOB_PREDICATE (image_tag, image_smob),
- image_smob, SCM_ARG1, "clear-image");
-
- image = (struct image *) SCM_SMOB_DATA (image_smob);
- area = image->width * image->height;
- memset (image->pixels, 0, area);
-
- /* Invoke the image's update function. */
- if (image->update_func != SCM_BOOL_F)
- scm_apply (image->update_func, SCM_EOL, SCM_EOL);
-
- return SCM_UNSPECIFIED;
-}
-
-static SCM
-mark_image (SCM image_smob)
-{
- /* Mark the image's name and update function. */
- struct image *image = (struct image *) SCM_SMOB_DATA (image_smob);
-
- scm_gc_mark (image->name);
- return image->update_func;
-}
-
-static size_t
-free_image (SCM image_smob)
-{
- struct image *image = (struct image *) SCM_SMOB_DATA (image_smob);
-
- scm_gc_free (image->pixels, image->width * image->height, "image pixels");
- scm_gc_free (image, sizeof (struct image), "image");
-
- return 0;
-}
-
-static int
-print_image (SCM image_smob, SCM port, scm_print_state *pstate)
-{
- struct image *image = (struct image *) SCM_SMOB_DATA (image_smob);
-
- scm_puts ("#<image ", port);
- scm_display (image->name, port);
- scm_puts (">", port);
-
- /* non-zero means success */
- return 1;
-}
-
-void
-init_image_type (void)
-{
- image_tag = scm_make_smob_type ("image", sizeof (struct image));
- scm_set_smob_mark (image_tag, mark_image);
- scm_set_smob_free (image_tag, free_image);
- scm_set_smob_print (image_tag, print_image);
-
- scm_c_define_gsubr ("clear-image", 1, 0, 0, clear_image);
- scm_c_define_gsubr ("make-image", 3, 0, 0, make_image);
-}
diff --git a/doc/example-smob/image-type.h b/doc/example-smob/image-type.h
deleted file mode 100644
index 38fcf74c4..000000000
--- a/doc/example-smob/image-type.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/* file "image-type.h" */
-
-void init_image_type (void);
diff --git a/doc/example-smob/myguile.c b/doc/example-smob/myguile.c
deleted file mode 100644
index 95bff27fd..000000000
--- a/doc/example-smob/myguile.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* myguile.c
- *
- * Copyright (C) 1998 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, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307 USA
- */
-
-#include <libguile.h>
-#include "image-type.h"
-
-static void
-inner_main (void *closure, int argc, char **argv)
-{
- /* module initializations would go here */
- init_image_type();
- scm_shell (argc, argv);
-}
-
-int
-main (int argc, char **argv)
-{
- scm_boot_guile (argc, argv, inner_main, 0);
- return 0; /* never reached */
-}
diff --git a/doc/goops/.cvsignore b/doc/goops/.cvsignore
deleted file mode 100644
index 896c69f47..000000000
--- a/doc/goops/.cvsignore
+++ /dev/null
@@ -1,22 +0,0 @@
-Makefile
-Makefile.in
-stamp-vti
-stamp-vti.1
-*.log
-*.dvi
-*.aux
-*.toc
-*.cp
-*.fn
-*.vr
-*.tp
-*.ky
-*.pg
-*.cps
-*.fns
-*.tps
-*.vrs
-*.ps
-*.info*
-*.html
-goops.tmp
diff --git a/doc/goops/ChangeLog b/doc/goops/ChangeLog
deleted file mode 100644
index 9c3cd22a9..000000000
--- a/doc/goops/ChangeLog
+++ /dev/null
@@ -1,22 +0,0 @@
-2002-04-17 Marius Vollmer <mvo@zagadka.ping.de>
-
- * Makefile.am (CLEANFILES): Added goops.tmp, goops.cps.
-
-2001-12-03 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * goops.texi: Grammar fix.
-
-2001-08-27 Neil Jerram <neil@ossau.uklinux.net>
-
- * Makefile.am (goops_TEXINFOS): Remove ../AUTHORS.
- (TEXINFO_TEX): Added; avoids shipping multiple copies of
- texinfo.tex in a single distribution.
-
- * goops.texi: Incorporate text previously in separate AUTHORS
- file.
-
-2001-08-27 Neil Jerram <neil@ossau.uklinux.net>
-
- The change log for files in this directory continues backwards
- from 2001-08-27 in ../ChangeLog, as all the Guile documentation
- prior to this date was contained in a single directory.
diff --git a/doc/goops/Makefile.am b/doc/goops/Makefile.am
deleted file mode 100644
index 3a58df577..000000000
--- a/doc/goops/Makefile.am
+++ /dev/null
@@ -1,43 +0,0 @@
-## Process this file with Automake to create Makefile.in
-##
-## Copyright (C) 1998 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-AUTOMAKE_OPTIONS = gnu
-
-info_TEXINFOS = goops.texi
-
-goops_TEXINFOS = goops-tutorial.texi hierarchy.eps hierarchy.txt
-
-TEXINFO_TEX = ../ref/texinfo.tex
-
-# Optionally support building an HTML version of the manual.
-
-if HTMLDOC
-
-htmldir = $(prefix)/html/guile-$(VERSION)
-
-html_DATA = goops_toc.html $(shell ls goops_*.html 2>/dev/null)
-
-goops_toc.html: goops.texi $(goops_TEXINFOS)
- $(TEXI2HTML) -split_chapter goops.texi
-
-endif
-
-CLEANFILES = goops.tmp goops.cps
diff --git a/doc/goops/goops-tutorial.texi b/doc/goops/goops-tutorial.texi
deleted file mode 100644
index 7ab6ebcf0..000000000
--- a/doc/goops/goops-tutorial.texi
+++ /dev/null
@@ -1,810 +0,0 @@
-@c Original attribution:
-
-@c
-@c STk Reference manual (Appendix: An Introduction to STklos)
-@c
-@c Copyright © 1993-1999 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
-@c Permission to use, copy, modify, distribute,and license this
-@c software and its documentation for any purpose is hereby granted,
-@c provided that existing copyright notices are retained in all
-@c copies and that this notice is included verbatim in any
-@c distributions. No written agreement, license, or royalty fee is
-@c required for any of the authorized uses.
-@c This software is provided ``AS IS'' without express or implied
-@c warranty.
-@c
-
-@c Adapted for use in Guile with the authors permission
-
-@c @macro goops @c was {\stklos}
-@c GOOPS
-@c @end macro
-
-@c @macro guile @c was {\stk}
-@c Guile
-@c @end macro
-
-This is chapter was originally written by Erick Gallesio as an appendix
-for the STk reference manual, and subsequently adapted to @goops{}.
-
-@menu
-* Copyright::
-* Intro::
-* Class definition and instantiation::
-* Inheritance::
-* Generic functions::
-@end menu
-
-@node Copyright, Intro, Tutorial, Tutorial
-@section Copyright
-
-Original attribution:
-
-STk Reference manual (Appendix: An Introduction to STklos)
-
-Copyright © 1993-1999 Erick Gallesio - I3S-CNRS/ESSI <eg@@unice.fr>
-Permission to use, copy, modify, distribute,and license this
-software and its documentation for any purpose is hereby granted,
-provided that existing copyright notices are retained in all
-copies and that this notice is included verbatim in any
-distributions. No written agreement, license, or royalty fee is
-required for any of the authorized uses.
-This software is provided ``AS IS'' without express or implied
-warranty.
-
-Adapted for use in Guile with the authors permission
-
-@node Intro, Class definition and instantiation, Copyright, Tutorial
-@section Introduction
-
-@goops{} is the object oriented extension to @guile{}. Its
-implementation is derived from @w{STk-3.99.3} by Erick Gallesio and
-version 1.3 of the Gregor Kiczales @cite{Tiny-Clos}. It is very close
-to CLOS, the Common Lisp Object System (@cite{CLtL2}) but is adapted for
-the Scheme language.
-
-Briefly stated, the @goops{} extension gives the user a full object
-oriented system with multiple inheritance and generic functions with
-multi-method dispatch. Furthermore, the implementation relies on a true
-meta object protocol, in the spirit of the one defined for CLOS
-(@cite{Gregor Kiczales: A Metaobject Protocol}).
-
-The purpose of this tutorial is to introduce briefly the @goops{}
-package and in no case will it replace the @goops{} reference manual
-(which needs to be urgently written now@ @dots{}).
-
-Note that the operations described in this tutorial resides in modules
-that may need to be imported before being available. The main module is
-imported by evaluating:
-
-@lisp
-(use-modules (oop goops))
-@end lisp
-@findex (oop goops)
-@cindex main module
-@cindex loading
-@cindex preparing
-
-@node Class definition and instantiation, Inheritance, Intro, Tutorial
-@section Class definition and instantiation
-
-@menu
-* Class definition::
-@end menu
-
-@node Class definition, , Class definition and instantiation, Class definition and instantiation
-@subsection Class definition
-
-A new class is defined with the @code{define-class}@footnote{Don't
-forget to import the @code{(oop goops)} module} macro. The syntax of
-@code{define-class} is close to CLOS @code{defclass}:
-
-@findex define-class
-@cindex class
-@lisp
-(define-class @var{class} (@var{superclass} @dots{})
- @var{slot-description} @dots{}
- @var{class-option} @dots{})
-@end lisp
-
-Class options will not be discussed in this tutorial. The list of
-@var{superclass}es specifies which classes to inherit properties from
-@var{class} (see @ref{Inheritance} for more details). A
-@var{slot-description} gives the name of a slot and, eventually, some
-``properties'' of this slot (such as its initial value, the function
-which permit to access its value, @dots{}). Slot descriptions will be
-discussed in @ref{Slot description}.
-@cindex slot
-
-As an example, let us define a type for representation of complex
-numbers in terms of real numbers. This can be done with the following
-class definition:
-
-@lisp
-(define-class <complex> (<number>)
- r i)
-@end lisp
-
-This binds the variable @code{<complex>}@footnote{@code{<complex>} is in
-fact a builtin class in GOOPS. Because of this, GOOPS will create a new
-class. The old class will still serve as the type for Guile's native
-complex numbers.} to a new class whose instances contain two
-slots. These slots are called @code{r} an @code{i} and we suppose here
-that they contain respectively the real part and the imaginary part of a
-complex number. Note that this class inherits from @code{<number>} which
-is a pre-defined class. (@code{<number>} is the direct super class of
-the pre-defined class @code{<complex>} which, in turn, is the super
-class of @code{<real>} which is the super of
-@code{<integer>}.)@footnote{With the new definition of @code{<complex>},
-a @code{<real>} is not a @code{<complex>} since @code{<real>} inherits
-from @code{ <number>} rather than @code{<complex>}. In practice,
-inheritance could be modified @emph{a posteriori}, if needed. However,
-this necessitates some knowledge of the meta object protocol and it will
-not be shown in this document}.
-
-@node Inheritance, Generic functions, Class definition and instantiation, Tutorial
-@section Inheritance
-@c \label{inheritance}
-
-@menu
-* Class hierarchy and inheritance of slots::
-* Instance creation and slot access::
-* Slot description::
-* Class precedence list::
-@end menu
-
-@node Class hierarchy and inheritance of slots, Instance creation and slot access, Inheritance, Inheritance
-@subsection Class hierarchy and inheritance of slots
-Inheritance is specified upon class definition. As said in the
-introduction, @goops{} supports multiple inheritance. Here are some
-class definitions:
-
-@lisp
-(define-class A () a)
-(define-class B () b)
-(define-class C () c)
-(define-class D (A B) d a)
-(define-class E (A C) e c)
-(define-class F (D E) f)
-@end lisp
-
-@code{A}, @code{B}, @code{C} have a null list of super classes. In this
-case, the system will replace it by the list which only contains
-@code{<object>}, the root of all the classes defined by
-@code{define-class}. @code{D}, @code{E}, @code{F} use multiple
-inheritance: each class inherits from two previously defined classes.
-Those class definitions define a hierarchy which is shown in Figure@ 1.
-In this figure, the class @code{<top>} is also shown; this class is the
-super class of all Scheme objects. In particular, @code{<top>} is the
-super class of all standard Scheme types.
-
-@example
-@group
-@image{hierarchy}
-@center @emph{Fig 1: A class hierarchy}
-@iftex
-@emph{(@code{<complex>} which is the direct subclass of @code{<number>}
-and the direct superclass of @code{<real>} has been omitted in this
-figure.)}
-@end iftex
-@end group
-@end example
-
-The set of slots of a given class is calculated by taking the union of the
-slots of all its super class. For instance, each instance of the class
-D, defined before will have three slots (@code{a}, @code{b} and
-@code{d}). The slots of a class can be obtained by the @code{class-slots}
-primitive. For instance,
-
-@lisp
-(class-slots A) @result{} ((a))
-(class-slots E) @result{} ((a) (e) (c))
-(class-slots F) @result{} ((e) (c) (b) (d) (a) (f))
-@c used to be ((d) (a) (b) (c) (f))
-@end lisp
-
-@emph{Note: } The order of slots is not significant.
-
-@node Instance creation and slot access, Slot description, Class hierarchy and inheritance of slots, Inheritance
-@subsection Instance creation and slot access
-
-Creation of an instance of a previously defined
-class can be done with the @code{make} procedure. This
-procedure takes one mandatory parameter which is the class of the
-instance which must be created and a list of optional
-arguments. Optional arguments are generally used to initialize some
-slots of the newly created instance. For instance, the following form
-
-@findex make
-@cindex instance
-@lisp
-(define c (make <complex>))
-@end lisp
-
-will create a new @code{<complex>} object and will bind it to the @code{c}
-Scheme variable.
-
-Accessing the slots of the new complex number can be done with the
-@code{slot-ref} and the @code{slot-set!} primitives. @code{Slot-set!}
-primitive permits to set the value of an object slot and @code{slot-ref}
-permits to get its value.
-
-@findex slot-set!
-@findex slot-ref
-@lisp
-@group
-(slot-set! c 'r 10)
-(slot-set! c 'i 3)
-(slot-ref c 'r) @result{} 10
-(slot-ref c 'i) @result{} 3
-@end group
-@end lisp
-
-Using the @code{describe} function is a simple way to see all the
-slots of an object at one time: this function prints all the slots of an
-object on the standard output.
-
-First load the module @code{(oop goops describe)}:
-
-@example
-@code{(use-modules (oop goops describe))}
-@end example
-
-The expression
-
-@smalllisp
-(describe c)
-@end smalllisp
-
-will now print the following information on the standard output:
-
-@lisp
-#<<complex> 401d8638> is an instance of class <complex>
-Slots are:
- r = 10
- i = 3
-@end lisp
-
-@node Slot description, Class precedence list, Instance creation and slot access, Inheritance
-@subsection Slot description
-@c \label{slot-description}
-
-When specifying a slot, a set of options can be given to the
-system. Each option is specified with a keyword. The list of authorized
-keywords is given below:
-
-@cindex keyword
-@itemize @bullet
-@item
-@code{#:init-value} permits to supply a default value for the slot. This
-default value is obtained by evaluating the form given after the
-@code{#:init-form} in the global environment, at class definition time.
-@cindex default slot value
-@findex #:init-value
-@cindex top level environment
-
-@item
-@code{#:init-thunk} permits to supply a thunk that will provide a
-default value for the slot. The value is obtained by evaluating the
-thunk a instance creation time.
-@c CHECKME: in the global environment?
-@findex default slot value
-@findex #:init-thunk
-@cindex top level environment
-
-@item
-@code{#:init-keyword} permits to specify the keyword for initializing a
-slot. The init-keyword may be provided during instance creation (i.e. in
-the @code{make} optional parameter list). Specifying such a keyword
-during instance initialization will supersede the default slot
-initialization possibly given with @code{#:init-form}.
-@findex #:init-keyword
-
-@item
-@code{#:getter} permits to supply the name for the
-slot getter. The name binding is done in the
-environment of the @code{define-class} macro.
-@findex #:getter
-@cindex top level environment
-@cindex getter
-
-@item
-@code{#:setter} permits to supply the name for the
-slot setter. The name binding is done in the
-environment of the @code{define-class} macro.
-@findex #:setter
-@cindex top level environment
-@cindex setter
-
-@item
-@code{#:accessor} permits to supply the name for the
-slot accessor. The name binding is done in the global
-environment. An accessor permits to get and
-set the value of a slot. Setting the value of a slot is done with the extended
-version of @code{set!}.
-@findex set!
-@findex #:accessor
-@cindex top level environment
-@cindex accessor
-
-@item
-@code{#:allocation} permits to specify how storage for
-the slot is allocated. Three kinds of allocation are provided.
-They are described below:
-
-@itemize @minus
-@item
-@code{#:instance} indicates that each instance gets its own storage for
-the slot. This is the default.
-@item
-@code{#:class} indicates that there is one storage location used by all
-the direct and indirect instances of the class. This permits to define a
-kind of global variable which can be accessed only by (in)direct
-instances of the class which defines this slot.
-@item
-@code{#:each-subclass} indicates that there is one storage location used
-by all the direct instances of the class. In other words, if two classes
-are not siblings in the class hierarchy, they will not see the same
-value.
-@item
-@code{#:virtual} indicates that no storage will be allocated for this
-slot. It is up to the user to define a getter and a setter function for
-this slot. Those functions must be defined with the @code{#:slot-ref}
-and @code{#:slot-set!} options. See the example below.
-@findex #:slot-set!
-@findex #:slot-ref
-@findex #:virtual
-@findex #:class
-@findex #:each-subclass
-@findex #:instance
-@findex #:allocation
-@end itemize
-@end itemize
-
-To illustrate slot description, we shall redefine the @code{<complex>} class
-seen before. A definition could be:
-
-@lisp
-(define-class <complex> (<number>)
- (r #:init-value 0 #:getter get-r #:setter set-r! #:init-keyword #:r)
- (i #:init-value 0 #:getter get-i #:setter set-i! #:init-keyword #:i))
-@end lisp
-
-With this definition, the @code{r} and @code{i} slot are set to 0 by
-default. Value of a slot can also be specified by calling @code{make}
-with the @code{#:r} and @code{#:i} keywords. Furthermore, the generic
-functions @code{get-r} and @code{set-r!} (resp. @code{get-i} and
-@code{set-i!}) are automatically defined by the system to read and write
-the @code{r} (resp. @code{i}) slot.
-
-@lisp
-(define c1 (make <complex> #:r 1 #:i 2))
-(get-r c1) @result{} 1
-(set-r! c1 12)
-(get-r c1) @result{} 12
-(define c2 (make <complex> #:r 2))
-(get-r c2) @result{} 2
-(get-i c2) @result{} 0
-@end lisp
-
-Accessors provide an uniform access for reading and writing an object
-slot. Writing a slot is done with an extended form of @code{set!}
-which is close to the Common Lisp @code{setf} macro. So, another
-definition of the previous @code{<complex>} class, using the
-@code{#:accessor} option, could be:
-
-@findex set!
-@lisp
-(define-class <complex> (<number>)
- (r #:init-value 0 #:accessor real-part #:init-keyword #:r)
- (i #:init-value 0 #:accessor imag-part #:init-keyword #:i))
-@end lisp
-
-Using this class definition, reading the real part of the @code{c}
-complex can be done with:
-@lisp
-(real-part c)
-@end lisp
-and setting it to the value contained in the @code{new-value} variable
-can be done using the extended form of @code{set!}.
-@lisp
-(set! (real-part c) new-value)
-@end lisp
-
-Suppose now that we have to manipulate complex numbers with rectangular
-coordinates as well as with polar coordinates. One solution could be to
-have a definition of complex numbers which uses one particular
-representation and some conversion functions to pass from one
-representation to the other. A better solution uses virtual slots. A
-complete definition of the @code{<complex>} class using virtual slots is
-given in Figure@ 2.
-
-@example
-@group
-@lisp
-(define-class <complex> (<number>)
- ;; True slots use rectangular coordinates
- (r #:init-value 0 #:accessor real-part #:init-keyword #:r)
- (i #:init-value 0 #:accessor imag-part #:init-keyword #:i)
- ;; Virtual slots access do the conversion
- (m #:accessor magnitude #:init-keyword #:magn
- #:allocation #:virtual
- #:slot-ref (lambda (o)
- (let ((r (slot-ref o 'r)) (i (slot-ref o 'i)))
- (sqrt (+ (* r r) (* i i)))))
- #:slot-set! (lambda (o m)
- (let ((a (slot-ref o 'a)))
- (slot-set! o 'r (* m (cos a)))
- (slot-set! o 'i (* m (sin a))))))
- (a #:accessor angle #:init-keyword #:angle
- #:allocation #:virtual
- #:slot-ref (lambda (o)
- (atan (slot-ref o 'i) (slot-ref o 'r)))
- #:slot-set! (lambda(o a)
- (let ((m (slot-ref o 'm)))
- (slot-set! o 'r (* m (cos a)))
- (slot-set! o 'i (* m (sin a)))))))
-
-@end lisp
-@center @emph{Fig 2: A @code{<complex>} number class definition using virtual slots}
-@end group
-@end example
-
-@sp 3
-This class definition implements two real slots (@code{r} and
-@code{i}). Values of the @code{m} and @code{a} virtual slots are
-calculated from real slot values. Reading a virtual slot leads to the
-application of the function defined in the @code{#:slot-ref}
-option. Writing such a slot leads to the application of the function
-defined in the @code{#:slot-set!} option. For instance, the following
-expression
-
-@findex #:slot-set!
-@findex #:slot-ref
-@lisp
-(slot-set! c 'a 3)
-@end lisp
-
-permits to set the angle of the @code{c} complex number. This expression
-conducts, in fact, to the evaluation of the following expression
-
-@lisp
-((lambda o m)
- (let ((m (slot-ref o 'm)))
- (slot-set! o 'r (* m (cos a)))
- (slot-set! o 'i (* m (sin a))))
- c 3)
-@end lisp
-
-A more complete example is given below:
-
-@example
-@group
-@lisp
-(define c (make <complex> #:r 12 #:i 20))
-(real-part c) @result{} 12
-(angle c) @result{} 1.03037682652431
-(slot-set! c 'i 10)
-(set! (real-part c) 1)
-(describe c) @result{}
- #<<complex> 401e9b58> is an instance of class <complex>
- Slots are:
- r = 1
- i = 10
- m = 10.0498756211209
- a = 1.47112767430373
-@end lisp
-@end group
-@end example
-
-Since initialization keywords have been defined for the four slots, we
-can now define the @code{make-rectangular} and @code{make-polar} standard
-Scheme primitives.
-
-@lisp
-(define make-rectangular
- (lambda (x y) (make <complex> #:r x #:i y)))
-
-(define make-polar
- (lambda (x y) (make <complex> #:magn x #:angle y)))
-@end lisp
-
-@node Class precedence list, , Slot description, Inheritance
-@subsection Class precedence list
-
-A class may have more than one superclass. @footnote{This section is an
-adaptation of Jeff Dalton's (J.Dalton@@ed.ac.uk) @cite{Brief
-introduction to CLOS}} With single inheritance (one superclass), it is
-easy to order the super classes from most to least specific. This is the
-rule:
-
-@display
-@cartouche
-Rule 1: Each class is more specific than its superclasses.@c was \bf
-@end cartouche
-@end display
-
-With multiple inheritance, ordering is harder. Suppose we have
-
-@lisp
-(define-class X ()
- (x #:init-value 1))
-
-(define-class Y ()
- (x #:init-value 2))
-
-(define-class Z (X Y)
- (@dots{}))
-@end lisp
-
-In this case, the @code{Z} class is more specific than the @code{X} or
-@code{Y} class for instances of @code{Z}. However, the @code{#:init-value}
-specified in @code{X} and @code{Y} leads to a problem: which one
-overrides the other? The rule in @goops{}, as in CLOS, is that the
-superclasses listed earlier are more specific than those listed later.
-So:
-
-@display
-@cartouche
-Rule 2: For a given class, superclasses listed earlier are more
- specific than those listed later.
-@end cartouche
-@end display
-
-These rules are used to compute a linear order for a class and all its
-superclasses, from most specific to least specific. This order is
-called the ``class precedence list'' of the class. Given these two
-rules, we can claim that the initial form for the @code{x} slot of
-previous example is 1 since the class @code{X} is placed before @code{Y}
-in class precedence list of @code{Z}.
-
-These two rules are not always enough to determine a unique order,
-however, but they give an idea of how things work. Taking the @code{F}
-class shown in Figure@ 1, the class precedence list is
-
-@example
-(f d e a c b <object> <top>)
-@end example
-
-However, it is usually considered a bad idea for programmers to rely on
-exactly what the order is. If the order for some superclasses is important,
-it can be expressed directly in the class definition.
-
-The precedence list of a class can be obtained by the function
-@code{class-precedence-list}. This function returns a ordered
-list whose first element is the most specific class. For instance,
-
-@lisp
-(class-precedence-list B) @result{} (#<<class> B 401b97c8>
- #<<class> <object> 401e4a10>
- #<<class> <top> 4026a9d8>)
-@end lisp
-
-However, this result is not too much readable; using the function
-@code{class-name} yields a clearer result:
-
-@lisp
-(map class-name (class-precedence-list B)) @result{} (B <object> <top>)
-@end lisp
-
-@node Generic functions, , Inheritance, Tutorial
-@section Generic functions
-
-@menu
-* Generic functions and methods::
-* Next-method::
-* Example::
-@end menu
-
-@node Generic functions and methods, Next-method, Generic functions, Generic functions
-@subsection Generic functions and methods
-
-@c \label{gf-n-methods}
-Neither @goops{} nor CLOS use the message mechanism for methods as most
-Object Oriented language do. Instead, they use the notion of
-@dfn{generic functions}. A generic function can be seen as a methods
-``tanker''. When the evaluator requested the application of a generic
-function, all the methods of this generic function will be grabbed and
-the most specific among them will be applied. We say that a method
-@var{M} is @emph{more specific} than a method @var{M'} if the class of
-its parameters are more specific than the @var{M'} ones. To be more
-precise, when a generic function must be ``called'' the system will:
-
-@cindex generic function
-@enumerate
-@item
-search among all the generic function those which are applicable
-@item
-sort the list of applicable methods in the ``most specific'' order
-@item
-call the most specific method of this list (i.e. the first method of
-the sorted methods list).
-@end enumerate
-
-The definition of a generic function is done with the
-@code{define-generic} macro. Definition of a new method is done with the
-@code{define-method} macro. Note that @code{define-method} automatically
-defines the generic function if it has not been defined
-before. Consequently, most of the time, the @code{define-generic} needs
-not be used.
-@findex define-generic
-@findex define-method
-Consider the following definitions:
-
-@lisp
-(define-generic G)
-(define-method (G (a <integer>) b) 'integer)
-(define-method (G (a <real>) b) 'real)
-(define-method (G a b) 'top)
-@end lisp
-
-The @code{define-generic} call defines @var{G} as a generic
-function. Note that the signature of the generic function is not given
-upon definition, contrarily to CLOS. This will permit methods with
-different signatures for a given generic function, as we shall see
-later. The three next lines define methods for the @var{G} generic
-function. Each method uses a sequence of @dfn{parameter specializers}
-that specify when the given method is applicable. A specializer permits
-to indicate the class a parameter must belong to (directly or
-indirectly) to be applicable. If no specializer is given, the system
-defaults it to @code{<top>}. Thus, the first method definition is
-equivalent to
-
-@cindex parameter specializers
-@lisp
-(define-method (G (a <integer>) (b <top>)) 'integer)
-@end lisp
-
-Now, let us look at some possible calls to generic function @var{G}:
-
-@lisp
-(G 2 3) @result{} integer
-(G 2 #t) @result{} integer
-(G 1.2 'a) @result{} real
-@c (G #3 'a) @result{} real @c was {\sharpsign}
-(G #t #f) @result{} top
-(G 1 2 3) @result{} error (since no method exists for 3 parameters)
-@end lisp
-
-The preceding methods use only one specializer per parameter list. Of
-course, each parameter can use a specializer. In this case, the
-parameter list is scanned from left to right to determine the
-applicability of a method. Suppose we declare now
-
-@lisp
-(define-method (G (a <integer>) (b <number>)) 'integer-number)
-(define-method (G (a <integer>) (b <real>)) 'integer-real)
-(define-method (G (a <integer>) (b <integer>)) 'integer-integer)
-(define-method (G a (b <number>)) 'top-number)
-@end lisp
-
-In this case,
-
-@lisp
-(G 1 2) @result{} integer-integer
-(G 1 1.0) @result{} integer-real
-(G 1 #t) @result{} integer
-(G 'a 1) @result{} top-number
-@end lisp
-
-@node Next-method, Example, Generic functions and methods, Generic functions
-@subsection Next-method
-
-When a generic function is called, the list of applicable methods is
-built. As mentioned before, the most specific method of this list is
-applied (see@ @ref{Generic functions and methods}). This method may call
-the next method in the list of applicable methods. This is done by using
-the special form @code{next-method}. Consider the following definitions
-
-@lisp
-(define-method (Test (a <integer>)) (cons 'integer (next-method)))
-(define-method (Test (a <number>)) (cons 'number (next-method)))
-(define-method (Test a) (list 'top))
-@end lisp
-
-With those definitions,
-
-@lisp
-(Test 1) @result{} (integer number top)
-(Test 1.0) @result{} (number top)
-(Test #t) @result{} (top)
-@end lisp
-
-@node Example, , Next-method, Generic functions
-@subsection Example
-
-In this section we shall continue to define operations on the @code{<complex>}
-class defined in Figure@ 2. Suppose that we want to use it to implement
-complex numbers completely. For instance a definition for the addition of
-two complexes could be
-
-@lisp
-(define-method (new-+ (a <complex>) (b <complex>))
- (make-rectangular (+ (real-part a) (real-part b))
- (+ (imag-part a) (imag-part b))))
-@end lisp
-
-To be sure that the @code{+} used in the method @code{new-+} is the standard
-addition we can do:
-
-@lisp
-(define-generic new-+)
-
-(let ((+ +))
- (define-method (new-+ (a <complex>) (b <complex>))
- (make-rectangular (+ (real-part a) (real-part b))
- (+ (imag-part a) (imag-part b)))))
-@end lisp
-
-The @code{define-generic} ensures here that @code{new-+} will be defined
-in the global environment. Once this is done, we can add methods to the
-generic function @code{new-+} which make a closure on the @code{+}
-symbol. A complete writing of the @code{new-+} methods is shown in
-Figure@ 3.
-
-@example
-@group
-@lisp
-(define-generic new-+)
-
-(let ((+ +))
-
- (define-method (new-+ (a <real>) (b <real>)) (+ a b))
-
- (define-method (new-+ (a <real>) (b <complex>))
- (make-rectangular (+ a (real-part b)) (imag-part b)))
-
- (define-method (new-+ (a <complex>) (b <real>))
- (make-rectangular (+ (real-part a) b) (imag-part a)))
-
- (define-method (new-+ (a <complex>) (b <complex>))
- (make-rectangular (+ (real-part a) (real-part b))
- (+ (imag-part a) (imag-part b))))
-
- (define-method (new-+ (a <number>)) a)
-
- (define-method (new-+) 0)
-
- (define-method (new-+ . args)
- (new-+ (car args)
- (apply new-+ (cdr args)))))
-
-(set! + new-+)
-@end lisp
-
-@center @emph{Fig 3: Extending @code{+} for dealing with complex numbers}
-@end group
-@end example
-
-@sp 3
-We use here the fact that generic function are not obliged to have the
-same number of parameters, contrarily to CLOS. The four first methods
-implement the dyadic addition. The fifth method says that the addition
-of a single element is this element itself. The sixth method says that
-using the addition with no parameter always return 0. The last method
-takes an arbitrary number of parameters@footnote{The parameter list for
-a @code{define-method} follows the conventions used for Scheme
-procedures. In particular it can use the dot notation or a symbol to
-denote an arbitrary number of parameters}. This method acts as a kind
-of @code{reduce}: it calls the dyadic addition on the @emph{car} of the
-list and on the result of applying it on its rest. To finish, the
-@code{set!} permits to redefine the @code{+} symbol to our extended
-addition.
-
-@sp 3
-To terminate our implementation (integration?) of complex numbers, we can
-redefine standard Scheme predicates in the following manner:
-
-@lisp
-(define-method (complex? c <complex>) #t)
-(define-method (complex? c) #f)
-
-(define-method (number? n <number>) #t)
-(define-method (number? n) #f)
-@dots{}
-@dots{}
-@end lisp
-
-Standard primitives in which complex numbers are involved could also be
-redefined in the same manner.
-
diff --git a/doc/goops/goops.texi b/doc/goops/goops.texi
deleted file mode 100644
index 230bd3eb2..000000000
--- a/doc/goops/goops.texi
+++ /dev/null
@@ -1,2803 +0,0 @@
-\input texinfo
-@c -*-texinfo-*-
-@c %**start of header
-@setfilename goops.info
-@settitle Goops Manual
-@set goops
-@setchapternewpage odd
-@paragraphindent 0
-@c %**end of header
-
-@set VERSION 0.3
-
-@dircategory The Algorithmic Language Scheme
-@direntry
-* GOOPS: (goops). The GOOPS reference manual.
-@end direntry
-
-@macro goops
-GOOPS
-@end macro
-
-@macro guile
-Guile
-@end macro
-
-@ifinfo
-This file documents GOOPS, an object oriented extension for Guile.
-
-Copyright (C) 1999, 2000, 2001 Free Software Foundation
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@end ifinfo
-
-@c This title page illustrates only one of the
-@c two methods of forming a title page.
-
-@titlepage
-@title Goops Manual
-@subtitle For use with GOOPS @value{VERSION}
-
-@c AUTHORS
-
-@c The GOOPS tutorial was written by Christian Lynbech and Mikael
-@c Djurfeldt, who also wrote GOOPS itself. The GOOPS reference manual
-@c and MOP documentation were written by Neil Jerram and reviewed by
-@c Mikael Djurfeldt.
-
-@author Christian Lynbech
-@author @email{chl@@tbit.dk}
-@author
-@author Mikael Djurfeldt
-@author @email{djurfeldt@@nada.kth.se}
-@author
-@author Neil Jerram
-@author @email{neil@@ossau.uklinux.net}
-
-@c The following two commands
-@c start the copyright page.
-@page
-@vskip 0pt plus 1filll
-Copyright @copyright{} 1999 Free Software Foundation
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@end titlepage
-
-@node Top, Introduction, (dir), (dir)
-
-@menu
-[When the manual is completed, this will be a flat index in the style of
- the Emacs manual. More nodes will turn up under parts I-III.]
-
-Part I: Preliminaries
-
-* Introduction::
-* Getting Started::
-
-Part II: Reference Manual
-
-* Reference Manual::
-
-Part III: GOOPS Meta Object Protocol
-
-* MOP Specification::
-
-The GOOPS tutorial
-
-* Tutorial::
-
-* Index::
-* Concept Index::
-* Function and Variable Index::
-@end menu
-
-@iftex
-@chapter Preliminaries
-@end iftex
-
-@node Introduction, Getting Started, Top, Top
-@section Introduction
-
-@goops{} is the object oriented extension to @guile{}. Its
-implementation is derived from @w{STk-3.99.3} by Erick Gallesio and
-version 1.3 of Gregor Kiczales @cite{Tiny-Clos}. It is very close in
-spirit to CLOS, the Common Lisp Object System (@cite{CLtL2}) but is
-adapted for the Scheme language. While GOOPS is not compatible with any
-of these systems, GOOPS contains a compatibility module which allows for
-execution of STKlos programs.
-
-Briefly stated, the @goops{} extension gives the user a full object
-oriented system with multiple inheritance and generic functions with
-multi-method dispatch. Furthermore, the implementation relies on a true
-meta object protocol, in the spirit of the one defined for CLOS
-(@cite{Gregor Kiczales: A Metaobject Protocol}).
-
-@node Getting Started, Reference Manual, Introduction, Top
-@section Getting Started
-
-@menu
-* Running GOOPS::
-
-Examples of some basic GOOPS functionality.
-
-* Methods::
-* User-defined types::
-* Asking for the type of an object::
-
-See further in the GOOPS tutorial available in this distribution in
-info (goops.info) and texinfo format.
-@end menu
-
-@node Running GOOPS, Methods, Getting Started, Getting Started
-@subsection Running GOOPS
-
-@enumerate
-@item
-Type
-
-@smalllisp
-guile-oops
-@end smalllisp
-
-You should now be at the Guile prompt ("guile> ").
-
-@item
-Type
-
-@smalllisp
-(use-modules (oop goops))
-@end smalllisp
-
-to load GOOPS. (If your system supports dynamic loading, you
-should be able to do this not only from `guile-oops' but from an
-arbitrary Guile interpreter.)
-@end enumerate
-
-We're now ready to try some basic GOOPS functionality.
-
-@node Methods, User-defined types, Running GOOPS, Getting Started
-@subsection Methods
-
-@smalllisp
-@group
-(define-method (+ (x <string>) (y <string>))
- (string-append x y))
-
-(+ 1 2) --> 3
-(+ "abc" "de") --> "abcde"
-@end group
-@end smalllisp
-
-@node User-defined types, Asking for the type of an object, Methods, Getting Started
-@subsection User-defined types
-
-@smalllisp
-(define-class <2D-vector> ()
- (x #:init-value 0 #:accessor x-component #:init-keyword #:x)
- (y #:init-value 0 #:accessor y-component #:init-keyword #:y))
-
-@group
-(use-modules (ice-9 format))
-
-(define-method (write (obj <2D-vector>) port)
- (display (format #f "<~S, ~S>" (x-component obj) (y-component obj))
- port))
-
-(define v (make <2D-vector> #:x 3 #:y 4))
-
-v --> <3, 4>
-@end group
-
-@group
-(define-method (+ (x <2D-vector>) (y <2D-vector>))
- (make <2D-vector>
- #:x (+ (x-component x) (x-component y))
- #:y (+ (y-component x) (y-component y))))
-
-(+ v v) --> <6, 8>
-@end group
-@end smalllisp
-
-@node Asking for the type of an object, , User-defined types, Getting Started
-@subsection Types
-
-@example
-(class-of v) --> #<<class> <2D-vector> 40241ac0>
-<2D-vector> --> #<<class> <2D-vector> 40241ac0>
-(class-of 1) --> #<<class> <integer> 401b2a98>
-<integer> --> #<<class> <integer> 401b2a98>
-
-(is-a? v <2D-vector>) --> #t
-@end example
-
-@node Reference Manual, MOP Specification, Getting Started, Top
-@chapter Reference Manual
-
-This chapter is the GOOPS reference manual. It aims to describe all the
-syntax, procedures, options and associated concepts that a typical
-application author would need to understand in order to use GOOPS
-effectively in their application. It also describes what is meant by
-the GOOPS ``metaobject protocol'' (aka ``MOP''), and indicates how
-authors can use the metaobject protocol to customize the behaviour of
-GOOPS itself.
-
-For a detailed specification of the GOOPS metaobject protocol, see
-@ref{MOP Specification}.
-
-@menu
-* Introductory Remarks::
-* Defining New Classes::
-* Creating Instances::
-* Accessing Slots::
-* Creating Generic Functions::
-* Adding Methods to Generic Functions::
-* Invoking Generic Functions::
-* Redefining a Class::
-* Changing the Class of an Instance::
-* Introspection::
-* Miscellaneous Functions::
-@end menu
-
-@node Introductory Remarks
-@section Introductory Remarks
-
-GOOPS is an object-oriented programming system based on a ``metaobject
-protocol'' derived from the ones used in CLOS (the Common Lisp Object
-System), tiny-clos (a small Scheme implementation of a subset of CLOS
-functionality) and STKlos.
-
-GOOPS can be used by application authors at a basic level without any
-need to understand what the metaobject protocol (aka ``MOP'') is and how
-it works. On the other hand, the MOP underlies even the customizations
-that application authors are likely to make use of very quickly --- such
-as defining an @code{initialize} method to customize the initialization
-of instances of an application-defined class --- and an understanding of
-the MOP makes it much easier to explain such customizations in a precise
-way. And in the long run, understanding the MOP is the key both to
-understanding GOOPS at a deeper level and to taking full advantage of
-GOOPS' power, by customizing the behaviour of GOOPS itself.
-
-Each of the following sections of the reference manual is arranged
-such that the most basic usage is introduced first, and then subsequent
-subsections discuss the related internal functions and metaobject
-protocols, finishing with a description of how to customize that area of
-functionality.
-
-These introductory remarks continue with a few words about metaobjects
-and the MOP. Readers who do not want to be bothered yet with the MOP
-and customization could safely skip this subsection on a first reading,
-and should correspondingly skip subsequent subsections that are
-concerned with internals and customization.
-
-In general, this reference manual assumes familiarity with standard
-object oriented concepts and terminology. However, some of the terms
-used in GOOPS are less well known, so the Terminology subsection
-provides definitions for these terms.
-
-@menu
-* Metaobjects and the Metaobject Protocol::
-* Terminology::
-@end menu
-
-@node Metaobjects and the Metaobject Protocol
-@subsection Metaobjects and the Metaobject Protocol
-
-The conceptual building blocks of GOOPS are classes, slot definitions,
-instances, generic functions and methods. A class is a grouping of
-inheritance relations and slot definitions. An instance is an object
-with slots that are allocated following the rules implied by its class's
-superclasses and slot definitions. A generic function is a collection
-of methods and rules for determining which of those methods to apply
-when the generic function is invoked. A method is a procedure and a set
-of specializers that specify the type of arguments to which the
-procedure is applicable.
-
-Of these entities, GOOPS represents classes, generic functions and
-methods as ``metaobjects''. In other words, the values in a GOOPS
-program that describe classes, generic functions and methods, are
-themselves instances (or ``objects'') of special GOOPS classes that
-encapsulate the behaviour, respectively, of classes, generic functions,
-and methods.
-
-(The other two entities are slot definitions and instances. Slot
-definitions are not strictly instances, but every slot definition is
-associated with a GOOPS class that specifies the behaviour of the slot
-as regards accessibility and protection from garbage collection.
-Instances are of course objects in the usual sense, and there is no
-benefit from thinking of them as metaobjects.)
-
-The ``metaobject protocol'' (aka ``MOP'') is the specification of the
-generic functions which determine the behaviour of these metaobjects and
-the circumstances in which these generic functions are invoked.
-
-For a concrete example of what this means, consider how GOOPS calculates
-the set of slots for a class that is being defined using
-@code{define-class}. The desired set of slots is the union of the new
-class's direct slots and the slots of all its superclasses. But
-@code{define-class} itself does not perform this calculation. Instead,
-there is a method of the @code{initialize} generic function that is
-specialized for instances of type @code{<class>}, and it is this method
-that performs the slot calculation.
-
-@code{initialize} is a generic function which GOOPS calls whenever a new
-instance is created, immediately after allocating memory for a new
-instance, in order to initialize the new instance's slots. The sequence
-of steps is as follows.
-
-@itemize @bullet
-@item
-@code{define-class} uses @code{make} to make a new instance of the
-@code{<class>}, passing as initialization arguments the superclasses,
-slot definitions and class options that were specified in the
-@code{define-class} form.
-
-@item
-@code{make} allocates memory for the new instance, and then invokes the
-@code{initialize} generic function to initialize the new instance's
-slots.
-
-@item
-The @code{initialize} generic function applies the method that is
-specialized for instances of type @code{<class>}, and this method
-performs the slot calculation.
-@end itemize
-
-In other words, rather than being hardcoded in @code{define-class}, the
-behaviour of class definition is encapsulated by generic function
-methods that are specialized for the class @code{<class>}.
-
-It is possible to create a new class that inherits from @code{<class>},
-which is called a ``metaclass'', and to write a new @code{initialize}
-method that is specialized for instances of the new metaclass. Then, if
-the @code{define-class} form includes a @code{#:metaclass} class option
-whose value is the new metaclass, the class that is defined by the
-@code{define-class} form will be an instance of the new metaclass rather
-than of the default @code{<class>}, and will be defined in accordance
-with the new @code{initialize} method. Thus the default slot
-calculation, as well as any other aspect of the new class's relationship
-with its superclasses, can be modified or overridden.
-
-In a similar way, the behaviour of generic functions can be modified or
-overridden by creating a new class that inherits from the standard
-generic function class @code{<generic>}, writing appropriate methods
-that are specialized to the new class, and creating new generic
-functions that are instances of the new class.
-
-The same is true for method metaobjects. And the same basic mechanism
-allows the application class author to write an @code{initialize} method
-that is specialized to their application class, to initialize instances
-of that class.
-
-Such is the power of the MOP. Note that @code{initialize} is just one
-of a large number of generic functions that can be customized to modify
-the behaviour of application objects and classes and of GOOPS itself.
-Each subsequent section of the reference manual covers a particular area
-of GOOPS functionality, and describes the generic functions that are
-relevant for customization of that area.
-
-We conclude this subsection by emphasizing a point that may seem
-obvious, but contrasts with the corresponding situation in some other
-MOP implementations, such as CLOS. The point is simply that an
-identifier which represents a GOOPS class or generic function is a
-variable with a first-class value, the value being an instance of class
-@code{<class>} or @code{<generic>}. (In CLOS, on the other hand, a
-class identifier is a symbol that indexes the corresponding class
-metaobject in a separate namespace for classes.) This is, of course,
-simply an extension of the tendency in Scheme to avoid the unnecessary
-use of, on the one hand, syntactic forms that require unevaluated
-arguments and, on the other, separate identifier namespaces (e.g. for
-class names), but it is worth noting that GOOPS conforms fully to this
-Schemely principle.
-
-@node Terminology
-@subsection Terminology
-
-It is assumed that the reader is already familiar with standard object
-orientation concepts such as classes, objects/instances,
-inheritance/subclassing, generic functions and methods, encapsulation
-and polymorphism.
-
-This section explains some of the less well known concepts and
-terminology that GOOPS uses, which are assumed by the following sections
-of the reference manual.
-
-@menu
-* Metaclass::
-* Class Precedence List::
-* Accessor::
-@end menu
-
-@node Metaclass
-@subsubsection Metaclass
-
-A @dfn{metaclass} is the class of an object which represents a GOOPS
-class. Put more succinctly, a metaclass is a class's class.
-
-Most GOOPS classes have the metaclass @code{<class>} and, by default,
-any new class that is created using @code{define-class} has the
-metaclass @code{<class>}.
-
-But what does this really mean? To find out, let's look in more detail
-at what happens when a new class is created using @code{define-class}:
-
-@example
-(define-class <my-class> (<object>) . slots)
-@end example
-
-GOOPS actually expands the @code{define-class} form to something like
-this
-
-@example
-(define <my-class> (class (<object>) . slots))
-@end example
-
-and thence to
-
-@example
-(define <my-class>
- (make <class> #:supers (list <object>) #:slots slots))
-@end example
-
-In other words, the value of @code{<my-class>} is in fact an instance of
-the class @code{<class>} with slot values specifying the superclasses
-and slot definitions for the class @code{<my-class>}. (@code{#:supers}
-and @code{#:slots} are initialization keywords for the @code{dsupers}
-and @code{dslots} slots of the @code{<class>} class.)
-
-In order to take advantage of the full power of the GOOPS metaobject
-protocol (@pxref{MOP Specification}), it is sometimes desirable to
-create a new class with a metaclass other than the default
-@code{<class>}. This is done by writing:
-
-@example
-(define-class <my-class2> (<object>)
- slot @dots{}
- #:metaclass <my-metaclass>)
-@end example
-
-GOOPS expands this to something like:
-
-@example
-(define <my-class2>
- (make <my-metaclass> #:supers (list <object>) #:slots slots))
-@end example
-
-In this case, the value of @code{<my-class2>} is an instance of the more
-specialized class @code{<my-metaclass>}. Note that
-@code{<my-metaclass>} itself must previously have been defined as a
-subclass of @code{<class>}. For a full discussion of when and how it is
-useful to define new metaclasses, see @ref{MOP Specification}.
-
-Now let's make an instance of @code{<my-class2>}:
-
-@example
-(define my-object (make <my-class2> ...))
-@end example
-
-All of the following statements are correct expressions of the
-relationships between @code{my-object}, @code{<my-class2>},
-@code{<my-metaclass>} and @code{<class>}.
-
-@itemize @bullet
-@item
-@code{my-object} is an instance of the class @code{<my-class2>}.
-
-@item
-@code{<my-class2>} is an instance of the class @code{<my-metaclass>}.
-
-@item
-@code{<my-metaclass>} is an instance of the class @code{<class>}.
-
-@item
-The class of @code{my-object} is @code{<my-class2>}.
-
-@item
-The metaclass of @code{my-object} is @code{<my-metaclass>}.
-
-@item
-The class of @code{<my-class2>} is @code{<my-metaclass>}.
-
-@item
-The metaclass of @code{<my-class2>} is @code{<class>}.
-
-@item
-The class of @code{<my-metaclass>} is @code{<class>}.
-
-@item
-The metaclass of @code{<my-metaclass>} is @code{<class>}.
-
-@item
-@code{<my-class2>} is not a metaclass, since it is does not inherit from
-@code{<class>}.
-
-@item
-@code{<my-metaclass>} is a metaclass, since it inherits from
-@code{<class>}.
-@end itemize
-
-@node Class Precedence List
-@subsubsection Class Precedence List
-
-The @dfn{class precedence list} of a class is the list of all direct and
-indirect superclasses of that class, including the class itself.
-
-In the absence of multiple inheritance, the class precedence list is
-ordered straightforwardly, beginning with the class itself and ending
-with @code{<top>}.
-
-For example, given this inheritance hierarchy:
-
-@example
-(define-class <invertebrate> (<object>) @dots{})
-(define-class <echinoderm> (<invertebrate>) @dots{})
-(define-class <starfish> (<echinoderm>) @dots{})
-@end example
-
-the class precedence list of <starfish> would be
-
-@example
-(<starfish> <echinoderm> <invertebrate> <object> <top>)
-@end example
-
-With multiple inheritance, the algorithm is a little more complicated.
-A full description is provided by the GOOPS Tutorial: see @ref{Class
-precedence list}.
-
-``Class precedence list'' is often abbreviated, in documentation and
-Scheme variable names, to @dfn{cpl}.
-
-@node Accessor
-@subsubsection Accessor
-
-An @dfn{accessor} is a generic function with both reference and setter
-methods.
-
-@example
-(define-accessor perimeter)
-@end example
-
-Reference methods for an accessor are defined in the same way as generic
-function methods.
-
-@example
-(define-method (perimeter (s <square>))
- (* 4 (side-length s)))
-@end example
-
-Setter methods for an accessor are defined by specifying ``(setter
-<accessor-name>)'' as the first parameter of the @code{define-method}
-call.
-
-@example
-(define-method ((setter perimeter) (s <square>) (n <number>))
- (set! (side-length s) (/ n 4)))
-@end example
-
-Once an appropriate setter method has been defined in this way, it can
-be invoked using the generalized @code{set!} syntax, as in:
-
-@example
-(set! (perimeter s1) 18.3)
-@end example
-
-@node Defining New Classes
-@section Defining New Classes
-
-[ *fixme* Somewhere in this manual there needs to be an introductory
-discussion about GOOPS classes, generic functions and methods, covering
-
-@itemize @bullet
-@item
-how classes encapsulate related items of data in @dfn{slots}
-
-@item
-why it is that, unlike in C++ and Java, a class does not encapsulate the
-methods that act upon the class (at least not in the C++/Java sense)
-
-@item
-how generic functions provide a more general solution that provides for
-dispatch on all argument types, and avoids idiosyncracies like C++'s
-friend classes
-
-@item
-how encapsulation in the sense of data- and code-hiding, or of
-distinguishing interface from implementation, is treated in Guile as an
-orthogonal concept to object orientation, and is the responsibility of
-the module system.
-@end itemize
-
-Some of this is covered in the Tutorial chapter, in @ref{Generic
-functions and methods} - perhaps the best solution would be to expand
-the discussion there. ]
-
-@menu
-* Basic Class Definition::
-* Class Options::
-* Slot Options::
-* Class Definition Internals::
-* Customizing Class Definition::
-* STKlos Compatibility::
-@end menu
-
-@node Basic Class Definition
-@subsection Basic Class Definition
-
-New classes are defined using the @code{define-class} syntax, with
-arguments that specify the classes that the new class should inherit
-from, the direct slots of the new class, and any required class options.
-
-@deffn syntax define-class name (super @dots{}) slot-definition @dots{} . options
-Define a class called @var{name} that inherits from @var{super}s, with
-direct slots defined by @var{slot-definition}s and class options
-@var{options}. The newly created class is bound to the variable name
-@var{name} in the current environment.
-
-Each @var{slot-definition} is either a symbol that names the slot or a
-list,
-
-@example
-(@var{slot-name-symbol} . @var{slot-options})
-@end example
-
-where @var{slot-name-symbol} is a symbol and @var{slot-options} is a
-list with an even number of elements. The even-numbered elements of
-@var{slot-options} (counting from zero) are slot option keywords; the
-odd-numbered elements are the corresponding values for those keywords.
-
-@var{options} is a similarly structured list containing class option
-keywords and corresponding values.
-@end deffn
-
-The standard GOOPS class and slot options are described in the following
-subsections: see @ref{Class Options} and @ref{Slot Options}.
-
-Example 1. Define a class that combines two pre-existing classes by
-inheritance but adds no new slots.
-
-@example
-(define-class <combined> (<tree> <bicycle>))
-@end example
-
-Example 2. Define a @code{regular-polygon} class with slots for side
-length and number of sides that have default values and can be accessed
-via the generic functions @code{side-length} and @code{num-sides}.
-
-@example
-(define-class <regular-polygon> ()
- (sl #:init-value 1 #:accessor side-length)
- (ns #:init-value 5 #:accessor num-sides))
-@end example
-
-Example 3. Define a class whose behavior (and that of its instances) is
-customized via an application-defined metaclass.
-
-@example
-(define-class <tcpip-fsm> ()
- (s #:init-value #f #:accessor state)
- ...
- #:metaclass <finite-state-class>)
-@end example
-
-@node Class Options
-@subsection Class Options
-
-@deffn {class option} #:metaclass metaclass
-The @code{#:metaclass} class option specifies the metaclass of the class
-being defined. @var{metaclass} must be a class that inherits from
-@code{<class>}. For an introduction to the use of metaclasses, see
-@ref{Metaobjects and the Metaobject Protocol} and @ref{Metaclass}.
-
-If the @code{#:metaclass} option is absent, GOOPS reuses or constructs a
-metaclass for the new class by calling @code{ensure-metaclass}
-(@pxref{Class Definition Internals,, ensure-metaclass}).
-@end deffn
-
-@deffn {class option} #:name name
-The @code{#:name} class option specifies the new class's name. This
-name is used to identify the class whenever related objects - the class
-itself, its instances and its subclasses - are printed.
-
-If the @code{#:name} option is absent, GOOPS uses the first argument to
-@code{define-class} as the class name.
-@end deffn
-
-@deffn {class option} #:environment environment
-*fixme* Not sure about this one, but I think that the
-@code{#:environment} option specifies the environment in which the
-class's getters and setters are computed and evaluated.
-
-If the @code{#:environment} option is not specified, the class's
-environment defaults to the top-level environment in which the
-@code{define-class} form appears.
-@end deffn
-
-@node Slot Options
-@subsection Slot Options
-
-@deffn {slot option} #:allocation allocation
-The @code{#:allocation} option tells GOOPS how to allocate storage for
-the slot. Possible values for @var{allocation} are
-
-@itemize @bullet
-@item @code{#:instance}
-
-Indicates that GOOPS should create separate storage for this slot in
-each new instance of the containing class (and its subclasses).
-
-@item @code{#:class}
-
-Indicates that GOOPS should create storage for this slot that is shared
-by all instances of the containing class (and its subclasses). In other
-words, a slot in class @var{C} with allocation @code{#:class} is shared
-by all @var{instance}s for which @code{(is-a? @var{instance} @var{c})}.
-
-@item @code{#:each-subclass}
-
-Indicates that GOOPS should create storage for this slot that is shared
-by all @emph{direct} instances of the containing class, and that
-whenever a subclass of the containing class is defined, GOOPS should
-create a new storage for the slot that is shared by all @emph{direct}
-instances of the subclass. In other words, a slot with allocation
-@code{#:each-subclass} is shared by all instances with the same
-@code{class-of}.
-
-@item @code{#:virtual}
-
-Indicates that GOOPS should not allocate storage for this slot. The
-slot definition must also include the @code{#:slot-ref} and
-@code{#:slot-set!} options to specify how to reference and set the value
-for this slot.
-@end itemize
-
-The default value is @code{#:instance}.
-
-Slot allocation options are processed when defining a new class by the
-generic function @code{compute-get-n-set}, which is specialized by the
-class's metaclass. Hence new types of slot allocation can be
-implemented by defining a new metaclass and a method for
-@code{compute-get-n-set} that is specialized for the new metaclass. For
-an example of how to do this, see @ref{Customizing Class Definition}.
-@end deffn
-
-@deffn {slot option} #:slot-ref getter
-@deffnx {slot option} #:slot-set! setter
-The @code{#:slot-ref} and @code{#:slot-set!} options must be specified
-if the slot allocation is @code{#:virtual}, and are ignored otherwise.
-
-@var{getter} should be a closure taking a single @var{instance} parameter
-that returns the current slot value. @var{setter} should be a closure
-taking two parameters - @var{instance} and @var{new-val} - that sets the
-slot value to @var{new-val}.
-@end deffn
-
-@deffn {slot option} #:getter getter
-@deffnx {slot option} #:setter setter
-@deffnx {slot option} #:accessor accessor
-These options, if present, tell GOOPS to create generic function and
-method definitions that can be used to get and set the slot value more
-conveniently than by using @code{slot-ref} and @code{slot-set!}.
-
-@var{getter} specifies a generic function to which GOOPS will add a
-method for getting the slot value. @var{setter} specifies a generic
-function to which GOOPS will add a method for setting the slot value.
-@var{accessor} specifies an accessor to which GOOPS will add methods for
-both getting and setting the slot value.
-
-So if a class includes a slot definition like this:
-
-@example
-(c #:getter get-count #:setter set-count #:accessor count)
-@end example
-
-GOOPS defines generic function methods such that the slot value can be
-referenced using either the getter or the accessor -
-
-@example
-(let ((current-count (get-count obj))) @dots{})
-(let ((current-count (count obj))) @dots{})
-@end example
-
-- and set using either the setter or the accessor -
-
-@example
-(set-count obj (+ 1 current-count))
-(set! (count obj) (+ 1 current-count))
-@end example
-
-Note that
-
-@itemize @bullet
-@item
-with an accessor, the slot value is set using the generalized
-@code{set!} syntax
-
-@item
-in practice, it is unusual for a slot to use all three of these options:
-read-only, write-only and read-write slots would typically use only
-@code{#:getter}, @code{#:setter} and @code{#:accessor} options
-respectively.
-@end itemize
-
-If the specified names are already bound in the top-level environment to
-values that cannot be upgraded to generic functions, those values are
-overwritten during evaluation of the @code{define-class} that contains
-the slot definition. For details, see @ref{Generic Function Internals,,
-ensure-generic}.
-@end deffn
-
-@deffn {slot option} #:init-value init-value
-@deffnx {slot option} #:init-form init-form
-@deffnx {slot option} #:init-thunk init-thunk
-@deffnx {slot option} #:init-keyword init-keyword
-These options provide various ways to specify how to initialize the
-slot's value at instance creation time. @var{init-value} is a fixed
-value. @var{init-thunk} is a procedure of no arguments that is called
-when a new instance is created and should return the desired initial
-slot value. @var{init-form} is an unevaluated expression that gets
-evaluated when a new instance is created and should return the desired
-initial slot value. @var{init-keyword} is a keyword that can be used to
-pass an initial slot value to @code{make} when creating a new instance.
-
-If more than one of these options is specified for the same slot, the
-order of precedence, highest first is
-
-@itemize @bullet
-@item
-@code{#:init-keyword}, if @var{init-keyword} is present in the options
-passed to @code{make}
-
-@item
-@code{#:init-thunk}, @code{#:init-form} or @code{#:init-value}.
-@end itemize
-
-If the slot definition contains more than one initialization option of
-the same precedence, the later ones are ignored. If a slot is not
-initialized at all, its value is unbound.
-
-In general, slots that are shared between more than one instance are
-only initialized at new instance creation time if the slot value is
-unbound at that time. However, if the new instance creation specifies
-a valid init keyword and value for a shared slot, the slot is
-re-initialized regardless of its previous value.
-
-Note, however, that the power of GOOPS' metaobject protocol means that
-everything written here may be customized or overridden for particular
-classes! The slot initializations described here are performed by the least
-specialized method of the generic function @code{initialize}, whose
-signature is
-
-@example
-(define-method (initialize (object <object>) initargs) ...)
-@end example
-
-The initialization of instances of any given class can be customized by
-defining a @code{initialize} method that is specialized for that class,
-and the author of the specialized method may decide to call
-@code{next-method} - which will result in a call to the next less
-specialized @code{initialize} method - at any point within the
-specialized code, or maybe not at all. In general, therefore, the
-initialization mechanisms described here may be modified or overridden by
-more specialized code, or may not be supported at all for particular
-classes.
-@end deffn
-
-@node Class Definition Internals
-@subsection Class Definition Internals
-
-Implementation notes: @code{define-class} expands to an expression which
-
-@itemize @bullet
-@item
-checks that it is being evaluated only at top level
-
-@item
-defines any accessors that are implied by the @var{slot-definition}s
-
-@item
-uses @code{class} to create the new class (@pxref{Class Definition
-Internals,, class})
-
-@item
-checks for a previous class definition for @var{name} and, if found,
-handles the redefinition by invoking @code{class-redefinition}
-(@pxref{Redefining a Class}).
-@end itemize
-
-@deffn syntax class name (super @dots{}) slot-definition @dots{} . options
-Return a newly created class that inherits from @var{super}s, with
-direct slots defined by @var{slot-definition}s and class options
-@var{options}. For the format of @var{slot-definition}s and
-@var{options}, see @ref{Basic Class Definition,, define-class}.
-@end deffn
-
-Implementation notes: @code{class} expands to an expression which
-
-@itemize @bullet
-@item
-processes the class and slot definition options to check that they are
-well-formed, to convert the @code{#:init-form} option to an
-@code{#:init-thunk} option, to supply a default environment parameter
-(the current top-level environment) and to evaluate all the bits that
-need to be evaluated
-
-@item
-calls @code{make-class} to create the class with the processed and
-evaluated parameters.
-@end itemize
-
-@deffn procedure make-class supers slots . options
-Return a newly created class that inherits from @var{supers}, with
-direct slots defined by @var{slots} and class options @var{options}.
-For the format of @var{slots} and @var{options}, see @ref{Basic Class
-Definition,, define-class}, except note that for @code{make-class},
-@var{slots} and @var{options} are separate list parameters: @var{slots}
-here is a list of slot definitions.
-@end deffn
-
-Implementation notes: @code{make-class}
-
-@itemize @bullet
-@item
-adds @code{<object>} to the @var{supers} list if @var{supers} is empty
-or if none of the classes in @var{supers} have @code{<object>} in their
-class precedence list
-
-@item
-defaults the @code{#:environment}, @code{#:name} and @code{#:metaclass}
-options, if they are not specified by @var{options}, to the current
-top-level environment, the unbound value, and @code{(ensure-metaclass
-@var{supers})} respectively (@pxref{Class Definition Internals,,
-ensure-metaclass})
-
-@item
-checks for duplicate classes in @var{supers} and duplicate slot names in
-@var{slots}, and signals an error if there are any duplicates
-
-@item
-calls @code{make}, passing the metaclass as the first parameter and all
-other parameters as option keywords with values.
-@end itemize
-
-@deffn procedure ensure-metaclass supers env
-Return a metaclass suitable for a class that inherits from the list of
-classes in @var{supers}. The returned metaclass is the union by
-inheritance of the metaclasses of the classes in @var{supers}.
-
-In the simplest case, where all the @var{supers} are straightforward
-classes with metaclass @code{<class>}, the returned metaclass is just
-@code{<class>}.
-
-For a more complex example, suppose that @var{supers} contained one
-class with metaclass @code{<operator-class>} and one with metaclass
-@code{<foreign-object-class>}. Then the returned metaclass would be a
-class that inherits from both @code{<operator-class>} and
-@code{<foreign-object-class>}.
-
-If @var{supers} is the empty list, @code{ensure-metaclass} returns the
-default GOOPS metaclass @code{<class>}.
-
-GOOPS keeps a list of the metaclasses created by
-@code{ensure-metaclass}, so that each required type of metaclass only
-has to be created once.
-
-The @code{env} parameter is ignored.
-@end deffn
-
-@deffn procedure ensure-metaclass-with-supers meta-supers
-@code{ensure-metaclass-with-supers} is an internal procedure used by
-@code{ensure-metaclass} (@pxref{Class Definition Internals,,
-ensure-metaclass}). It returns a metaclass that is the union by
-inheritance of the metaclasses in @var{meta-supers}.
-@end deffn
-
-The internals of @code{make}, which is ultimately used to create the new
-class object, are described in @ref{Customizing Instance Creation},
-which covers the creation and initialization of instances in general.
-
-@node Customizing Class Definition
-@subsection Customizing Class Definition
-
-During the initialization of a new class, GOOPS calls a number of generic
-functions with the newly allocated class instance as the first
-argument. Specifically, GOOPS calls the generic function
-
-@itemize @bullet
-@item
-(initialize @var{class} @dots{})
-@end itemize
-
-where @var{class} is the newly allocated class instance, and the default
-@code{initialize} method for arguments of type @code{<class>} calls the
-generic functions
-
-@itemize @bullet
-@item
-(compute-cpl @var{class})
-
-@item
-(compute-slots @var{class})
-
-@item
-(compute-get-n-set @var{class} @var{slot-def}), for each of the slot
-definitions returned by @code{compute-slots}
-
-@item
-(compute-getter-method @var{class} @var{slot-def}), for each of the
-slot definitions returned by @code{compute-slots} that includes a
-@code{#:getter} or @code{#:accessor} slot option
-
-@item
-(compute-setter-method @var{class} @var{slot-def}), for each of the
-slot definitions returned by @code{compute-slots} that includes a
-@code{#:setter} or @code{#:accessor} slot option.
-@end itemize
-
-If the metaclass of the new class is something more specialized than the
-default @code{<class>}, then the type of @var{class} in the calls above
-is more specialized than @code{<class>}, and hence it becomes possible
-to define generic function methods, specialized for the new class's
-metaclass, that can modify or override the default behaviour of
-@code{initialize}, @code{compute-cpl} or @code{compute-get-n-set}.
-
-@code{compute-cpl} computes the class precedence list (``CPL'') for the
-new class (@pxref{Class precedence list}), and returns it as a list of
-class objects. The CPL is important because it defines a superclass
-ordering that is used, when a generic function is invoked upon an
-instance of the class, to decide which of the available generic function
-methods is the most specific. Hence @code{compute-cpl} could be
-customized in order to modify the CPL ordering algorithm for all classes
-with a special metaclass.
-
-The default CPL algorithm is encapsulated by the @code{compute-std-cpl}
-procedure, which is in turn called by the default @code{compute-cpl}
-method.
-
-@deffn procedure compute-std-cpl class
-Compute and return the class precedence list for @var{class} according
-to the algorithm described in @ref{Class precedence list}.
-@end deffn
-
-@code{compute-slots} computes and returns a list of all slot definitions
-for the new class. By default, this list includes the direct slot
-definitions from the @code{define-class} form, plus the slot definitions
-that are inherited from the new class's superclasses. The default
-@code{compute-slots} method uses the CPL computed by @code{compute-cpl}
-to calculate this union of slot definitions, with the rule that slots
-inherited from superclasses are shadowed by direct slots with the same
-name. One possible reason for customizing @code{compute-slots} would be
-to implement an alternative resolution strategy for slot name conflicts.
-
-@code{compute-get-n-set} computes the low-level closures that will be
-used to get and set the value of a particular slot, and returns them in
-a list with two elements.
-
-The closures returned depend on how storage for that slot is allocated.
-The standard @code{compute-get-n-set} method, specialized for classes of
-type @code{<class>}, handles the standard GOOPS values for the
-@code{#:allocation} slot option (@pxref{Slot Options,, allocation}). By
-defining a new @code{compute-get-n-set} method for a more specialized
-metaclass, it is possible to support new types of slot allocation.
-
-Suppose you wanted to create a large number of instances of some class
-with a slot that should be shared between some but not all instances of
-that class - say every 10 instances should share the same slot storage.
-The following example shows how to implement and use a new type of slot
-allocation to do this.
-
-@example
-(define-class <batched-allocation-metaclass> (<class>))
-
-(let ((batch-allocation-count 0)
- (batch-get-n-set #f))
- (define-method (compute-get-n-set (class <batched-allocation-metaclass>) s)
- (case (slot-definition-allocation s)
- ((#:batched)
- ;; If we've already used the same slot storage for 10 instances,
- ;; reset variables.
- (if (= batch-allocation-count 10)
- (begin
- (set! batch-allocation-count 0)
- (set! batch-get-n-set #f)))
- ;; If we don't have a current pair of get and set closures,
- ;; create one. make-closure-variable returns a pair of closures
- ;; around a single Scheme variable - see goops.scm for details.
- (or batch-get-n-set
- (set! batch-get-n-set (make-closure-variable)))
- ;; Increment the batch allocation count.
- (set! batch-allocation-count (+ batch-allocation-count 1))
- batch-get-n-set)
-
- ;; Call next-method to handle standard allocation types.
- (else (next-method)))))
-
-(define-class <class-using-batched-slot> ()
- ...
- (c #:allocation #:batched)
- ...
- #:metaclass <batched-allocation-metaclass>)
-@end example
-
-The usage of @code{compute-getter-method} and @code{compute-setter-method}
-is described in @ref{MOP Specification}.
-
-@code{compute-cpl} and @code{compute-get-n-set} are called by the
-standard @code{initialize} method for classes whose metaclass is
-@code{<class>}. But @code{initialize} itself can also be modified, by
-defining an @code{initialize} method specialized to the new class's
-metaclass. Such a method could complete override the standard
-behaviour, by not calling @code{(next-method)} at all, but more
-typically it would perform additional class initialization steps before
-and/or after calling @code{(next-method)} for the standard behaviour.
-
-@node STKlos Compatibility
-@subsection STKlos Compatibility
-
-If the STKlos compatibility module is loaded, @code{define-class} is
-overwritten by a STKlos-specific definition; the standard GOOPS
-definition of @code{define-class} remains available in
-@code{standard-define-class}.
-
-@deffn syntax standard-define-class name (super @dots{}) slot-definition @dots{} . options
-@code{standard-define-class} is equivalent to the standard GOOPS
-@code{define-class}.
-@end deffn
-
-@node Creating Instances
-@section Creating Instances
-
-@menu
-* Basic Instance Creation::
-* Customizing Instance Creation::
-@end menu
-
-@node Basic Instance Creation
-@subsection Basic Instance Creation
-
-To create a new instance of any GOOPS class, use the generic function
-@code{make} or @code{make-instance}, passing the required class and any
-appropriate instance initialization arguments as keyword and value
-pairs. Note that @code{make} and @code{make-instances} are aliases for
-each other - their behaviour is identical.
-
-@deffn generic make
-@deffnx method make (class <class>) . initargs
-Create and return a new instance of class @var{class}, initialized using
-@var{initargs}.
-
-In theory, @var{initargs} can have any structure that is understood by
-whatever methods get applied when the @code{initialize} generic function
-is applied to the newly allocated instance.
-
-In practice, specialized @code{initialize} methods would normally call
-@code{(next-method)}, and so eventually the standard GOOPS
-@code{initialize} methods are applied. These methods expect
-@var{initargs} to be a list with an even number of elements, where
-even-numbered elements (counting from zero) are keywords and
-odd-numbered elements are the corresponding values.
-
-GOOPS processes initialization argument keywords automatically for slots
-whose definition includes the @code{#:init-keyword} option (@pxref{Slot
-Options,, init-keyword}). Other keyword value pairs can only be
-processed by an @code{initialize} method that is specialized for the new
-instance's class. Any unprocessed keyword value pairs are ignored.
-@end deffn
-
-@deffn generic make-instance
-@deffnx method make-instance (class <class>) . initargs
-@code{make-instance} is an alias for @code{make}.
-@end deffn
-
-@node Customizing Instance Creation
-@subsection Customizing Instance Creation
-
-@code{make} itself is a generic function. Hence the @code{make}
-invocation itself can be customized in the case where the new instance's
-metaclass is more specialized than the default @code{<class>}, by
-defining a @code{make} method that is specialized to that metaclass.
-
-Normally, however, the method for classes with metaclass @code{<class>}
-will be applied. This method calls two generic functions:
-
-@itemize @bullet
-@item
-(allocate-instance @var{class} . @var{initargs})
-
-@item
-(initialize @var{instance} . @var{initargs})
-@end itemize
-
-@code{allocate-instance} allocates storage for and returns the new
-instance, uninitialized. You might customize @code{allocate-instance},
-for example, if you wanted to provide a GOOPS wrapper around some other
-object programming system.
-
-To do this, you would create a specialized metaclass, which would act as
-the metaclass for all classes and instances from the other system. Then
-define an @code{allocate-instance} method, specialized to that
-metaclass, which calls a Guile primitive C function, which in turn
-allocates the new instance using the interface of the other object
-system.
-
-In this case, for a complete system, you would also need to customize a
-number of other generic functions like @code{make} and
-@code{initialize}, so that GOOPS knows how to make classes from the
-other system, access instance slots, and so on.
-
-@code{initialize} initializes the instance that is returned by
-@code{allocate-instance}. The standard GOOPS methods perform
-initializations appropriate to the instance class.
-
-@itemize @bullet
-@item
-At the least specialized level, the method for instances of type
-@code{<object>} performs internal GOOPS instance initialization, and
-initializes the instance's slots according to the slot definitions and
-any slot initialization keywords that appear in @var{initargs}.
-
-@item
-The method for instances of type @code{<class>} calls
-@code{(next-method)}, then performs the class initializations described
-in @ref{Customizing Class Definition}.
-
-@item
-and so on for generic functions, method, operator classes @dots{}
-@end itemize
-
-Similarly, you can customize the initialization of instances of any
-application-defined class by defining an @code{initialize} method
-specialized to that class.
-
-Imagine a class whose instances' slots need to be initialized at
-instance creation time by querying a database. Although it might be
-possible to achieve this a combination of @code{#:init-thunk} keywords
-and closures in the slot definitions, it is neater to write an
-@code{initialize} method for the class that queries the database once
-and initializes all the dependent slot values according to the results.
-
-@node Accessing Slots
-@section Accessing Slots
-
-The definition of a slot contains at the very least a slot name, and may
-also contain various slot options, including getter, setter and/or
-accessor functions for the slot.
-
-It is always possible to access slots by name, using the various
-``slot-ref'' and ``slot-set!'' procedures described in the following
-subsections. For example,
-
-@example
-(define-class <my-class> () ;; Define a class with slots
- (count #:init-value 0) ;; named "count" and "cache".
- (cache #:init-value '())
- @dots{})
-
-(define inst (make <my-class>)) ;; Make an instance of this class.
-
-(slot-set! inst 'count 5) ;; Set the value of the "count"
- ;; slot to 5.
-
-(slot-set! inst 'cache ;; Modify the value of the
- (cons (cons "^it" "It") ;; "cache" slot.
- (slot-ref inst 'cache)))
-@end example
-
-If a slot definition includes a getter, setter or accessor function,
-these can be used instead of @code{slot-ref} and @code{slot-set!} to
-access the slot.
-
-@example
-(define-class <adv-class> () ;; Define a new class whose slots
- (count #:setter set-count) ;; use a getter, a setter and
- (cache #:accessor cache) ;; an accessor.
- (csize #:getter cache-size)
- @dots{})
-
-(define inst (make <adv-class>)) ;; Make an instance of this class.
-
-(set-count inst 5) ;; Set the value of the "count"
- ;; slot to 5.
-
-(set! (cache inst) ;; Modify the value of the
- (cons (cons "^it" "It") ;; "cache" slot.
- (cache inst)))
-
-(let ((size (cache-size inst))) ;; Get the value of the "csize"
- @dots{}) ;; slot.
-@end example
-
-Whichever of these methods is used to access slots, GOOPS always calls
-the low-level @dfn{getter} and @dfn{setter} closures for the slot to get
-and set its value. These closures make sure that the slot behaves
-according to the @code{#:allocation} type that was specified in the slot
-definition (@pxref{Slot Options,, allocation}). (For more about these
-closures, see @ref{Customizing Class Definition,, compute-get-n-set}.)
-
-@menu
-* Instance Slots::
-* Class Slots::
-* Handling Slot Access Errors::
-@end menu
-
-@node Instance Slots
-@subsection Instance Slots
-
-Any slot, regardless of its allocation, can be queried, referenced and
-set using the following four primitive procedures.
-
-@deffn {primitive procedure} slot-exists? obj slot-name
-Return @code{#t} if @var{obj} has a slot with name @var{slot-name},
-otherwise @code{#f}.
-@end deffn
-
-@deffn {primitive procedure} slot-bound? obj slot-name
-Return @code{#t} if the slot named @var{slot-name} in @var{obj} has a
-value, otherwise @code{#f}.
-
-@code{slot-bound?} calls the generic function @code{slot-missing} if
-@var{obj} does not have a slot called @var{slot-name} (@pxref{Handling
-Slot Access Errors, slot-missing}).
-@end deffn
-
-@deffn {primitive procedure} slot-ref obj slot-name
-Return the value of the slot named @var{slot-name} in @var{obj}.
-
-@code{slot-ref} calls the generic function @code{slot-missing} if
-@var{obj} does not have a slot called @var{slot-name} (@pxref{Handling
-Slot Access Errors, slot-missing}).
-
-@code{slot-ref} calls the generic function @code{slot-unbound} if the
-named slot in @var{obj} does not have a value (@pxref{Handling Slot
-Access Errors, slot-unbound}).
-@end deffn
-
-@deffn {primitive procedure} slot-set! obj slot-name value
-Set the value of the slot named @var{slot-name} in @var{obj} to @var{value}.
-
-@code{slot-set!} calls the generic function @code{slot-missing} if
-@var{obj} does not have a slot called @var{slot-name} (@pxref{Handling
-Slot Access Errors, slot-missing}).
-@end deffn
-
-GOOPS stores information about slots in class metaobjects. Internally,
-all of these procedures work by looking up the slot definition for the
-slot named @var{slot-name} in the class metaobject for @code{(class-of
-@var{obj})}, and then using the slot definition's ``getter'' and
-``setter'' closures to get and set the slot value.
-
-The next four procedures differ from the previous ones in that they take
-the class metaobject as an explicit argument, rather than assuming
-@code{(class-of @var{obj})}. Therefore they allow you to apply the
-``getter'' and ``setter'' closures of a slot definition in one class to
-an instance of a different class.
-
-[ *fixme* I have no idea why this is useful! Perhaps when a slot in
-@code{(class-of @var{obj})} shadows a slot with the same name in one of
-its superclasses? There should be an enlightening example here. ]
-
-@deffn {primitive procedure} slot-exists-using-class? class obj slot-name
-Return @code{#t} if the class metaobject @var{class} has a slot
-definition for a slot with name @var{slot-name}, otherwise @code{#f}.
-@end deffn
-
-@deffn {primitive procedure} slot-bound-using-class? class obj slot-name
-Return @code{#t} if applying @code{slot-ref-using-class} to the same
-arguments would call the generic function @code{slot-unbound}, otherwise
-@code{#f}.
-
-@code{slot-bound-using-class?} calls the generic function
-@code{slot-missing} if @var{class} does not have a slot definition for a
-slot called @var{slot-name} (@pxref{Handling Slot Access Errors,
-slot-missing}).
-@end deffn
-
-@deffn {primitive procedure} slot-ref-using-class class obj slot-name
-Apply the ``getter'' closure for the slot named @var{slot-name} in
-@var{class} to @var{obj}, and return its result.
-
-@code{slot-ref-using-class} calls the generic function
-@code{slot-missing} if @var{class} does not have a slot definition for a
-slot called @var{slot-name} (@pxref{Handling Slot Access Errors,
-slot-missing}).
-
-@code{slot-ref-using-class} calls the generic function
-@code{slot-unbound} if the application of the ``getter'' closure to
-@var{obj} returns an unbound value (@pxref{Handling Slot Access Errors,
-slot-unbound}).
-@end deffn
-
-@deffn {primitive procedure} slot-set-using-class! class obj slot-name value
-Apply the ``setter'' closure for the slot named @var{slot-name} in
-@var{class} to @var{obj} and @var{value}.
-
-@code{slot-set-using-class!} calls the generic function
-@code{slot-missing} if @var{class} does not have a slot definition for a
-slot called @var{slot-name} (@pxref{Handling Slot Access Errors,
-slot-missing}).
-@end deffn
-
-@node Class Slots
-@subsection Class Slots
-
-Slots whose allocation is per-class rather than per-instance can be
-referenced and set without needing to specify any particular instance.
-
-@deffn procedure class-slot-ref class slot-name
-Return the value of the slot named @var{slot-name} in class @var{class}.
-The named slot must have @code{#:class} or @code{#:each-subclass}
-allocation (@pxref{Slot Options,, allocation}).
-
-If there is no such slot with @code{#:class} or @code{#:each-subclass}
-allocation, @code{class-slot-ref} calls the @code{slot-missing} generic
-function with arguments @var{class} and @var{slot-name}. Otherwise, if
-the slot value is unbound, @code{class-slot-ref} calls the
-@code{slot-missing} generic function, with the same arguments.
-@end deffn
-
-@deffn procedure class-slot-set! class slot-name value
-Set the value of the slot named @var{slot-name} in class @var{class} to
-@var{value}. The named slot must have @code{#:class} or
-@code{#:each-subclass} allocation (@pxref{Slot Options,, allocation}).
-
-If there is no such slot with @code{#:class} or @code{#:each-subclass}
-allocation, @code{class-slot-ref} calls the @code{slot-missing} generic
-function with arguments @var{class} and @var{slot-name}.
-@end deffn
-
-@node Handling Slot Access Errors
-@subsection Handling Slot Access Errors
-
-GOOPS calls one of the following generic functions when a ``slot-ref''
-or ``slot-set!'' call specifies a non-existent slot name, or tries to
-reference a slot whose value is unbound.
-
-@deffn generic slot-missing
-@deffnx method slot-missing (class <class>) slot-name
-@deffnx method slot-missing (class <class>) (object <object>) slot-name
-@deffnx method slot-missing (class <class>) (object <object>) slot-name value
-When an application attempts to reference or set a class or instance
-slot by name, and the slot name is invalid for the specified @var{class}
-or @var{object}, GOOPS calls the @code{slot-missing} generic function.
-
-The default methods all call @code{goops-error} with an appropriate
-message.
-@end deffn
-
-@deffn generic slot-unbound
-@deffnx method slot-unbound (object <object>)
-@deffnx method slot-unbound (class <class>) slot-name
-@deffnx method slot-unbound (class <class>) (object <object>) slot-name
-When an application attempts to reference a class or instance slot, and
-the slot's value is unbound, GOOPS calls the @code{slot-unbound} generic
-function.
-
-The default methods all call @code{goops-error} with an appropriate
-message.
-@end deffn
-
-@node Creating Generic Functions
-@section Creating Generic Functions
-
-A generic function is a collection of methods, with rules for
-determining which of the methods should be applied for any given
-invocation of the generic function.
-
-GOOPS represents generic functions as metaobjects of the class
-@code{<generic>} (or one of its subclasses).
-
-@menu
-* Basic Generic Function Creation::
-* Generic Function Internals::
-* Extending Guiles Primitives::
-@end menu
-
-@node Basic Generic Function Creation
-@subsection Basic Generic Function Creation
-
-The following forms may be used to bind a variable to a generic
-function. Depending on that variable's pre-existing value, the generic
-function may be created empty - with no methods - or it may contain
-methods that are inferred from the pre-existing value.
-
-It is not, in general, necessary to use @code{define-generic} or
-@code{define-accessor} before defining methods for the generic function
-using @code{define-method}, since @code{define-method} will
-automatically interpolate a @code{define-generic} call, or upgrade an
-existing generic to an accessor, if that is implied by the
-@code{define-method} call. Note in particular that,
-if the specified variable already has a @emph{generic function} value,
-@code{define-generic} and @code{define-accessor} will @emph{discard} it!
-Obviously it is application-dependent whether this is desirable or not.
-
-If, for example, you wanted to extend @code{+} for a class representing
-a new numerical type, you probably want to inherit any existing methods
-for @code{+} and so should not use @code{define-generic}. If, on the
-other hand, you do not want to risk inheriting methods whose behaviour
-might surprise you, you can use @code{define-generic} or
-@code{define-accessor} to wipe the slate clean.
-
-@deffn syntax define-generic symbol
-Create a generic function with name @var{symbol} and bind it to the
-variable @var{symbol}.
-
-If the variable @var{symbol} was previously bound to a Scheme procedure
-(or procedure-with-setter), the old procedure (and setter) is
-incorporated into the new generic function as its default procedure (and
-setter). Any other previous value that was bound to @var{symbol},
-including an existing generic function, is overwritten by the new
-generic function.
-@end deffn
-
-@deffn syntax define-accessor symbol
-Create an accessor with name @var{symbol} and bind it to the variable
-@var{symbol}.
-
-If the variable @var{symbol} was previously bound to a Scheme procedure
-(or procedure-with-setter), the old procedure (and setter) is
-incorporated into the new accessor as its default procedure (and
-setter). Any other previous value that was bound to @var{symbol},
-including an existing generic function or accessor, is overwritten by
-the new definition.
-@end deffn
-
-@node Generic Function Internals
-@subsection Generic Function Internals
-
-@code{define-generic} calls @code{ensure-generic} to upgrade a
-pre-existing procedure value, or @code{make} with metaclass
-@code{<generic>} to create a new generic function.
-
-@code{define-accessor} calls @code{ensure-accessor} to upgrade a
-pre-existing procedure value, or @code{make-accessor} to create a new
-accessor.
-
-@deffn procedure ensure-generic old-definition [name]
-Return a generic function with name @var{name}, if possible by using or
-upgrading @var{old-definition}. If unspecified, @var{name} defaults to
-@code{#f}.
-
-If @var{old-definition} is already a generic function, it is returned
-unchanged.
-
-If @var{old-definition} is a Scheme procedure or procedure-with-setter,
-@code{ensure-generic} returns a new generic function that uses
-@var{old-definition} for its default procedure and setter.
-
-Otherwise @code{ensure-generic} returns a new generic function with no
-defaults and no methods.
-@end deffn
-
-@deffn procedure make-generic [name]
-Return a new generic function with name @code{(car @var{name})}. If
-unspecified, @var{name} defaults to @code{#f}.
-@end deffn
-
-@code{ensure-generic} calls @code{make} with metaclasses
-@code{<generic>} and @code{<generic-with-setter>}, depending on the
-previous value of the variable that it is trying to upgrade.
-
-@code{make-generic} is a simple wrapper for @code{make} with metaclass
-@code{<generic>}.
-
-@deffn procedure ensure-accessor proc [name]
-Return an accessor with name @var{name}, if possible by using or
-upgrading @var{proc}. If unspecified, @var{name} defaults to @code{#f}.
-
-If @var{proc} is already an accessor, it is returned unchanged.
-
-If @var{proc} is a Scheme procedure, procedure-with-setter or generic
-function, @code{ensure-accessor} returns an accessor that reuses the
-reusable elements of @var{proc}.
-
-Otherwise @code{ensure-accessor} returns a new accessor with no defaults
-and no methods.
-@end deffn
-
-@deffn procedure make-accessor [name]
-Return a new accessor with name @code{(car @var{name})}. If
-unspecified, @var{name} defaults to @code{#f}.
-@end deffn
-
-@code{ensure-accessor} calls @code{make} with
-metaclass @code{<generic-with-setter>}, as well as calls to
-@code{ensure-generic}, @code{make-accessor} and (tail recursively)
-@code{ensure-accessor}.
-
-@code{make-accessor} calls @code{make} twice, first
-with metaclass @code{<generic>} to create a generic function for the
-setter, then with metaclass @code{<generic-with-setter>} to create the
-accessor, passing the setter generic function as the value of the
-@code{#:setter} keyword.
-
-@node Extending Guiles Primitives
-@subsection Extending Guile's Primitives
-
-When GOOPS is loaded, many of Guile's primitive procedures can be
-extended by giving them a generic function definition that operates
-in conjunction with their normal C-coded implementation. For
-primitives that are extended in this way, the result from the user-
-or application-level point of view is that the extended primitive
-behaves exactly like a generic function with the C-coded implementation
-as its default method.
-
-The @code{generic-capability?} predicate should be used to determine
-whether a particular primitive is extensible in this way.
-
-@deffn {primitive procedure} generic-capability? primitive
-Return @code{#t} if @var{primitive} can be extended by giving it a
-generic function definition, otherwise @code{#f}.
-@end deffn
-
-Even when a primitive procedure is extensible like this, its generic
-function definition is not created until it is needed by a call to
-@code{define-method}, or until the application explicitly requests it
-by calling @code{enable-primitive-generic!}.
-
-@deffn {primitive procedure} enable-primitive-generic! primitive
-Force the creation of a generic function definition for
-@var{primitive}.
-@end deffn
-
-Once the generic function definition for a primitive has been created,
-it can be retrieved using @code{primitive-generic-generic}.
-
-@deffn {primitive procedure} primitive-generic-generic primitive
-Return the generic function definition of @var{primitive}.
-
-@code{primitive-generic-generic} raises an error if @var{primitive}
-is not a primitive with generic capability, or if its generic capability
-has not yet been enabled, whether implicitly (by @code{define-method})
-or explicitly (by @code{enable-primitive-generic!}).
-@end deffn
-
-Note that the distinction between, on the one hand, primitives with
-additional generic function definitions and, on the other hand, generic
-functions with a default method, may disappear when GOOPS is fully
-integrated into the core of Guile. Consequently, the
-procedures described in this section may disappear as well.
-
-@node Adding Methods to Generic Functions
-@section Adding Methods to Generic Functions
-
-@menu
-* Basic Method Definition::
-* Method Definition Internals::
-@end menu
-
-@node Basic Method Definition
-@subsection Basic Method Definition
-
-To add a method to a generic function, use the @code{define-method} form.
-
-@deffn syntax define-method (generic parameter @dots{}) . body
-Define a method for the generic function or accessor @var{generic} with
-parameters @var{parameter}s and body @var{body}.
-
-@var{generic} is a generic function. If @var{generic} is a variable
-which is not yet bound to a generic function object, the expansion of
-@code{define-method} will include a call to @code{define-generic}. If
-@var{generic} is @code{(setter @var{generic-with-setter})}, where
-@var{generic-with-setter} is a variable which is not yet bound to a
-generic-with-setter object, the expansion will include a call to
-@code{define-accessor}.
-
-Each @var{parameter} must be either a symbol or a two-element list
-@code{(@var{symbol} @var{class})}. The symbols refer to variables in
-the @var{body} that will be bound to the parameters supplied by the
-caller when calling this method. The @var{class}es, if present,
-specify the possible combinations of parameters to which this method
-can be applied.
-
-@var{body} is the body of the method definition.
-@end deffn
-
-@code{define-method} expressions look a little like normal Scheme
-procedure definitions of the form
-
-@example
-(define (name formals @dots{}) . body)
-@end example
-
-The most important difference is that each formal parameter, apart from the
-possible ``rest'' argument, can be qualified by a class name:
-@code{@var{formal}} becomes @code{(@var{formal} @var{class})}. The
-meaning of this qualification is that the method being defined
-will only be applicable in a particular generic function invocation if
-the corresponding argument is an instance of @code{@var{class}} (or one of
-its subclasses). If more than one of the formal parameters is qualified
-in this way, then the method will only be applicable if each of the
-corresponding arguments is an instance of its respective qualifying class.
-
-Note that unqualified formal parameters act as though they are qualified
-by the class @code{<top>}, which GOOPS uses to mean the superclass of
-all valid Scheme types, including both primitive types and GOOPS classes.
-
-For example, if a generic function method is defined with
-@var{parameter}s @code{((s1 <square>) (n <number>))}, that method is
-only applicable to invocations of its generic function that have two
-parameters where the first parameter is an instance of the
-@code{<square>} class and the second parameter is a number.
-
-If a generic function is invoked with a combination of parameters for which
-there is no applicable method, GOOPS raises an error. For more about
-invocation error handling, and generic function invocation in general,
-see @ref{Invoking Generic Functions}.
-
-@node Method Definition Internals
-@subsection Method Definition Internals
-
-@code{define-method}
-
-@itemize @bullet
-@item
-checks the form of the first parameter, and applies the following steps
-to the accessor's setter if it has the @code{(setter @dots{})} form
-
-@item
-interpolates a call to @code{define-generic} or @code{define-accessor}
-if a generic function is not already defined with the supplied name
-
-@item
-calls @code{method} with the @var{parameter}s and @var{body}, to make a
-new method instance
-
-@item
-calls @code{add-method!} to add this method to the relevant generic
-function.
-@end itemize
-
-@deffn syntax method (parameter @dots{}) . body
-Make a method whose specializers are defined by the classes in
-@var{parameter}s and whose procedure definition is constructed from the
-@var{parameter} symbols and @var{body} forms.
-
-The @var{parameter} and @var{body} parameters should be as for
-@code{define-method} (@pxref{Basic Method Definition,, define-method}).
-@end deffn
-
-@code{method}
-
-@itemize @bullet
-@item
-extracts formals and specializing classes from the @var{parameter}s,
-defaulting the class for unspecialized parameters to @code{<top>}
-
-@item
-creates a closure using the formals and the @var{body} forms
-
-@item
-calls @code{make} with metaclass @code{<method>} and the specializers
-and closure using the @code{#:specializers} and @code{#:procedure}
-keywords.
-@end itemize
-
-@deffn procedure make-method specializers procedure
-Make a method using @var{specializers} and @var{procedure}.
-
-@var{specializers} should be a list of classes that specifies the
-parameter combinations to which this method will be applicable.
-
-@var{procedure} should be the closure that will applied to the generic
-function parameters when this method is invoked.
-@end deffn
-
-@code{make-method} is a simple wrapper around @code{make} with metaclass
-@code{<method>}.
-
-@deffn generic add-method! target method
-Generic function for adding method @var{method} to @var{target}.
-@end deffn
-
-@deffn method add-method! (generic <generic>) (method <method>)
-Add method @var{method} to the generic function @var{generic}.
-@end deffn
-
-@deffn method add-method! (proc <procedure>) (method <method>)
-If @var{proc} is a procedure with generic capability (@pxref{Extending
-Guiles Primitives,, generic-capability?}), upgrade it to a
-primitive generic and add @var{method} to its generic function
-definition.
-@end deffn
-
-@deffn method add-method! (pg <primitive-generic>) (method <method>)
-Add method @var{method} to the generic function definition of @var{pg}.
-
-Implementation: @code{(add-method! (primitive-generic-generic pg) method)}.
-@end deffn
-
-@deffn method add-method! (whatever <top>) (method <method>)
-Raise an error indicating that @var{whatever} is not a valid generic
-function.
-@end deffn
-
-@node Invoking Generic Functions
-@section Invoking Generic Functions
-
-When a variable with a generic function definition appears as the first
-element of a list that is being evaluated, the Guile evaluator tries
-to apply the generic function to the arguments obtained by evaluating
-the remaining elements of the list. [ *fixme* How do I put this in a
-more Schemely and less Lispy way? ]
-
-Usually a generic function contains several method definitions, with
-varying degrees of formal parameter specialization (@pxref{Basic
-Method Definition,, define-method}). So it is necessary to sort these
-methods by specificity with respect to the supplied arguments, and then
-apply the most specific method definition. Less specific methods
-may be applied subsequently if a method that is being applied calls
-@code{next-method}.
-
-@menu
-* Determining Which Methods to Apply::
-* Handling Invocation Errors::
-@end menu
-
-@node Determining Which Methods to Apply
-@subsection Determining Which Methods to Apply
-
-[ *fixme* Sorry - this is the area of GOOPS that I understand least of
-all, so I'm afraid I have to pass on this section. Would some other
-kind person consider filling it in? ]
-
-@deffn generic apply-generic
-@deffnx method apply-generic (gf <generic>) args
-@end deffn
-
-@deffn generic compute-applicable-methods
-@deffnx method compute-applicable-methods (gf <generic>) args
-@end deffn
-
-@deffn generic sort-applicable-methods
-@deffnx method sort-applicable-methods (gf <generic>) methods args
-@end deffn
-
-@deffn generic method-more-specific?
-@deffnx method method-more-specific? (m1 <method>) (m2 <method>) args
-@end deffn
-
-@deffn generic apply-method
-@deffnx method apply-method (gf <generic>) methods build-next args
-@end deffn
-
-@deffn generic apply-methods
-@deffnx method apply-methods (gf <generic>) (l <list>) args
-@end deffn
-
-@node Handling Invocation Errors
-@subsection Handling Invocation Errors
-
-@deffn generic no-method
-@deffnx method no-method (gf <generic>) args
-When an application invokes a generic function, and no methods at all
-have been defined for that generic function, GOOPS calls the
-@code{no-method} generic function. The default method calls
-@code{goops-error} with an appropriate message.
-@end deffn
-
-@deffn generic no-applicable-method
-@deffnx method no-applicable-method (gf <generic>) args
-When an application applies a generic function to a set of arguments,
-and no methods have been defined for those argument types, GOOPS calls
-the @code{no-applicable-method} generic function. The default method
-calls @code{goops-error} with an appropriate message.
-@end deffn
-
-@deffn generic no-next-method
-@deffnx method no-next-method (gf <generic>) args
-When a generic function method calls @code{(next-method)} to invoke the
-next less specialized method for that generic function, and no less
-specialized methods have been defined for the current generic function
-arguments, GOOPS calls the @code{no-next-method} generic function. The
-default method calls @code{goops-error} with an appropriate message.
-@end deffn
-
-@node Redefining a Class
-@section Redefining a Class
-
-Suppose that a class @code{<my-class>} is defined using @code{define-class}
-(@pxref{Basic Class Definition,, define-class}), with slots that have
-accessor functions, and that an application has created several instances
-of @code{<my-class>} using @code{make} (@pxref{Basic Instance Creation,,
-make}). What then happens if @code{<my-class>} is redefined by calling
-@code{define-class} again?
-
-@menu
-* Default Class Redefinition Behaviour::
-* Customizing Class Redefinition::
-@end menu
-
-@node Default Class Redefinition Behaviour
-@subsection Default Class Redefinition Behaviour
-
-GOOPS' default answer to this question is as follows.
-
-@itemize @bullet
-@item
-All existing direct instances of @code{<my-class>} are converted to be
-instances of the new class. This is achieved by preserving the values
-of slots that exist in both the old and new definitions, and initializing the
-values of new slots in the usual way (@pxref{Basic Instance Creation,,
-make}).
-
-@item
-All existing subclasses of @code{<my-class>} are redefined, as though
-the @code{define-class} expressions that defined them were re-evaluated
-following the redefinition of @code{<my-class>}, and the class
-redefinition process described here is applied recursively to the
-redefined subclasses.
-
-@item
-Once all of its instances and subclasses have been updated, the class
-metaobject previously bound to the variable @code{<my-class>} is no
-longer needed and so can be allowed to be garbage collected.
-@end itemize
-
-To keep things tidy, GOOPS also needs to do a little housekeeping on
-methods that are associated with the redefined class.
-
-@itemize @bullet
-@item
-Slot accessor methods for slots in the old definition should be removed
-from their generic functions. They will be replaced by accessor methods
-for the slots of the new class definition.
-
-@item
-Any generic function method that uses the old @code{<my-class>} metaobject
-as one of its formal parameter specializers must be updated to refer to
-the new @code{<my-class>} metaobject. (Whenever a new generic function
-method is defined, @code{define-method} adds the method to a list stored
-in the class metaobject for each class used as a formal parameter
-specializer, so it is easy to identify all the methods that must be
-updated when a class is redefined.)
-@end itemize
-
-If this class redefinition strategy strikes you as rather counter-intuitive,
-bear in mind that it is derived from similar behaviour in other object
-systems such as CLOS, and that experience in those systems has shown it to be
-very useful in practice.
-
-Also bear in mind that, like most of GOOPS' default behaviour, it can
-be customized@dots{}
-
-@node Customizing Class Redefinition
-@subsection Customizing Class Redefinition
-
-When @code{define-class} notices that a class is being redefined,
-it constructs the new class metaobject as usual, and then invokes the
-@code{class-redefinition} generic function with the old and new classes
-as arguments. Therefore, if the old or new classes have metaclasses
-other than the default @code{<class>}, class redefinition behaviour can
-be customized by defining a @code{class-redefinition} method that is
-specialized for the relevant metaclasses.
-
-@deffn generic class-redefinition
-Handle the class redefinition from @var{old-class} to @var{new-class},
-and return the new class metaobject that should be bound to the
-variable specified by @code{define-class}'s first argument.
-@end deffn
-
-@deffn method class-redefinition (old-class <class>) (new-class <class>)
-Implements GOOPS' default class redefinition behaviour, as described in
-@ref{Default Class Redefinition Behaviour}. Returns the metaobject
-for the new class definition.
-@end deffn
-
-An alternative class redefinition strategy could be to leave all
-existing instances as instances of the old class, but accepting that the
-old class is now ``nameless'', since its name has been taken over by the
-new definition. In this strategy, any existing subclasses could also
-be left as they are, on the understanding that they inherit from a nameless
-superclass.
-
-This strategy is easily implemented in GOOPS, by defining a new metaclass,
-that will be used as the metaclass for all classes to which the strategy
-should apply, and then defining a @code{class-redefinition} method that
-is specialized for this metaclass:
-
-@example
-(define-class <can-be-nameless> (<class>))
-
-(define-method (class-redefinition (old <can-be-nameless>) (new <class>))
- new)
-@end example
-
-When customization can be as easy as this, aren't you glad that GOOPS
-implements the far more difficult strategy as its default!
-
-Finally, note that, if @code{class-redefinition} itself is not customized,
-the default @code{class-redefinition} method invokes three further
-generic functions that could be individually customized:
-
-@itemize @bullet
-@item
-(remove-class-accessors! @var{old-class})
-
-@item
-(update-direct-method! @var{method} @var{old-class} @var{new-class})
-
-@item
-(update-direct-subclass! @var{subclass} @var{old-class} @var{new-class})
-@end itemize
-
-and the default methods for these generic functions invoke further
-generic functions, and so on@dots{} The detailed protocol for all of these
-is described in @ref{MOP Specification}.
-
-@node Changing the Class of an Instance
-@section Changing the Class of an Instance
-
-You can change the class of an existing instance by invoking the
-generic function @code{change-class} with two arguments: the instance
-and the new class.
-
-@deffn generic change-class
-@end deffn
-
-The default method for @code{change-class} decides how to implement the
-change of class by looking at the slot definitions for the instance's
-existing class and for the new class. If the new class has slots with
-the same name as slots in the existing class, the values for those slots
-are preserved. Slots that are present only in the existing class are
-discarded. Slots that are present only in the new class are initialized
-using the corresponding slot definition's init function (@pxref{Classes,,
-slot-init-function}).
-
-@deffn {method} change-class (obj <object>) (new <class>)
-Modify instance @var{obj} to make it an instance of class @var{new}.
-
-The value of each of @var{obj}'s slots is preserved only if a similarly named
-slot exists in @var{new}; any other slot values are discarded.
-
-The slots in @var{new} that do not correspond to any of @var{obj}'s
-pre-existing slots are initialized according to @var{new}'s slot definitions'
-init functions.
-@end deffn
-
-Customized change of class behaviour can be implemented by defining
-@code{change-class} methods that are specialized either by the class
-of the instances to be modified or by the metaclass of the new class.
-
-When a class is redefined (@pxref{Redefining a Class}), and the default
-class redefinition behaviour is not overridden, GOOPS (eventually)
-invokes the @code{change-class} generic function for each existing
-instance of the redefined class.
-
-@node Introspection
-@section Introspection
-
-@dfn{Introspection}, also known as @dfn{reflection}, is the name given
-to the ability to obtain information dynamically about GOOPS metaobjects.
-It is perhaps best illustrated by considering an object oriented language
-that does not provide any introspection, namely C++.
-
-Nothing in C++ allows a running program to obtain answers to the following
-types of question:
-
-@itemize @bullet
-@item
-What are the data members of this object or class?
-
-@item
-What classes does this class inherit from?
-
-@item
-Is this method call virtual or non-virtual?
-
-@item
-If I invoke @code{Employee::adjustHoliday()}, what class contains the
-@code{adjustHoliday()} method that will be applied?
-@end itemize
-
-In C++, answers to such questions can only be determined by looking at
-the source code, if you have access to it. GOOPS, on the other hand,
-includes procedures that allow answers to these questions --- or their
-GOOPS equivalents --- to be obtained dynamically, at run time.
-
-@menu
-* Classes::
-* Slots::
-* Instances::
-* Generic Functions::
-* Generic Function Methods::
-@end menu
-
-@node Classes
-@subsection Classes
-
-@deffn {primitive procedure} class-name class
-Return the name of class @var{class}.
-This is the value of the @var{class} metaobject's @code{name} slot.
-@end deffn
-
-@deffn {primitive procedure} class-direct-supers class
-Return a list containing the direct superclasses of @var{class}.
-This is the value of the @var{class} metaobject's
-@code{direct-supers} slot.
-@end deffn
-
-@deffn {primitive procedure} class-direct-slots class
-Return a list containing the slot definitions of the direct slots of
-@var{class}.
-This is the value of the @var{class} metaobject's @code{direct-slots}
-slot.
-@end deffn
-
-@deffn {primitive procedure} class-direct-subclasses class
-Return a list containing the direct subclasses of @var{class}.
-This is the value of the @var{class} metaobject's
-@code{direct-subclasses} slot.
-@end deffn
-
-@deffn {primitive procedure} class-direct-methods class
-Return a list of all the generic function methods that use @var{class}
-as a formal parameter specializer.
-This is the value of the @var{class} metaobject's @code{direct-methods}
-slot.
-@end deffn
-
-@deffn {primitive procedure} class-precedence-list class
-Return the class precedence list for class @var{class} (@pxref{Class
-precedence list}).
-This is the value of the @var{class} metaobject's @code{cpl} slot.
-@end deffn
-
-@deffn {primitive procedure} class-slots class
-Return a list containing the slot definitions for all @var{class}'s slots,
-including any slots that are inherited from superclasses.
-This is the value of the @var{class} metaobject's @code{slots} slot.
-@end deffn
-
-@deffn {primitive procedure} class-environment class
-Return the value of @var{class}'s @code{environment} slot.
-[ *fixme* I don't know what this value is used for. ]
-@end deffn
-
-@deffn procedure class-subclasses class
-Return a list of all subclasses of @var{class}.
-@end deffn
-
-@deffn procedure class-methods class
-Return a list of all methods that use @var{class} or a subclass of
-@var{class} as one of its formal parameter specializers.
-@end deffn
-
-@node Slots
-@subsection Slots
-
-@deffn procedure class-slot-definition class slot-name
-Return the slot definition for the slot named @var{slot-name} in class
-@var{class}. @var{slot-name} should be a symbol.
-@end deffn
-
-@deffn procedure slot-definition-name slot-def
-Extract and return the slot name from @var{slot-def}.
-@end deffn
-
-@deffn procedure slot-definition-options slot-def
-Extract and return the slot options from @var{slot-def}.
-@end deffn
-
-@deffn procedure slot-definition-allocation slot-def
-Extract and return the slot allocation option from @var{slot-def}. This
-is the value of the @code{#:allocation} keyword (@pxref{Slot Options,,
-allocation}), or @code{#:instance} if the @code{#:allocation} keyword is
-absent.
-@end deffn
-
-@deffn procedure slot-definition-getter slot-def
-Extract and return the slot getter option from @var{slot-def}. This is
-the value of the @code{#:getter} keyword (@pxref{Slot Options,,
-getter}), or @code{#f} if the @code{#:getter} keyword is absent.
-@end deffn
-
-@deffn procedure slot-definition-setter slot-def
-Extract and return the slot setter option from @var{slot-def}. This is
-the value of the @code{#:setter} keyword (@pxref{Slot Options,,
-setter}), or @code{#f} if the @code{#:setter} keyword is absent.
-@end deffn
-
-@deffn procedure slot-definition-accessor slot-def
-Extract and return the slot accessor option from @var{slot-def}. This
-is the value of the @code{#:accessor} keyword (@pxref{Slot Options,,
-accessor}), or @code{#f} if the @code{#:accessor} keyword is absent.
-@end deffn
-
-@deffn procedure slot-definition-init-value slot-def
-Extract and return the slot init-value option from @var{slot-def}. This
-is the value of the @code{#:init-value} keyword (@pxref{Slot Options,,
-init-value}), or the unbound value if the @code{#:init-value} keyword is
-absent.
-@end deffn
-
-@deffn procedure slot-definition-init-form slot-def
-Extract and return the slot init-form option from @var{slot-def}. This
-is the value of the @code{#:init-form} keyword (@pxref{Slot Options,,
-init-form}), or the unbound value if the @code{#:init-form} keyword is
-absent.
-@end deffn
-
-@deffn procedure slot-definition-init-thunk slot-def
-Extract and return the slot init-thunk option from @var{slot-def}. This
-is the value of the @code{#:init-thunk} keyword (@pxref{Slot Options,,
-init-thunk}), or @code{#f} if the @code{#:init-thunk} keyword is absent.
-@end deffn
-
-@deffn procedure slot-definition-init-keyword slot-def
-Extract and return the slot init-keyword option from @var{slot-def}.
-This is the value of the @code{#:init-keyword} keyword (@pxref{Slot
-Options,, init-keyword}), or @code{#f} if the @code{#:init-keyword}
-keyword is absent.
-@end deffn
-
-@deffn procedure slot-init-function class slot-name
-Return the initialization function for the slot named @var{slot-name} in
-class @var{class}. @var{slot-name} should be a symbol.
-
-The returned initialization function incorporates the effects of the
-standard @code{#:init-thunk}, @code{#:init-form} and @code{#:init-value}
-slot options. These initializations can be overridden by the
-@code{#:init-keyword} slot option or by a specialized @code{initialize}
-method, so, in general, the function returned by
-@code{slot-init-function} may be irrelevant. For a fuller discussion,
-see @ref{Slot Options,, init-value}.
-@end deffn
-
-@node Instances
-@subsection Instances
-
-@deffn {primitive procedure} class-of value
-Return the GOOPS class of any Scheme @var{value}.
-@end deffn
-
-@deffn {primitive procedure} instance? object
-Return @code{#t} if @var{object} is any GOOPS instance, otherwise
-@code{#f}.
-@end deffn
-
-@deffn procedure is-a? object class
-Return @code{#t} if @var{object} is an instance of @var{class} or one of
-its subclasses.
-@end deffn
-
-Implementation notes: @code{is-a?} uses @code{class-of} and
-@code{class-precedence-list} to obtain the class precedence list for
-@var{object}.
-
-@node Generic Functions
-@subsection Generic Functions
-
-@deffn {primitive procedure} generic-function-name gf
-Return the name of generic function @var{gf}.
-@end deffn
-
-@deffn {primitive procedure} generic-function-methods gf
-Return a list of the methods of generic function @var{gf}.
-This is the value of the @var{gf} metaobject's @code{methods} slot.
-@end deffn
-
-@node Generic Function Methods
-@subsection Generic Function Methods
-
-@deffn {primitive procedure} method-generic-function method
-Return the generic function that @var{method} belongs to.
-This is the value of the @var{method} metaobject's
-@code{generic-function} slot.
-@end deffn
-
-@deffn {primitive procedure} method-specializers method
-Return a list of @var{method}'s formal parameter specializers .
-This is the value of the @var{method} metaobject's
-@code{specializers} slot.
-@end deffn
-
-@deffn {primitive procedure} method-procedure method
-Return the procedure that implements @var{method}.
-This is the value of the @var{method} metaobject's
-@code{procedure} slot.
-@end deffn
-
-@deffn generic method-source
-@deffnx method method-source (m <method>)
-Return an expression that prints to show the definition of method
-@var{m}.
-
-@example
-(define-generic cube)
-
-(define-method (cube (n <number>))
- (* n n n))
-
-(map method-source (generic-function-methods cube))
-@result{}
-((method ((n <number>)) (* n n n)))
-@end example
-@end deffn
-
-@node Miscellaneous Functions
-@section Miscellaneous Functions
-
-@menu
-* Administrative Functions::
-* Error Handling::
-* Object Comparisons::
-* Cloning Objects::
-* Write and Display::
-@end menu
-
-@node Administrative Functions
-@subsection Administration Functions
-
-This section describes administrative, non-technical GOOPS functions.
-
-@deffn primitive goops-version
-Return the current GOOPS version as a string, for example ``0.2''.
-@end deffn
-
-@node Error Handling
-@subsection Error Handling
-
-The procedure @code{goops-error} is called to raise an appropriate error
-by the default methods of the following generic functions:
-
-@itemize @bullet
-@item
-@code{slot-missing} (@pxref{Handling Slot Access Errors,, slot-missing})
-
-@item
-@code{slot-unbound} (@pxref{Handling Slot Access Errors,, slot-unbound})
-
-@item
-@code{no-method} (@pxref{Handling Invocation Errors,, no-method})
-
-@item
-@code{no-applicable-method} (@pxref{Handling Invocation Errors,,
-no-applicable-method})
-
-@item
-@code{no-next-method} (@pxref{Handling Invocation Errors,,
-no-next-method})
-@end itemize
-
-If you customize these functions for particular classes or metaclasses,
-you may still want to use @code{goops-error} to signal any error
-conditions that you detect.
-
-@deffn procedure goops-error format-string . args
-Raise an error with key @code{goops-error} and error message constructed
-from @var{format-string} and @var{args}. Error message formatting is
-as done by @code{scm-error}.
-@end deffn
-
-@node Object Comparisons
-@subsection Object Comparisons
-
-@deffn generic object-eqv?
-@deffnx method object-eqv? ((x <top>) (y <top>))
-@deffnx generic object-equal?
-@deffnx method object-equal? ((x <top>) (y <top>))
-Generic functions and default (unspecialized) methods for comparing two
-GOOPS objects.
-
-The default methods always return @code{#f}. Application class authors
-may wish to define specialized methods for @code{object-eqv?} and
-@code{object-equal?} that compare instances of the same class for
-equality in whatever sense is useful to the application.
-@end deffn
-
-@node Cloning Objects
-@subsection Cloning Objects
-
-@deffn generic shallow-clone
-@deffnx method shallow-clone (self <object>)
-Return a ``shallow'' clone of @var{self}. The default method makes a
-shallow clone by allocating a new instance and copying slot values from
-self to the new instance. Each slot value is copied either as an
-immediate value or by reference.
-@end deffn
-
-@deffn generic deep-clone
-@deffnx method deep-clone (self <object>)
-Return a ``deep'' clone of @var{self}. The default method makes a deep
-clone by allocating a new instance and copying or cloning slot values
-from self to the new instance. If a slot value is an instance
-(satisfies @code{instance?}), it is cloned by calling @code{deep-clone}
-on that value. Other slot values are copied either as immediate values
-or by reference.
-@end deffn
-
-@node Write and Display
-@subsection Write and Display
-
-@deffn {primitive generic} write object port
-@deffnx {primitive generic} display object port
-When GOOPS is loaded, @code{write} and @code{display} become generic
-functions with special methods for printing
-
-@itemize @bullet
-@item
-objects - instances of the class @code{<object>}
-
-@item
-foreign objects - instances of the class @code{<foreign-object>}
-
-@item
-classes - instances of the class @code{<class>}
-
-@item
-generic functions - instances of the class @code{<generic>}
-
-@item
-methods - instances of the class @code{<method>}.
-@end itemize
-
-@code{write} and @code{display} print non-GOOPS values in the same way
-as the Guile primitive @code{write} and @code{display} functions.
-@end deffn
-
-@node MOP Specification, Tutorial, Reference Manual, Top
-@chapter MOP Specification
-
-For an introduction to metaobjects and the metaobject protocol,
-see @ref{Metaobjects and the Metaobject Protocol}.
-
-The aim of the MOP specification in this chapter is to specify all the
-customizable generic function invocations that can be made by the standard
-GOOPS syntax, procedures and methods, and to explain the protocol for
-customizing such invocations.
-
-A generic function invocation is customizable if the types of the arguments
-to which it is applied are not all determined by the lexical context in
-which the invocation appears. For example,
-
-@itemize @bullet
-@item
-the @code{(initialize @var{instance} @var{initargs})} invocation in the
-default @code{make-instance} method is customizable, because the type of the
-@code{@var{instance}} argument is determined by the class that was passed to
-@code{make-instance}.
-
-@item
-the @code{(make <generic> #:name ',name)} invocation in @code{define-generic}
-is not customizable, because all of its arguments have lexically determined
-types.
-@end itemize
-
-When using this rule to decide whether a given generic function invocation
-is customizable, we ignore arguments that are expected to be handled in
-method definitions as a single ``rest'' list argument.
-
-For each customizable generic function invocation, the @dfn{invocation
-protocol} is explained by specifying
-
-@itemize @bullet
-@item
-what, conceptually, the applied method is intended to do
-
-@item
-what assumptions, if any, the caller makes about the applied method's side
-effects
-
-@item
-what the caller expects to get as the applied method's return value.
-@end itemize
-
-@menu
-* Class Definition::
-* Instance Creation::
-* Class Redefinition::
-* Method Definition::
-* Generic Function Invocation::
-@end menu
-
-@node Class Definition
-@section Class Definition
-
-@code{define-class} (syntax)
-
-@itemize @bullet
-@item
-@code{class} (syntax)
-
-@itemize @bullet
-@item
-@code{make-class} (procedure)
-
-@itemize @bullet
-@item
-@code{make @var{metaclass} @dots{}} (generic)
-
-@var{metaclass} is the metaclass of the class being defined, either
-taken from the @code{#:metaclass} class option or computed by
-@code{ensure-metaclass}. The applied method must create and return the
-fully initialized class metaobject for the new class definition.
-@end itemize
-
-@end itemize
-
-@item
-@code{class-redefinition @var{old-class} @var{new-class}} (generic)
-
-@code{define-class} calls @code{class-redefinition} if the variable
-specified by its first argument already held a GOOPS class definition.
-@var{old-class} and @var{new-class} are the old and new class metaobjects.
-The applied method should perform whatever is necessary to handle the
-redefinition, and should return the class metaobject that is to be bound
-to @code{define-class}'s variable. The default class redefinition
-protocol is described in @ref{Class Redefinition}.
-@end itemize
-
-The @code{(make @var{metaclass} @dots{})} invocation above will create
-an class metaobject with metaclass @var{metaclass}. By default, this
-metaobject will be initialized by the @code{initialize} method that is
-specialized for instances of type @code{<class>}.
-
-@code{initialize <class> @var{initargs}} (method)
-
-@itemize @bullet
-@item
-@code{compute-cpl @var{class}} (generic)
-
-The applied method should compute and return the class precedence list
-for @var{class} as a list of class metaobjects. When @code{compute-cpl}
-is called, the following @var{class} metaobject slots have all been
-initialized: @code{name}, @code{direct-supers}, @code{direct-slots},
-@code{direct-subclasses} (empty), @code{direct-methods}. The value
-returned by @code{compute-cpl} will be stored in the @code{cpl} slot.
-
-@item
-@code{compute-slots @var{class}} (generic)
-
-The applied method should compute and return the slots (union of direct
-and inherited) for @var{class} as a list of slot definitions. When
-@code{compute-slots} is called, all the @var{class} metaobject slots
-mentioned for @code{compute-cpl} have been initialized, plus the
-following: @code{cpl}, @code{redefined} (@code{#f}), @code{environment}.
-The value returned by @code{compute-slots} will be stored in the
-@code{slots} slot.
-
-@item
-@code{compute-get-n-set @var{class} @var{slot-def}} (generic)
-
-@code{initialize} calls @code{compute-get-n-set} for each slot computed
-by @code{compute-slots}. The applied method should compute and return a
-pair of closures that, respectively, get and set the value of the specified
-slot. The get closure should have arity 1 and expect a single argument
-that is the instance whose slot value is to be retrieved. The set closure
-should have arity 2 and expect two arguments, where the first argument is
-the instance whose slot value is to be set and the second argument is the
-new value for that slot. The closures should be returned in a two element
-list: @code{(list @var{get} @var{set})}.
-
-The closures returned by @code{compute-get-n-set} are stored as part of
-the value of the @var{class} metaobject's @code{getters-n-setters} slot.
-Specifically, the value of this slot is a list with the same number of
-elements as there are slots in the class, and each element looks either like
-
-@example
-@code{(@var{slot-name-symbol} @var{init-function} . @var{index})}
-@end example
-
-or like
-
-@example
-@code{(@var{slot-name-symbol} @var{init-function} @var{get} @var{set})}
-@end example
-
-Where the get and set closures are replaced by @var{index}, the slot is
-an instance slot and @var{index} is the slot's index in the underlying
-structure: GOOPS knows how to get and set the value of such slots and so
-does not need specially constructed get and set closures. Otherwise,
-@var{get} and @var{set} are the closures returned by @code{compute-get-n-set}.
-
-The structure of the @code{getters-n-setters} slot value is important when
-understanding the next customizable generic functions that @code{initialize}
-calls@dots{}
-
-@item
-@code{compute-getter-method @var{class} @var{gns}} (generic)
-
-@code{initialize} calls @code{compute-getter-method} for each of the class's
-slots (as determined by @code{compute-slots}) that includes a
-@code{#:getter} or @code{#:accessor} slot option. @var{gns} is the
-element of the @var{class} metaobject's @code{getters-n-setters} slot that
-specifies how the slot in question is referenced and set, as described
-above under @code{compute-get-n-set}. The applied method should create
-and return a method that is specialized for instances of type @var{class}
-and uses the get closure to retrieve the slot's value. [ *fixme Need
-to insert something here about checking that the value is not unbound. ]
-@code{initialize} uses @code{add-method!} to add the returned method to
-the generic function named by the slot definition's @code{#:getter} or
-@code{#:accessor} option.
-
-@item
-@code{compute-setter-method @var{class} @var{gns}} (generic)
-
-@code{compute-setter-method} is invoked with the same arguments as
-@code{compute-getter-method}, for each of the class's slots that includes
-a @code{#:setter} or @code{#:accessor} slot option. The applied method
-should create and return a method that is specialized for instances of
-type @var{class} and uses the set closure to set the slot's value.
-@code{initialize} then uses @code{add-method!} to add the returned method
-to the generic function named by the slot definition's @code{#:setter}
-or @code{#:accessor} option.
-@end itemize
-
-@node Instance Creation
-@section Instance Creation
-
-@code{make <class> . @var{initargs}} (method)
-
-@itemize @bullet
-@item
-@code{allocate-instance @var{class} @var{initargs}} (generic)
-
-The applied @code{allocate-instance} method should allocate storage for
-a new instance of class @var{class} and return the uninitialized instance.
-
-@item
-@code{initialize @var{instance} @var{initargs}} (generic)
-
-@var{instance} is the uninitialized instance returned by
-@code{allocate-instance}. The applied method should initialize the new
-instance in whatever sense is appropriate for its class. The method's
-return value is ignored.
-@end itemize
-
-@node Class Redefinition
-@section Class Redefinition
-
-The default @code{class-redefinition} method, specialized for classes
-with the default metaclass @code{<class>}, has the following internal
-protocol.
-
-[ *fixme* I'm not sure that I understand this sufficiently to explain
-it. Also, the internals of the default class redefinition method are
-extremely implementation-specific, and I'm not sure that there is that
-much point trying to describe the internal protocol such that it could
-be customized without going to look at the source code. ]
-
-@code{class-redefinition @var{(old <class>)} @var{(new <class>)}}
-(method)
-
-@itemize @bullet
-@item
-@code{remove-class-accessors! @var{old}} (generic)
-
-@item
-@code{update-direct-method! @var{method} @var{old} @var{new}} (generic)
-
-@item
-@code{update-direct-subclass! @var{subclass} @var{old} @var{new}} (generic)
-@end itemize
-
-The default @code{update-direct-subclass!} method invokes
-@code{class-redefinition} recursively to handle the redefinition of the
-subclass.
-
-When a class is redefined, any existing instance of the redefined class
-will be modified for the new class definition before the next time that
-any of the instance's slot is referenced or set. GOOPS modifies each
-instance by calling the generic function @code{change-class}. [ *fixme*
-Actually it sometimes calls @code{change-class} and sometimes
-@code{change-object-class}, and I don't understand why. ]
-
-The default @code{change-class} method copies slot values from the old
-to the modified instance, and initializes new slots, as described in
-@ref{Changing the Class of an Instance}. After doing so, it makes a
-generic function invocation that can be used to customize the instance
-update algorithm.
-
-@code{change-class @var{(old-instance <object>)} @var{(new <class>)}} (method)
-
-@itemize @bullet
-@item
-@code{update-instance-for-different-class @var{old-instance} @var{new-instance}} (generic)
-
-@code{change-class} invokes @code{update-instance-for-different-class}
-as the last thing that it does before returning. The applied method can
-make any further adjustments to @var{new-instance} that are required to
-complete or modify the change of class. The return value from the
-applied method is ignored.
-
-The default @code{update-instance-for-different-class} method does
-nothing.
-@end itemize
-
-@node Method Definition
-@section Method Definition
-
-@code{define-method} (syntax)
-
-@itemize @bullet
-@item
-@code{add-method! @var{target} @var{method}} (generic)
-
-@code{define-method} invokes the @code{add-method!} generic function to
-handle adding the new method to a variety of possible targets. GOOPS
-includes methods to handle @var{target} as
-
-@itemize @bullet
-@item
-a generic function (the most common case)
-
-@item
-a procedure
-
-@item
-a primitive generic (@pxref{Extending Guiles Primitives})
-@end itemize
-
-By defining further methods for @code{add-method!}, you can
-theoretically handle adding methods to further types of target.
-@end itemize
-
-@node Generic Function Invocation
-@section Generic Function Invocation
-
-[ *fixme* Description required here. ]
-
-@code{apply-generic}
-
-@itemize @bullet
-@item
-@code{no-method}
-
-@item
-@code{compute-applicable-methods}
-
-@item
-@code{sort-applicable-methods}
-
-@item
-@code{apply-methods}
-
-@item
-@code{no-applicable-method}
-@end itemize
-
-@code{sort-applicable-methods}
-
-@itemize @bullet
-@item
-@code{method-more-specific?}
-@end itemize
-
-@code{apply-methods}
-
-@itemize @bullet
-@item
-@code{apply-method}
-@end itemize
-
-@code{next-method}
-
-@itemize @bullet
-@item
-@code{no-next-method}
-@end itemize
-
-@node Tutorial, Index, MOP Specification, Top
-@chapter Tutorial
-@include goops-tutorial.texi
-
-@node Index, Concept Index, Tutorial, Top
-@chapter Index
-@page
-@node Concept Index, Function and Variable Index, Index, Top
-@unnumberedsec Concept Index
-
-@printindex cp
-
-@node Function and Variable Index, , Concept Index, Top
-@unnumberedsec Function and Variable Index
-
-@printindex fn
-
-@summarycontents
-@contents
-@bye
diff --git a/doc/goops/hierarchy.eps b/doc/goops/hierarchy.eps
deleted file mode 100644
index 7b1a98605..000000000
--- a/doc/goops/hierarchy.eps
+++ /dev/null
@@ -1,127 +0,0 @@
-%!PS-Adobe-2.0 EPSF
-%%Title: /tmp/xfig-fig016295
-%%Creator: fig2dev
-%%CreationDate: Fri Jun 10 23:18:16 1994
-%%For: eg@kaolin (Erick Gallesio)
-%%BoundingBox: 0 0 361 217
-%%Pages: 0
-%%EndComments
-/$F2psDict 200 dict def
-$F2psDict begin
-$F2psDict /mtrx matrix put
-/l {lineto} bind def
-/m {moveto} bind def
-/s {stroke} bind def
-/n {newpath} bind def
-/gs {gsave} bind def
-/gr {grestore} bind def
-/clp {closepath} bind def
-/graycol {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
-4 -2 roll mul setrgbcolor} bind def
-/col-1 {} def
-/col0 {0 0 0 setrgbcolor} bind def
-/col1 {0 0 1 setrgbcolor} bind def
-/col2 {0 1 0 setrgbcolor} bind def
-/col3 {0 1 1 setrgbcolor} bind def
-/col4 {1 0 0 setrgbcolor} bind def
-/col5 {1 0 1 setrgbcolor} bind def
-/col6 {1 1 0 setrgbcolor} bind def
-/col7 {1 1 1 setrgbcolor} bind def
- end
-/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
-/$F2psEnd {$F2psEnteredState restore end} def
-%%EndProlog
-
-$F2psBegin
-0 setlinecap 0 setlinejoin
--216.0 288.0 translate 0.900 -0.900 scale
-0.500 setlinewidth
-n 309 159 m 309 159 l gs col-1 s gr
-n 246.401 216.889 m 244.000 209.000 l 249.831 214.831 l gs 2 setlinejoin col-1 s gr
-% Polyline
-n 244 209 m 274 259 l gs col-1 s gr
-n 298.169 214.831 m 304.000 209.000 l 301.599 216.889 l gs 2 setlinejoin col-1 s gr
-% Polyline
-n 304 209 m 274 259 l gs col-1 s gr
-n 255.721 213.778 m 249.000 209.000 l 257.179 210.053 l gs 2 setlinejoin col-1 s gr
-% Polyline
-n 249 209 m 364 254 l gs col-1 s gr
-n 370.312 216.376 m 374.000 209.000 l 374.217 217.243 l gs 2 setlinejoin col-1 s gr
-% Polyline
-n 374 209 m 364 254 l gs col-1 s gr
-n 283.772 280.725 m 279.000 274.000 l 286.376 277.688 l gs 2 setlinejoin col-1 s gr
-% Polyline
-n 279 274 m 314 304 l gs col-1 s gr
-n 351.457 272.333 m 359.000 269.000 l 353.913 275.490 l gs 2 setlinejoin col-1 s gr
-% Polyline
-n 359 269 m 314 304 l gs col-1 s gr
-n 300.950 165.789 m 309.000 164.000 l 302.739 169.367 l gs 2 setlinejoin col-1 s gr
-% Polyline
-n 309 164 m 249 194 l gs col-1 s gr
-n 307.000 172.000 m 309.000 164.000 l 311.000 172.000 l gs 2 setlinejoin col-1 s gr
-% Polyline
-n 309 164 m 309 199 l gs col-1 s gr
-n 315.261 169.367 m 309.000 164.000 l 317.050 165.789 l gs 2 setlinejoin col-1 s gr
-% Polyline
-n 309 164 m 379 199 l gs col-1 s gr
-n 406.949 101.701 m 404.000 94.000 l 410.226 99.407 l gs 2 setlinejoin col-1 s gr
-% Polyline
-n 404 94 m 439 144 l gs col-1 s gr
-n 410.363 99.245 m 404.000 94.000 l 412.083 95.634 l gs 2 setlinejoin col-1 s gr
-% Polyline
-n 404 94 m 509 144 l gs col-1 s gr
-n 411.173 98.068 m 404.000 94.000 l 412.243 94.214 l gs 2 setlinejoin col-1 s gr
-% Polyline
-n 404 94 m 584 144 l gs col-1 s gr
-n 396.075 96.277 m 404.000 94.000 l 398.079 99.739 l gs 2 setlinejoin col-1 s gr
-% Polyline
-n 404 94 m 309 149 l gs col-1 s gr
-% Polyline
-n 584 229 m 584 204 l gs col-1 s gr
-n 582.000 212.000 m 584.000 204.000 l 586.000 212.000 l gs 2 setlinejoin col-1 s gr
-% Polyline
-n 584 189 m 584 159 l gs col-1 s gr
-n 582.000 167.000 m 584.000 159.000 l 586.000 167.000 l gs 2 setlinejoin col-1 s gr
-/Times-Bold findfont 12.00 scalefont setfont
-239 209 m
-gs 1 -1 scale (A) col-1 show gr
-/Times-Bold findfont 12.00 scalefont setfont
-274 274 m
-gs 1 -1 scale (D) col-1 show gr
-/Times-Bold findfont 12.00 scalefont setfont
-359 269 m
-gs 1 -1 scale (E) col-1 show gr
-/Times-Bold findfont 12.00 scalefont setfont
-304 209 m
-gs 1 -1 scale (B) col-1 show gr
-/Times-Bold findfont 12.00 scalefont setfont
-374 209 m
-gs 1 -1 scale (C) col-1 show gr
-/Times-Bold findfont 12.00 scalefont setfont
-314 319 m
-gs 1 -1 scale (F) col-1 show gr
-/Times-Bold findfont 12.00 scalefont setfont
-289 159 m
-gs 1 -1 scale (<object>) col-1 show gr
-/Times-Bold findfont 12.00 scalefont setfont
-389 89 m
-gs 1 -1 scale (<top>) col-1 show gr
-/Times-Bold findfont 12.00 scalefont setfont
-424 154 m
-gs 1 -1 scale (<pair>) col-1 show gr
-/Times-Bold findfont 12.00 scalefont setfont
-474 154 m
-gs 1 -1 scale (<procedure>) col-1 show gr
-/Times-Bold findfont 12.00 scalefont setfont
-559 154 m
-gs 1 -1 scale (<number>) col-1 show gr
-/Times-Bold findfont 12.00 scalefont setfont
-629 154 m
-gs 1 -1 scale (...) col-1 show gr
-/Times-Bold findfont 12.00 scalefont setfont
-569 199 m
-gs 1 -1 scale (<real>) col-1 show gr
-/Times-Bold findfont 12.00 scalefont setfont
-559 239 m
-gs 1 -1 scale (<integer>) col-1 show gr
-$F2psEnd
diff --git a/doc/goops/hierarchy.txt b/doc/goops/hierarchy.txt
deleted file mode 100644
index c7992df7b..000000000
--- a/doc/goops/hierarchy.txt
+++ /dev/null
@@ -1,14 +0,0 @@
- <top>
- / \\\_____________________
- / \\___________ \
- / \ \ \
- <object> <pair> <procedure> <number>
- / | \ |
- / | \ |
- A B C <complex>
- |\__/__ | |
- \ / \ / |
- D E <real>
- \ / |
- F |
- <integer>
diff --git a/doc/goops/mop.text b/doc/goops/mop.text
deleted file mode 100644
index 0180f2c1e..000000000
--- a/doc/goops/mop.text
+++ /dev/null
@@ -1,66 +0,0 @@
-*** NOTE: This information needs updating! ***
-
-P - procedure
-L - local procedure
-S - syntax
-G - generic
-M - method
-
-define-class (S)
- make-class (S)
- ensure-metaclass (P)
- ensure-metaclass-with-supers (P)
- make (G)
- ensure-class (P)
- make (G)
- class-redefinition (G)
- remove-class-accessors (G)
- update-direct-method (G)
- update-direct-subclass (G)
-
-define-generic (S)
- make-generic-function (S)
- ensure-generic-function (P)
- make (G)
-
-define-method (S)
- ensure-method (P)
- ensure-generic-function (P)
- make (G)
- make (G)
- add-method (P)
-
-method (S)
- ensure-method (P)
-
-initialize (class) (M)
- compute-cpl (P)
- compute-slots (G)
- compute-getters-n-setters (P)
- compute-slot-init-function (L)
- compute-get-n-set (G)
- compute-slot-accessors (P)
- ensure-method (P)
- %inherit-magic! (P)
- %prep-layout! (P)
-
-initialize (generic) (M)
- make (G)
-
-change-class (G)
- change-object-class (P)
- update-instance-for-different-class (G)
-
-make = make-instance (G)
- allocate-instance (G)
- %allocate-instance (P)
- initialize (G)
- %initialize-object (P)
-
-apply-generic (G)
- compute-applicable-methods (G)
- find-method (P)
- sort-applicable-methods (G)
- sort (P)
- apply-methods (G)
- apply-method (G)
diff --git a/doc/groupings.alist b/doc/groupings.alist
deleted file mode 100644
index df198631c..000000000
--- a/doc/groupings.alist
+++ /dev/null
@@ -1,176 +0,0 @@
-;;; groupings.alist -*-scheme-*-
-
-;; Copyright (C) 2002 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, Inc., 59 Temple Place, Suite 330,
-;; Boston, MA 02111-1307 USA
-
-;;; Commentary:
-
-;; This file describes interface element groupings.
-;; See (scripts scan-api) commentary for more info.
-;; NOTE: Order matters; put simple ones first, composites after.
-;;
-;; TODO: Add goops, add math, etc etc.
-;; Group `guile-C-API' needs much more serious thought.
-
-;;; Code:
-
-(
-
- ;; Integrity checks
-
- (C+scheme
- (description "in both groups `scheme' and `C' -- should be empty!")
- (grok () (lambda (x)
- (and (in-group? x 'Scheme)
- (in-group? x 'C)))))
-
- ;; Embedded foreign libraries
-
- (embedded-libltdl
- (description "begins with lt_ -- should become empty over time")
- (grok () (lambda (x)
- (name-prefix? x "lt_"))))
-
- ;; By name
-
- (libguile-internal
- (description "begins with scm_i_")
- (grok () (lambda (x)
- (name-prefix? x "scm_i_"))))
-
- (gdb
- (description "begins with gdb_")
- (grok () (lambda (x)
- (name-prefix? x "gdb_"))))
-
- (coop
- (description "begins with coop_")
- (grok () (lambda (x)
- (name-prefix? x "coop_"))))
-
- (gh
- (description "begins with gh_")
- (grok () (lambda (x)
- (name-prefix? x "gh_"))))
-
- (g-fdes
- (description "begins with g and ends with fds")
- (grok () (lambda (x)
- (name-prefix? x "g.+fds$"))))
-
- (r-fdes
- (description "begins with r and ends with fds")
- (grok () (lambda (x)
- (name-prefix? x "r.+fds$"))))
-
- (scm
- (description "begins with scm_")
- (grok () (lambda (x)
- (name-prefix? x "scm_"))))
-
- (k
- (description "constants")
- (grok () (lambda (x)
- (name-prefix? x "[_A-Z0-9]+$"))))
-
- (POSIX
- (description "POSIX support")
- (members ; from docs
-
- ;; ports and file descriptors
- port-revealed set-port-revealed! fileno port->fdes fdopen fdes->ports
- fdes->inport fdes->outport primitive-move->fdes move->fdes
- release-port-handle fsync open open-fdes close close-fdes unread-char
- unread-string pipe dup->fdes dup->inport dup->outport dup dup->port
- duplicate-port redirect-port dup2 port-mode close-all-ports-except
- port-for-each setvbuf fcntl flock select
- O_RDONLY O_WRONLY O_RDWR O_APPEND O_CREAT _IONBF _IOLBF _IOFBF
- F_DUPFD F_GETFD F_SETFD F_GETFL F_SETFL F_GETOWN F_SETOWN FD_CLOEXEC
- LOCK_SH LOCK_EX LOCK_UN LOCK_NB
-
- ;; file system
- access? stat lstat readlink chown chmod utime delete-file copy-file
- rename-file link symlink mkdir rmdir opendir directory-stream? readdir
- rewinddir closedir sync mknod tmpnam mkstemp! dirname basename
- R_OK W_OK X_OK F_OK
- stat:perms stat:type stat:blocks stat:blksize stat:ctime stat:mtime
- stat:atime stat:size stat:rdev stat:gid stat:uid stat:nlink stat:mode
- stat:ino stat:dev
-
- ;; user information
- passwd:name passwd:passwd passwd:uid passwd:gid passwd:gecos passwd:dir
- passwd:shell group:name group:passwd group:gid group:mem
- getpwuid getpwnam name setpwent getpwent endpwent setpw getpw getgrgid
- getgrnam setgrent getgrent endgrent setgr getgr cuserid getlogin
-
- ;; time
- tm:sec set-tm:sec tm:min set-tm:min tm:hour set-tm:hour tm:mday set-tm:mday
- tm:mon set-tm:mon tm:year set-tm:year tm:wday set-tm:wday tm:yday
- set-tm:yday tm:isdst set-tm:isdst tm:gmtoff set-tm:gmtoff tm:zone
- set-tm:zone tms:clock tms:utime tms:stime tms:cutime tms:cstime
- current-time gettimeofday localtime gmtime mktime tzset strftime strptime
- times get-internal-real-time get-internal-run-time
-
- ;; runtime environment
- program-arguments command-line getenv setenv environ putenv
-
- ;; proceses
- chdir getcwd umask chroot getpid getgroups getppid getuid getgid geteuid
- getegid setuid setgid seteuid setegid getpgrp setpgid setsid waitpid
- status:exit-val status:term-sig status:stop-sig system primitive-exit execl
- execlp execle primitive-fork nice setpriority getpriority
- WNOHANG WUNTRACED
-
- ;; signals
- kill raise sigaction restore-signals alarm pause sleep usleep setitimer
- getitimer SIGHUP SIGINT
-
- ;; terminals and ptys
- isatty? ttyname ctermid tcgetpgrp tcsetpgrp
-
- ;; pipes -- not included because they are in (ice-9 popen)
-
- ;; system identification
- utsname:sysname utsname:nodename utsname:release utsname:version
- utsname:machine uname gethostname sethostname software-type
-
- ;; locales
- setlocale
- LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME
-
- ;; encryption
- crypt getpass))
-
- (math
- (description "math functions")
- (members $abs $acos $acosh $asin $asinh $atan $atan2 $atanh $cos $cosh
- $exp $expt $log $sin $sinh $sqrt $tan $tanh))
-
- ;; By composition (these must be AFTER their constituent groupings)
-
- (guile-C-API
- (description "the official guile API available to C programs")
- (grok () (lambda (x)
- (and (in-group? x 'C)
- (or (in-group? x 'gh)
- (in-group? x 'coop)
- (in-group? x 'gdb))))))
-
- ;; Add new grouping descriptions here.
- )
-
-;;; groupings.alist ends here
diff --git a/doc/guile-api.alist b/doc/guile-api.alist
deleted file mode 100644
index 5f73cae3a..000000000
--- a/doc/guile-api.alist
+++ /dev/null
@@ -1,3219 +0,0 @@
-;;; generated 2002-05-12 05:25:39 UTC by scan-api -- do not edit!
-
-(
-(meta
- (GUILE_LOAD_PATH . "")
- (LTDL_LIBRARY_PATH . "")
- (guile . "pre-inst-guile")
- (libguileinterface . "15:0:0")
- (sofile . "libguile/.libs/libguile.so.15.0.0")
- (groups C+scheme embedded-libltdl libguile-internal gdb coop gh g-fdes r-fdes scm k POSIX math guile-C-API Scheme C)
-) ;; end of meta
-(interface
-($abs (groups math Scheme) (scan-data "#<primitive-procedure $abs>"))
-($acos (groups math Scheme) (scan-data "#<primitive-procedure $acos>"))
-($acosh (groups math Scheme) (scan-data "#<primitive-procedure $acosh>"))
-($asin (groups math Scheme) (scan-data "#<primitive-procedure $asin>"))
-($asinh (groups math Scheme) (scan-data "#<primitive-procedure $asinh>"))
-($atan (groups math Scheme) (scan-data "#<primitive-procedure $atan>"))
-($atan2 (groups math Scheme) (scan-data "#<primitive-procedure $atan2>"))
-($atanh (groups math Scheme) (scan-data "#<primitive-procedure $atanh>"))
-($cos (groups math Scheme) (scan-data "#<primitive-procedure $cos>"))
-($cosh (groups math Scheme) (scan-data "#<primitive-procedure $cosh>"))
-($exp (groups math Scheme) (scan-data "#<primitive-procedure $exp>"))
-($expt (groups math Scheme) (scan-data "#<primitive-procedure $expt>"))
-($log (groups math Scheme) (scan-data "#<primitive-procedure $log>"))
-($sin (groups math Scheme) (scan-data "#<primitive-procedure $sin>"))
-($sinh (groups math Scheme) (scan-data "#<primitive-procedure $sinh>"))
-($sqrt (groups math Scheme) (scan-data "#<primitive-procedure $sqrt>"))
-($tan (groups math Scheme) (scan-data "#<primitive-procedure $tan>"))
-($tanh (groups math Scheme) (scan-data "#<primitive-procedure $tanh>"))
-(%cond-expand-features (groups Scheme) (scan-data ""))
-(%cond-expand-table (groups Scheme) (scan-data ""))
-(%deliver-signals (groups Scheme) (scan-data "#<primitive-procedure %deliver-signals>"))
-(%get-pre-modules-obarray (groups Scheme) (scan-data "#<primitive-procedure %get-pre-modules-obarray>"))
-(%guile-build-info (groups Scheme) (scan-data ""))
-(%init-goops-builtins (groups Scheme) (scan-data "#<primitive-procedure %init-goops-builtins>"))
-(%init-rdelim-builtins (groups Scheme) (scan-data "#<primitive-procedure %init-rdelim-builtins>"))
-(%init-rw-builtins (groups Scheme) (scan-data "#<primitive-procedure %init-rw-builtins>"))
-(%library-dir (groups Scheme) (scan-data "#<primitive-procedure %library-dir>"))
-(%load-announce (groups Scheme) (scan-data "#<procedure %load-announce (file)>"))
-(%load-extensions (groups Scheme) (scan-data ""))
-(%load-hook (groups Scheme) (scan-data "#<procedure %load-announce (file)>"))
-(%load-path (groups Scheme) (scan-data ""))
-(%load-verbosely (groups Scheme) (scan-data ""))
-(%make-void-port (groups Scheme) (scan-data "#<primitive-procedure %make-void-port>"))
-(%module-public-interface (groups Scheme) (scan-data ""))
-(%nil (groups Scheme) (scan-data ""))
-(%package-data-dir (groups Scheme) (scan-data "#<primitive-procedure %package-data-dir>"))
-(%print-module (groups Scheme) (scan-data "#<procedure %print-module (mod port)>"))
-(%print-values (groups Scheme) (scan-data "#<primitive-procedure %print-values>"))
-(%search-load-path (groups Scheme) (scan-data "#<primitive-procedure %search-load-path>"))
-(%site-dir (groups Scheme) (scan-data "#<primitive-procedure %site-dir>"))
-(* (groups Scheme) (scan-data "#<primitive-procedure *>"))
-(*features* (groups Scheme) (scan-data ""))
-(*null-device* (groups Scheme) (scan-data ""))
-(*random-state* (groups Scheme) (scan-data ""))
-(*unspecified* (groups Scheme) (scan-data ""))
-(+ (groups Scheme) (scan-data "#<primitive-procedure +>"))
-(- (groups Scheme) (scan-data "#<primitive-procedure ->"))
-(->bool (groups Scheme) (scan-data "#<procedure ->bool (x)>"))
-(/ (groups Scheme) (scan-data "#<primitive-procedure />"))
-(1+ (groups Scheme) (scan-data "#<procedure 1+ (n)>"))
-(1- (groups Scheme) (scan-data "#<procedure 1- (n)>"))
-(< (groups Scheme) (scan-data "#<primitive-procedure <>"))
-(<= (groups Scheme) (scan-data "#<primitive-procedure <=>"))
-(<class> (groups Scheme) (scan-data ""))
-(<entity> (groups Scheme) (scan-data ""))
-(<operator-class> (groups Scheme) (scan-data ""))
-(= (groups Scheme) (scan-data "#<primitive-procedure =>"))
-(> (groups Scheme) (scan-data "#<primitive-procedure >>"))
-(>= (groups Scheme) (scan-data "#<primitive-procedure >=>"))
-(@apply (groups Scheme) (scan-data ""))
-(@bind (groups Scheme) (scan-data ""))
-(@call-with-current-continuation (groups Scheme) (scan-data ""))
-(@call-with-values (groups Scheme) (scan-data ""))
-(@fop (groups Scheme) (scan-data ""))
-(AF_INET (groups k Scheme) (scan-data ""))
-(AF_INET6 (groups k Scheme) (scan-data ""))
-(AF_UNIX (groups k Scheme) (scan-data ""))
-(AF_UNSPEC (groups k Scheme) (scan-data ""))
-(E2BIG (groups k Scheme) (scan-data ""))
-(EACCES (groups k Scheme) (scan-data ""))
-(EADDRINUSE (groups k Scheme) (scan-data ""))
-(EADDRNOTAVAIL (groups k Scheme) (scan-data ""))
-(EADV (groups k Scheme) (scan-data ""))
-(EAFNOSUPPORT (groups k Scheme) (scan-data ""))
-(EAGAIN (groups k Scheme) (scan-data ""))
-(EALREADY (groups k Scheme) (scan-data ""))
-(EBADE (groups k Scheme) (scan-data ""))
-(EBADF (groups k Scheme) (scan-data ""))
-(EBADFD (groups k Scheme) (scan-data ""))
-(EBADMSG (groups k Scheme) (scan-data ""))
-(EBADR (groups k Scheme) (scan-data ""))
-(EBADRQC (groups k Scheme) (scan-data ""))
-(EBADSLT (groups k Scheme) (scan-data ""))
-(EBFONT (groups k Scheme) (scan-data ""))
-(EBUSY (groups k Scheme) (scan-data ""))
-(ECHILD (groups k Scheme) (scan-data ""))
-(ECHRNG (groups k Scheme) (scan-data ""))
-(ECOMM (groups k Scheme) (scan-data ""))
-(ECONNABORTED (groups k Scheme) (scan-data ""))
-(ECONNREFUSED (groups k Scheme) (scan-data ""))
-(ECONNRESET (groups k Scheme) (scan-data ""))
-(EDEADLK (groups k Scheme) (scan-data ""))
-(EDEADLOCK (groups k Scheme) (scan-data ""))
-(EDESTADDRREQ (groups k Scheme) (scan-data ""))
-(EDOM (groups k Scheme) (scan-data ""))
-(EDOTDOT (groups k Scheme) (scan-data ""))
-(EDQUOT (groups k Scheme) (scan-data ""))
-(EEXIST (groups k Scheme) (scan-data ""))
-(EFAULT (groups k Scheme) (scan-data ""))
-(EFBIG (groups k Scheme) (scan-data ""))
-(EHOSTDOWN (groups k Scheme) (scan-data ""))
-(EHOSTUNREACH (groups k Scheme) (scan-data ""))
-(EIDRM (groups k Scheme) (scan-data ""))
-(EILSEQ (groups k Scheme) (scan-data ""))
-(EINPROGRESS (groups k Scheme) (scan-data ""))
-(EINTR (groups k Scheme) (scan-data ""))
-(EINVAL (groups k Scheme) (scan-data ""))
-(EIO (groups k Scheme) (scan-data ""))
-(EISCONN (groups k Scheme) (scan-data ""))
-(EISDIR (groups k Scheme) (scan-data ""))
-(EISNAM (groups k Scheme) (scan-data ""))
-(EL2HLT (groups k Scheme) (scan-data ""))
-(EL2NSYNC (groups k Scheme) (scan-data ""))
-(EL3HLT (groups k Scheme) (scan-data ""))
-(EL3RST (groups k Scheme) (scan-data ""))
-(ELIBACC (groups k Scheme) (scan-data ""))
-(ELIBBAD (groups k Scheme) (scan-data ""))
-(ELIBEXEC (groups k Scheme) (scan-data ""))
-(ELIBMAX (groups k Scheme) (scan-data ""))
-(ELIBSCN (groups k Scheme) (scan-data ""))
-(ELNRNG (groups k Scheme) (scan-data ""))
-(ELOOP (groups k Scheme) (scan-data ""))
-(EMFILE (groups k Scheme) (scan-data ""))
-(EMLINK (groups k Scheme) (scan-data ""))
-(EMSGSIZE (groups k Scheme) (scan-data ""))
-(EMULTIHOP (groups k Scheme) (scan-data ""))
-(ENAMETOOLONG (groups k Scheme) (scan-data ""))
-(ENAVAIL (groups k Scheme) (scan-data ""))
-(ENETDOWN (groups k Scheme) (scan-data ""))
-(ENETRESET (groups k Scheme) (scan-data ""))
-(ENETUNREACH (groups k Scheme) (scan-data ""))
-(ENFILE (groups k Scheme) (scan-data ""))
-(ENOANO (groups k Scheme) (scan-data ""))
-(ENOBUFS (groups k Scheme) (scan-data ""))
-(ENOCSI (groups k Scheme) (scan-data ""))
-(ENODATA (groups k Scheme) (scan-data ""))
-(ENODEV (groups k Scheme) (scan-data ""))
-(ENOENT (groups k Scheme) (scan-data ""))
-(ENOEXEC (groups k Scheme) (scan-data ""))
-(ENOLCK (groups k Scheme) (scan-data ""))
-(ENOLINK (groups k Scheme) (scan-data ""))
-(ENOMEM (groups k Scheme) (scan-data ""))
-(ENOMSG (groups k Scheme) (scan-data ""))
-(ENONET (groups k Scheme) (scan-data ""))
-(ENOPKG (groups k Scheme) (scan-data ""))
-(ENOPROTOOPT (groups k Scheme) (scan-data ""))
-(ENOSPC (groups k Scheme) (scan-data ""))
-(ENOSR (groups k Scheme) (scan-data ""))
-(ENOSTR (groups k Scheme) (scan-data ""))
-(ENOSYS (groups k Scheme) (scan-data ""))
-(ENOTBLK (groups k Scheme) (scan-data ""))
-(ENOTCONN (groups k Scheme) (scan-data ""))
-(ENOTDIR (groups k Scheme) (scan-data ""))
-(ENOTEMPTY (groups k Scheme) (scan-data ""))
-(ENOTNAM (groups k Scheme) (scan-data ""))
-(ENOTSOCK (groups k Scheme) (scan-data ""))
-(ENOTTY (groups k Scheme) (scan-data ""))
-(ENOTUNIQ (groups k Scheme) (scan-data ""))
-(ENXIO (groups k Scheme) (scan-data ""))
-(EOPNOTSUPP (groups k Scheme) (scan-data ""))
-(EOVERFLOW (groups k Scheme) (scan-data ""))
-(EPERM (groups k Scheme) (scan-data ""))
-(EPFNOSUPPORT (groups k Scheme) (scan-data ""))
-(EPIPE (groups k Scheme) (scan-data ""))
-(EPROTO (groups k Scheme) (scan-data ""))
-(EPROTONOSUPPORT (groups k Scheme) (scan-data ""))
-(EPROTOTYPE (groups k Scheme) (scan-data ""))
-(ERANGE (groups k Scheme) (scan-data ""))
-(EREMCHG (groups k Scheme) (scan-data ""))
-(EREMOTE (groups k Scheme) (scan-data ""))
-(EREMOTEIO (groups k Scheme) (scan-data ""))
-(ERESTART (groups k Scheme) (scan-data ""))
-(EROFS (groups k Scheme) (scan-data ""))
-(ESHUTDOWN (groups k Scheme) (scan-data ""))
-(ESOCKTNOSUPPORT (groups k Scheme) (scan-data ""))
-(ESPIPE (groups k Scheme) (scan-data ""))
-(ESRCH (groups k Scheme) (scan-data ""))
-(ESRMNT (groups k Scheme) (scan-data ""))
-(ESTALE (groups k Scheme) (scan-data ""))
-(ESTRPIPE (groups k Scheme) (scan-data ""))
-(ETIME (groups k Scheme) (scan-data ""))
-(ETIMEDOUT (groups k Scheme) (scan-data ""))
-(ETOOMANYREFS (groups k Scheme) (scan-data ""))
-(ETXTBSY (groups k Scheme) (scan-data ""))
-(EUCLEAN (groups k Scheme) (scan-data ""))
-(EUNATCH (groups k Scheme) (scan-data ""))
-(EUSERS (groups k Scheme) (scan-data ""))
-(EWOULDBLOCK (groups k Scheme) (scan-data ""))
-(EXDEV (groups k Scheme) (scan-data ""))
-(EXFULL (groups k Scheme) (scan-data ""))
-(FD_CLOEXEC (groups POSIX k Scheme) (scan-data ""))
-(F_DUPFD (groups POSIX k Scheme) (scan-data ""))
-(F_GETFD (groups POSIX k Scheme) (scan-data ""))
-(F_GETFL (groups POSIX k Scheme) (scan-data ""))
-(F_GETOWN (groups POSIX k Scheme) (scan-data ""))
-(F_OK (groups POSIX k Scheme) (scan-data ""))
-(F_SETFD (groups POSIX k Scheme) (scan-data ""))
-(F_SETFL (groups POSIX k Scheme) (scan-data ""))
-(F_SETOWN (groups POSIX k Scheme) (scan-data ""))
-(INADDR_ANY (groups k Scheme) (scan-data ""))
-(INADDR_BROADCAST (groups k Scheme) (scan-data ""))
-(INADDR_LOOPBACK (groups k Scheme) (scan-data ""))
-(INADDR_NONE (groups k Scheme) (scan-data ""))
-(ITIMER_PROF (groups k Scheme) (scan-data ""))
-(ITIMER_REAL (groups k Scheme) (scan-data ""))
-(ITIMER_VIRTUAL (groups k Scheme) (scan-data ""))
-(LC_ALL (groups POSIX k Scheme) (scan-data ""))
-(LC_COLLATE (groups POSIX k Scheme) (scan-data ""))
-(LC_CTYPE (groups POSIX k Scheme) (scan-data ""))
-(LC_MESSAGES (groups POSIX k Scheme) (scan-data ""))
-(LC_MONETARY (groups POSIX k Scheme) (scan-data ""))
-(LC_NUMERIC (groups POSIX k Scheme) (scan-data ""))
-(LC_TIME (groups POSIX k Scheme) (scan-data ""))
-(LOCK_EX (groups POSIX k Scheme) (scan-data ""))
-(LOCK_NB (groups POSIX k Scheme) (scan-data ""))
-(LOCK_SH (groups POSIX k Scheme) (scan-data ""))
-(LOCK_UN (groups POSIX k Scheme) (scan-data ""))
-(MSG_DONTROUTE (groups k Scheme) (scan-data ""))
-(MSG_OOB (groups k Scheme) (scan-data ""))
-(MSG_PEEK (groups k Scheme) (scan-data ""))
-(NSIG (groups k Scheme) (scan-data ""))
-(OPEN_BOTH (groups k Scheme) (scan-data ""))
-(OPEN_READ (groups k Scheme) (scan-data ""))
-(OPEN_WRITE (groups k Scheme) (scan-data ""))
-(O_APPEND (groups POSIX k Scheme) (scan-data ""))
-(O_CREAT (groups POSIX k Scheme) (scan-data ""))
-(O_EXCL (groups k Scheme) (scan-data ""))
-(O_NDELAY (groups k Scheme) (scan-data ""))
-(O_NOCTTY (groups k Scheme) (scan-data ""))
-(O_NONBLOCK (groups k Scheme) (scan-data ""))
-(O_RDONLY (groups POSIX k Scheme) (scan-data ""))
-(O_RDWR (groups POSIX k Scheme) (scan-data ""))
-(O_SYNC (groups k Scheme) (scan-data ""))
-(O_TRUNC (groups k Scheme) (scan-data ""))
-(O_WRONLY (groups POSIX k Scheme) (scan-data ""))
-(PF_INET (groups k Scheme) (scan-data ""))
-(PF_INET6 (groups k Scheme) (scan-data ""))
-(PF_UNIX (groups k Scheme) (scan-data ""))
-(PF_UNSPEC (groups k Scheme) (scan-data ""))
-(PIPE_BUF (groups k Scheme) (scan-data ""))
-(PRIO_PGRP (groups k Scheme) (scan-data ""))
-(PRIO_PROCESS (groups k Scheme) (scan-data ""))
-(PRIO_USER (groups k Scheme) (scan-data ""))
-(R_OK (groups POSIX k Scheme) (scan-data ""))
-(SA_NOCLDSTOP (groups k Scheme) (scan-data ""))
-(SA_RESTART (groups k Scheme) (scan-data ""))
-(SEEK_CUR (groups k Scheme) (scan-data ""))
-(SEEK_END (groups k Scheme) (scan-data ""))
-(SEEK_SET (groups k Scheme) (scan-data ""))
-(SIGABRT (groups k Scheme) (scan-data ""))
-(SIGALRM (groups k Scheme) (scan-data ""))
-(SIGBUS (groups k Scheme) (scan-data ""))
-(SIGCHLD (groups k Scheme) (scan-data ""))
-(SIGCLD (groups k Scheme) (scan-data ""))
-(SIGCONT (groups k Scheme) (scan-data ""))
-(SIGFPE (groups k Scheme) (scan-data ""))
-(SIGHUP (groups POSIX k Scheme) (scan-data ""))
-(SIGILL (groups k Scheme) (scan-data ""))
-(SIGINT (groups POSIX k Scheme) (scan-data ""))
-(SIGIO (groups k Scheme) (scan-data ""))
-(SIGIOT (groups k Scheme) (scan-data ""))
-(SIGKILL (groups k Scheme) (scan-data ""))
-(SIGPIPE (groups k Scheme) (scan-data ""))
-(SIGPOLL (groups k Scheme) (scan-data ""))
-(SIGPROF (groups k Scheme) (scan-data ""))
-(SIGPWR (groups k Scheme) (scan-data ""))
-(SIGQUIT (groups k Scheme) (scan-data ""))
-(SIGSEGV (groups k Scheme) (scan-data ""))
-(SIGSTKFLT (groups k Scheme) (scan-data ""))
-(SIGSTOP (groups k Scheme) (scan-data ""))
-(SIGTERM (groups k Scheme) (scan-data ""))
-(SIGTRAP (groups k Scheme) (scan-data ""))
-(SIGTSTP (groups k Scheme) (scan-data ""))
-(SIGTTIN (groups k Scheme) (scan-data ""))
-(SIGTTOU (groups k Scheme) (scan-data ""))
-(SIGUNUSED (groups k Scheme) (scan-data ""))
-(SIGURG (groups k Scheme) (scan-data ""))
-(SIGUSR1 (groups k Scheme) (scan-data ""))
-(SIGUSR2 (groups k Scheme) (scan-data ""))
-(SIGVTALRM (groups k Scheme) (scan-data ""))
-(SIGWINCH (groups k Scheme) (scan-data ""))
-(SIGXCPU (groups k Scheme) (scan-data ""))
-(SIGXFSZ (groups k Scheme) (scan-data ""))
-(SIG_DFL (groups k Scheme) (scan-data ""))
-(SIG_IGN (groups k Scheme) (scan-data ""))
-(SOCK_DGRAM (groups k Scheme) (scan-data ""))
-(SOCK_RAW (groups k Scheme) (scan-data ""))
-(SOCK_STREAM (groups k Scheme) (scan-data ""))
-(SOL_IP (groups k Scheme) (scan-data ""))
-(SOL_SOCKET (groups k Scheme) (scan-data ""))
-(SO_BROADCAST (groups k Scheme) (scan-data ""))
-(SO_DEBUG (groups k Scheme) (scan-data ""))
-(SO_DONTROUTE (groups k Scheme) (scan-data ""))
-(SO_ERROR (groups k Scheme) (scan-data ""))
-(SO_KEEPALIVE (groups k Scheme) (scan-data ""))
-(SO_LINGER (groups k Scheme) (scan-data ""))
-(SO_NO_CHECK (groups k Scheme) (scan-data ""))
-(SO_OOBINLINE (groups k Scheme) (scan-data ""))
-(SO_PRIORITY (groups k Scheme) (scan-data ""))
-(SO_RCVBUF (groups k Scheme) (scan-data ""))
-(SO_REUSEADDR (groups k Scheme) (scan-data ""))
-(SO_SNDBUF (groups k Scheme) (scan-data ""))
-(SO_TYPE (groups k Scheme) (scan-data ""))
-(WAIT_ANY (groups k Scheme) (scan-data ""))
-(WAIT_MYPGRP (groups k Scheme) (scan-data ""))
-(WNOHANG (groups POSIX k Scheme) (scan-data ""))
-(WUNTRACED (groups POSIX k Scheme) (scan-data ""))
-(W_OK (groups POSIX k Scheme) (scan-data ""))
-(X_OK (groups POSIX k Scheme) (scan-data ""))
-(_IOFBF (groups POSIX k Scheme) (scan-data ""))
-(_IOLBF (groups POSIX k Scheme) (scan-data ""))
-(_IONBF (groups POSIX k Scheme) (scan-data ""))
-(_fini (groups C) (scan-data T))
-(_init (groups C) (scan-data T))
-(abort-hook (groups Scheme) (scan-data ""))
-(abs (groups Scheme) (scan-data "#<primitive-procedure abs>"))
-(accept (groups Scheme) (scan-data "#<primitive-procedure accept>"))
-(access? (groups POSIX Scheme) (scan-data "#<primitive-procedure access?>"))
-(acons (groups Scheme) (scan-data "#<primitive-procedure acons>"))
-(acos (groups Scheme) (scan-data "#<procedure acos (z)>"))
-(acosh (groups Scheme) (scan-data "#<procedure acosh (z)>"))
-(add-hook! (groups Scheme) (scan-data "#<primitive-procedure add-hook!>"))
-(after-backtrace-hook (groups Scheme) (scan-data ""))
-(after-error-hook (groups Scheme) (scan-data ""))
-(after-eval-hook (groups Scheme) (scan-data ""))
-(after-gc-hook (groups Scheme) (scan-data ""))
-(after-print-hook (groups Scheme) (scan-data ""))
-(after-read-hook (groups Scheme) (scan-data ""))
-(alarm (groups POSIX Scheme) (scan-data "#<primitive-procedure alarm>"))
-(and (groups Scheme) (scan-data ""))
-(and-map (groups Scheme) (scan-data "#<procedure and-map (f lst)>"))
-(and=> (groups Scheme) (scan-data "#<procedure and=> (value procedure)>"))
-(angle (groups Scheme) (scan-data "#<primitive-procedure angle>"))
-(app (groups Scheme) (scan-data ""))
-(append (groups Scheme) (scan-data "#<primitive-procedure append>"))
-(append! (groups Scheme) (scan-data "#<primitive-procedure append!>"))
-(apply (groups Scheme) (scan-data "#<procedure apply (fun . args)>"))
-(apply-to-args (groups Scheme) (scan-data "#<procedure apply-to-args (args fn)>"))
-(apply:nconc2last (groups Scheme) (scan-data "#<primitive-procedure apply:nconc2last>"))
-(array->list (groups Scheme) (scan-data "#<primitive-procedure array->list>"))
-(array-contents (groups Scheme) (scan-data "#<primitive-procedure array-contents>"))
-(array-copy! (groups Scheme) (scan-data "#<primitive-procedure array-copy!>"))
-(array-copy-in-order! (groups Scheme) (scan-data "#<primitive-procedure array-copy-in-order!>"))
-(array-dimensions (groups Scheme) (scan-data "#<primitive-procedure array-dimensions>"))
-(array-equal? (groups Scheme) (scan-data "#<primitive-procedure array-equal?>"))
-(array-fill! (groups Scheme) (scan-data "#<primitive-procedure array-fill!>"))
-(array-for-each (groups Scheme) (scan-data "#<primitive-procedure array-for-each>"))
-(array-in-bounds? (groups Scheme) (scan-data "#<primitive-procedure array-in-bounds?>"))
-(array-index-map! (groups Scheme) (scan-data "#<primitive-procedure array-index-map!>"))
-(array-map! (groups Scheme) (scan-data "#<primitive-procedure array-map!>"))
-(array-map-in-order! (groups Scheme) (scan-data "#<primitive-procedure array-map-in-order!>"))
-(array-prototype (groups Scheme) (scan-data "#<primitive-procedure array-prototype>"))
-(array-rank (groups Scheme) (scan-data "#<primitive-procedure array-rank>"))
-(array-ref (groups Scheme) (scan-data "#<primitive-procedure array-ref>"))
-(array-set! (groups Scheme) (scan-data "#<primitive-procedure array-set!>"))
-(array-shape (groups Scheme) (scan-data "#<procedure array-shape (a)>"))
-(array? (groups Scheme) (scan-data "#<primitive-procedure array?>"))
-(ash (groups Scheme) (scan-data "#<primitive-procedure ash>"))
-(asin (groups Scheme) (scan-data "#<procedure asin (z)>"))
-(asinh (groups Scheme) (scan-data "#<procedure asinh (z)>"))
-(assert-defmacro?! (groups Scheme) (scan-data "#<procedure assert-defmacro?! (m)>"))
-(assert-load-verbosity (groups Scheme) (scan-data "#<procedure assert-load-verbosity (v)>"))
-(assert-repl-print-unspecified (groups Scheme) (scan-data "#<procedure assert-repl-print-unspecified (v)>"))
-(assert-repl-silence (groups Scheme) (scan-data "#<procedure assert-repl-silence (v)>"))
-(assert-repl-verbosity (groups Scheme) (scan-data "#<procedure assert-repl-verbosity (v)>"))
-(assoc (groups Scheme) (scan-data "#<primitive-procedure assoc>"))
-(assoc-ref (groups Scheme) (scan-data "#<primitive-procedure assoc-ref>"))
-(assoc-remove! (groups Scheme) (scan-data "#<primitive-procedure assoc-remove!>"))
-(assoc-set! (groups Scheme) (scan-data "#<primitive-procedure assoc-set!>"))
-(assq (groups Scheme) (scan-data "#<primitive-procedure assq>"))
-(assq-ref (groups Scheme) (scan-data "#<primitive-procedure assq-ref>"))
-(assq-remove! (groups Scheme) (scan-data "#<primitive-procedure assq-remove!>"))
-(assq-set! (groups Scheme) (scan-data "#<primitive-procedure assq-set!>"))
-(assv (groups Scheme) (scan-data "#<primitive-procedure assv>"))
-(assv-ref (groups Scheme) (scan-data "#<primitive-procedure assv-ref>"))
-(assv-remove! (groups Scheme) (scan-data "#<primitive-procedure assv-remove!>"))
-(assv-set! (groups Scheme) (scan-data "#<primitive-procedure assv-set!>"))
-(async (groups Scheme) (scan-data "#<primitive-procedure async>"))
-(async-mark (groups Scheme) (scan-data "#<primitive-procedure async-mark>"))
-(atan (groups Scheme) (scan-data "#<procedure atan (z . y)>"))
-(atanh (groups Scheme) (scan-data "#<procedure atanh (z)>"))
-(autoload-done! (groups Scheme) (scan-data "#<procedure autoload-done! (p m)>"))
-(autoload-done-or-in-progress? (groups Scheme) (scan-data "#<procedure autoload-done-or-in-progress? (p m)>"))
-(autoload-in-progress! (groups Scheme) (scan-data "#<procedure autoload-in-progress! (p m)>"))
-(autoloads-done (groups Scheme) (scan-data ""))
-(autoloads-in-progress (groups Scheme) (scan-data ""))
-(backtrace (groups Scheme) (scan-data "#<primitive-procedure backtrace>"))
-(bad-throw (groups Scheme) (scan-data "#<procedure bad-throw (key . args)>"))
-(basename (groups POSIX Scheme) (scan-data "#<primitive-procedure basename>"))
-(basic-load (groups Scheme) (scan-data "#<procedure load (name)>"))
-(batch-mode? (groups Scheme) (scan-data "#<procedure batch-mode? ()>"))
-(beautify-user-module! (groups Scheme) (scan-data "#<procedure beautify-user-module! (module)>"))
-(before-backtrace-hook (groups Scheme) (scan-data ""))
-(before-error-hook (groups Scheme) (scan-data ""))
-(before-eval-hook (groups Scheme) (scan-data ""))
-(before-print-hook (groups Scheme) (scan-data ""))
-(before-read-hook (groups Scheme) (scan-data ""))
-(before-signal-stack (groups Scheme) (scan-data ""))
-(begin (groups Scheme) (scan-data ""))
-(begin-deprecated (groups Scheme) (scan-data ""))
-(bind (groups Scheme) (scan-data "#<primitive-procedure bind>"))
-(bit-count (groups Scheme) (scan-data "#<primitive-procedure bit-count>"))
-(bit-count* (groups Scheme) (scan-data "#<primitive-procedure bit-count*>"))
-(bit-extract (groups Scheme) (scan-data "#<primitive-procedure bit-extract>"))
-(bit-invert! (groups Scheme) (scan-data "#<primitive-procedure bit-invert!>"))
-(bit-position (groups Scheme) (scan-data "#<primitive-procedure bit-position>"))
-(bit-set*! (groups Scheme) (scan-data "#<primitive-procedure bit-set*!>"))
-(boolean? (groups Scheme) (scan-data "#<primitive-procedure boolean?>"))
-(caaaar (groups Scheme) (scan-data "#<primitive-procedure caaaar>"))
-(caaadr (groups Scheme) (scan-data "#<primitive-procedure caaadr>"))
-(caaar (groups Scheme) (scan-data "#<primitive-procedure caaar>"))
-(caadar (groups Scheme) (scan-data "#<primitive-procedure caadar>"))
-(caaddr (groups Scheme) (scan-data "#<primitive-procedure caaddr>"))
-(caadr (groups Scheme) (scan-data "#<primitive-procedure caadr>"))
-(caar (groups Scheme) (scan-data "#<primitive-procedure caar>"))
-(cadaar (groups Scheme) (scan-data "#<primitive-procedure cadaar>"))
-(cadadr (groups Scheme) (scan-data "#<primitive-procedure cadadr>"))
-(cadar (groups Scheme) (scan-data "#<primitive-procedure cadar>"))
-(caddar (groups Scheme) (scan-data "#<primitive-procedure caddar>"))
-(cadddr (groups Scheme) (scan-data "#<primitive-procedure cadddr>"))
-(caddr (groups Scheme) (scan-data "#<primitive-procedure caddr>"))
-(cadr (groups Scheme) (scan-data "#<primitive-procedure cadr>"))
-(call-with-current-continuation (groups Scheme) (scan-data "#<procedure call-with-current-continuation (proc)>"))
-(call-with-dynamic-root (groups Scheme) (scan-data "#<primitive-procedure call-with-dynamic-root>"))
-(call-with-input-file (groups Scheme) (scan-data "#<procedure call-with-input-file (str proc)>"))
-(call-with-input-string (groups Scheme) (scan-data "#<primitive-procedure call-with-input-string>"))
-(call-with-new-thread (groups Scheme) (scan-data "#<primitive-procedure call-with-new-thread>"))
-(call-with-output-file (groups Scheme) (scan-data "#<procedure call-with-output-file (str proc)>"))
-(call-with-output-string (groups Scheme) (scan-data "#<primitive-procedure call-with-output-string>"))
-(call-with-values (groups Scheme) (scan-data "#<procedure call-with-values (producer consumer)>"))
-(car (groups Scheme) (scan-data "#<primitive-procedure car>"))
-(case (groups Scheme) (scan-data ""))
-(catch (groups Scheme) (scan-data "#<primitive-procedure catch>"))
-(cdaaar (groups Scheme) (scan-data "#<primitive-procedure cdaaar>"))
-(cdaadr (groups Scheme) (scan-data "#<primitive-procedure cdaadr>"))
-(cdaar (groups Scheme) (scan-data "#<primitive-procedure cdaar>"))
-(cdadar (groups Scheme) (scan-data "#<primitive-procedure cdadar>"))
-(cdaddr (groups Scheme) (scan-data "#<primitive-procedure cdaddr>"))
-(cdadr (groups Scheme) (scan-data "#<primitive-procedure cdadr>"))
-(cdar (groups Scheme) (scan-data "#<primitive-procedure cdar>"))
-(cddaar (groups Scheme) (scan-data "#<primitive-procedure cddaar>"))
-(cddadr (groups Scheme) (scan-data "#<primitive-procedure cddadr>"))
-(cddar (groups Scheme) (scan-data "#<primitive-procedure cddar>"))
-(cdddar (groups Scheme) (scan-data "#<primitive-procedure cdddar>"))
-(cddddr (groups Scheme) (scan-data "#<primitive-procedure cddddr>"))
-(cdddr (groups Scheme) (scan-data "#<primitive-procedure cdddr>"))
-(cddr (groups Scheme) (scan-data "#<primitive-procedure cddr>"))
-(cdr (groups Scheme) (scan-data "#<primitive-procedure cdr>"))
-(ceiling (groups Scheme) (scan-data "#<primitive-procedure ceiling>"))
-(char->integer (groups Scheme) (scan-data "#<primitive-procedure char->integer>"))
-(char-alphabetic? (groups Scheme) (scan-data "#<primitive-procedure char-alphabetic?>"))
-(char-ci<=? (groups Scheme) (scan-data "#<primitive-procedure char-ci<=?>"))
-(char-ci<? (groups Scheme) (scan-data "#<primitive-procedure char-ci<?>"))
-(char-ci=? (groups Scheme) (scan-data "#<primitive-procedure char-ci=?>"))
-(char-ci>=? (groups Scheme) (scan-data "#<primitive-procedure char-ci>=?>"))
-(char-ci>? (groups Scheme) (scan-data "#<primitive-procedure char-ci>?>"))
-(char-code-limit (groups Scheme) (scan-data ""))
-(char-downcase (groups Scheme) (scan-data "#<primitive-procedure char-downcase>"))
-(char-is-both? (groups Scheme) (scan-data "#<primitive-procedure char-is-both?>"))
-(char-lower-case? (groups Scheme) (scan-data "#<primitive-procedure char-lower-case?>"))
-(char-numeric? (groups Scheme) (scan-data "#<primitive-procedure char-numeric?>"))
-(char-ready? (groups Scheme) (scan-data "#<primitive-procedure char-ready?>"))
-(char-upcase (groups Scheme) (scan-data "#<primitive-procedure char-upcase>"))
-(char-upper-case? (groups Scheme) (scan-data "#<primitive-procedure char-upper-case?>"))
-(char-whitespace? (groups Scheme) (scan-data "#<primitive-procedure char-whitespace?>"))
-(char<=? (groups Scheme) (scan-data "#<primitive-procedure char<=?>"))
-(char<? (groups Scheme) (scan-data "#<primitive-procedure char<?>"))
-(char=? (groups Scheme) (scan-data "#<primitive-procedure char=?>"))
-(char>=? (groups Scheme) (scan-data "#<primitive-procedure char>=?>"))
-(char>? (groups Scheme) (scan-data "#<primitive-procedure char>?>"))
-(char? (groups Scheme) (scan-data "#<primitive-procedure char?>"))
-(chdir (groups POSIX Scheme) (scan-data "#<primitive-procedure chdir>"))
-(chmod (groups POSIX Scheme) (scan-data "#<primitive-procedure chmod>"))
-(chown (groups POSIX Scheme) (scan-data "#<primitive-procedure chown>"))
-(chroot (groups POSIX Scheme) (scan-data "#<primitive-procedure chroot>"))
-(class-of (groups Scheme) (scan-data "#<primitive-procedure class-of>"))
-(close (groups POSIX Scheme) (scan-data "#<primitive-procedure close>"))
-(close-fdes (groups POSIX Scheme) (scan-data "#<primitive-procedure close-fdes>"))
-(close-input-port (groups Scheme) (scan-data "#<primitive-procedure close-input-port>"))
-(close-io-port (groups Scheme) (scan-data "#<primitive-procedure close-port>"))
-(close-output-port (groups Scheme) (scan-data "#<primitive-procedure close-output-port>"))
-(close-port (groups Scheme) (scan-data "#<primitive-procedure close-port>"))
-(closedir (groups POSIX Scheme) (scan-data "#<primitive-procedure closedir>"))
-(closure? (groups Scheme) (scan-data "#<primitive-procedure closure?>"))
-(collect (groups Scheme) (scan-data ""))
-(command-line (groups POSIX Scheme) (scan-data "#<procedure command-line ()>"))
-(compile-define-module-args (groups Scheme) (scan-data "#<procedure compile-define-module-args (args)>"))
-(compile-interface-spec (groups Scheme) (scan-data "#<procedure compile-interface-spec (spec)>"))
-(complex? (groups Scheme) (scan-data "#<primitive-procedure complex?>"))
-(cond (groups Scheme) (scan-data ""))
-(cond-expand (groups Scheme) (scan-data ""))
-(cond-expand-provide (groups Scheme) (scan-data "#<procedure cond-expand-provide (module features)>"))
-(connect (groups Scheme) (scan-data "#<primitive-procedure connect>"))
-(cons (groups Scheme) (scan-data "#<primitive-procedure cons>"))
-(cons* (groups Scheme) (scan-data "#<primitive-procedure cons*>"))
-(cons-source (groups Scheme) (scan-data "#<primitive-procedure cons-source>"))
-(coop_abort (groups guile-C-API coop C) (scan-data T))
-(coop_condition_variable_destroy (groups guile-C-API coop C) (scan-data T))
-(coop_condition_variable_init (groups guile-C-API coop C) (scan-data T))
-(coop_condition_variable_signal (groups guile-C-API coop C) (scan-data T))
-(coop_condition_variable_timed_wait_mutex (groups guile-C-API coop C) (scan-data T))
-(coop_condition_variable_wait_mutex (groups guile-C-API coop C) (scan-data T))
-(coop_create (groups guile-C-API coop C) (scan-data T))
-(coop_getspecific (groups guile-C-API coop C) (scan-data T))
-(coop_global_allq (groups guile-C-API coop C) (scan-data B))
-(coop_global_curr (groups guile-C-API coop C) (scan-data B))
-(coop_global_runq (groups guile-C-API coop C) (scan-data B))
-(coop_global_sleepq (groups guile-C-API coop C) (scan-data B))
-(coop_init (groups guile-C-API coop C) (scan-data T))
-(coop_join (groups guile-C-API coop C) (scan-data T))
-(coop_key_create (groups guile-C-API coop C) (scan-data T))
-(coop_key_delete (groups guile-C-API coop C) (scan-data T))
-(coop_mutex_destroy (groups guile-C-API coop C) (scan-data T))
-(coop_mutex_init (groups guile-C-API coop C) (scan-data T))
-(coop_mutex_lock (groups guile-C-API coop C) (scan-data T))
-(coop_mutex_trylock (groups guile-C-API coop C) (scan-data T))
-(coop_mutex_unlock (groups guile-C-API coop C) (scan-data T))
-(coop_new_condition_variable_init (groups guile-C-API coop C) (scan-data T))
-(coop_new_mutex_init (groups guile-C-API coop C) (scan-data T))
-(coop_next_runnable_thread (groups guile-C-API coop C) (scan-data T))
-(coop_qget (groups guile-C-API coop C) (scan-data T))
-(coop_qput (groups guile-C-API coop C) (scan-data T))
-(coop_setspecific (groups guile-C-API coop C) (scan-data T))
-(coop_sleephelp (groups guile-C-API coop C) (scan-data T))
-(coop_start (groups guile-C-API coop C) (scan-data T))
-(coop_timeout_qinsert (groups guile-C-API coop C) (scan-data T))
-(coop_tmp_queue (groups guile-C-API coop C) (scan-data B))
-(coop_wait_for_runnable_thread (groups guile-C-API coop C) (scan-data T))
-(coop_wait_for_runnable_thread_now (groups guile-C-API coop C) (scan-data T))
-(coop_yield (groups guile-C-API coop C) (scan-data T))
-(copy-file (groups POSIX Scheme) (scan-data "#<primitive-procedure copy-file>"))
-(copy-random-state (groups Scheme) (scan-data "#<primitive-procedure copy-random-state>"))
-(copy-tree (groups Scheme) (scan-data "#<primitive-procedure copy-tree>"))
-(cos (groups Scheme) (scan-data "#<procedure cos (z)>"))
-(cosh (groups Scheme) (scan-data "#<procedure cosh (z)>"))
-(crypt (groups POSIX Scheme) (scan-data "#<primitive-procedure crypt>"))
-(ctermid (groups POSIX Scheme) (scan-data "#<primitive-procedure ctermid>"))
-(current-error-port (groups Scheme) (scan-data "#<primitive-procedure current-error-port>"))
-(current-input-port (groups Scheme) (scan-data "#<primitive-procedure current-input-port>"))
-(current-load-port (groups Scheme) (scan-data "#<primitive-procedure current-load-port>"))
-(current-module (groups Scheme) (scan-data "#<primitive-procedure current-module>"))
-(current-output-port (groups Scheme) (scan-data "#<primitive-procedure current-output-port>"))
-(current-time (groups POSIX Scheme) (scan-data "#<primitive-procedure current-time>"))
-(cuserid (groups POSIX Scheme) (scan-data "#<primitive-procedure cuserid>"))
-(debug-disable (groups Scheme) (scan-data "#<procedure debug-disable flags>"))
-(debug-enable (groups Scheme) (scan-data "#<procedure debug-enable flags>"))
-(debug-object? (groups Scheme) (scan-data "#<primitive-procedure debug-object?>"))
-(debug-options (groups Scheme) (scan-data "#<procedure debug-options args>"))
-(debug-options-interface (groups Scheme) (scan-data "#<primitive-procedure debug-options-interface>"))
-(debug-set! (groups Scheme) (scan-data ""))
-(default-lazy-handler (groups Scheme) (scan-data "#<procedure default-lazy-handler (key . args)>"))
-(define (groups Scheme) (scan-data ""))
-(define-macro (groups Scheme) (scan-data ""))
-(define-module (groups Scheme) (scan-data ""))
-(define-option-interface (groups Scheme) (scan-data ""))
-(define-private (groups Scheme) (scan-data ""))
-(define-public (groups Scheme) (scan-data ""))
-(define-syntax-macro (groups Scheme) (scan-data ""))
-(defined? (groups Scheme) (scan-data "#<primitive-procedure defined?>"))
-(defmacro (groups Scheme) (scan-data ""))
-(defmacro-public (groups Scheme) (scan-data ""))
-(defmacro-transformer (groups Scheme) (scan-data "#<procedure defmacro-transformer (m)>"))
-(defmacro:syntax-transformer (groups Scheme) (scan-data "#<procedure defmacro:syntax-transformer (f)>"))
-(defmacro:transformer (groups Scheme) (scan-data "#<procedure defmacro:transformer (f)>"))
-(defmacro? (groups Scheme) (scan-data "#<procedure defmacro? (m)>"))
-(delay (groups Scheme) (scan-data ""))
-(delete (groups Scheme) (scan-data "#<primitive-procedure delete>"))
-(delete! (groups Scheme) (scan-data "#<primitive-procedure delete!>"))
-(delete-file (groups POSIX Scheme) (scan-data "#<primitive-procedure delete-file>"))
-(delete1! (groups Scheme) (scan-data "#<primitive-procedure delete1!>"))
-(delq (groups Scheme) (scan-data "#<primitive-procedure delq>"))
-(delq! (groups Scheme) (scan-data "#<primitive-procedure delq!>"))
-(delq1! (groups Scheme) (scan-data "#<primitive-procedure delq1!>"))
-(delv (groups Scheme) (scan-data "#<primitive-procedure delv>"))
-(delv! (groups Scheme) (scan-data "#<primitive-procedure delv!>"))
-(delv1! (groups Scheme) (scan-data "#<primitive-procedure delv1!>"))
-(destroy-guardian! (groups Scheme) (scan-data "#<primitive-procedure destroy-guardian!>"))
-(dimensions->uniform-array (groups Scheme) (scan-data "#<primitive-procedure dimensions->uniform-array>"))
-(directory-stream? (groups POSIX Scheme) (scan-data "#<primitive-procedure directory-stream?>"))
-(dirname (groups POSIX Scheme) (scan-data "#<primitive-procedure dirname>"))
-(display (groups Scheme) (scan-data "#<primitive-procedure display>"))
-(display-application (groups Scheme) (scan-data "#<primitive-procedure display-application>"))
-(display-backtrace (groups Scheme) (scan-data "#<primitive-procedure display-backtrace>"))
-(display-error (groups Scheme) (scan-data "#<primitive-procedure display-error>"))
-(display-usage-report (groups Scheme) (scan-data "#<procedure display-usage-report (kw-desc)>"))
-(do (groups Scheme) (scan-data ""))
-(doubly-weak-hash-table? (groups Scheme) (scan-data "#<primitive-procedure doubly-weak-hash-table?>"))
-(drain-input (groups Scheme) (scan-data "#<primitive-procedure drain-input>"))
-(dup (groups POSIX Scheme) (scan-data "#<procedure dup (port/fd . maybe-fd)>"))
-(dup->fdes (groups POSIX Scheme) (scan-data "#<primitive-procedure dup->fdes>"))
-(dup->inport (groups POSIX Scheme) (scan-data "#<procedure dup->inport (port/fd . maybe-fd)>"))
-(dup->outport (groups POSIX Scheme) (scan-data "#<procedure dup->outport (port/fd . maybe-fd)>"))
-(dup->port (groups POSIX Scheme) (scan-data "#<procedure dup->port (port/fd mode . maybe-fd)>"))
-(dup2 (groups POSIX Scheme) (scan-data "#<primitive-procedure dup2>"))
-(duplicate-port (groups POSIX Scheme) (scan-data "#<procedure duplicate-port (port modes)>"))
-(dynamic-args-call (groups Scheme) (scan-data "#<primitive-procedure dynamic-args-call>"))
-(dynamic-call (groups Scheme) (scan-data "#<primitive-procedure dynamic-call>"))
-(dynamic-func (groups Scheme) (scan-data "#<primitive-procedure dynamic-func>"))
-(dynamic-link (groups Scheme) (scan-data "#<primitive-procedure dynamic-link>"))
-(dynamic-object? (groups Scheme) (scan-data "#<primitive-procedure dynamic-object?>"))
-(dynamic-root (groups Scheme) (scan-data "#<primitive-procedure dynamic-root>"))
-(dynamic-unlink (groups Scheme) (scan-data "#<primitive-procedure dynamic-unlink>"))
-(dynamic-wind (groups Scheme) (scan-data "#<primitive-procedure dynamic-wind>"))
-(enclose-array (groups Scheme) (scan-data "#<primitive-procedure enclose-array>"))
-(endgrent (groups POSIX Scheme) (scan-data "#<procedure endgrent ()>"))
-(endhostent (groups Scheme) (scan-data "#<procedure endhostent ()>"))
-(endnetent (groups Scheme) (scan-data "#<procedure endnetent ()>"))
-(endprotoent (groups Scheme) (scan-data "#<procedure endprotoent ()>"))
-(endpwent (groups POSIX Scheme) (scan-data "#<procedure endpwent ()>"))
-(endservent (groups Scheme) (scan-data "#<procedure endservent ()>"))
-(entity? (groups Scheme) (scan-data "#<primitive-procedure entity?>"))
-(env-module (groups Scheme) (scan-data "#<primitive-procedure env-module>"))
-(environ (groups POSIX Scheme) (scan-data "#<primitive-procedure environ>"))
-(environment-bound? (groups Scheme) (scan-data "#<primitive-procedure environment-bound?>"))
-(environment-cell (groups Scheme) (scan-data "#<primitive-procedure environment-cell>"))
-(environment-define (groups Scheme) (scan-data "#<primitive-procedure environment-define>"))
-(environment-fold (groups Scheme) (scan-data "#<primitive-procedure environment-fold>"))
-(environment-module (groups Scheme) (scan-data "#<procedure environment-module (env)>"))
-(environment-observe (groups Scheme) (scan-data "#<primitive-procedure environment-observe>"))
-(environment-observe-weak (groups Scheme) (scan-data "#<primitive-procedure environment-observe-weak>"))
-(environment-ref (groups Scheme) (scan-data "#<primitive-procedure environment-ref>"))
-(environment-set! (groups Scheme) (scan-data "#<primitive-procedure environment-set!>"))
-(environment-undefine (groups Scheme) (scan-data "#<primitive-procedure environment-undefine>"))
-(environment-unobserve (groups Scheme) (scan-data "#<primitive-procedure environment-unobserve>"))
-(environment? (groups Scheme) (scan-data "#<primitive-procedure environment?>"))
-(eof-object? (groups Scheme) (scan-data "#<primitive-procedure eof-object?>"))
-(eq? (groups Scheme) (scan-data "#<primitive-procedure eq?>"))
-(equal? (groups Scheme) (scan-data "#<primitive-procedure equal?>"))
-(eqv? (groups Scheme) (scan-data "#<primitive-procedure eqv?>"))
-(error (groups Scheme) (scan-data "#<procedure error args>"))
-(error-catching-loop (groups Scheme) (scan-data "#<procedure error-catching-loop (thunk)>"))
-(error-catching-repl (groups Scheme) (scan-data "#<procedure error-catching-repl (r e p)>"))
-(eval (groups Scheme) (scan-data "#<primitive-procedure eval>"))
-(eval-case (groups Scheme) (scan-data ""))
-(eval-disable (groups Scheme) (scan-data "#<procedure eval-disable flags>"))
-(eval-enable (groups Scheme) (scan-data "#<procedure eval-enable flags>"))
-(eval-environment-imported (groups Scheme) (scan-data "#<primitive-procedure eval-environment-imported>"))
-(eval-environment-local (groups Scheme) (scan-data "#<primitive-procedure eval-environment-local>"))
-(eval-environment-set-imported! (groups Scheme) (scan-data "#<primitive-procedure eval-environment-set-imported!>"))
-(eval-environment-set-local! (groups Scheme) (scan-data "#<primitive-procedure eval-environment-set-local!>"))
-(eval-environment? (groups Scheme) (scan-data "#<primitive-procedure eval-environment?>"))
-(eval-options (groups Scheme) (scan-data "#<procedure eval-options args>"))
-(eval-options-interface (groups Scheme) (scan-data "#<primitive-procedure eval-options-interface>"))
-(eval-set! (groups Scheme) (scan-data ""))
-(eval-string (groups Scheme) (scan-data "#<primitive-procedure eval-string>"))
-(evaluator-traps-interface (groups Scheme) (scan-data "#<primitive-procedure evaluator-traps-interface>"))
-(even? (groups Scheme) (scan-data "#<primitive-procedure even?>"))
-(exact->inexact (groups Scheme) (scan-data "#<primitive-procedure exact->inexact>"))
-(exact? (groups Scheme) (scan-data "#<primitive-procedure exact?>"))
-(execl (groups POSIX Scheme) (scan-data "#<primitive-procedure execl>"))
-(execle (groups POSIX Scheme) (scan-data "#<primitive-procedure execle>"))
-(execlp (groups POSIX Scheme) (scan-data "#<primitive-procedure execlp>"))
-(exit (groups Scheme) (scan-data "#<procedure quit args>"))
-(exit-hook (groups Scheme) (scan-data ""))
-(exp (groups Scheme) (scan-data "#<procedure exp (z)>"))
-(export (groups Scheme) (scan-data ""))
-(export-environment-private (groups Scheme) (scan-data "#<primitive-procedure export-environment-private>"))
-(export-environment-set-private! (groups Scheme) (scan-data "#<primitive-procedure export-environment-set-private!>"))
-(export-environment-set-signature! (groups Scheme) (scan-data "#<primitive-procedure export-environment-set-signature!>"))
-(export-environment-signature (groups Scheme) (scan-data "#<primitive-procedure export-environment-signature>"))
-(export-environment? (groups Scheme) (scan-data "#<primitive-procedure export-environment?>"))
-(export-syntax (groups Scheme) (scan-data ""))
-(expt (groups Scheme) (scan-data "#<procedure expt (z1 z2)>"))
-(false-if-exception (groups Scheme) (scan-data ""))
-(fcntl (groups POSIX Scheme) (scan-data "#<primitive-procedure fcntl>"))
-(fdes->inport (groups POSIX Scheme) (scan-data "#<procedure fdes->inport (fdes)>"))
-(fdes->outport (groups POSIX Scheme) (scan-data "#<procedure fdes->outport (fdes)>"))
-(fdes->ports (groups POSIX Scheme) (scan-data "#<primitive-procedure fdes->ports>"))
-(fdopen (groups POSIX Scheme) (scan-data "#<primitive-procedure fdopen>"))
-(feature? (groups Scheme) (scan-data "#<procedure provided? (feature)>"))
-(file-exists? (groups Scheme) (scan-data "#<procedure file-exists? (str)>"))
-(file-is-directory? (groups Scheme) (scan-data "#<procedure file-is-directory? (str)>"))
-(file-port? (groups Scheme) (scan-data "#<primitive-procedure file-port?>"))
-(file-position (groups Scheme) (scan-data "#<procedure file-position args>"))
-(file-set-position (groups Scheme) (scan-data "#<procedure file-set-position args>"))
-(fileno (groups POSIX Scheme) (scan-data "#<primitive-procedure fileno>"))
-(flock (groups POSIX Scheme) (scan-data "#<primitive-procedure flock>"))
-(floor (groups Scheme) (scan-data "#<primitive-procedure floor>"))
-(fluid-ref (groups Scheme) (scan-data "#<primitive-procedure fluid-ref>"))
-(fluid-set! (groups Scheme) (scan-data "#<primitive-procedure fluid-set!>"))
-(fluid? (groups Scheme) (scan-data "#<primitive-procedure fluid?>"))
-(flush-all-ports (groups Scheme) (scan-data "#<primitive-procedure flush-all-ports>"))
-(for-each (groups Scheme) (scan-data "#<primitive-procedure for-each>"))
-(for-next-option (groups Scheme) (scan-data "#<procedure for-next-option (proc argv kw-opts kw-args)>"))
-(force (groups Scheme) (scan-data "#<primitive-procedure force>"))
-(force-output (groups Scheme) (scan-data "#<primitive-procedure force-output>"))
-(format (groups Scheme) (scan-data "#<primitive-procedure simple-format>"))
-(frame-arguments (groups Scheme) (scan-data "#<primitive-procedure frame-arguments>"))
-(frame-evaluating-args? (groups Scheme) (scan-data "#<primitive-procedure frame-evaluating-args?>"))
-(frame-next (groups Scheme) (scan-data "#<primitive-procedure frame-next>"))
-(frame-number (groups Scheme) (scan-data "#<primitive-procedure frame-number>"))
-(frame-overflow? (groups Scheme) (scan-data "#<primitive-procedure frame-overflow?>"))
-(frame-previous (groups Scheme) (scan-data "#<primitive-procedure frame-previous>"))
-(frame-procedure (groups Scheme) (scan-data "#<primitive-procedure frame-procedure>"))
-(frame-procedure? (groups Scheme) (scan-data "#<primitive-procedure frame-procedure?>"))
-(frame-real? (groups Scheme) (scan-data "#<primitive-procedure frame-real?>"))
-(frame-source (groups Scheme) (scan-data "#<primitive-procedure frame-source>"))
-(frame? (groups Scheme) (scan-data "#<primitive-procedure frame?>"))
-(fsync (groups POSIX Scheme) (scan-data "#<primitive-procedure fsync>"))
-(ftell (groups Scheme) (scan-data "#<primitive-procedure ftell>"))
-(gc (groups Scheme) (scan-data "#<primitive-procedure gc>"))
-(gc-run-time (groups Scheme) (scan-data "#<procedure gc-run-time ()>"))
-(gc-stats (groups Scheme) (scan-data "#<primitive-procedure gc-stats>"))
-(gcd (groups Scheme) (scan-data "#<primitive-procedure gcd>"))
-(gdb_binding (groups guile-C-API gdb C) (scan-data T))
-(gdb_eval (groups guile-C-API gdb C) (scan-data T))
-(gdb_language (groups guile-C-API gdb C) (scan-data D))
-(gdb_maybe_valid_type_p (groups guile-C-API gdb C) (scan-data T))
-(gdb_options (groups guile-C-API gdb C) (scan-data D))
-(gdb_output (groups guile-C-API gdb C) (scan-data B))
-(gdb_output_length (groups guile-C-API gdb C) (scan-data B))
-(gdb_print (groups guile-C-API gdb C) (scan-data T))
-(gdb_read (groups guile-C-API gdb C) (scan-data T))
-(gdb_result (groups guile-C-API gdb C) (scan-data B))
-(gensym (groups Scheme) (scan-data "#<primitive-procedure gensym>"))
-(get-internal-real-time (groups POSIX Scheme) (scan-data "#<primitive-procedure get-internal-real-time>"))
-(get-internal-run-time (groups POSIX Scheme) (scan-data "#<primitive-procedure get-internal-run-time>"))
-(get-option (groups Scheme) (scan-data "#<procedure get-option (argv kw-opts kw-args return)>"))
-(get-output-string (groups Scheme) (scan-data "#<primitive-procedure get-output-string>"))
-(get-print-state (groups Scheme) (scan-data "#<primitive-procedure get-print-state>"))
-(getcwd (groups POSIX Scheme) (scan-data "#<primitive-procedure getcwd>"))
-(getegid (groups POSIX Scheme) (scan-data "#<primitive-procedure getegid>"))
-(getenv (groups POSIX Scheme) (scan-data "#<primitive-procedure getenv>"))
-(geteuid (groups POSIX Scheme) (scan-data "#<primitive-procedure geteuid>"))
-(getgid (groups POSIX Scheme) (scan-data "#<primitive-procedure getgid>"))
-(getgr (groups POSIX Scheme) (scan-data "#<primitive-procedure getgr>"))
-(getgrent (groups POSIX Scheme) (scan-data "#<procedure getgrent ()>"))
-(getgrgid (groups POSIX Scheme) (scan-data "#<procedure getgrgid (id)>"))
-(getgrnam (groups POSIX Scheme) (scan-data "#<procedure getgrnam (name)>"))
-(getgroups (groups POSIX Scheme) (scan-data "#<primitive-procedure getgroups>"))
-(gethost (groups Scheme) (scan-data "#<primitive-procedure gethost>"))
-(gethostbyaddr (groups Scheme) (scan-data "#<procedure gethostbyaddr (addr)>"))
-(gethostbyname (groups Scheme) (scan-data "#<procedure gethostbyname (name)>"))
-(gethostent (groups Scheme) (scan-data "#<procedure gethostent ()>"))
-(gethostname (groups POSIX Scheme) (scan-data "#<primitive-procedure gethostname>"))
-(getitimer (groups POSIX Scheme) (scan-data "#<primitive-procedure getitimer>"))
-(getlogin (groups POSIX Scheme) (scan-data "#<primitive-procedure getlogin>"))
-(getnet (groups Scheme) (scan-data "#<primitive-procedure getnet>"))
-(getnetbyaddr (groups Scheme) (scan-data "#<procedure getnetbyaddr (addr)>"))
-(getnetbyname (groups Scheme) (scan-data "#<procedure getnetbyname (name)>"))
-(getnetent (groups Scheme) (scan-data "#<procedure getnetent ()>"))
-(getpass (groups POSIX Scheme) (scan-data "#<primitive-procedure getpass>"))
-(getpeername (groups Scheme) (scan-data "#<primitive-procedure getpeername>"))
-(getpgrp (groups POSIX Scheme) (scan-data "#<primitive-procedure getpgrp>"))
-(getpid (groups POSIX Scheme) (scan-data "#<primitive-procedure getpid>"))
-(getppid (groups POSIX Scheme) (scan-data "#<primitive-procedure getppid>"))
-(getpriority (groups POSIX Scheme) (scan-data "#<primitive-procedure getpriority>"))
-(getproto (groups Scheme) (scan-data "#<primitive-procedure getproto>"))
-(getprotobyname (groups Scheme) (scan-data "#<procedure getprotobyname (name)>"))
-(getprotobynumber (groups Scheme) (scan-data "#<procedure getprotobynumber (addr)>"))
-(getprotoent (groups Scheme) (scan-data "#<procedure getprotoent ()>"))
-(getpw (groups POSIX Scheme) (scan-data "#<primitive-procedure getpw>"))
-(getpwent (groups POSIX Scheme) (scan-data "#<procedure getpwent ()>"))
-(getpwnam (groups POSIX Scheme) (scan-data "#<procedure getpwnam (name)>"))
-(getpwuid (groups POSIX Scheme) (scan-data "#<procedure getpwuid (uid)>"))
-(getserv (groups Scheme) (scan-data "#<primitive-procedure getserv>"))
-(getservbyname (groups Scheme) (scan-data "#<procedure getservbyname (name proto)>"))
-(getservbyport (groups Scheme) (scan-data "#<procedure getservbyport (port proto)>"))
-(getservent (groups Scheme) (scan-data "#<procedure getservent ()>"))
-(getsockname (groups Scheme) (scan-data "#<primitive-procedure getsockname>"))
-(getsockopt (groups Scheme) (scan-data "#<primitive-procedure getsockopt>"))
-(gettimeofday (groups POSIX Scheme) (scan-data "#<primitive-procedure gettimeofday>"))
-(getuid (groups POSIX Scheme) (scan-data "#<primitive-procedure getuid>"))
-(gh_append (groups guile-C-API gh C) (scan-data T))
-(gh_append2 (groups guile-C-API gh C) (scan-data T))
-(gh_append3 (groups guile-C-API gh C) (scan-data T))
-(gh_append4 (groups guile-C-API gh C) (scan-data T))
-(gh_apply (groups guile-C-API gh C) (scan-data T))
-(gh_bool2scm (groups guile-C-API gh C) (scan-data T))
-(gh_boolean_p (groups guile-C-API gh C) (scan-data T))
-(gh_caaar (groups guile-C-API gh C) (scan-data T))
-(gh_caadr (groups guile-C-API gh C) (scan-data T))
-(gh_caar (groups guile-C-API gh C) (scan-data T))
-(gh_cadar (groups guile-C-API gh C) (scan-data T))
-(gh_caddr (groups guile-C-API gh C) (scan-data T))
-(gh_cadr (groups guile-C-API gh C) (scan-data T))
-(gh_call0 (groups guile-C-API gh C) (scan-data T))
-(gh_call1 (groups guile-C-API gh C) (scan-data T))
-(gh_call2 (groups guile-C-API gh C) (scan-data T))
-(gh_call3 (groups guile-C-API gh C) (scan-data T))
-(gh_car (groups guile-C-API gh C) (scan-data T))
-(gh_catch (groups guile-C-API gh C) (scan-data T))
-(gh_cdaar (groups guile-C-API gh C) (scan-data T))
-(gh_cdadr (groups guile-C-API gh C) (scan-data T))
-(gh_cdar (groups guile-C-API gh C) (scan-data T))
-(gh_cddar (groups guile-C-API gh C) (scan-data T))
-(gh_cdddr (groups guile-C-API gh C) (scan-data T))
-(gh_cddr (groups guile-C-API gh C) (scan-data T))
-(gh_cdr (groups guile-C-API gh C) (scan-data T))
-(gh_char2scm (groups guile-C-API gh C) (scan-data T))
-(gh_char_p (groups guile-C-API gh C) (scan-data T))
-(gh_chars2byvect (groups guile-C-API gh C) (scan-data T))
-(gh_cons (groups guile-C-API gh C) (scan-data T))
-(gh_define (groups guile-C-API gh C) (scan-data T))
-(gh_display (groups guile-C-API gh C) (scan-data T))
-(gh_double2scm (groups guile-C-API gh C) (scan-data T))
-(gh_doubles2dvect (groups guile-C-API gh C) (scan-data T))
-(gh_doubles2scm (groups guile-C-API gh C) (scan-data T))
-(gh_enter (groups guile-C-API gh C) (scan-data T))
-(gh_eq_p (groups guile-C-API gh C) (scan-data T))
-(gh_equal_p (groups guile-C-API gh C) (scan-data T))
-(gh_eqv_p (groups guile-C-API gh C) (scan-data T))
-(gh_eval_file (groups guile-C-API gh C) (scan-data T))
-(gh_eval_file_with_catch (groups guile-C-API gh C) (scan-data T))
-(gh_eval_file_with_standard_handler (groups guile-C-API gh C) (scan-data T))
-(gh_eval_str (groups guile-C-API gh C) (scan-data T))
-(gh_eval_str_with_catch (groups guile-C-API gh C) (scan-data T))
-(gh_eval_str_with_stack_saving_handler (groups guile-C-API gh C) (scan-data T))
-(gh_eval_str_with_standard_handler (groups guile-C-API gh C) (scan-data T))
-(gh_exact_p (groups guile-C-API gh C) (scan-data T))
-(gh_floats2fvect (groups guile-C-API gh C) (scan-data T))
-(gh_get_substr (groups guile-C-API gh C) (scan-data T))
-(gh_inexact_p (groups guile-C-API gh C) (scan-data T))
-(gh_int2scm (groups guile-C-API gh C) (scan-data T))
-(gh_ints2scm (groups guile-C-API gh C) (scan-data T))
-(gh_length (groups guile-C-API gh C) (scan-data T))
-(gh_list_p (groups guile-C-API gh C) (scan-data T))
-(gh_long2scm (groups guile-C-API gh C) (scan-data T))
-(gh_longs2ivect (groups guile-C-API gh C) (scan-data T))
-(gh_lookup (groups guile-C-API gh C) (scan-data T))
-(gh_make_vector (groups guile-C-API gh C) (scan-data T))
-(gh_module_lookup (groups guile-C-API gh C) (scan-data T))
-(gh_new_procedure (groups guile-C-API gh C) (scan-data T))
-(gh_new_procedure0_0 (groups guile-C-API gh C) (scan-data T))
-(gh_new_procedure0_1 (groups guile-C-API gh C) (scan-data T))
-(gh_new_procedure0_2 (groups guile-C-API gh C) (scan-data T))
-(gh_new_procedure1_0 (groups guile-C-API gh C) (scan-data T))
-(gh_new_procedure1_1 (groups guile-C-API gh C) (scan-data T))
-(gh_new_procedure1_2 (groups guile-C-API gh C) (scan-data T))
-(gh_new_procedure2_0 (groups guile-C-API gh C) (scan-data T))
-(gh_new_procedure2_1 (groups guile-C-API gh C) (scan-data T))
-(gh_new_procedure2_2 (groups guile-C-API gh C) (scan-data T))
-(gh_new_procedure3_0 (groups guile-C-API gh C) (scan-data T))
-(gh_new_procedure4_0 (groups guile-C-API gh C) (scan-data T))
-(gh_new_procedure5_0 (groups guile-C-API gh C) (scan-data T))
-(gh_newline (groups guile-C-API gh C) (scan-data T))
-(gh_null_p (groups guile-C-API gh C) (scan-data T))
-(gh_number_p (groups guile-C-API gh C) (scan-data T))
-(gh_pair_p (groups guile-C-API gh C) (scan-data T))
-(gh_procedure_p (groups guile-C-API gh C) (scan-data T))
-(gh_repl (groups guile-C-API gh C) (scan-data T))
-(gh_scm2bool (groups guile-C-API gh C) (scan-data T))
-(gh_scm2char (groups guile-C-API gh C) (scan-data T))
-(gh_scm2chars (groups guile-C-API gh C) (scan-data T))
-(gh_scm2double (groups guile-C-API gh C) (scan-data T))
-(gh_scm2doubles (groups guile-C-API gh C) (scan-data T))
-(gh_scm2floats (groups guile-C-API gh C) (scan-data T))
-(gh_scm2int (groups guile-C-API gh C) (scan-data T))
-(gh_scm2long (groups guile-C-API gh C) (scan-data T))
-(gh_scm2longs (groups guile-C-API gh C) (scan-data T))
-(gh_scm2newstr (groups guile-C-API gh C) (scan-data T))
-(gh_scm2shorts (groups guile-C-API gh C) (scan-data T))
-(gh_scm2ulong (groups guile-C-API gh C) (scan-data T))
-(gh_set_car_x (groups guile-C-API gh C) (scan-data T))
-(gh_set_cdr_x (groups guile-C-API gh C) (scan-data T))
-(gh_set_substr (groups guile-C-API gh C) (scan-data T))
-(gh_shorts2svect (groups guile-C-API gh C) (scan-data T))
-(gh_standard_handler (groups guile-C-API gh C) (scan-data T))
-(gh_str02scm (groups guile-C-API gh C) (scan-data T))
-(gh_str2scm (groups guile-C-API gh C) (scan-data T))
-(gh_string_equal_p (groups guile-C-API gh C) (scan-data T))
-(gh_string_p (groups guile-C-API gh C) (scan-data T))
-(gh_symbol2newstr (groups guile-C-API gh C) (scan-data T))
-(gh_symbol2scm (groups guile-C-API gh C) (scan-data T))
-(gh_symbol_p (groups guile-C-API gh C) (scan-data T))
-(gh_ulong2scm (groups guile-C-API gh C) (scan-data T))
-(gh_ulongs2uvect (groups guile-C-API gh C) (scan-data T))
-(gh_uniform_vector_length (groups guile-C-API gh C) (scan-data T))
-(gh_uniform_vector_ref (groups guile-C-API gh C) (scan-data T))
-(gh_vector_length (groups guile-C-API gh C) (scan-data T))
-(gh_vector_p (groups guile-C-API gh C) (scan-data T))
-(gh_vector_ref (groups guile-C-API gh C) (scan-data T))
-(gh_vector_set_x (groups guile-C-API gh C) (scan-data T))
-(gh_write (groups guile-C-API gh C) (scan-data T))
-(gmtime (groups POSIX Scheme) (scan-data "#<primitive-procedure gmtime>"))
-(group:gid (groups POSIX Scheme) (scan-data "#<procedure group:gid (obj)>"))
-(group:mem (groups POSIX Scheme) (scan-data "#<procedure group:mem (obj)>"))
-(group:name (groups POSIX Scheme) (scan-data "#<procedure group:name (obj)>"))
-(group:passwd (groups POSIX Scheme) (scan-data "#<procedure group:passwd (obj)>"))
-(guardian-destroyed? (groups Scheme) (scan-data "#<primitive-procedure guardian-destroyed?>"))
-(guardian-greedy? (groups Scheme) (scan-data "#<primitive-procedure guardian-greedy?>"))
-(handle-system-error (groups Scheme) (scan-data "#<procedure handle-system-error (key . args)>"))
-(has-shown-backtrace-hint? (groups Scheme) (scan-data ""))
-(has-shown-debugger-hint? (groups Scheme) (scan-data ""))
-(has-suffix? (groups Scheme) (scan-data "#<procedure has-suffix? (str suffix)>"))
-(hash (groups Scheme) (scan-data "#<primitive-procedure hash>"))
-(hash-create-handle! (groups Scheme) (scan-data "#<primitive-procedure hash-create-handle!>"))
-(hash-fold (groups Scheme) (scan-data "#<primitive-procedure hash-fold>"))
-(hash-get-handle (groups Scheme) (scan-data "#<primitive-procedure hash-get-handle>"))
-(hash-ref (groups Scheme) (scan-data "#<primitive-procedure hash-ref>"))
-(hash-remove! (groups Scheme) (scan-data "#<primitive-procedure hash-remove!>"))
-(hash-set! (groups Scheme) (scan-data "#<primitive-procedure hash-set!>"))
-(hashq (groups Scheme) (scan-data "#<primitive-procedure hashq>"))
-(hashq-create-handle! (groups Scheme) (scan-data "#<primitive-procedure hashq-create-handle!>"))
-(hashq-get-handle (groups Scheme) (scan-data "#<primitive-procedure hashq-get-handle>"))
-(hashq-ref (groups Scheme) (scan-data "#<primitive-procedure hashq-ref>"))
-(hashq-remove! (groups Scheme) (scan-data "#<primitive-procedure hashq-remove!>"))
-(hashq-set! (groups Scheme) (scan-data "#<primitive-procedure hashq-set!>"))
-(hashv (groups Scheme) (scan-data "#<primitive-procedure hashv>"))
-(hashv-create-handle! (groups Scheme) (scan-data "#<primitive-procedure hashv-create-handle!>"))
-(hashv-get-handle (groups Scheme) (scan-data "#<primitive-procedure hashv-get-handle>"))
-(hashv-ref (groups Scheme) (scan-data "#<primitive-procedure hashv-ref>"))
-(hashv-remove! (groups Scheme) (scan-data "#<primitive-procedure hashv-remove!>"))
-(hashv-set! (groups Scheme) (scan-data "#<primitive-procedure hashv-set!>"))
-(hashx-create-handle! (groups Scheme) (scan-data "#<primitive-procedure hashx-create-handle!>"))
-(hashx-get-handle (groups Scheme) (scan-data "#<primitive-procedure hashx-get-handle>"))
-(hashx-ref (groups Scheme) (scan-data "#<primitive-procedure hashx-ref>"))
-(hashx-set! (groups Scheme) (scan-data "#<primitive-procedure hashx-set!>"))
-(hook->list (groups Scheme) (scan-data "#<primitive-procedure hook->list>"))
-(hook-empty? (groups Scheme) (scan-data "#<primitive-procedure hook-empty?>"))
-(hook? (groups Scheme) (scan-data "#<primitive-procedure hook?>"))
-(hostent:addr-list (groups Scheme) (scan-data "#<procedure hostent:addr-list (obj)>"))
-(hostent:addrtype (groups Scheme) (scan-data "#<procedure hostent:addrtype (obj)>"))
-(hostent:aliases (groups Scheme) (scan-data "#<procedure hostent:aliases (obj)>"))
-(hostent:length (groups Scheme) (scan-data "#<procedure hostent:length (obj)>"))
-(hostent:name (groups Scheme) (scan-data "#<procedure hostent:name (obj)>"))
-(htonl (groups Scheme) (scan-data "#<primitive-procedure htonl>"))
-(htons (groups Scheme) (scan-data "#<primitive-procedure htons>"))
-(identity (groups Scheme) (scan-data "#<procedure identity (x)>"))
-(if (groups Scheme) (scan-data ""))
-(imag-part (groups Scheme) (scan-data "#<primitive-procedure imag-part>"))
-(import-environment-imports (groups Scheme) (scan-data "#<primitive-procedure import-environment-imports>"))
-(import-environment-set-imports! (groups Scheme) (scan-data "#<primitive-procedure import-environment-set-imports!>"))
-(import-environment? (groups Scheme) (scan-data "#<primitive-procedure import-environment?>"))
-(in-vicinity (groups Scheme) (scan-data "#<procedure in-vicinity (vicinity file)>"))
-(include-deprecated-features (groups Scheme) (scan-data "#<primitive-procedure include-deprecated-features>"))
-(inet-aton (groups Scheme) (scan-data "#<primitive-procedure inet-aton>"))
-(inet-lnaof (groups Scheme) (scan-data "#<primitive-procedure inet-lnaof>"))
-(inet-makeaddr (groups Scheme) (scan-data "#<primitive-procedure inet-makeaddr>"))
-(inet-netof (groups Scheme) (scan-data "#<primitive-procedure inet-netof>"))
-(inet-ntoa (groups Scheme) (scan-data "#<primitive-procedure inet-ntoa>"))
-(inet-ntop (groups Scheme) (scan-data "#<primitive-procedure inet-ntop>"))
-(inet-pton (groups Scheme) (scan-data "#<primitive-procedure inet-pton>"))
-(inexact->exact (groups Scheme) (scan-data "#<primitive-procedure inexact->exact>"))
-(inexact? (groups Scheme) (scan-data "#<primitive-procedure inexact?>"))
-(inf (groups Scheme) (scan-data "#<primitive-procedure inf>"))
-(inf? (groups Scheme) (scan-data "#<primitive-procedure inf?>"))
-(inherit-print-state (groups Scheme) (scan-data "#<procedure inherit-print-state (old-port new-port)>"))
-(input-port? (groups Scheme) (scan-data "#<primitive-procedure input-port?>"))
-(integer->char (groups Scheme) (scan-data "#<primitive-procedure integer->char>"))
-(integer-expt (groups Scheme) (scan-data "#<primitive-procedure integer-expt>"))
-(integer-length (groups Scheme) (scan-data "#<primitive-procedure integer-length>"))
-(integer? (groups Scheme) (scan-data "#<primitive-procedure integer?>"))
-(interaction-environment (groups Scheme) (scan-data "#<primitive-procedure interaction-environment>"))
-(internal-time-units-per-second (groups Scheme) (scan-data ""))
-(iota (groups Scheme) (scan-data "#<procedure iota (n)>"))
-(ipow-by-squaring (groups Scheme) (scan-data "#<procedure ipow-by-squaring (x k acc proc)>"))
-(isatty? (groups POSIX Scheme) (scan-data "#<primitive-procedure isatty?>"))
-(issue-deprecation-warning (groups Scheme) (scan-data "#<primitive-procedure issue-deprecation-warning>"))
-(join-thread (groups Scheme) (scan-data "#<primitive-procedure join-thread>"))
-(keyword->symbol (groups Scheme) (scan-data "#<procedure keyword->symbol (kw)>"))
-(keyword-dash-symbol (groups Scheme) (scan-data "#<primitive-procedure keyword-dash-symbol>"))
-(keyword-like-symbol->keyword (groups Scheme) (scan-data "#<procedure keyword-like-symbol->keyword (sym)>"))
-(keyword? (groups Scheme) (scan-data "#<primitive-procedure keyword?>"))
-(kill (groups POSIX Scheme) (scan-data "#<primitive-procedure kill>"))
-(kw-arg-ref (groups Scheme) (scan-data "#<procedure kw-arg-ref (args kw)>"))
-(lambda (groups Scheme) (scan-data ""))
-(last-pair (groups Scheme) (scan-data "#<primitive-procedure last-pair>"))
-(last-stack-frame (groups Scheme) (scan-data "#<primitive-procedure last-stack-frame>"))
-(lazy-catch (groups Scheme) (scan-data "#<primitive-procedure lazy-catch>"))
-(lazy-handler-dispatch (groups Scheme) (scan-data "#<procedure lazy-handler-dispatch (key . args)>"))
-(lcm (groups Scheme) (scan-data "#<primitive-procedure lcm>"))
-(leaf-environment? (groups Scheme) (scan-data "#<primitive-procedure leaf-environment?>"))
-(length (groups Scheme) (scan-data "#<primitive-procedure length>"))
-(let (groups Scheme) (scan-data ""))
-(let* (groups Scheme) (scan-data ""))
-(letrec (groups Scheme) (scan-data ""))
-(link (groups POSIX Scheme) (scan-data "#<primitive-procedure link>"))
-(list (groups Scheme) (scan-data "#<primitive-procedure list>"))
-(list->array (groups Scheme) (scan-data "#<procedure list->array (ndim lst)>"))
-(list->string (groups Scheme) (scan-data "#<primitive-procedure list->string>"))
-(list->symbol (groups Scheme) (scan-data "#<procedure list->symbol args>"))
-(list->uniform-array (groups Scheme) (scan-data "#<primitive-procedure list->uniform-array>"))
-(list->uniform-vector (groups Scheme) (scan-data "#<procedure list->uniform-vector (prot lst)>"))
-(list->vector (groups Scheme) (scan-data "#<primitive-procedure list->vector>"))
-(list->weak-vector (groups Scheme) (scan-data "#<primitive-procedure list->weak-vector>"))
-(list-cdr-ref (groups Scheme) (scan-data "#<primitive-procedure list-cdr-ref>"))
-(list-cdr-set! (groups Scheme) (scan-data "#<primitive-procedure list-cdr-set!>"))
-(list-copy (groups Scheme) (scan-data "#<primitive-procedure list-copy>"))
-(list-head (groups Scheme) (scan-data "#<primitive-procedure list-head>"))
-(list-index (groups Scheme) (scan-data "#<procedure list-index (l k)>"))
-(list-ref (groups Scheme) (scan-data "#<primitive-procedure list-ref>"))
-(list-set! (groups Scheme) (scan-data "#<primitive-procedure list-set!>"))
-(list-tail (groups Scheme) (scan-data "#<primitive-procedure list-tail>"))
-(list? (groups Scheme) (scan-data "#<primitive-procedure list?>"))
-(listen (groups Scheme) (scan-data "#<primitive-procedure listen>"))
-(load (groups Scheme) (scan-data "#<procedure load-module (filename)>"))
-(load-compiled (groups Scheme) (scan-data ""))
-(load-emacs-interface (groups Scheme) (scan-data "#<procedure load-emacs-interface ()>"))
-(load-extension (groups Scheme) (scan-data "#<primitive-procedure load-extension>"))
-(load-from-path (groups Scheme) (scan-data "#<procedure load-from-path (name)>"))
-(load-module (groups Scheme) (scan-data "#<procedure load-module (filename)>"))
-(load-user-init (groups Scheme) (scan-data "#<procedure load-user-init ()>"))
-(local-define (groups Scheme) (scan-data "#<procedure local-define (names val)>"))
-(local-eval (groups Scheme) (scan-data "#<primitive-procedure local-eval>"))
-(local-ref (groups Scheme) (scan-data "#<procedure local-ref (names)>"))
-(local-remove (groups Scheme) (scan-data "#<procedure local-remove (names)>"))
-(local-set! (groups Scheme) (scan-data "#<procedure local-set! (names val)>"))
-(localtime (groups POSIX Scheme) (scan-data "#<primitive-procedure localtime>"))
-(lock-mutex (groups Scheme) (scan-data "#<primitive-procedure lock-mutex>"))
-(log (groups Scheme) (scan-data "#<procedure log (z)>"))
-(log10 (groups Scheme) (scan-data "#<procedure log10 (arg)>"))
-(logand (groups Scheme) (scan-data "#<primitive-procedure logand>"))
-(logbit? (groups Scheme) (scan-data "#<primitive-procedure logbit?>"))
-(logcount (groups Scheme) (scan-data "#<primitive-procedure logcount>"))
-(logior (groups Scheme) (scan-data "#<primitive-procedure logior>"))
-(lognot (groups Scheme) (scan-data "#<primitive-procedure lognot>"))
-(logtest (groups Scheme) (scan-data "#<primitive-procedure logtest>"))
-(logxor (groups Scheme) (scan-data "#<primitive-procedure logxor>"))
-(lstat (groups POSIX Scheme) (scan-data "#<primitive-procedure lstat>"))
-(macro-name (groups Scheme) (scan-data "#<primitive-procedure macro-name>"))
-(macro-table (groups Scheme) (scan-data ""))
-(macro-transformer (groups Scheme) (scan-data "#<primitive-procedure macro-transformer>"))
-(macro-type (groups Scheme) (scan-data "#<primitive-procedure macro-type>"))
-(macro? (groups Scheme) (scan-data "#<primitive-procedure macro?>"))
-(macroexpand (groups Scheme) (scan-data "#<procedure macroexpand (e)>"))
-(macroexpand-1 (groups Scheme) (scan-data "#<procedure macroexpand-1 (e)>"))
-(magnitude (groups Scheme) (scan-data "#<primitive-procedure magnitude>"))
-(major-version (groups Scheme) (scan-data "#<primitive-procedure major-version>"))
-(make-arbiter (groups Scheme) (scan-data "#<primitive-procedure make-arbiter>"))
-(make-array (groups Scheme) (scan-data "#<procedure make-array (fill . args)>"))
-(make-autoload-interface (groups Scheme) (scan-data "#<procedure make-autoload-interface (module name bindings)>"))
-(make-class-object (groups Scheme) (scan-data "#<primitive-procedure make-class-object>"))
-(make-condition-variable (groups Scheme) (scan-data "#<primitive-procedure make-condition-variable>"))
-(make-doubly-weak-hash-table (groups Scheme) (scan-data "#<primitive-procedure make-doubly-weak-hash-table>"))
-(make-eval-environment (groups Scheme) (scan-data "#<primitive-procedure make-eval-environment>"))
-(make-export-environment (groups Scheme) (scan-data "#<primitive-procedure make-export-environment>"))
-(make-fluid (groups Scheme) (scan-data "#<primitive-procedure make-fluid>"))
-(make-guardian (groups Scheme) (scan-data "#<primitive-procedure make-guardian>"))
-(make-hash-table (groups Scheme) (scan-data "#<procedure make-hash-table (k)>"))
-(make-hook (groups Scheme) (scan-data "#<primitive-procedure make-hook>"))
-(make-import-environment (groups Scheme) (scan-data "#<primitive-procedure make-import-environment>"))
-(make-keyword-from-dash-symbol (groups Scheme) (scan-data "#<primitive-procedure make-keyword-from-dash-symbol>"))
-(make-leaf-environment (groups Scheme) (scan-data "#<primitive-procedure make-leaf-environment>"))
-(make-list (groups Scheme) (scan-data "#<procedure make-list (n . init)>"))
-(make-module (groups Scheme) (scan-data "#<procedure make-module args>"))
-(make-modules-in (groups Scheme) (scan-data "#<procedure make-modules-in (module name)>"))
-(make-mutex (groups Scheme) (scan-data "#<primitive-procedure make-mutex>"))
-(make-object-property (groups Scheme) (scan-data "#<procedure make-object-property ()>"))
-(make-polar (groups Scheme) (scan-data "#<primitive-procedure make-polar>"))
-(make-procedure-with-setter (groups Scheme) (scan-data "#<primitive-procedure make-procedure-with-setter>"))
-(make-record-type (groups Scheme) (scan-data "#<procedure make-record-type (type-name fields . opt)>"))
-(make-rectangular (groups Scheme) (scan-data "#<primitive-procedure make-rectangular>"))
-(make-regexp (groups Scheme) (scan-data "#<primitive-procedure make-regexp>"))
-(make-root-module (groups Scheme) (scan-data "#<procedure make-root-module ()>"))
-(make-scm-module (groups Scheme) (scan-data "#<procedure make-scm-module ()>"))
-(make-shared-array (groups Scheme) (scan-data "#<primitive-procedure make-shared-array>"))
-(make-soft-port (groups Scheme) (scan-data "#<primitive-procedure make-soft-port>"))
-(make-stack (groups Scheme) (scan-data "#<primitive-procedure make-stack>"))
-(make-string (groups Scheme) (scan-data "#<primitive-procedure make-string>"))
-(make-struct (groups Scheme) (scan-data "#<primitive-procedure make-struct>"))
-(make-struct-layout (groups Scheme) (scan-data "#<primitive-procedure make-struct-layout>"))
-(make-subclass-object (groups Scheme) (scan-data "#<primitive-procedure make-subclass-object>"))
-(make-symbol (groups Scheme) (scan-data "#<primitive-procedure make-symbol>"))
-(make-undefined-variable (groups Scheme) (scan-data "#<primitive-procedure make-undefined-variable>"))
-(make-uniform-array (groups Scheme) (scan-data "#<procedure make-uniform-array (prot . args)>"))
-(make-uniform-vector (groups Scheme) (scan-data "#<primitive-procedure dimensions->uniform-array>"))
-(make-variable (groups Scheme) (scan-data "#<primitive-procedure make-variable>"))
-(make-vector (groups Scheme) (scan-data "#<primitive-procedure make-vector>"))
-(make-vtable-vtable (groups Scheme) (scan-data "#<primitive-procedure make-vtable-vtable>"))
-(make-weak-key-hash-table (groups Scheme) (scan-data "#<primitive-procedure make-weak-key-hash-table>"))
-(make-weak-value-hash-table (groups Scheme) (scan-data "#<primitive-procedure make-weak-value-hash-table>"))
-(make-weak-vector (groups Scheme) (scan-data "#<primitive-procedure make-weak-vector>"))
-(map (groups Scheme) (scan-data "#<primitive-procedure map>"))
-(map-in-order (groups Scheme) (scan-data "#<primitive-procedure map-in-order>"))
-(mask-signals (groups Scheme) (scan-data "#<primitive-procedure mask-signals>"))
-(max (groups Scheme) (scan-data "#<primitive-procedure max>"))
-(member (groups Scheme) (scan-data "#<primitive-procedure member>"))
-(memoized-environment (groups Scheme) (scan-data "#<primitive-procedure memoized-environment>"))
-(memoized? (groups Scheme) (scan-data "#<primitive-procedure memoized?>"))
-(memq (groups Scheme) (scan-data "#<primitive-procedure memq>"))
-(memv (groups Scheme) (scan-data "#<primitive-procedure memv>"))
-(merge (groups Scheme) (scan-data "#<primitive-procedure merge>"))
-(merge! (groups Scheme) (scan-data "#<primitive-procedure merge!>"))
-(micro-version (groups Scheme) (scan-data "#<primitive-procedure micro-version>"))
-(min (groups Scheme) (scan-data "#<primitive-procedure min>"))
-(minor-version (groups Scheme) (scan-data "#<primitive-procedure minor-version>"))
-(mkdir (groups POSIX Scheme) (scan-data "#<primitive-procedure mkdir>"))
-(mknod (groups POSIX Scheme) (scan-data "#<primitive-procedure mknod>"))
-(mkstemp! (groups POSIX Scheme) (scan-data "#<primitive-procedure mkstemp!>"))
-(mktime (groups POSIX Scheme) (scan-data "#<primitive-procedure mktime>"))
-(module-add! (groups Scheme) (scan-data "#<procedure module-add! (m v var)>"))
-(module-binder (groups Scheme) (scan-data "#<procedure module-binder (obj)>"))
-(module-bound? (groups Scheme) (scan-data "#<procedure module-bound? (m v)>"))
-(module-clear! (groups Scheme) (scan-data "#<procedure module-clear! (m)>"))
-(module-constructor (groups Scheme) (scan-data "#<procedure module-constructor (obarray uses binder eval-closure transformer name kind observers weak-observers observer-id)>"))
-(module-define! (groups Scheme) (scan-data "#<procedure module-define! (module name value)>"))
-(module-defined? (groups Scheme) (scan-data "#<procedure module-defined? (module name)>"))
-(module-ensure-local-variable! (groups Scheme) (scan-data "#<procedure module-ensure-local-variable! (module symbol)>"))
-(module-eval-closure (groups Scheme) (scan-data "#<procedure module-eval-closure (obj)>"))
-(module-export! (groups Scheme) (scan-data "#<procedure module-export! (m names)>"))
-(module-for-each (groups Scheme) (scan-data "#<procedure module-for-each (proc module)>"))
-(module-kind (groups Scheme) (scan-data "#<procedure module-kind (obj)>"))
-(module-local-variable (groups Scheme) (scan-data "#<procedure module-local-variable (m v)>"))
-(module-locally-bound? (groups Scheme) (scan-data "#<procedure module-locally-bound? (m v)>"))
-(module-make-local-var! (groups Scheme) (scan-data "#<procedure module-make-local-var! (m v)>"))
-(module-map (groups Scheme) (scan-data "#<procedure module-map (proc module)>"))
-(module-modified (groups Scheme) (scan-data "#<procedure module-modified (m)>"))
-(module-name (groups Scheme) (scan-data "#<procedure module-name (obj)>"))
-(module-obarray (groups Scheme) (scan-data "#<procedure module-obarray (obj)>"))
-(module-obarray-get-handle (groups Scheme) (scan-data "#<procedure module-obarray-get-handle (ob key)>"))
-(module-obarray-ref (groups Scheme) (scan-data "#<procedure module-obarray-ref (ob key)>"))
-(module-obarray-remove! (groups Scheme) (scan-data "#<procedure module-obarray-remove! (ob key)>"))
-(module-obarray-set! (groups Scheme) (scan-data "#<procedure module-obarray-set! (ob key val)>"))
-(module-observe (groups Scheme) (scan-data "#<procedure module-observe (module proc)>"))
-(module-observe-weak (groups Scheme) (scan-data "#<procedure module-observe-weak (module proc)>"))
-(module-observer-id (groups Scheme) (scan-data "#<procedure module-observer-id (obj)>"))
-(module-observers (groups Scheme) (scan-data "#<procedure module-observers (obj)>"))
-(module-public-interface (groups Scheme) (scan-data "#<procedure module-public-interface (m)>"))
-(module-re-export! (groups Scheme) (scan-data "#<procedure module-re-export! (m names)>"))
-(module-ref (groups Scheme) (scan-data "#<procedure module-ref (module name . rest)>"))
-(module-remove! (groups Scheme) (scan-data "#<procedure module-remove! (m v)>"))
-(module-search (groups Scheme) (scan-data "#<procedure module-search (fn m v)>"))
-(module-set! (groups Scheme) (scan-data "#<procedure module-set! (module name value)>"))
-(module-symbol-binding (groups Scheme) (scan-data "#<procedure module-symbol-binding (m v . opt-val)>"))
-(module-symbol-interned? (groups Scheme) (scan-data "#<procedure module-symbol-interned? (m v)>"))
-(module-symbol-local-binding (groups Scheme) (scan-data "#<procedure module-symbol-local-binding (m v . opt-val)>"))
-(module-symbol-locally-interned? (groups Scheme) (scan-data "#<procedure module-symbol-locally-interned? (m v)>"))
-(module-transformer (groups Scheme) (scan-data "#<procedure module-transformer (obj)>"))
-(module-type (groups Scheme) (scan-data ""))
-(module-unobserve (groups Scheme) (scan-data "#<procedure module-unobserve (token)>"))
-(module-use! (groups Scheme) (scan-data "#<procedure module-use! (module interface)>"))
-(module-uses (groups Scheme) (scan-data "#<procedure module-uses (obj)>"))
-(module-variable (groups Scheme) (scan-data "#<procedure module-variable (m v)>"))
-(module-weak-observers (groups Scheme) (scan-data "#<procedure module-weak-observers (obj)>"))
-(module? (groups Scheme) (scan-data "#<procedure module? (obj)>"))
-(modulo (groups Scheme) (scan-data "#<primitive-procedure modulo>"))
-(most-negative-fixnum (groups Scheme) (scan-data ""))
-(most-positive-fixnum (groups Scheme) (scan-data ""))
-(move->fdes (groups POSIX Scheme) (scan-data "#<procedure move->fdes (fd/port fd)>"))
-(named-module-use! (groups Scheme) (scan-data "#<procedure named-module-use! (user usee)>"))
-(nan (groups Scheme) (scan-data "#<primitive-procedure nan>"))
-(nan? (groups Scheme) (scan-data "#<primitive-procedure nan?>"))
-(negative? (groups Scheme) (scan-data "#<primitive-procedure negative?>"))
-(nested-define! (groups Scheme) (scan-data "#<procedure nested-define! (root names val)>"))
-(nested-ref (groups Scheme) (scan-data "#<procedure nested-ref (root names)>"))
-(nested-remove! (groups Scheme) (scan-data "#<procedure nested-remove! (root names)>"))
-(nested-set! (groups Scheme) (scan-data "#<procedure nested-set! (root names val)>"))
-(netent:addrtype (groups Scheme) (scan-data "#<procedure netent:addrtype (obj)>"))
-(netent:aliases (groups Scheme) (scan-data "#<procedure netent:aliases (obj)>"))
-(netent:name (groups Scheme) (scan-data "#<procedure netent:name (obj)>"))
-(netent:net (groups Scheme) (scan-data "#<procedure netent:net (obj)>"))
-(newline (groups Scheme) (scan-data "#<primitive-procedure newline>"))
-(nice (groups POSIX Scheme) (scan-data "#<primitive-procedure nice>"))
-(nil-cond (groups Scheme) (scan-data ""))
-(noop (groups Scheme) (scan-data "#<primitive-procedure noop>"))
-(not (groups Scheme) (scan-data "#<primitive-procedure not>"))
-(ntohl (groups Scheme) (scan-data "#<primitive-procedure ntohl>"))
-(ntohs (groups Scheme) (scan-data "#<primitive-procedure ntohs>"))
-(null? (groups Scheme) (scan-data "#<primitive-procedure null?>"))
-(number->string (groups Scheme) (scan-data "#<primitive-procedure number->string>"))
-(number? (groups Scheme) (scan-data "#<primitive-procedure number?>"))
-(object->string (groups Scheme) (scan-data "#<primitive-procedure object->string>"))
-(object-address (groups Scheme) (scan-data "#<primitive-procedure object-address>"))
-(object-properties (groups Scheme) (scan-data "#<primitive-procedure object-properties>"))
-(object-property (groups Scheme) (scan-data "#<primitive-procedure object-property>"))
-(odd? (groups Scheme) (scan-data "#<primitive-procedure odd?>"))
-(open (groups POSIX Scheme) (scan-data "#<primitive-procedure open>"))
-(open-fdes (groups POSIX Scheme) (scan-data "#<primitive-procedure open-fdes>"))
-(open-file (groups Scheme) (scan-data "#<primitive-procedure open-file>"))
-(open-input-file (groups Scheme) (scan-data "#<procedure open-input-file (str)>"))
-(open-input-string (groups Scheme) (scan-data "#<primitive-procedure open-input-string>"))
-(open-io-file (groups Scheme) (scan-data "#<procedure open-io-file (str)>"))
-(open-output-file (groups Scheme) (scan-data "#<procedure open-output-file (str)>"))
-(open-output-string (groups Scheme) (scan-data "#<primitive-procedure open-output-string>"))
-(opendir (groups POSIX Scheme) (scan-data "#<primitive-procedure opendir>"))
-(operator? (groups Scheme) (scan-data "#<primitive-procedure operator?>"))
-(or (groups Scheme) (scan-data ""))
-(or-map (groups Scheme) (scan-data "#<procedure or-map (f lst)>"))
-(output-port? (groups Scheme) (scan-data "#<primitive-procedure output-port?>"))
-(pair? (groups Scheme) (scan-data "#<primitive-procedure pair?>"))
-(parse-path (groups Scheme) (scan-data "#<primitive-procedure parse-path>"))
-(passwd:dir (groups POSIX Scheme) (scan-data "#<procedure passwd:dir (obj)>"))
-(passwd:gecos (groups POSIX Scheme) (scan-data "#<procedure passwd:gecos (obj)>"))
-(passwd:gid (groups POSIX Scheme) (scan-data "#<procedure passwd:gid (obj)>"))
-(passwd:name (groups POSIX Scheme) (scan-data "#<procedure passwd:name (obj)>"))
-(passwd:passwd (groups POSIX Scheme) (scan-data "#<procedure passwd:passwd (obj)>"))
-(passwd:shell (groups POSIX Scheme) (scan-data "#<procedure passwd:shell (obj)>"))
-(passwd:uid (groups POSIX Scheme) (scan-data "#<procedure passwd:uid (obj)>"))
-(pause (groups POSIX Scheme) (scan-data "#<primitive-procedure pause>"))
-(peek (groups Scheme) (scan-data "#<procedure peek stuff>"))
-(peek-char (groups Scheme) (scan-data "#<primitive-procedure peek-char>"))
-(pipe (groups POSIX Scheme) (scan-data "#<primitive-procedure pipe>"))
-(pk (groups Scheme) (scan-data "#<procedure peek stuff>"))
-(port->fdes (groups POSIX Scheme) (scan-data "#<procedure port->fdes (port)>"))
-(port-closed? (groups Scheme) (scan-data "#<primitive-procedure port-closed?>"))
-(port-column (groups Scheme) (scan-data "#<primitive-procedure port-column>"))
-(port-filename (groups Scheme) (scan-data "#<primitive-procedure port-filename>"))
-(port-for-each (groups POSIX Scheme) (scan-data "#<primitive-procedure port-for-each>"))
-(port-line (groups Scheme) (scan-data "#<primitive-procedure port-line>"))
-(port-mode (groups POSIX Scheme) (scan-data "#<primitive-procedure port-mode>"))
-(port-revealed (groups POSIX Scheme) (scan-data "#<primitive-procedure port-revealed>"))
-(port-with-print-state (groups Scheme) (scan-data "#<primitive-procedure port-with-print-state>"))
-(port? (groups Scheme) (scan-data "#<primitive-procedure port?>"))
-(positive? (groups Scheme) (scan-data "#<primitive-procedure positive?>"))
-(primitive-eval (groups Scheme) (scan-data "#<primitive-procedure primitive-eval>"))
-(primitive-exit (groups POSIX Scheme) (scan-data "#<primitive-procedure primitive-exit>"))
-(primitive-fork (groups POSIX Scheme) (scan-data "#<primitive-procedure primitive-fork>"))
-(primitive-load (groups Scheme) (scan-data "#<primitive-procedure primitive-load>"))
-(primitive-load-path (groups Scheme) (scan-data "#<primitive-procedure primitive-load-path>"))
-(primitive-macro? (groups Scheme) (scan-data "#<procedure primitive-macro? (m)>"))
-(primitive-make-property (groups Scheme) (scan-data "#<primitive-procedure primitive-make-property>"))
-(primitive-move->fdes (groups POSIX Scheme) (scan-data "#<primitive-procedure primitive-move->fdes>"))
-(primitive-property-del! (groups Scheme) (scan-data "#<primitive-procedure primitive-property-del!>"))
-(primitive-property-ref (groups Scheme) (scan-data "#<primitive-procedure primitive-property-ref>"))
-(primitive-property-set! (groups Scheme) (scan-data "#<primitive-procedure primitive-property-set!>"))
-(print-disable (groups Scheme) (scan-data "#<procedure print-disable flags>"))
-(print-enable (groups Scheme) (scan-data "#<procedure print-enable flags>"))
-(print-options (groups Scheme) (scan-data "#<procedure print-options args>"))
-(print-options-interface (groups Scheme) (scan-data "#<primitive-procedure print-options-interface>"))
-(print-set! (groups Scheme) (scan-data ""))
-(procedure (groups Scheme) (scan-data "#<primitive-procedure procedure>"))
-(procedure->macro (groups Scheme) (scan-data "#<primitive-procedure procedure->macro>"))
-(procedure->memoizing-macro (groups Scheme) (scan-data "#<primitive-procedure procedure->memoizing-macro>"))
-(procedure->syntax (groups Scheme) (scan-data "#<primitive-procedure procedure->syntax>"))
-(procedure-documentation (groups Scheme) (scan-data "#<primitive-procedure procedure-documentation>"))
-(procedure-environment (groups Scheme) (scan-data "#<primitive-procedure procedure-environment>"))
-(procedure-name (groups Scheme) (scan-data "#<primitive-procedure procedure-name>"))
-(procedure-properties (groups Scheme) (scan-data "#<primitive-procedure procedure-properties>"))
-(procedure-property (groups Scheme) (scan-data "#<primitive-procedure procedure-property>"))
-(procedure-source (groups Scheme) (scan-data "#<primitive-procedure procedure-source>"))
-(procedure-with-setter? (groups Scheme) (scan-data "#<primitive-procedure procedure-with-setter?>"))
-(procedure? (groups Scheme) (scan-data "#<primitive-procedure procedure?>"))
-(process-define-module (groups Scheme) (scan-data "#<procedure process-define-module (args)>"))
-(process-use-modules (groups Scheme) (scan-data "#<procedure process-use-modules (module-interface-args)>"))
-(program-arguments (groups POSIX Scheme) (scan-data "#<primitive-procedure program-arguments>"))
-(promise? (groups Scheme) (scan-data "#<primitive-procedure promise?>"))
-(protoent:aliases (groups Scheme) (scan-data "#<procedure protoent:aliases (obj)>"))
-(protoent:name (groups Scheme) (scan-data "#<procedure protoent:name (obj)>"))
-(protoent:proto (groups Scheme) (scan-data "#<procedure protoent:proto (obj)>"))
-(provide (groups Scheme) (scan-data "#<procedure provide (sym)>"))
-(provided? (groups Scheme) (scan-data "#<procedure provided? (feature)>"))
-(purify-module! (groups Scheme) (scan-data "#<procedure purify-module! (module)>"))
-(putenv (groups POSIX Scheme) (scan-data "#<primitive-procedure putenv>"))
-(quasiquote (groups Scheme) (scan-data ""))
-(quit (groups Scheme) (scan-data "#<procedure quit args>"))
-(quote (groups Scheme) (scan-data ""))
-(quotient (groups Scheme) (scan-data "#<primitive-procedure quotient>"))
-(raise (groups POSIX Scheme) (scan-data "#<primitive-procedure raise>"))
-(random (groups Scheme) (scan-data "#<primitive-procedure random>"))
-(random:exp (groups Scheme) (scan-data "#<primitive-procedure random:exp>"))
-(random:hollow-sphere! (groups Scheme) (scan-data "#<primitive-procedure random:hollow-sphere!>"))
-(random:normal (groups Scheme) (scan-data "#<primitive-procedure random:normal>"))
-(random:normal-vector! (groups Scheme) (scan-data "#<primitive-procedure random:normal-vector!>"))
-(random:solid-sphere! (groups Scheme) (scan-data "#<primitive-procedure random:solid-sphere!>"))
-(random:uniform (groups Scheme) (scan-data "#<primitive-procedure random:uniform>"))
-(rational? (groups Scheme) (scan-data "#<primitive-procedure rational?>"))
-(re-export (groups Scheme) (scan-data ""))
-(re-export-syntax (groups Scheme) (scan-data ""))
-(read (groups Scheme) (scan-data "#<primitive-procedure read>"))
-(read-char (groups Scheme) (scan-data "#<primitive-procedure read-char>"))
-(read-disable (groups Scheme) (scan-data "#<procedure read-disable flags>"))
-(read-enable (groups Scheme) (scan-data "#<procedure read-enable flags>"))
-(read-eval? (groups Scheme) (scan-data ""))
-(read-hash-extend (groups Scheme) (scan-data "#<primitive-procedure read-hash-extend>"))
-(read-hash-procedures (groups Scheme) (scan-data ""))
-(read-options (groups Scheme) (scan-data "#<procedure read-options args>"))
-(read-options-interface (groups Scheme) (scan-data "#<primitive-procedure read-options-interface>"))
-(read-set! (groups Scheme) (scan-data ""))
-(read:array (groups Scheme) (scan-data "#<procedure read:array (digit port)>"))
-(read:uniform-vector (groups Scheme) (scan-data "#<procedure read:uniform-vector (proto port)>"))
-(readdir (groups POSIX Scheme) (scan-data "#<primitive-procedure readdir>"))
-(readlink (groups POSIX Scheme) (scan-data "#<primitive-procedure readlink>"))
-(real-part (groups Scheme) (scan-data "#<primitive-procedure real-part>"))
-(real? (groups Scheme) (scan-data "#<primitive-procedure real?>"))
-(record-accessor (groups Scheme) (scan-data "#<procedure record-accessor (rtd field-name)>"))
-(record-constructor (groups Scheme) (scan-data "#<procedure record-constructor (rtd . opt)>"))
-(record-modifier (groups Scheme) (scan-data "#<procedure record-modifier (rtd field-name)>"))
-(record-predicate (groups Scheme) (scan-data "#<procedure record-predicate (rtd)>"))
-(record-type-descriptor (groups Scheme) (scan-data "#<procedure record-type-descriptor (obj)>"))
-(record-type-fields (groups Scheme) (scan-data "#<procedure record-type-fields (obj)>"))
-(record-type-name (groups Scheme) (scan-data "#<procedure record-type-name (obj)>"))
-(record-type-vtable (groups Scheme) (scan-data ""))
-(record-type? (groups Scheme) (scan-data "#<procedure record-type? (obj)>"))
-(record? (groups Scheme) (scan-data "#<procedure record? (obj)>"))
-(recv! (groups Scheme) (scan-data "#<primitive-procedure recv!>"))
-(recvfrom! (groups Scheme) (scan-data "#<primitive-procedure recvfrom!>"))
-(redirect-port (groups POSIX Scheme) (scan-data "#<primitive-procedure redirect-port>"))
-(regexp-exec (groups Scheme) (scan-data "#<primitive-procedure regexp-exec>"))
-(regexp/basic (groups Scheme) (scan-data ""))
-(regexp/extended (groups Scheme) (scan-data ""))
-(regexp/icase (groups Scheme) (scan-data ""))
-(regexp/newline (groups Scheme) (scan-data ""))
-(regexp/notbol (groups Scheme) (scan-data ""))
-(regexp/noteol (groups Scheme) (scan-data ""))
-(regexp? (groups Scheme) (scan-data "#<primitive-procedure regexp?>"))
-(release-arbiter (groups Scheme) (scan-data "#<primitive-procedure release-arbiter>"))
-(release-port-handle (groups POSIX Scheme) (scan-data "#<procedure release-port-handle (port)>"))
-(remainder (groups Scheme) (scan-data "#<primitive-procedure remainder>"))
-(remove-hook! (groups Scheme) (scan-data "#<primitive-procedure remove-hook!>"))
-(rename-file (groups POSIX Scheme) (scan-data "#<primitive-procedure rename-file>"))
-(repl (groups Scheme) (scan-data "#<procedure repl (read evaler print)>"))
-(repl-reader (groups Scheme) (scan-data "#<procedure repl-reader (prompt)>"))
-(reset-hook! (groups Scheme) (scan-data "#<primitive-procedure reset-hook!>"))
-(resolve-interface (groups Scheme) (scan-data "#<procedure resolve-interface (name . args)>"))
-(resolve-module (groups Scheme) (scan-data "#<procedure resolve-module (name . maybe-autoload)>"))
-(restore-signals (groups POSIX Scheme) (scan-data "#<primitive-procedure restore-signals>"))
-(restricted-vector-sort! (groups Scheme) (scan-data "#<primitive-procedure restricted-vector-sort!>"))
-(reverse (groups Scheme) (scan-data "#<primitive-procedure reverse>"))
-(reverse! (groups Scheme) (scan-data "#<primitive-procedure reverse!>"))
-(rewinddir (groups POSIX Scheme) (scan-data "#<primitive-procedure rewinddir>"))
-(rmdir (groups POSIX Scheme) (scan-data "#<primitive-procedure rmdir>"))
-(round (groups Scheme) (scan-data "#<primitive-procedure round>"))
-(run-asyncs (groups Scheme) (scan-data "#<primitive-procedure run-asyncs>"))
-(run-hook (groups Scheme) (scan-data "#<primitive-procedure run-hook>"))
-(save-module-excursion (groups Scheme) (scan-data "#<procedure save-module-excursion (thunk)>"))
-(save-stack (groups Scheme) (scan-data "#<procedure save-stack narrowing>"))
-(scheme-file-suffix (groups Scheme) (scan-data "#<procedure scheme-file-suffix ()>"))
-(scm-error (groups Scheme) (scan-data "#<primitive-procedure scm-error>"))
-(scm-repl-print-unspecified (groups Scheme) (scan-data ""))
-(scm-repl-prompt (groups Scheme) (scan-data ""))
-(scm-repl-silent (groups Scheme) (scan-data ""))
-(scm-repl-verbose (groups Scheme) (scan-data ""))
-(scm-style-repl (groups Scheme) (scan-data "#<procedure scm-style-repl ()>"))
-(scm_I_am_dead (groups scm C) (scan-data B))
-(scm_abs (groups scm C) (scan-data T))
-(scm_accept (groups scm C) (scan-data T))
-(scm_access (groups scm C) (scan-data T))
-(scm_accessor_method_slot_definition (groups scm C) (scan-data T))
-(scm_acons (groups scm C) (scan-data T))
-(scm_acosh (groups scm C) (scan-data T))
-(scm_add_feature (groups scm C) (scan-data T))
-(scm_add_hook_x (groups scm C) (scan-data T))
-(scm_add_method (groups scm C) (scan-data T))
-(scm_add_slot (groups scm C) (scan-data T))
-(scm_add_to_port_table (groups scm C) (scan-data T))
-(scm_addbig (groups scm C) (scan-data T))
-(scm_after_gc_c_hook (groups scm C) (scan-data B))
-(scm_after_gc_hook (groups scm C) (scan-data B))
-(scm_after_sweep_c_hook (groups scm C) (scan-data B))
-(scm_aind (groups scm C) (scan-data T))
-(scm_alarm (groups scm C) (scan-data T))
-(scm_alloc_struct (groups scm C) (scan-data T))
-(scm_allocate_string (groups scm C) (scan-data T))
-(scm_angle (groups scm C) (scan-data T))
-(scm_append (groups scm C) (scan-data T))
-(scm_append_x (groups scm C) (scan-data T))
-(scm_apply (groups scm C) (scan-data T))
-(scm_apply_0 (groups scm C) (scan-data T))
-(scm_apply_1 (groups scm C) (scan-data T))
-(scm_apply_2 (groups scm C) (scan-data T))
-(scm_apply_3 (groups scm C) (scan-data T))
-(scm_apply_generic (groups scm C) (scan-data T))
-(scm_apply_with_dynamic_root (groups scm C) (scan-data T))
-(scm_arg_type_key (groups scm C) (scan-data B))
-(scm_args_number_key (groups scm C) (scan-data B))
-(scm_array_contents (groups scm C) (scan-data T))
-(scm_array_copy_x (groups scm C) (scan-data T))
-(scm_array_dimensions (groups scm C) (scan-data T))
-(scm_array_equal_p (groups scm C) (scan-data T))
-(scm_array_fill_int (groups scm C) (scan-data T))
-(scm_array_fill_x (groups scm C) (scan-data T))
-(scm_array_for_each (groups scm C) (scan-data T))
-(scm_array_identity (groups scm C) (scan-data T))
-(scm_array_in_bounds_p (groups scm C) (scan-data T))
-(scm_array_index_map_x (groups scm C) (scan-data T))
-(scm_array_map_x (groups scm C) (scan-data T))
-(scm_array_p (groups scm C) (scan-data T))
-(scm_array_prototype (groups scm C) (scan-data T))
-(scm_array_rank (groups scm C) (scan-data T))
-(scm_array_set_x (groups scm C) (scan-data T))
-(scm_array_to_list (groups scm C) (scan-data T))
-(scm_ash (groups scm C) (scan-data T))
-(scm_asinh (groups scm C) (scan-data T))
-(scm_assoc (groups scm C) (scan-data T))
-(scm_assoc_ref (groups scm C) (scan-data T))
-(scm_assoc_remove_x (groups scm C) (scan-data T))
-(scm_assoc_set_x (groups scm C) (scan-data T))
-(scm_assq (groups scm C) (scan-data T))
-(scm_assq_ref (groups scm C) (scan-data T))
-(scm_assq_remove_x (groups scm C) (scan-data T))
-(scm_assq_set_x (groups scm C) (scan-data T))
-(scm_assv (groups scm C) (scan-data T))
-(scm_assv_ref (groups scm C) (scan-data T))
-(scm_assv_remove_x (groups scm C) (scan-data T))
-(scm_assv_set_x (groups scm C) (scan-data T))
-(scm_async (groups scm C) (scan-data T))
-(scm_async_click (groups scm C) (scan-data T))
-(scm_async_mark (groups scm C) (scan-data T))
-(scm_asyncs_pending_p (groups scm C) (scan-data D))
-(scm_atanh (groups scm C) (scan-data T))
-(scm_backtrace (groups scm C) (scan-data T))
-(scm_badargsp (groups scm C) (scan-data T))
-(scm_basename (groups scm C) (scan-data T))
-(scm_basic_basic_make_class (groups scm C) (scan-data T))
-(scm_basic_make_class (groups scm C) (scan-data T))
-(scm_before_gc_c_hook (groups scm C) (scan-data B))
-(scm_before_mark_c_hook (groups scm C) (scan-data B))
-(scm_before_sweep_c_hook (groups scm C) (scan-data B))
-(scm_big_and (groups scm C) (scan-data T))
-(scm_big_ior (groups scm C) (scan-data T))
-(scm_big_test (groups scm C) (scan-data T))
-(scm_big_xor (groups scm C) (scan-data T))
-(scm_bigcomp (groups scm C) (scan-data T))
-(scm_bigequal (groups scm C) (scan-data T))
-(scm_bigprint (groups scm C) (scan-data T))
-(scm_bind (groups scm C) (scan-data T))
-(scm_bit_count (groups scm C) (scan-data T))
-(scm_bit_count_star (groups scm C) (scan-data T))
-(scm_bit_extract (groups scm C) (scan-data T))
-(scm_bit_invert_x (groups scm C) (scan-data T))
-(scm_bit_position (groups scm C) (scan-data T))
-(scm_bit_set_star_x (groups scm C) (scan-data T))
-(scm_block_gc (groups scm C) (scan-data D))
-(scm_body_thunk (groups scm C) (scan-data T))
-(scm_boolean_p (groups scm C) (scan-data T))
-(scm_boot_guile (groups scm C) (scan-data T))
-(scm_boot_guile_1_live (groups scm C) (scan-data D))
-(scm_c_call_with_current_module (groups scm C) (scan-data T))
-(scm_c_chars2byvect (groups scm C) (scan-data T))
-(scm_c_chars2scm (groups scm C) (scan-data T))
-(scm_c_default_rstate (groups scm C) (scan-data T))
-(scm_c_define (groups scm C) (scan-data T))
-(scm_c_define_gsubr (groups scm C) (scan-data T))
-(scm_c_define_gsubr_with_generic (groups scm C) (scan-data T))
-(scm_c_define_module (groups scm C) (scan-data T))
-(scm_c_define_subr (groups scm C) (scan-data T))
-(scm_c_define_subr_with_generic (groups scm C) (scan-data T))
-(scm_c_doubles2dvect (groups scm C) (scan-data T))
-(scm_c_doubles2scm (groups scm C) (scan-data T))
-(scm_c_environment_cell (groups scm C) (scan-data T))
-(scm_c_environment_fold (groups scm C) (scan-data T))
-(scm_c_environment_observe (groups scm C) (scan-data T))
-(scm_c_environment_ref (groups scm C) (scan-data T))
-(scm_c_eval_string (groups scm C) (scan-data T))
-(scm_c_exp1 (groups scm C) (scan-data T))
-(scm_c_export (groups scm C) (scan-data T))
-(scm_c_floats2fvect (groups scm C) (scan-data T))
-(scm_c_floats2scm (groups scm C) (scan-data T))
-(scm_c_get_internal_run_time (groups scm C) (scan-data T))
-(scm_c_hook_add (groups scm C) (scan-data T))
-(scm_c_hook_init (groups scm C) (scan-data T))
-(scm_c_hook_remove (groups scm C) (scan-data T))
-(scm_c_hook_run (groups scm C) (scan-data T))
-(scm_c_ints2ivect (groups scm C) (scan-data T))
-(scm_c_ints2scm (groups scm C) (scan-data T))
-(scm_c_issue_deprecation_warning (groups scm C) (scan-data T))
-(scm_c_issue_deprecation_warning_fmt (groups scm C) (scan-data T))
-(scm_c_load_extension (groups scm C) (scan-data T))
-(scm_c_longs2ivect (groups scm C) (scan-data T))
-(scm_c_longs2scm (groups scm C) (scan-data T))
-(scm_c_lookup (groups scm C) (scan-data T))
-(scm_c_make_gsubr (groups scm C) (scan-data T))
-(scm_c_make_gsubr_with_generic (groups scm C) (scan-data T))
-(scm_c_make_hash_table (groups scm C) (scan-data T))
-(scm_c_make_keyword (groups scm C) (scan-data T))
-(scm_c_make_rstate (groups scm C) (scan-data T))
-(scm_c_make_subr (groups scm C) (scan-data T))
-(scm_c_make_subr_with_generic (groups scm C) (scan-data T))
-(scm_c_make_vector (groups scm C) (scan-data T))
-(scm_c_memq (groups scm C) (scan-data T))
-(scm_c_module_define (groups scm C) (scan-data T))
-(scm_c_module_lookup (groups scm C) (scan-data T))
-(scm_c_normal01 (groups scm C) (scan-data T))
-(scm_c_primitive_load (groups scm C) (scan-data T))
-(scm_c_primitive_load_path (groups scm C) (scan-data T))
-(scm_c_random (groups scm C) (scan-data T))
-(scm_c_random_bignum (groups scm C) (scan-data T))
-(scm_c_read (groups scm C) (scan-data T))
-(scm_c_read_string (groups scm C) (scan-data T))
-(scm_c_register_extension (groups scm C) (scan-data T))
-(scm_c_resolve_module (groups scm C) (scan-data T))
-(scm_c_run_hook (groups scm C) (scan-data T))
-(scm_c_scm2chars (groups scm C) (scan-data T))
-(scm_c_scm2doubles (groups scm C) (scan-data T))
-(scm_c_scm2floats (groups scm C) (scan-data T))
-(scm_c_scm2ints (groups scm C) (scan-data T))
-(scm_c_scm2longs (groups scm C) (scan-data T))
-(scm_c_scm2shorts (groups scm C) (scan-data T))
-(scm_c_shorts2scm (groups scm C) (scan-data T))
-(scm_c_shorts2svect (groups scm C) (scan-data T))
-(scm_c_source_property_breakpoint_p (groups scm C) (scan-data T))
-(scm_c_string2str (groups scm C) (scan-data T))
-(scm_c_substring2str (groups scm C) (scan-data T))
-(scm_c_symbol2str (groups scm C) (scan-data T))
-(scm_c_uints2uvect (groups scm C) (scan-data T))
-(scm_c_ulongs2uvect (groups scm C) (scan-data T))
-(scm_c_uniform01 (groups scm C) (scan-data T))
-(scm_c_use_module (groups scm C) (scan-data T))
-(scm_c_with_fluid (groups scm C) (scan-data T))
-(scm_c_with_fluids (groups scm C) (scan-data T))
-(scm_c_write (groups scm C) (scan-data T))
-(scm_call_0 (groups scm C) (scan-data T))
-(scm_call_1 (groups scm C) (scan-data T))
-(scm_call_2 (groups scm C) (scan-data T))
-(scm_call_3 (groups scm C) (scan-data T))
-(scm_call_4 (groups scm C) (scan-data T))
-(scm_call_generic_0 (groups scm C) (scan-data T))
-(scm_call_generic_1 (groups scm C) (scan-data T))
-(scm_call_generic_2 (groups scm C) (scan-data T))
-(scm_call_generic_3 (groups scm C) (scan-data T))
-(scm_call_with_dynamic_root (groups scm C) (scan-data T))
-(scm_call_with_input_string (groups scm C) (scan-data T))
-(scm_call_with_new_thread (groups scm C) (scan-data T))
-(scm_call_with_output_string (groups scm C) (scan-data T))
-(scm_casei_streq (groups scm C) (scan-data T))
-(scm_catch (groups scm C) (scan-data T))
-(scm_cellp (groups scm C) (scan-data T))
-(scm_cells_allocated (groups scm C) (scan-data D))
-(scm_ceval (groups scm C) (scan-data T))
-(scm_ceval_ptr (groups scm C) (scan-data B))
-(scm_change_object_class (groups scm C) (scan-data T))
-(scm_char_alphabetic_p (groups scm C) (scan-data T))
-(scm_char_ci_eq_p (groups scm C) (scan-data T))
-(scm_char_ci_geq_p (groups scm C) (scan-data T))
-(scm_char_ci_gr_p (groups scm C) (scan-data T))
-(scm_char_ci_leq_p (groups scm C) (scan-data T))
-(scm_char_ci_less_p (groups scm C) (scan-data T))
-(scm_char_downcase (groups scm C) (scan-data T))
-(scm_char_eq_p (groups scm C) (scan-data T))
-(scm_char_geq_p (groups scm C) (scan-data T))
-(scm_char_gr_p (groups scm C) (scan-data T))
-(scm_char_is_both_p (groups scm C) (scan-data T))
-(scm_char_leq_p (groups scm C) (scan-data T))
-(scm_char_less_p (groups scm C) (scan-data T))
-(scm_char_lower_case_p (groups scm C) (scan-data T))
-(scm_char_numeric_p (groups scm C) (scan-data T))
-(scm_char_p (groups scm C) (scan-data T))
-(scm_char_ready_p (groups scm C) (scan-data T))
-(scm_char_to_integer (groups scm C) (scan-data T))
-(scm_char_upcase (groups scm C) (scan-data T))
-(scm_char_upper_case_p (groups scm C) (scan-data T))
-(scm_char_whitespace_p (groups scm C) (scan-data T))
-(scm_charnames (groups scm C) (scan-data D))
-(scm_charnums (groups scm C) (scan-data R))
-(scm_chdir (groups scm C) (scan-data T))
-(scm_check_apply_p (groups scm C) (scan-data B))
-(scm_check_entry_p (groups scm C) (scan-data B))
-(scm_check_exit_p (groups scm C) (scan-data B))
-(scm_chmod (groups scm C) (scan-data T))
-(scm_chown (groups scm C) (scan-data T))
-(scm_chroot (groups scm C) (scan-data T))
-(scm_class_accessor (groups scm C) (scan-data B))
-(scm_class_boolean (groups scm C) (scan-data B))
-(scm_class_char (groups scm C) (scan-data B))
-(scm_class_class (groups scm C) (scan-data B))
-(scm_class_complex (groups scm C) (scan-data B))
-(scm_class_direct_methods (groups scm C) (scan-data T))
-(scm_class_direct_slots (groups scm C) (scan-data T))
-(scm_class_direct_subclasses (groups scm C) (scan-data T))
-(scm_class_direct_supers (groups scm C) (scan-data T))
-(scm_class_double (groups scm C) (scan-data B))
-(scm_class_entity (groups scm C) (scan-data B))
-(scm_class_entity_class (groups scm C) (scan-data B))
-(scm_class_entity_with_setter (groups scm C) (scan-data B))
-(scm_class_environment (groups scm C) (scan-data T))
-(scm_class_float (groups scm C) (scan-data B))
-(scm_class_foreign_class (groups scm C) (scan-data B))
-(scm_class_foreign_object (groups scm C) (scan-data B))
-(scm_class_foreign_slot (groups scm C) (scan-data B))
-(scm_class_generic (groups scm C) (scan-data B))
-(scm_class_generic_with_setter (groups scm C) (scan-data B))
-(scm_class_input_output_port (groups scm C) (scan-data B))
-(scm_class_input_port (groups scm C) (scan-data B))
-(scm_class_int (groups scm C) (scan-data B))
-(scm_class_integer (groups scm C) (scan-data B))
-(scm_class_keyword (groups scm C) (scan-data B))
-(scm_class_list (groups scm C) (scan-data B))
-(scm_class_method (groups scm C) (scan-data B))
-(scm_class_name (groups scm C) (scan-data T))
-(scm_class_null (groups scm C) (scan-data B))
-(scm_class_number (groups scm C) (scan-data B))
-(scm_class_object (groups scm C) (scan-data B))
-(scm_class_of (groups scm C) (scan-data T))
-(scm_class_opaque (groups scm C) (scan-data B))
-(scm_class_operator_class (groups scm C) (scan-data B))
-(scm_class_operator_with_setter_class (groups scm C) (scan-data B))
-(scm_class_output_port (groups scm C) (scan-data B))
-(scm_class_pair (groups scm C) (scan-data B))
-(scm_class_port (groups scm C) (scan-data B))
-(scm_class_precedence_list (groups scm C) (scan-data T))
-(scm_class_primitive_generic (groups scm C) (scan-data B))
-(scm_class_procedure (groups scm C) (scan-data B))
-(scm_class_procedure_class (groups scm C) (scan-data B))
-(scm_class_procedure_with_setter (groups scm C) (scan-data B))
-(scm_class_protected (groups scm C) (scan-data B))
-(scm_class_protected_opaque (groups scm C) (scan-data B))
-(scm_class_protected_read_only (groups scm C) (scan-data B))
-(scm_class_read_only (groups scm C) (scan-data B))
-(scm_class_real (groups scm C) (scan-data B))
-(scm_class_scm (groups scm C) (scan-data B))
-(scm_class_self (groups scm C) (scan-data B))
-(scm_class_simple_method (groups scm C) (scan-data B))
-(scm_class_slots (groups scm C) (scan-data T))
-(scm_class_string (groups scm C) (scan-data B))
-(scm_class_symbol (groups scm C) (scan-data B))
-(scm_class_top (groups scm C) (scan-data B))
-(scm_class_unknown (groups scm C) (scan-data B))
-(scm_class_vector (groups scm C) (scan-data B))
-(scm_close (groups scm C) (scan-data T))
-(scm_close_fdes (groups scm C) (scan-data T))
-(scm_close_input_port (groups scm C) (scan-data T))
-(scm_close_output_port (groups scm C) (scan-data T))
-(scm_close_port (groups scm C) (scan-data T))
-(scm_closedir (groups scm C) (scan-data T))
-(scm_closure (groups scm C) (scan-data T))
-(scm_closure_p (groups scm C) (scan-data T))
-(scm_compile_shell_switches (groups scm C) (scan-data T))
-(scm_complex_equalp (groups scm C) (scan-data T))
-(scm_components (groups scm C) (scan-data B))
-(scm_compute_applicable_methods (groups scm C) (scan-data T))
-(scm_connect (groups scm C) (scan-data T))
-(scm_cons (groups scm C) (scan-data T))
-(scm_cons2 (groups scm C) (scan-data T))
-(scm_cons_source (groups scm C) (scan-data T))
-(scm_cons_star (groups scm C) (scan-data T))
-(scm_copy_big_dec (groups scm C) (scan-data T))
-(scm_copy_file (groups scm C) (scan-data T))
-(scm_copy_fluids (groups scm C) (scan-data T))
-(scm_copy_random_state (groups scm C) (scan-data T))
-(scm_copy_smaller (groups scm C) (scan-data T))
-(scm_copy_tree (groups scm C) (scan-data T))
-(scm_count_argv (groups scm C) (scan-data T))
-(scm_critical_section_mutex (groups scm C) (scan-data B))
-(scm_crypt (groups scm C) (scan-data T))
-(scm_ctermid (groups scm C) (scan-data T))
-(scm_current_error_port (groups scm C) (scan-data T))
-(scm_current_input_port (groups scm C) (scan-data T))
-(scm_current_load_port (groups scm C) (scan-data T))
-(scm_current_module (groups scm C) (scan-data T))
-(scm_current_module_lookup_closure (groups scm C) (scan-data T))
-(scm_current_module_transformer (groups scm C) (scan-data T))
-(scm_current_output_port (groups scm C) (scan-data T))
-(scm_current_time (groups scm C) (scan-data T))
-(scm_cuserid (groups scm C) (scan-data T))
-(scm_cvref (groups scm C) (scan-data T))
-(scm_dapply (groups scm C) (scan-data T))
-(scm_dblprec (groups scm C) (scan-data B))
-(scm_debug_eframe_size (groups scm C) (scan-data B))
-(scm_debug_mode (groups scm C) (scan-data B))
-(scm_debug_object_p (groups scm C) (scan-data T))
-(scm_debug_options (groups scm C) (scan-data T))
-(scm_debug_opts (groups scm C) (scan-data D))
-(scm_default_init_heap_size_1 (groups scm C) (scan-data D))
-(scm_default_init_heap_size_2 (groups scm C) (scan-data D))
-(scm_default_max_segment_size (groups scm C) (scan-data D))
-(scm_default_min_yield_1 (groups scm C) (scan-data D))
-(scm_default_min_yield_2 (groups scm C) (scan-data D))
-(scm_define (groups scm C) (scan-data T))
-(scm_definedp (groups scm C) (scan-data T))
-(scm_delete (groups scm C) (scan-data T))
-(scm_delete1_x (groups scm C) (scan-data T))
-(scm_delete_file (groups scm C) (scan-data T))
-(scm_delete_x (groups scm C) (scan-data T))
-(scm_delq (groups scm C) (scan-data T))
-(scm_delq1_x (groups scm C) (scan-data T))
-(scm_delq_x (groups scm C) (scan-data T))
-(scm_delv (groups scm C) (scan-data T))
-(scm_delv1_x (groups scm C) (scan-data T))
-(scm_delv_x (groups scm C) (scan-data T))
-(scm_deprecated_newcell (groups scm C) (scan-data T))
-(scm_deprecated_newcell2 (groups scm C) (scan-data T))
-(scm_destroy_guardian_x (groups scm C) (scan-data T))
-(scm_deval (groups scm C) (scan-data T))
-(scm_difference (groups scm C) (scan-data T))
-(scm_dimensions_to_uniform_array (groups scm C) (scan-data T))
-(scm_directory_stream_p (groups scm C) (scan-data T))
-(scm_dirname (groups scm C) (scan-data T))
-(scm_display (groups scm C) (scan-data T))
-(scm_display_application (groups scm C) (scan-data T))
-(scm_display_backtrace (groups scm C) (scan-data T))
-(scm_display_error (groups scm C) (scan-data T))
-(scm_display_error_message (groups scm C) (scan-data T))
-(scm_divbigdig (groups scm C) (scan-data T))
-(scm_divide (groups scm C) (scan-data T))
-(scm_done_free (groups scm C) (scan-data T))
-(scm_done_malloc (groups scm C) (scan-data T))
-(scm_dot_string (groups scm C) (scan-data B))
-(scm_double2num (groups scm C) (scan-data T))
-(scm_doubly_weak_hash_table_p (groups scm C) (scan-data T))
-(scm_dowinds (groups scm C) (scan-data T))
-(scm_downcase (groups scm C) (scan-data T))
-(scm_drain_input (groups scm C) (scan-data T))
-(scm_dup2 (groups scm C) (scan-data T))
-(scm_dup_to_fdes (groups scm C) (scan-data T))
-(scm_dynamic_args_call (groups scm C) (scan-data T))
-(scm_dynamic_call (groups scm C) (scan-data T))
-(scm_dynamic_func (groups scm C) (scan-data T))
-(scm_dynamic_link (groups scm C) (scan-data T))
-(scm_dynamic_object_p (groups scm C) (scan-data T))
-(scm_dynamic_root (groups scm C) (scan-data T))
-(scm_dynamic_unlink (groups scm C) (scan-data T))
-(scm_dynamic_wind (groups scm C) (scan-data T))
-(scm_enable_primitive_generic_x (groups scm C) (scan-data T))
-(scm_enclose_array (groups scm C) (scan-data T))
-(scm_end_input (groups scm C) (scan-data T))
-(scm_ensure_accessor (groups scm C) (scan-data T))
-(scm_entity_p (groups scm C) (scan-data T))
-(scm_env_module (groups scm C) (scan-data T))
-(scm_env_top_level (groups scm C) (scan-data T))
-(scm_environ (groups scm C) (scan-data T))
-(scm_environment_bound_p (groups scm C) (scan-data T))
-(scm_environment_cell (groups scm C) (scan-data T))
-(scm_environment_define (groups scm C) (scan-data T))
-(scm_environment_fold (groups scm C) (scan-data T))
-(scm_environment_observe (groups scm C) (scan-data T))
-(scm_environment_observe_weak (groups scm C) (scan-data T))
-(scm_environment_p (groups scm C) (scan-data T))
-(scm_environment_ref (groups scm C) (scan-data T))
-(scm_environment_set_x (groups scm C) (scan-data T))
-(scm_environment_undefine (groups scm C) (scan-data T))
-(scm_environment_unobserve (groups scm C) (scan-data T))
-(scm_environments_prehistory (groups scm C) (scan-data T))
-(scm_eof_object_p (groups scm C) (scan-data T))
-(scm_eq_p (groups scm C) (scan-data T))
-(scm_equal_p (groups scm C) (scan-data T))
-(scm_eqv_p (groups scm C) (scan-data T))
-(scm_error (groups scm C) (scan-data T))
-(scm_error_environment_immutable_binding (groups scm C) (scan-data T))
-(scm_error_environment_immutable_location (groups scm C) (scan-data T))
-(scm_error_environment_unbound (groups scm C) (scan-data T))
-(scm_error_num_args_subr (groups scm C) (scan-data T))
-(scm_error_revive_threads (groups scm C) (scan-data T))
-(scm_error_scm (groups scm C) (scan-data T))
-(scm_eval (groups scm C) (scan-data T))
-(scm_eval_args (groups scm C) (scan-data T))
-(scm_eval_body (groups scm C) (scan-data T))
-(scm_eval_car (groups scm C) (scan-data T))
-(scm_eval_closure_lookup (groups scm C) (scan-data T))
-(scm_eval_environment_imported (groups scm C) (scan-data T))
-(scm_eval_environment_local (groups scm C) (scan-data T))
-(scm_eval_environment_p (groups scm C) (scan-data T))
-(scm_eval_environment_set_imported_x (groups scm C) (scan-data T))
-(scm_eval_environment_set_local_x (groups scm C) (scan-data T))
-(scm_eval_options_interface (groups scm C) (scan-data T))
-(scm_eval_opts (groups scm C) (scan-data D))
-(scm_eval_stack (groups scm C) (scan-data B))
-(scm_eval_string (groups scm C) (scan-data T))
-(scm_eval_x (groups scm C) (scan-data T))
-(scm_evaluator_trap_table (groups scm C) (scan-data D))
-(scm_evaluator_traps (groups scm C) (scan-data T))
-(scm_even_p (groups scm C) (scan-data T))
-(scm_evict_ports (groups scm C) (scan-data T))
-(scm_exact_p (groups scm C) (scan-data T))
-(scm_exact_to_inexact (groups scm C) (scan-data T))
-(scm_execl (groups scm C) (scan-data T))
-(scm_execle (groups scm C) (scan-data T))
-(scm_execlp (groups scm C) (scan-data T))
-(scm_exit_status (groups scm C) (scan-data T))
-(scm_expmem (groups scm C) (scan-data D))
-(scm_export_environment_p (groups scm C) (scan-data T))
-(scm_export_environment_private (groups scm C) (scan-data T))
-(scm_export_environment_set_private_x (groups scm C) (scan-data T))
-(scm_export_environment_set_signature_x (groups scm C) (scan-data T))
-(scm_export_environment_signature (groups scm C) (scan-data T))
-(scm_f_apply (groups scm C) (scan-data B))
-(scm_f_gsubr_apply (groups scm C) (scan-data B))
-(scm_fcntl (groups scm C) (scan-data T))
-(scm_fdes_to_port (groups scm C) (scan-data T))
-(scm_fdes_to_ports (groups scm C) (scan-data T))
-(scm_fdopen (groups scm C) (scan-data T))
-(scm_file_port_p (groups scm C) (scan-data T))
-(scm_fileno (groups scm C) (scan-data T))
-(scm_fill_input (groups scm C) (scan-data T))
-(scm_find_executable (groups scm C) (scan-data T))
-(scm_find_method (groups scm C) (scan-data T))
-(scm_finish_srcprop (groups scm C) (scan-data T))
-(scm_float2num (groups scm C) (scan-data T))
-(scm_flock (groups scm C) (scan-data T))
-(scm_fluid_p (groups scm C) (scan-data T))
-(scm_fluid_ref (groups scm C) (scan-data T))
-(scm_fluid_set_x (groups scm C) (scan-data T))
-(scm_flush (groups scm C) (scan-data T))
-(scm_flush_all_ports (groups scm C) (scan-data T))
-(scm_flush_ws (groups scm C) (scan-data T))
-(scm_for_each (groups scm C) (scan-data T))
-(scm_force (groups scm C) (scan-data T))
-(scm_force_output (groups scm C) (scan-data T))
-(scm_fork (groups scm C) (scan-data T))
-(scm_frame_arguments (groups scm C) (scan-data T))
-(scm_frame_evaluating_args_p (groups scm C) (scan-data T))
-(scm_frame_next (groups scm C) (scan-data T))
-(scm_frame_number (groups scm C) (scan-data T))
-(scm_frame_overflow_p (groups scm C) (scan-data T))
-(scm_frame_p (groups scm C) (scan-data T))
-(scm_frame_previous (groups scm C) (scan-data T))
-(scm_frame_procedure (groups scm C) (scan-data T))
-(scm_frame_procedure_p (groups scm C) (scan-data T))
-(scm_frame_real_p (groups scm C) (scan-data T))
-(scm_frame_source (groups scm C) (scan-data T))
-(scm_free0 (groups scm C) (scan-data T))
-(scm_free_print_state (groups scm C) (scan-data T))
-(scm_free_subr_entry (groups scm C) (scan-data T))
-(scm_freelist (groups scm C) (scan-data D))
-(scm_freelist2 (groups scm C) (scan-data D))
-(scm_fsync (groups scm C) (scan-data T))
-(scm_ftell (groups scm C) (scan-data T))
-(scm_gc (groups scm C) (scan-data T))
-(scm_gc_cells_collected (groups scm C) (scan-data B))
-(scm_gc_cells_marked_acc (groups scm C) (scan-data D))
-(scm_gc_cells_swept (groups scm C) (scan-data D))
-(scm_gc_cells_swept_acc (groups scm C) (scan-data D))
-(scm_gc_for_newcell (groups scm C) (scan-data T))
-(scm_gc_free (groups scm C) (scan-data T))
-(scm_gc_heap_lock (groups scm C) (scan-data D))
-(scm_gc_malloc (groups scm C) (scan-data T))
-(scm_gc_malloc_collected (groups scm C) (scan-data B))
-(scm_gc_mark (groups scm C) (scan-data T))
-(scm_gc_mark_dependencies (groups scm C) (scan-data T))
-(scm_gc_mark_time_taken (groups scm C) (scan-data D))
-(scm_gc_ports_collected (groups scm C) (scan-data B))
-(scm_gc_protect_object (groups scm C) (scan-data T))
-(scm_gc_realloc (groups scm C) (scan-data T))
-(scm_gc_register_collectable_memory (groups scm C) (scan-data T))
-(scm_gc_register_root (groups scm C) (scan-data T))
-(scm_gc_register_roots (groups scm C) (scan-data T))
-(scm_gc_running_p (groups scm C) (scan-data D))
-(scm_gc_stats (groups scm C) (scan-data T))
-(scm_gc_strdup (groups scm C) (scan-data T))
-(scm_gc_strndup (groups scm C) (scan-data T))
-(scm_gc_sweep (groups scm C) (scan-data T))
-(scm_gc_sweep_time_taken (groups scm C) (scan-data D))
-(scm_gc_time_taken (groups scm C) (scan-data D))
-(scm_gc_times (groups scm C) (scan-data D))
-(scm_gc_unprotect_object (groups scm C) (scan-data T))
-(scm_gc_unregister_collectable_memory (groups scm C) (scan-data T))
-(scm_gc_unregister_root (groups scm C) (scan-data T))
-(scm_gc_unregister_roots (groups scm C) (scan-data T))
-(scm_gc_yield (groups scm C) (scan-data B))
-(scm_gcd (groups scm C) (scan-data T))
-(scm_generic_capability_p (groups scm C) (scan-data T))
-(scm_generic_function_methods (groups scm C) (scan-data T))
-(scm_generic_function_name (groups scm C) (scan-data T))
-(scm_gensym (groups scm C) (scan-data T))
-(scm_geq_p (groups scm C) (scan-data T))
-(scm_get_internal_real_time (groups scm C) (scan-data T))
-(scm_get_internal_run_time (groups scm C) (scan-data T))
-(scm_get_keyword (groups scm C) (scan-data T))
-(scm_get_meta_args (groups scm C) (scan-data T))
-(scm_get_one_zombie (groups scm C) (scan-data T))
-(scm_get_output_string (groups scm C) (scan-data T))
-(scm_get_pre_modules_obarray (groups scm C) (scan-data T))
-(scm_get_print_state (groups scm C) (scan-data T))
-(scm_get_stack_base (groups scm C) (scan-data T))
-(scm_getc (groups scm C) (scan-data T))
-(scm_getcwd (groups scm C) (scan-data T))
-(scm_getegid (groups scm C) (scan-data T))
-(scm_getenv (groups scm C) (scan-data T))
-(scm_geteuid (groups scm C) (scan-data T))
-(scm_getgid (groups scm C) (scan-data T))
-(scm_getgrgid (groups scm C) (scan-data T))
-(scm_getgroups (groups scm C) (scan-data T))
-(scm_gethost (groups scm C) (scan-data T))
-(scm_gethostname (groups scm C) (scan-data T))
-(scm_getitimer (groups scm C) (scan-data T))
-(scm_getlogin (groups scm C) (scan-data T))
-(scm_getnet (groups scm C) (scan-data T))
-(scm_getpass (groups scm C) (scan-data T))
-(scm_getpeername (groups scm C) (scan-data T))
-(scm_getpgrp (groups scm C) (scan-data T))
-(scm_getpid (groups scm C) (scan-data T))
-(scm_getppid (groups scm C) (scan-data T))
-(scm_getpriority (groups scm C) (scan-data T))
-(scm_getproto (groups scm C) (scan-data T))
-(scm_getpwuid (groups scm C) (scan-data T))
-(scm_getserv (groups scm C) (scan-data T))
-(scm_getsockname (groups scm C) (scan-data T))
-(scm_getsockopt (groups scm C) (scan-data T))
-(scm_gettimeofday (groups scm C) (scan-data T))
-(scm_getuid (groups scm C) (scan-data T))
-(scm_gmtime (groups scm C) (scan-data T))
-(scm_gr_p (groups scm C) (scan-data T))
-(scm_grow_tok_buf (groups scm C) (scan-data T))
-(scm_gsubr_apply (groups scm C) (scan-data T))
-(scm_guard (groups scm C) (scan-data T))
-(scm_guardian_destroyed_p (groups scm C) (scan-data T))
-(scm_guardian_greedy_p (groups scm C) (scan-data T))
-(scm_handle_by_message (groups scm C) (scan-data T))
-(scm_handle_by_message_noexit (groups scm C) (scan-data T))
-(scm_handle_by_proc (groups scm C) (scan-data T))
-(scm_handle_by_proc_catching_all (groups scm C) (scan-data T))
-(scm_handle_by_throw (groups scm C) (scan-data T))
-(scm_hash (groups scm C) (scan-data T))
-(scm_hash_create_handle_x (groups scm C) (scan-data T))
-(scm_hash_fn_create_handle_x (groups scm C) (scan-data T))
-(scm_hash_fn_get_handle (groups scm C) (scan-data T))
-(scm_hash_fn_ref (groups scm C) (scan-data T))
-(scm_hash_fn_remove_x (groups scm C) (scan-data T))
-(scm_hash_fn_set_x (groups scm C) (scan-data T))
-(scm_hash_fold (groups scm C) (scan-data T))
-(scm_hash_get_handle (groups scm C) (scan-data T))
-(scm_hash_ref (groups scm C) (scan-data T))
-(scm_hash_remove_x (groups scm C) (scan-data T))
-(scm_hash_set_x (groups scm C) (scan-data T))
-(scm_hasher (groups scm C) (scan-data T))
-(scm_hashq (groups scm C) (scan-data T))
-(scm_hashq_create_handle_x (groups scm C) (scan-data T))
-(scm_hashq_get_handle (groups scm C) (scan-data T))
-(scm_hashq_ref (groups scm C) (scan-data T))
-(scm_hashq_remove_x (groups scm C) (scan-data T))
-(scm_hashq_set_x (groups scm C) (scan-data T))
-(scm_hashv (groups scm C) (scan-data T))
-(scm_hashv_create_handle_x (groups scm C) (scan-data T))
-(scm_hashv_get_handle (groups scm C) (scan-data T))
-(scm_hashv_ref (groups scm C) (scan-data T))
-(scm_hashv_remove_x (groups scm C) (scan-data T))
-(scm_hashv_set_x (groups scm C) (scan-data T))
-(scm_hashx_create_handle_x (groups scm C) (scan-data T))
-(scm_hashx_get_handle (groups scm C) (scan-data T))
-(scm_hashx_ref (groups scm C) (scan-data T))
-(scm_hashx_remove_x (groups scm C) (scan-data T))
-(scm_hashx_set_x (groups scm C) (scan-data T))
-(scm_heap_org (groups scm C) (scan-data B))
-(scm_heap_table (groups scm C) (scan-data D))
-(scm_hook_empty_p (groups scm C) (scan-data T))
-(scm_hook_p (groups scm C) (scan-data T))
-(scm_hook_to_list (groups scm C) (scan-data T))
-(scm_htonl (groups scm C) (scan-data T))
-(scm_htons (groups scm C) (scan-data T))
-(scm_i_adjbig (groups scm libguile-internal C) (scan-data T))
-(scm_i_big2dbl (groups scm libguile-internal C) (scan-data T))
-(scm_i_big2inum (groups scm libguile-internal C) (scan-data T))
-(scm_i_copy_rstate (groups scm libguile-internal C) (scan-data T))
-(scm_i_copybig (groups scm libguile-internal C) (scan-data T))
-(scm_i_dbl2big (groups scm libguile-internal C) (scan-data T))
-(scm_i_display_error (groups scm libguile-internal C) (scan-data T))
-(scm_i_dummy (groups scm libguile-internal C) (scan-data B))
-(scm_i_eval (groups scm libguile-internal C) (scan-data T))
-(scm_i_eval_x (groups scm libguile-internal C) (scan-data T))
-(scm_i_get_keyword (groups scm libguile-internal C) (scan-data T))
-(scm_i_init_rstate (groups scm libguile-internal C) (scan-data T))
-(scm_i_int2big (groups scm libguile-internal C) (scan-data T))
-(scm_i_long2big (groups scm libguile-internal C) (scan-data T))
-(scm_i_long_long2big (groups scm libguile-internal C) (scan-data T))
-(scm_i_make_class_object (groups scm libguile-internal C) (scan-data T))
-(scm_i_mem2number (groups scm libguile-internal C) (scan-data T))
-(scm_i_mkbig (groups scm libguile-internal C) (scan-data T))
-(scm_i_normbig (groups scm libguile-internal C) (scan-data T))
-(scm_i_procedure_arity (groups scm libguile-internal C) (scan-data T))
-(scm_i_ptrdiff2big (groups scm libguile-internal C) (scan-data T))
-(scm_i_short2big (groups scm libguile-internal C) (scan-data T))
-(scm_i_size2big (groups scm libguile-internal C) (scan-data T))
-(scm_i_terminating (groups scm libguile-internal C) (scan-data B))
-(scm_i_uint2big (groups scm libguile-internal C) (scan-data T))
-(scm_i_ulong2big (groups scm libguile-internal C) (scan-data T))
-(scm_i_ulong_long2big (groups scm libguile-internal C) (scan-data T))
-(scm_i_uniform32 (groups scm libguile-internal C) (scan-data T))
-(scm_i_ushort2big (groups scm libguile-internal C) (scan-data T))
-(scm_i_variable_print (groups scm libguile-internal C) (scan-data T))
-(scm_ice_9_already_loaded (groups scm C) (scan-data D))
-(scm_igc (groups scm C) (scan-data T))
-(scm_ihash (groups scm C) (scan-data T))
-(scm_ihashq (groups scm C) (scan-data T))
-(scm_ihashv (groups scm C) (scan-data T))
-(scm_iint2str (groups scm C) (scan-data T))
-(scm_ilength (groups scm C) (scan-data T))
-(scm_ilookup (groups scm C) (scan-data T))
-(scm_imag_part (groups scm C) (scan-data T))
-(scm_import_environment_imports (groups scm C) (scan-data T))
-(scm_import_environment_p (groups scm C) (scan-data T))
-(scm_import_environment_set_imports_x (groups scm C) (scan-data T))
-(scm_include_deprecated_features (groups scm C) (scan-data T))
-(scm_inet_aton (groups scm C) (scan-data T))
-(scm_inet_makeaddr (groups scm C) (scan-data T))
-(scm_inet_netof (groups scm C) (scan-data T))
-(scm_inet_ntoa (groups scm C) (scan-data T))
-(scm_inet_ntop (groups scm C) (scan-data T))
-(scm_inet_pton (groups scm C) (scan-data T))
-(scm_inexact_p (groups scm C) (scan-data T))
-(scm_inexact_to_exact (groups scm C) (scan-data T))
-(scm_inf (groups scm C) (scan-data T))
-(scm_inf_p (groups scm C) (scan-data T))
-(scm_init_alist (groups scm C) (scan-data T))
-(scm_init_arbiters (groups scm C) (scan-data T))
-(scm_init_async (groups scm C) (scan-data T))
-(scm_init_backtrace (groups scm C) (scan-data T))
-(scm_init_boolean (groups scm C) (scan-data T))
-(scm_init_chars (groups scm C) (scan-data T))
-(scm_init_continuations (groups scm C) (scan-data T))
-(scm_init_debug (groups scm C) (scan-data T))
-(scm_init_deprecation (groups scm C) (scan-data T))
-(scm_init_dynamic_linking (groups scm C) (scan-data T))
-(scm_init_dynwind (groups scm C) (scan-data T))
-(scm_init_environments (groups scm C) (scan-data T))
-(scm_init_eq (groups scm C) (scan-data T))
-(scm_init_error (groups scm C) (scan-data T))
-(scm_init_eval (groups scm C) (scan-data T))
-(scm_init_evalext (groups scm C) (scan-data T))
-(scm_init_extensions (groups scm C) (scan-data T))
-(scm_init_feature (groups scm C) (scan-data T))
-(scm_init_filesys (groups scm C) (scan-data T))
-(scm_init_fluids (groups scm C) (scan-data T))
-(scm_init_fports (groups scm C) (scan-data T))
-(scm_init_gc (groups scm C) (scan-data T))
-(scm_init_gdbint (groups scm C) (scan-data T))
-(scm_init_goops (groups scm C) (scan-data T))
-(scm_init_goops_builtins (groups scm C) (scan-data T))
-(scm_init_gsubr (groups scm C) (scan-data T))
-(scm_init_guardians (groups scm C) (scan-data T))
-(scm_init_guile (groups scm C) (scan-data T))
-(scm_init_hash (groups scm C) (scan-data T))
-(scm_init_hashtab (groups scm C) (scan-data T))
-(scm_init_hooks (groups scm C) (scan-data T))
-(scm_init_ioext (groups scm C) (scan-data T))
-(scm_init_iselect (groups scm C) (scan-data T))
-(scm_init_keywords (groups scm C) (scan-data T))
-(scm_init_lang (groups scm C) (scan-data T))
-(scm_init_list (groups scm C) (scan-data T))
-(scm_init_load (groups scm C) (scan-data T))
-(scm_init_load_path (groups scm C) (scan-data T))
-(scm_init_macros (groups scm C) (scan-data T))
-(scm_init_mallocs (groups scm C) (scan-data T))
-(scm_init_modules (groups scm C) (scan-data T))
-(scm_init_net_db (groups scm C) (scan-data T))
-(scm_init_numbers (groups scm C) (scan-data T))
-(scm_init_objects (groups scm C) (scan-data T))
-(scm_init_objprop (groups scm C) (scan-data T))
-(scm_init_options (groups scm C) (scan-data T))
-(scm_init_opts (groups scm C) (scan-data T))
-(scm_init_pairs (groups scm C) (scan-data T))
-(scm_init_ports (groups scm C) (scan-data T))
-(scm_init_posix (groups scm C) (scan-data T))
-(scm_init_print (groups scm C) (scan-data T))
-(scm_init_procprop (groups scm C) (scan-data T))
-(scm_init_procs (groups scm C) (scan-data T))
-(scm_init_properties (groups scm C) (scan-data T))
-(scm_init_ramap (groups scm C) (scan-data T))
-(scm_init_random (groups scm C) (scan-data T))
-(scm_init_rdelim (groups scm C) (scan-data T))
-(scm_init_rdelim_builtins (groups scm C) (scan-data T))
-(scm_init_read (groups scm C) (scan-data T))
-(scm_init_regex_posix (groups scm C) (scan-data T))
-(scm_init_root (groups scm C) (scan-data T))
-(scm_init_rw (groups scm C) (scan-data T))
-(scm_init_rw_builtins (groups scm C) (scan-data T))
-(scm_init_scmsigs (groups scm C) (scan-data T))
-(scm_init_script (groups scm C) (scan-data T))
-(scm_init_simpos (groups scm C) (scan-data T))
-(scm_init_socket (groups scm C) (scan-data T))
-(scm_init_sort (groups scm C) (scan-data T))
-(scm_init_srcprop (groups scm C) (scan-data T))
-(scm_init_stackchk (groups scm C) (scan-data T))
-(scm_init_stacks (groups scm C) (scan-data T))
-(scm_init_stime (groups scm C) (scan-data T))
-(scm_init_storage (groups scm C) (scan-data T))
-(scm_init_strings (groups scm C) (scan-data T))
-(scm_init_strop (groups scm C) (scan-data T))
-(scm_init_strorder (groups scm C) (scan-data T))
-(scm_init_strports (groups scm C) (scan-data T))
-(scm_init_struct (groups scm C) (scan-data T))
-(scm_init_subr_table (groups scm C) (scan-data T))
-(scm_init_symbols (groups scm C) (scan-data T))
-(scm_init_threads (groups scm C) (scan-data T))
-(scm_init_throw (groups scm C) (scan-data T))
-(scm_init_unif (groups scm C) (scan-data T))
-(scm_init_values (groups scm C) (scan-data T))
-(scm_init_variable (groups scm C) (scan-data T))
-(scm_init_vectors (groups scm C) (scan-data T))
-(scm_init_version (groups scm C) (scan-data T))
-(scm_init_vports (groups scm C) (scan-data T))
-(scm_init_weaks (groups scm C) (scan-data T))
-(scm_initialized_p (groups scm C) (scan-data D))
-(scm_input_port_p (groups scm C) (scan-data T))
-(scm_instance_p (groups scm C) (scan-data T))
-(scm_int2num (groups scm C) (scan-data T))
-(scm_integer_expt (groups scm C) (scan-data T))
-(scm_integer_length (groups scm C) (scan-data T))
-(scm_integer_p (groups scm C) (scan-data T))
-(scm_integer_to_char (groups scm C) (scan-data T))
-(scm_interaction_environment (groups scm C) (scan-data T))
-(scm_internal_catch (groups scm C) (scan-data T))
-(scm_internal_cwdr (groups scm C) (scan-data T))
-(scm_internal_dynamic_wind (groups scm C) (scan-data T))
-(scm_internal_hash_fold (groups scm C) (scan-data T))
-(scm_internal_lazy_catch (groups scm C) (scan-data T))
-(scm_internal_parse_path (groups scm C) (scan-data T))
-(scm_internal_select (groups scm C) (scan-data T))
-(scm_internal_stack_catch (groups scm C) (scan-data T))
-(scm_intprint (groups scm C) (scan-data T))
-(scm_ints_disabled (groups scm C) (scan-data D))
-(scm_iprin1 (groups scm C) (scan-data T))
-(scm_iprlist (groups scm C) (scan-data T))
-(scm_ipruk (groups scm C) (scan-data T))
-(scm_isatty_p (groups scm C) (scan-data T))
-(scm_issue_deprecation_warning (groups scm C) (scan-data T))
-(scm_istr2bve (groups scm C) (scan-data T))
-(scm_isymnames (groups scm C) (scan-data D))
-(scm_ithrow (groups scm C) (scan-data T))
-(scm_join_thread (groups scm C) (scan-data T))
-(scm_keyword_dash_symbol (groups scm C) (scan-data T))
-(scm_keyword_p (groups scm C) (scan-data T))
-(scm_kill (groups scm C) (scan-data T))
-(scm_last_pair (groups scm C) (scan-data T))
-(scm_last_stack_frame (groups scm C) (scan-data T))
-(scm_lazy_catch (groups scm C) (scan-data T))
-(scm_lcm (groups scm C) (scan-data T))
-(scm_leaf_environment_p (groups scm C) (scan-data T))
-(scm_length (groups scm C) (scan-data T))
-(scm_leq_p (groups scm C) (scan-data T))
-(scm_less_p (groups scm C) (scan-data T))
-(scm_lfwrite (groups scm C) (scan-data T))
-(scm_link (groups scm C) (scan-data T))
-(scm_list (groups scm C) (scan-data T))
-(scm_list_1 (groups scm C) (scan-data T))
-(scm_list_2 (groups scm C) (scan-data T))
-(scm_list_3 (groups scm C) (scan-data T))
-(scm_list_4 (groups scm C) (scan-data T))
-(scm_list_5 (groups scm C) (scan-data T))
-(scm_list_cdr_set_x (groups scm C) (scan-data T))
-(scm_list_copy (groups scm C) (scan-data T))
-(scm_list_head (groups scm C) (scan-data T))
-(scm_list_n (groups scm C) (scan-data T))
-(scm_list_p (groups scm C) (scan-data T))
-(scm_list_ref (groups scm C) (scan-data T))
-(scm_list_set_x (groups scm C) (scan-data T))
-(scm_list_tail (groups scm C) (scan-data T))
-(scm_list_to_uniform_array (groups scm C) (scan-data T))
-(scm_listen (groups scm C) (scan-data T))
-(scm_listofnullstr (groups scm C) (scan-data B))
-(scm_lnaof (groups scm C) (scan-data T))
-(scm_load_extension (groups scm C) (scan-data T))
-(scm_load_goops (groups scm C) (scan-data T))
-(scm_load_startup_files (groups scm C) (scan-data T))
-(scm_local_eval (groups scm C) (scan-data T))
-(scm_localtime (groups scm C) (scan-data T))
-(scm_lock_mutex (groups scm C) (scan-data T))
-(scm_logand (groups scm C) (scan-data T))
-(scm_logbit_p (groups scm C) (scan-data T))
-(scm_logcount (groups scm C) (scan-data T))
-(scm_logior (groups scm C) (scan-data T))
-(scm_lognot (groups scm C) (scan-data T))
-(scm_logtest (groups scm C) (scan-data T))
-(scm_logxor (groups scm C) (scan-data T))
-(scm_long2num (groups scm C) (scan-data T))
-(scm_long_long2num (groups scm C) (scan-data T))
-(scm_lookup (groups scm C) (scan-data T))
-(scm_lookup_closure_module (groups scm C) (scan-data T))
-(scm_lookupcar (groups scm C) (scan-data T))
-(scm_lreadparen (groups scm C) (scan-data T))
-(scm_lreadr (groups scm C) (scan-data T))
-(scm_lreadrecparen (groups scm C) (scan-data T))
-(scm_lstat (groups scm C) (scan-data T))
-(scm_m_and (groups scm C) (scan-data T))
-(scm_m_apply (groups scm C) (scan-data T))
-(scm_m_at_call_with_values (groups scm C) (scan-data T))
-(scm_m_atbind (groups scm C) (scan-data T))
-(scm_m_atdispatch (groups scm C) (scan-data T))
-(scm_m_atfop (groups scm C) (scan-data T))
-(scm_m_atslot_ref (groups scm C) (scan-data T))
-(scm_m_atslot_set_x (groups scm C) (scan-data T))
-(scm_m_begin (groups scm C) (scan-data T))
-(scm_m_case (groups scm C) (scan-data T))
-(scm_m_cond (groups scm C) (scan-data T))
-(scm_m_cont (groups scm C) (scan-data T))
-(scm_m_define (groups scm C) (scan-data T))
-(scm_m_delay (groups scm C) (scan-data T))
-(scm_m_do (groups scm C) (scan-data T))
-(scm_m_expand_body (groups scm C) (scan-data T))
-(scm_m_generalized_set_x (groups scm C) (scan-data T))
-(scm_m_if (groups scm C) (scan-data T))
-(scm_m_lambda (groups scm C) (scan-data T))
-(scm_m_let (groups scm C) (scan-data T))
-(scm_m_letrec (groups scm C) (scan-data T))
-(scm_m_letstar (groups scm C) (scan-data T))
-(scm_m_nil_cond (groups scm C) (scan-data T))
-(scm_m_or (groups scm C) (scan-data T))
-(scm_m_quasiquote (groups scm C) (scan-data T))
-(scm_m_quote (groups scm C) (scan-data T))
-(scm_m_set_x (groups scm C) (scan-data T))
-(scm_m_undefine (groups scm C) (scan-data T))
-(scm_macro_name (groups scm C) (scan-data T))
-(scm_macro_p (groups scm C) (scan-data T))
-(scm_macro_transformer (groups scm C) (scan-data T))
-(scm_macro_type (groups scm C) (scan-data T))
-(scm_macroexp (groups scm C) (scan-data T))
-(scm_magnitude (groups scm C) (scan-data T))
-(scm_major_version (groups scm C) (scan-data T))
-(scm_makacro (groups scm C) (scan-data T))
-(scm_makcclo (groups scm C) (scan-data T))
-(scm_make (groups scm C) (scan-data T))
-(scm_make_arbiter (groups scm C) (scan-data T))
-(scm_make_class (groups scm C) (scan-data T))
-(scm_make_class_object (groups scm C) (scan-data T))
-(scm_make_complex (groups scm C) (scan-data T))
-(scm_make_condition_variable (groups scm C) (scan-data T))
-(scm_make_continuation (groups scm C) (scan-data T))
-(scm_make_debugobj (groups scm C) (scan-data T))
-(scm_make_doubly_weak_hash_table (groups scm C) (scan-data T))
-(scm_make_environment (groups scm C) (scan-data T))
-(scm_make_eval_environment (groups scm C) (scan-data T))
-(scm_make_export_environment (groups scm C) (scan-data T))
-(scm_make_extended_class (groups scm C) (scan-data T))
-(scm_make_fluid (groups scm C) (scan-data T))
-(scm_make_foreign_object (groups scm C) (scan-data T))
-(scm_make_guardian (groups scm C) (scan-data T))
-(scm_make_hook (groups scm C) (scan-data T))
-(scm_make_import_environment (groups scm C) (scan-data T))
-(scm_make_initial_fluids (groups scm C) (scan-data T))
-(scm_make_keyword_from_dash_symbol (groups scm C) (scan-data T))
-(scm_make_leaf_environment (groups scm C) (scan-data T))
-(scm_make_memoized (groups scm C) (scan-data T))
-(scm_make_method_cache (groups scm C) (scan-data T))
-(scm_make_mutex (groups scm C) (scan-data T))
-(scm_make_polar (groups scm C) (scan-data T))
-(scm_make_port_classes (groups scm C) (scan-data T))
-(scm_make_port_type (groups scm C) (scan-data T))
-(scm_make_print_state (groups scm C) (scan-data T))
-(scm_make_procedure_with_setter (groups scm C) (scan-data T))
-(scm_make_ra (groups scm C) (scan-data T))
-(scm_make_real (groups scm C) (scan-data T))
-(scm_make_rectangular (groups scm C) (scan-data T))
-(scm_make_regexp (groups scm C) (scan-data T))
-(scm_make_root (groups scm C) (scan-data T))
-(scm_make_shared_array (groups scm C) (scan-data T))
-(scm_make_smob (groups scm C) (scan-data T))
-(scm_make_smob_type (groups scm C) (scan-data T))
-(scm_make_soft_port (groups scm C) (scan-data T))
-(scm_make_srcprops (groups scm C) (scan-data T))
-(scm_make_stack (groups scm C) (scan-data T))
-(scm_make_string (groups scm C) (scan-data T))
-(scm_make_struct (groups scm C) (scan-data T))
-(scm_make_struct_layout (groups scm C) (scan-data T))
-(scm_make_subclass_object (groups scm C) (scan-data T))
-(scm_make_symbol (groups scm C) (scan-data T))
-(scm_make_synt (groups scm C) (scan-data T))
-(scm_make_undefined_variable (groups scm C) (scan-data T))
-(scm_make_uve (groups scm C) (scan-data T))
-(scm_make_variable (groups scm C) (scan-data T))
-(scm_make_vector (groups scm C) (scan-data T))
-(scm_make_vtable_vtable (groups scm C) (scan-data T))
-(scm_make_weak_key_hash_table (groups scm C) (scan-data T))
-(scm_make_weak_value_hash_table (groups scm C) (scan-data T))
-(scm_make_weak_vector (groups scm C) (scan-data T))
-(scm_makfrom0str (groups scm C) (scan-data T))
-(scm_makfrom0str_opt (groups scm C) (scan-data T))
-(scm_makfromstrs (groups scm C) (scan-data T))
-(scm_makmacro (groups scm C) (scan-data T))
-(scm_makmmacro (groups scm C) (scan-data T))
-(scm_makprom (groups scm C) (scan-data T))
-(scm_malloc (groups scm C) (scan-data T))
-(scm_malloc_obj (groups scm C) (scan-data T))
-(scm_mallocated (groups scm C) (scan-data D))
-(scm_map (groups scm C) (scan-data T))
-(scm_mark0 (groups scm C) (scan-data T))
-(scm_mark_locations (groups scm C) (scan-data T))
-(scm_mark_subr_table (groups scm C) (scan-data T))
-(scm_markcdr (groups scm C) (scan-data T))
-(scm_markstream (groups scm C) (scan-data T))
-(scm_mask_ints (groups scm C) (scan-data D))
-(scm_mask_signals (groups scm C) (scan-data T))
-(scm_masktab (groups scm C) (scan-data B))
-(scm_master_freelist (groups scm C) (scan-data D))
-(scm_master_freelist2 (groups scm C) (scan-data D))
-(scm_max (groups scm C) (scan-data T))
-(scm_max_segment_size (groups scm C) (scan-data B))
-(scm_mcache_compute_cmethod (groups scm C) (scan-data T))
-(scm_mcache_lookup_cmethod (groups scm C) (scan-data T))
-(scm_mem2string (groups scm C) (scan-data T))
-(scm_mem2symbol (groups scm C) (scan-data T))
-(scm_mem2uninterned_symbol (groups scm C) (scan-data T))
-(scm_member (groups scm C) (scan-data T))
-(scm_memoize_method (groups scm C) (scan-data T))
-(scm_memoized_environment (groups scm C) (scan-data T))
-(scm_memoized_p (groups scm C) (scan-data T))
-(scm_memory_alloc_key (groups scm C) (scan-data B))
-(scm_memory_error (groups scm C) (scan-data T))
-(scm_memq (groups scm C) (scan-data T))
-(scm_memv (groups scm C) (scan-data T))
-(scm_merge (groups scm C) (scan-data T))
-(scm_merge_x (groups scm C) (scan-data T))
-(scm_metaclass_operator (groups scm C) (scan-data B))
-(scm_metaclass_standard (groups scm C) (scan-data B))
-(scm_method_generic_function (groups scm C) (scan-data T))
-(scm_method_procedure (groups scm C) (scan-data T))
-(scm_method_specializers (groups scm C) (scan-data T))
-(scm_micro_version (groups scm C) (scan-data T))
-(scm_min (groups scm C) (scan-data T))
-(scm_minor_version (groups scm C) (scan-data T))
-(scm_misc_error (groups scm C) (scan-data T))
-(scm_misc_error_key (groups scm C) (scan-data B))
-(scm_mkdir (groups scm C) (scan-data T))
-(scm_mknod (groups scm C) (scan-data T))
-(scm_mkstemp (groups scm C) (scan-data T))
-(scm_mkstrport (groups scm C) (scan-data T))
-(scm_mktime (groups scm C) (scan-data T))
-(scm_mode_bits (groups scm C) (scan-data T))
-(scm_module_define (groups scm C) (scan-data T))
-(scm_module_goops (groups scm C) (scan-data B))
-(scm_module_lookup (groups scm C) (scan-data T))
-(scm_module_lookup_closure (groups scm C) (scan-data T))
-(scm_module_reverse_lookup (groups scm C) (scan-data T))
-(scm_module_system_booted_p (groups scm C) (scan-data D))
-(scm_module_tag (groups scm C) (scan-data B))
-(scm_module_transformer (groups scm C) (scan-data T))
-(scm_modules_prehistory (groups scm C) (scan-data T))
-(scm_modulo (groups scm C) (scan-data T))
-(scm_mtrigger (groups scm C) (scan-data B))
-(scm_mulbig (groups scm C) (scan-data T))
-(scm_must_free (groups scm C) (scan-data T))
-(scm_must_malloc (groups scm C) (scan-data T))
-(scm_must_realloc (groups scm C) (scan-data T))
-(scm_must_strdup (groups scm C) (scan-data T))
-(scm_must_strndup (groups scm C) (scan-data T))
-(scm_n_charnames (groups scm C) (scan-data D))
-(scm_n_heap_segs (groups scm C) (scan-data D))
-(scm_nan (groups scm C) (scan-data T))
-(scm_nan_p (groups scm C) (scan-data T))
-(scm_nconc2last (groups scm C) (scan-data T))
-(scm_negative_p (groups scm C) (scan-data T))
-(scm_newline (groups scm C) (scan-data T))
-(scm_nice (groups scm C) (scan-data T))
-(scm_no_applicable_method (groups scm C) (scan-data B))
-(scm_noop (groups scm C) (scan-data T))
-(scm_not (groups scm C) (scan-data T))
-(scm_ntohl (groups scm C) (scan-data T))
-(scm_ntohs (groups scm C) (scan-data T))
-(scm_null_p (groups scm C) (scan-data T))
-(scm_num2dbl (groups scm C) (scan-data T))
-(scm_num2double (groups scm C) (scan-data T))
-(scm_num2float (groups scm C) (scan-data T))
-(scm_num2int (groups scm C) (scan-data T))
-(scm_num2long (groups scm C) (scan-data T))
-(scm_num2long_long (groups scm C) (scan-data T))
-(scm_num2ptrdiff (groups scm C) (scan-data T))
-(scm_num2short (groups scm C) (scan-data T))
-(scm_num2size (groups scm C) (scan-data T))
-(scm_num2uint (groups scm C) (scan-data T))
-(scm_num2ulong (groups scm C) (scan-data T))
-(scm_num2ulong_long (groups scm C) (scan-data T))
-(scm_num2ushort (groups scm C) (scan-data T))
-(scm_num_eq_p (groups scm C) (scan-data T))
-(scm_num_overflow (groups scm C) (scan-data T))
-(scm_num_overflow_key (groups scm C) (scan-data B))
-(scm_number_p (groups scm C) (scan-data T))
-(scm_number_to_string (groups scm C) (scan-data T))
-(scm_numptob (groups scm C) (scan-data B))
-(scm_numsmob (groups scm C) (scan-data B))
-(scm_object_address (groups scm C) (scan-data T))
-(scm_object_properties (groups scm C) (scan-data T))
-(scm_object_property (groups scm C) (scan-data T))
-(scm_object_to_string (groups scm C) (scan-data T))
-(scm_odd_p (groups scm C) (scan-data T))
-(scm_open (groups scm C) (scan-data T))
-(scm_open_fdes (groups scm C) (scan-data T))
-(scm_open_file (groups scm C) (scan-data T))
-(scm_open_input_string (groups scm C) (scan-data T))
-(scm_open_output_string (groups scm C) (scan-data T))
-(scm_opendir (groups scm C) (scan-data T))
-(scm_operator_p (groups scm C) (scan-data T))
-(scm_options (groups scm C) (scan-data T))
-(scm_out_of_range (groups scm C) (scan-data T))
-(scm_out_of_range_key (groups scm C) (scan-data B))
-(scm_out_of_range_pos (groups scm C) (scan-data T))
-(scm_output_port_p (groups scm C) (scan-data T))
-(scm_pair_p (groups scm C) (scan-data T))
-(scm_parse_path (groups scm C) (scan-data T))
-(scm_pause (groups scm C) (scan-data T))
-(scm_peek_char (groups scm C) (scan-data T))
-(scm_permanent_object (groups scm C) (scan-data T))
-(scm_pipe (groups scm C) (scan-data T))
-(scm_port_class (groups scm C) (scan-data D))
-(scm_port_closed_p (groups scm C) (scan-data T))
-(scm_port_column (groups scm C) (scan-data T))
-(scm_port_filename (groups scm C) (scan-data T))
-(scm_port_for_each (groups scm C) (scan-data T))
-(scm_port_line (groups scm C) (scan-data T))
-(scm_port_mode (groups scm C) (scan-data T))
-(scm_port_non_buffer (groups scm C) (scan-data T))
-(scm_port_p (groups scm C) (scan-data T))
-(scm_port_print (groups scm C) (scan-data T))
-(scm_port_revealed (groups scm C) (scan-data T))
-(scm_port_table (groups scm C) (scan-data B))
-(scm_port_table_room (groups scm C) (scan-data D))
-(scm_port_table_size (groups scm C) (scan-data D))
-(scm_port_with_print_state (groups scm C) (scan-data T))
-(scm_ports_prehistory (groups scm C) (scan-data T))
-(scm_positive_p (groups scm C) (scan-data T))
-(scm_pre_modules_obarray (groups scm C) (scan-data B))
-(scm_primitive_eval (groups scm C) (scan-data T))
-(scm_primitive_eval_x (groups scm C) (scan-data T))
-(scm_primitive_exit (groups scm C) (scan-data T))
-(scm_primitive_generic_generic (groups scm C) (scan-data T))
-(scm_primitive_load (groups scm C) (scan-data T))
-(scm_primitive_load_path (groups scm C) (scan-data T))
-(scm_primitive_make_property (groups scm C) (scan-data T))
-(scm_primitive_move_to_fdes (groups scm C) (scan-data T))
-(scm_primitive_property_del_x (groups scm C) (scan-data T))
-(scm_primitive_property_ref (groups scm C) (scan-data T))
-(scm_primitive_property_set_x (groups scm C) (scan-data T))
-(scm_prin1 (groups scm C) (scan-data T))
-(scm_print_carefully_p (groups scm C) (scan-data B))
-(scm_print_complex (groups scm C) (scan-data T))
-(scm_print_options (groups scm C) (scan-data T))
-(scm_print_opts (groups scm C) (scan-data D))
-(scm_print_port_mode (groups scm C) (scan-data T))
-(scm_print_real (groups scm C) (scan-data T))
-(scm_print_state_vtable (groups scm C) (scan-data D))
-(scm_print_struct (groups scm C) (scan-data T))
-(scm_print_symbol_name (groups scm C) (scan-data T))
-(scm_printer_apply (groups scm C) (scan-data T))
-(scm_procedure (groups scm C) (scan-data T))
-(scm_procedure_documentation (groups scm C) (scan-data T))
-(scm_procedure_environment (groups scm C) (scan-data T))
-(scm_procedure_name (groups scm C) (scan-data T))
-(scm_procedure_p (groups scm C) (scan-data T))
-(scm_procedure_properties (groups scm C) (scan-data T))
-(scm_procedure_property (groups scm C) (scan-data T))
-(scm_procedure_source (groups scm C) (scan-data T))
-(scm_procedure_with_setter_p (groups scm C) (scan-data T))
-(scm_product (groups scm C) (scan-data T))
-(scm_program_arguments (groups scm C) (scan-data T))
-(scm_promise_p (groups scm C) (scan-data T))
-(scm_pseudolong (groups scm C) (scan-data T))
-(scm_ptobs (groups scm C) (scan-data B))
-(scm_ptrdiff2num (groups scm C) (scan-data T))
-(scm_putc (groups scm C) (scan-data T))
-(scm_putenv (groups scm C) (scan-data T))
-(scm_puts (groups scm C) (scan-data T))
-(scm_quotient (groups scm C) (scan-data T))
-(scm_ra2contig (groups scm C) (scan-data T))
-(scm_ra_difference (groups scm C) (scan-data T))
-(scm_ra_divide (groups scm C) (scan-data T))
-(scm_ra_eqp (groups scm C) (scan-data T))
-(scm_ra_greqp (groups scm C) (scan-data T))
-(scm_ra_grp (groups scm C) (scan-data T))
-(scm_ra_leqp (groups scm C) (scan-data T))
-(scm_ra_lessp (groups scm C) (scan-data T))
-(scm_ra_matchp (groups scm C) (scan-data T))
-(scm_ra_product (groups scm C) (scan-data T))
-(scm_ra_set_contp (groups scm C) (scan-data T))
-(scm_ra_sum (groups scm C) (scan-data T))
-(scm_raequal (groups scm C) (scan-data T))
-(scm_raise (groups scm C) (scan-data T))
-(scm_ramapc (groups scm C) (scan-data T))
-(scm_random (groups scm C) (scan-data T))
-(scm_random_exp (groups scm C) (scan-data T))
-(scm_random_hollow_sphere_x (groups scm C) (scan-data T))
-(scm_random_normal (groups scm C) (scan-data T))
-(scm_random_normal_vector_x (groups scm C) (scan-data T))
-(scm_random_solid_sphere_x (groups scm C) (scan-data T))
-(scm_random_uniform (groups scm C) (scan-data T))
-(scm_raprin1 (groups scm C) (scan-data T))
-(scm_read (groups scm C) (scan-data T))
-(scm_read_char (groups scm C) (scan-data T))
-(scm_read_delimited_x (groups scm C) (scan-data T))
-(scm_read_hash_extend (groups scm C) (scan-data T))
-(scm_read_line (groups scm C) (scan-data T))
-(scm_read_options (groups scm C) (scan-data T))
-(scm_read_opts (groups scm C) (scan-data D))
-(scm_read_string_x_partial (groups scm C) (scan-data T))
-(scm_read_token (groups scm C) (scan-data T))
-(scm_readdir (groups scm C) (scan-data T))
-(scm_readlink (groups scm C) (scan-data T))
-(scm_real_equalp (groups scm C) (scan-data T))
-(scm_real_p (groups scm C) (scan-data T))
-(scm_real_part (groups scm C) (scan-data T))
-(scm_realloc (groups scm C) (scan-data T))
-(scm_recv (groups scm C) (scan-data T))
-(scm_recvfrom (groups scm C) (scan-data T))
-(scm_redirect_port (groups scm C) (scan-data T))
-(scm_regexp_exec (groups scm C) (scan-data T))
-(scm_regexp_p (groups scm C) (scan-data T))
-(scm_release_arbiter (groups scm C) (scan-data T))
-(scm_remainder (groups scm C) (scan-data T))
-(scm_remember_upto_here (groups scm C) (scan-data T))
-(scm_remember_upto_here_1 (groups scm C) (scan-data T))
-(scm_remember_upto_here_2 (groups scm C) (scan-data T))
-(scm_remove_from_port_table (groups scm C) (scan-data T))
-(scm_remove_hook_x (groups scm C) (scan-data T))
-(scm_rename (groups scm C) (scan-data T))
-(scm_report_stack_overflow (groups scm C) (scan-data T))
-(scm_reset_hook_x (groups scm C) (scan-data T))
-(scm_resolve_module (groups scm C) (scan-data T))
-(scm_restore_signals (groups scm C) (scan-data T))
-(scm_restricted_vector_sort_x (groups scm C) (scan-data T))
-(scm_return_first (groups scm C) (scan-data T))
-(scm_return_first_int (groups scm C) (scan-data T))
-(scm_revealed_count (groups scm C) (scan-data T))
-(scm_reverse (groups scm C) (scan-data T))
-(scm_reverse_lookup (groups scm C) (scan-data T))
-(scm_reverse_x (groups scm C) (scan-data T))
-(scm_rewinddir (groups scm C) (scan-data T))
-(scm_rmdir (groups scm C) (scan-data T))
-(scm_round (groups scm C) (scan-data T))
-(scm_run_asyncs (groups scm C) (scan-data T))
-(scm_run_hook (groups scm C) (scan-data T))
-(scm_s_bindings (groups scm C) (scan-data R))
-(scm_s_body (groups scm C) (scan-data R))
-(scm_s_clauses (groups scm C) (scan-data R))
-(scm_s_duplicate_bindings (groups scm C) (scan-data R))
-(scm_s_duplicate_formals (groups scm C) (scan-data R))
-(scm_s_expression (groups scm C) (scan-data R))
-(scm_s_formals (groups scm C) (scan-data R))
-(scm_s_set_x (groups scm C) (scan-data R))
-(scm_s_slot_set_x (groups scm C) (scan-data D))
-(scm_s_test (groups scm C) (scan-data R))
-(scm_s_variable (groups scm C) (scan-data R))
-(scm_search_path (groups scm C) (scan-data T))
-(scm_seed_to_random_state (groups scm C) (scan-data T))
-(scm_seek (groups scm C) (scan-data T))
-(scm_select (groups scm C) (scan-data T))
-(scm_send (groups scm C) (scan-data T))
-(scm_sendto (groups scm C) (scan-data T))
-(scm_set_car_x (groups scm C) (scan-data T))
-(scm_set_cdr_x (groups scm C) (scan-data T))
-(scm_set_current_error_port (groups scm C) (scan-data T))
-(scm_set_current_input_port (groups scm C) (scan-data T))
-(scm_set_current_module (groups scm C) (scan-data T))
-(scm_set_current_output_port (groups scm C) (scan-data T))
-(scm_set_object_procedure_x (groups scm C) (scan-data T))
-(scm_set_object_properties_x (groups scm C) (scan-data T))
-(scm_set_object_property_x (groups scm C) (scan-data T))
-(scm_set_port_close (groups scm C) (scan-data T))
-(scm_set_port_column_x (groups scm C) (scan-data T))
-(scm_set_port_end_input (groups scm C) (scan-data T))
-(scm_set_port_equalp (groups scm C) (scan-data T))
-(scm_set_port_filename_x (groups scm C) (scan-data T))
-(scm_set_port_flush (groups scm C) (scan-data T))
-(scm_set_port_free (groups scm C) (scan-data T))
-(scm_set_port_input_waiting (groups scm C) (scan-data T))
-(scm_set_port_line_x (groups scm C) (scan-data T))
-(scm_set_port_mark (groups scm C) (scan-data T))
-(scm_set_port_print (groups scm C) (scan-data T))
-(scm_set_port_revealed_x (groups scm C) (scan-data T))
-(scm_set_port_seek (groups scm C) (scan-data T))
-(scm_set_port_truncate (groups scm C) (scan-data T))
-(scm_set_procedure_properties_x (groups scm C) (scan-data T))
-(scm_set_procedure_property_x (groups scm C) (scan-data T))
-(scm_set_program_arguments (groups scm C) (scan-data T))
-(scm_set_smob_apply (groups scm C) (scan-data T))
-(scm_set_smob_equalp (groups scm C) (scan-data T))
-(scm_set_smob_free (groups scm C) (scan-data T))
-(scm_set_smob_mark (groups scm C) (scan-data T))
-(scm_set_smob_print (groups scm C) (scan-data T))
-(scm_set_source_properties_x (groups scm C) (scan-data T))
-(scm_set_source_property_x (groups scm C) (scan-data T))
-(scm_set_struct_vtable_name_x (groups scm C) (scan-data T))
-(scm_setegid (groups scm C) (scan-data T))
-(scm_seteuid (groups scm C) (scan-data T))
-(scm_setgid (groups scm C) (scan-data T))
-(scm_setgrent (groups scm C) (scan-data T))
-(scm_sethost (groups scm C) (scan-data T))
-(scm_sethostname (groups scm C) (scan-data T))
-(scm_setitimer (groups scm C) (scan-data T))
-(scm_setlocale (groups scm C) (scan-data T))
-(scm_setnet (groups scm C) (scan-data T))
-(scm_setpgid (groups scm C) (scan-data T))
-(scm_setpriority (groups scm C) (scan-data T))
-(scm_setproto (groups scm C) (scan-data T))
-(scm_setpwent (groups scm C) (scan-data T))
-(scm_setserv (groups scm C) (scan-data T))
-(scm_setsid (groups scm C) (scan-data T))
-(scm_setsockopt (groups scm C) (scan-data T))
-(scm_setter (groups scm C) (scan-data T))
-(scm_setuid (groups scm C) (scan-data T))
-(scm_setvbuf (groups scm C) (scan-data T))
-(scm_shap2ra (groups scm C) (scan-data T))
-(scm_shared_array_increments (groups scm C) (scan-data T))
-(scm_shared_array_offset (groups scm C) (scan-data T))
-(scm_shared_array_root (groups scm C) (scan-data T))
-(scm_shell (groups scm C) (scan-data T))
-(scm_shell_usage (groups scm C) (scan-data T))
-(scm_short2num (groups scm C) (scan-data T))
-(scm_shutdown (groups scm C) (scan-data T))
-(scm_sigaction (groups scm C) (scan-data T))
-(scm_signal_condition_variable (groups scm C) (scan-data T))
-(scm_simple_format (groups scm C) (scan-data T))
-(scm_single_thread_p (groups scm C) (scan-data T))
-(scm_size2num (groups scm C) (scan-data T))
-(scm_sleep (groups scm C) (scan-data T))
-(scm_sloppy_assoc (groups scm C) (scan-data T))
-(scm_sloppy_assq (groups scm C) (scan-data T))
-(scm_sloppy_assv (groups scm C) (scan-data T))
-(scm_slot_bound_p (groups scm C) (scan-data T))
-(scm_slot_bound_using_class_p (groups scm C) (scan-data T))
-(scm_slot_exists_p (groups scm C) (scan-data T))
-(scm_slot_exists_using_class_p (groups scm C) (scan-data T))
-(scm_slot_ref (groups scm C) (scan-data T))
-(scm_slot_ref_using_class (groups scm C) (scan-data T))
-(scm_slot_set_using_class_x (groups scm C) (scan-data T))
-(scm_slot_set_x (groups scm C) (scan-data T))
-(scm_smob_class (groups scm C) (scan-data D))
-(scm_smob_free (groups scm C) (scan-data T))
-(scm_smob_prehistory (groups scm C) (scan-data T))
-(scm_smob_print (groups scm C) (scan-data T))
-(scm_smobs (groups scm C) (scan-data B))
-(scm_socket (groups scm C) (scan-data T))
-(scm_socketpair (groups scm C) (scan-data T))
-(scm_sort (groups scm C) (scan-data T))
-(scm_sort_list (groups scm C) (scan-data T))
-(scm_sort_list_x (groups scm C) (scan-data T))
-(scm_sort_x (groups scm C) (scan-data T))
-(scm_sorted_p (groups scm C) (scan-data T))
-(scm_source_properties (groups scm C) (scan-data T))
-(scm_source_property (groups scm C) (scan-data T))
-(scm_spawn_thread (groups scm C) (scan-data T))
-(scm_srcprops_to_plist (groups scm C) (scan-data T))
-(scm_stable_sort (groups scm C) (scan-data T))
-(scm_stable_sort_x (groups scm C) (scan-data T))
-(scm_stack_checking_enabled_p (groups scm C) (scan-data B))
-(scm_stack_id (groups scm C) (scan-data T))
-(scm_stack_length (groups scm C) (scan-data T))
-(scm_stack_p (groups scm C) (scan-data T))
-(scm_stack_ref (groups scm C) (scan-data T))
-(scm_stack_report (groups scm C) (scan-data T))
-(scm_stack_size (groups scm C) (scan-data T))
-(scm_stack_type (groups scm C) (scan-data B))
-(scm_standard_eval_closure (groups scm C) (scan-data T))
-(scm_standard_interface_eval_closure (groups scm C) (scan-data T))
-(scm_start_stack (groups scm C) (scan-data T))
-(scm_stat (groups scm C) (scan-data T))
-(scm_status_exit_val (groups scm C) (scan-data T))
-(scm_status_stop_sig (groups scm C) (scan-data T))
-(scm_status_term_sig (groups scm C) (scan-data T))
-(scm_str2string (groups scm C) (scan-data T))
-(scm_str2symbol (groups scm C) (scan-data T))
-(scm_strdup (groups scm C) (scan-data T))
-(scm_strerror (groups scm C) (scan-data T))
-(scm_strftime (groups scm C) (scan-data T))
-(scm_string (groups scm C) (scan-data T))
-(scm_string_append (groups scm C) (scan-data T))
-(scm_string_capitalize (groups scm C) (scan-data T))
-(scm_string_capitalize_x (groups scm C) (scan-data T))
-(scm_string_ci_equal_p (groups scm C) (scan-data T))
-(scm_string_ci_geq_p (groups scm C) (scan-data T))
-(scm_string_ci_gr_p (groups scm C) (scan-data T))
-(scm_string_ci_leq_p (groups scm C) (scan-data T))
-(scm_string_ci_less_p (groups scm C) (scan-data T))
-(scm_string_ci_to_symbol (groups scm C) (scan-data T))
-(scm_string_copy (groups scm C) (scan-data T))
-(scm_string_downcase (groups scm C) (scan-data T))
-(scm_string_downcase_x (groups scm C) (scan-data T))
-(scm_string_equal_p (groups scm C) (scan-data T))
-(scm_string_fill_x (groups scm C) (scan-data T))
-(scm_string_geq_p (groups scm C) (scan-data T))
-(scm_string_gr_p (groups scm C) (scan-data T))
-(scm_string_hash (groups scm C) (scan-data T))
-(scm_string_index (groups scm C) (scan-data T))
-(scm_string_length (groups scm C) (scan-data T))
-(scm_string_leq_p (groups scm C) (scan-data T))
-(scm_string_less_p (groups scm C) (scan-data T))
-(scm_string_null_p (groups scm C) (scan-data T))
-(scm_string_p (groups scm C) (scan-data T))
-(scm_string_ref (groups scm C) (scan-data T))
-(scm_string_rindex (groups scm C) (scan-data T))
-(scm_string_set_x (groups scm C) (scan-data T))
-(scm_string_split (groups scm C) (scan-data T))
-(scm_string_to_list (groups scm C) (scan-data T))
-(scm_string_to_number (groups scm C) (scan-data T))
-(scm_string_to_symbol (groups scm C) (scan-data T))
-(scm_string_upcase (groups scm C) (scan-data T))
-(scm_string_upcase_x (groups scm C) (scan-data T))
-(scm_strndup (groups scm C) (scan-data T))
-(scm_strport_to_string (groups scm C) (scan-data T))
-(scm_strptime (groups scm C) (scan-data T))
-(scm_struct_create_handle (groups scm C) (scan-data T))
-(scm_struct_free_0 (groups scm C) (scan-data T))
-(scm_struct_free_entity (groups scm C) (scan-data T))
-(scm_struct_free_light (groups scm C) (scan-data T))
-(scm_struct_free_standard (groups scm C) (scan-data T))
-(scm_struct_ihashq (groups scm C) (scan-data T))
-(scm_struct_p (groups scm C) (scan-data T))
-(scm_struct_prehistory (groups scm C) (scan-data T))
-(scm_struct_ref (groups scm C) (scan-data T))
-(scm_struct_set_x (groups scm C) (scan-data T))
-(scm_struct_table (groups scm C) (scan-data B))
-(scm_struct_vtable (groups scm C) (scan-data T))
-(scm_struct_vtable_name (groups scm C) (scan-data T))
-(scm_struct_vtable_p (groups scm C) (scan-data T))
-(scm_struct_vtable_tag (groups scm C) (scan-data T))
-(scm_structs_to_free (groups scm C) (scan-data B))
-(scm_subr_p (groups scm C) (scan-data T))
-(scm_subr_table (groups scm C) (scan-data B))
-(scm_subr_table_room (groups scm C) (scan-data D))
-(scm_subr_table_size (groups scm C) (scan-data D))
-(scm_substring (groups scm C) (scan-data T))
-(scm_substring_fill_x (groups scm C) (scan-data T))
-(scm_substring_move_x (groups scm C) (scan-data T))
-(scm_sum (groups scm C) (scan-data T))
-(scm_swap_bindings (groups scm C) (scan-data T))
-(scm_swap_fluids (groups scm C) (scan-data T))
-(scm_swap_fluids_reverse (groups scm C) (scan-data T))
-(scm_switch_counter (groups scm C) (scan-data D))
-(scm_sym2var (groups scm C) (scan-data T))
-(scm_sym_and (groups scm C) (scan-data B))
-(scm_sym_apply (groups scm C) (scan-data B))
-(scm_sym_apply_frame (groups scm C) (scan-data B))
-(scm_sym_arity (groups scm C) (scan-data B))
-(scm_sym_arrow (groups scm C) (scan-data B))
-(scm_sym_at_call_with_values (groups scm C) (scan-data B))
-(scm_sym_atapply (groups scm C) (scan-data B))
-(scm_sym_atcall_cc (groups scm C) (scan-data B))
-(scm_sym_begin (groups scm C) (scan-data B))
-(scm_sym_breakpoint (groups scm C) (scan-data B))
-(scm_sym_case (groups scm C) (scan-data B))
-(scm_sym_column (groups scm C) (scan-data B))
-(scm_sym_cond (groups scm C) (scan-data B))
-(scm_sym_copy (groups scm C) (scan-data B))
-(scm_sym_define (groups scm C) (scan-data B))
-(scm_sym_delay (groups scm C) (scan-data B))
-(scm_sym_do (groups scm C) (scan-data B))
-(scm_sym_dot (groups scm C) (scan-data B))
-(scm_sym_else (groups scm C) (scan-data B))
-(scm_sym_enter_frame (groups scm C) (scan-data B))
-(scm_sym_exit_frame (groups scm C) (scan-data B))
-(scm_sym_filename (groups scm C) (scan-data B))
-(scm_sym_if (groups scm C) (scan-data B))
-(scm_sym_lambda (groups scm C) (scan-data B))
-(scm_sym_let (groups scm C) (scan-data B))
-(scm_sym_letrec (groups scm C) (scan-data B))
-(scm_sym_letstar (groups scm C) (scan-data B))
-(scm_sym_line (groups scm C) (scan-data B))
-(scm_sym_name (groups scm C) (scan-data B))
-(scm_sym_or (groups scm C) (scan-data B))
-(scm_sym_quasiquote (groups scm C) (scan-data B))
-(scm_sym_quote (groups scm C) (scan-data B))
-(scm_sym_set_x (groups scm C) (scan-data B))
-(scm_sym_system_procedure (groups scm C) (scan-data B))
-(scm_sym_trace (groups scm C) (scan-data B))
-(scm_sym_unquote (groups scm C) (scan-data B))
-(scm_sym_uq_splicing (groups scm C) (scan-data B))
-(scm_symbol_fref (groups scm C) (scan-data T))
-(scm_symbol_fset_x (groups scm C) (scan-data T))
-(scm_symbol_hash (groups scm C) (scan-data T))
-(scm_symbol_interned_p (groups scm C) (scan-data T))
-(scm_symbol_p (groups scm C) (scan-data T))
-(scm_symbol_pref (groups scm C) (scan-data T))
-(scm_symbol_pset_x (groups scm C) (scan-data T))
-(scm_symbol_to_string (groups scm C) (scan-data T))
-(scm_symbols_prehistory (groups scm C) (scan-data T))
-(scm_symlink (groups scm C) (scan-data T))
-(scm_sync (groups scm C) (scan-data T))
-(scm_sys_allocate_instance (groups scm C) (scan-data T))
-(scm_sys_atan2 (groups scm C) (scan-data T))
-(scm_sys_compute_applicable_methods (groups scm C) (scan-data T))
-(scm_sys_compute_slots (groups scm C) (scan-data T))
-(scm_sys_expt (groups scm C) (scan-data T))
-(scm_sys_fast_slot_ref (groups scm C) (scan-data T))
-(scm_sys_fast_slot_set_x (groups scm C) (scan-data T))
-(scm_sys_inherit_magic_x (groups scm C) (scan-data T))
-(scm_sys_initialize_object (groups scm C) (scan-data T))
-(scm_sys_invalidate_class (groups scm C) (scan-data T))
-(scm_sys_invalidate_method_cache_x (groups scm C) (scan-data T))
-(scm_sys_library_dir (groups scm C) (scan-data T))
-(scm_sys_make_void_port (groups scm C) (scan-data T))
-(scm_sys_method_more_specific_p (groups scm C) (scan-data T))
-(scm_sys_modify_class (groups scm C) (scan-data T))
-(scm_sys_modify_instance (groups scm C) (scan-data T))
-(scm_sys_package_data_dir (groups scm C) (scan-data T))
-(scm_sys_prep_layout_x (groups scm C) (scan-data T))
-(scm_sys_protects (groups scm C) (scan-data B))
-(scm_sys_search_load_path (groups scm C) (scan-data T))
-(scm_sys_set_object_setter_x (groups scm C) (scan-data T))
-(scm_sys_site_dir (groups scm C) (scan-data T))
-(scm_sys_tag_body (groups scm C) (scan-data T))
-(scm_syserror (groups scm C) (scan-data T))
-(scm_syserror_msg (groups scm C) (scan-data T))
-(scm_system (groups scm C) (scan-data T))
-(scm_system_async (groups scm C) (scan-data T))
-(scm_system_async_mark (groups scm C) (scan-data T))
-(scm_system_async_mark_from_signal_handler (groups scm C) (scan-data T))
-(scm_system_environment (groups scm C) (scan-data B))
-(scm_system_error_key (groups scm C) (scan-data B))
-(scm_system_module_env_p (groups scm C) (scan-data T))
-(scm_tables_prehistory (groups scm C) (scan-data T))
-(scm_take0str (groups scm C) (scan-data T))
-(scm_take_from_input_buffers (groups scm C) (scan-data T))
-(scm_take_str (groups scm C) (scan-data T))
-(scm_tc16_allocated (groups scm C) (scan-data B))
-(scm_tc16_array (groups scm C) (scan-data B))
-(scm_tc16_condvar (groups scm C) (scan-data B))
-(scm_tc16_continuation (groups scm C) (scan-data B))
-(scm_tc16_debugobj (groups scm C) (scan-data B))
-(scm_tc16_dir (groups scm C) (scan-data B))
-(scm_tc16_dynamic_obj (groups scm C) (scan-data B))
-(scm_tc16_environment (groups scm C) (scan-data B))
-(scm_tc16_eval_closure (groups scm C) (scan-data B))
-(scm_tc16_fluid (groups scm C) (scan-data B))
-(scm_tc16_fport (groups scm C) (scan-data B))
-(scm_tc16_hook (groups scm C) (scan-data B))
-(scm_tc16_keyword (groups scm C) (scan-data B))
-(scm_tc16_macro (groups scm C) (scan-data B))
-(scm_tc16_malloc (groups scm C) (scan-data B))
-(scm_tc16_memoized (groups scm C) (scan-data B))
-(scm_tc16_mutex (groups scm C) (scan-data B))
-(scm_tc16_observer (groups scm C) (scan-data B))
-(scm_tc16_port_with_ps (groups scm C) (scan-data B))
-(scm_tc16_promise (groups scm C) (scan-data B))
-(scm_tc16_regex (groups scm C) (scan-data B))
-(scm_tc16_root (groups scm C) (scan-data B))
-(scm_tc16_rstate (groups scm C) (scan-data B))
-(scm_tc16_srcprops (groups scm C) (scan-data B))
-(scm_tc16_strport (groups scm C) (scan-data B))
-(scm_tc16_thread (groups scm C) (scan-data B))
-(scm_tc16_void_port (groups scm C) (scan-data D))
-(scm_tcgetpgrp (groups scm C) (scan-data T))
-(scm_tcsetpgrp (groups scm C) (scan-data T))
-(scm_the_last_stack_fluid_var (groups scm C) (scan-data B))
-(scm_the_rng (groups scm C) (scan-data B))
-(scm_thread_count (groups scm C) (scan-data D))
-(scm_thread_sleep (groups scm C) (scan-data T))
-(scm_thread_usleep (groups scm C) (scan-data T))
-(scm_threads_init (groups scm C) (scan-data T))
-(scm_threads_mark_stacks (groups scm C) (scan-data T))
-(scm_throw (groups scm C) (scan-data T))
-(scm_thunk_p (groups scm C) (scan-data T))
-(scm_times (groups scm C) (scan-data T))
-(scm_tmpnam (groups scm C) (scan-data T))
-(scm_top_level_env (groups scm C) (scan-data T))
-(scm_transpose_array (groups scm C) (scan-data T))
-(scm_truncate (groups scm C) (scan-data T))
-(scm_truncate_file (groups scm C) (scan-data T))
-(scm_try_arbiter (groups scm C) (scan-data T))
-(scm_ttyname (groups scm C) (scan-data T))
-(scm_type_eval_environment (groups scm C) (scan-data D))
-(scm_type_export_environment (groups scm C) (scan-data D))
-(scm_type_import_environment (groups scm C) (scan-data D))
-(scm_type_leaf_environment (groups scm C) (scan-data D))
-(scm_tzset (groups scm C) (scan-data T))
-(scm_uint2num (groups scm C) (scan-data T))
-(scm_ulong2num (groups scm C) (scan-data T))
-(scm_ulong_long2num (groups scm C) (scan-data T))
-(scm_umask (groups scm C) (scan-data T))
-(scm_uname (groups scm C) (scan-data T))
-(scm_ungetc (groups scm C) (scan-data T))
-(scm_ungets (groups scm C) (scan-data T))
-(scm_uniform_array_read_x (groups scm C) (scan-data T))
-(scm_uniform_array_write (groups scm C) (scan-data T))
-(scm_uniform_element_size (groups scm C) (scan-data T))
-(scm_uniform_vector_length (groups scm C) (scan-data T))
-(scm_uniform_vector_ref (groups scm C) (scan-data T))
-(scm_unlock_mutex (groups scm C) (scan-data T))
-(scm_unmask_signals (groups scm C) (scan-data T))
-(scm_unmemocar (groups scm C) (scan-data T))
-(scm_unmemocopy (groups scm C) (scan-data T))
-(scm_unmemoize (groups scm C) (scan-data T))
-(scm_unread_char (groups scm C) (scan-data T))
-(scm_unread_string (groups scm C) (scan-data T))
-(scm_upcase (groups scm C) (scan-data T))
-(scm_usage_name (groups scm C) (scan-data D))
-(scm_ushort2num (groups scm C) (scan-data T))
-(scm_usleep (groups scm C) (scan-data T))
-(scm_utime (groups scm C) (scan-data T))
-(scm_valid_object_procedure_p (groups scm C) (scan-data T))
-(scm_valid_oport_value_p (groups scm C) (scan-data T))
-(scm_values (groups scm C) (scan-data T))
-(scm_values_vtable (groups scm C) (scan-data B))
-(scm_var_random_state (groups scm C) (scan-data B))
-(scm_variable_bound_p (groups scm C) (scan-data T))
-(scm_variable_p (groups scm C) (scan-data T))
-(scm_variable_ref (groups scm C) (scan-data T))
-(scm_variable_set_x (groups scm C) (scan-data T))
-(scm_vector (groups scm C) (scan-data T))
-(scm_vector_equal_p (groups scm C) (scan-data T))
-(scm_vector_fill_x (groups scm C) (scan-data T))
-(scm_vector_length (groups scm C) (scan-data T))
-(scm_vector_move_left_x (groups scm C) (scan-data T))
-(scm_vector_move_right_x (groups scm C) (scan-data T))
-(scm_vector_p (groups scm C) (scan-data T))
-(scm_vector_ref (groups scm C) (scan-data T))
-(scm_vector_set_x (groups scm C) (scan-data T))
-(scm_vector_to_list (groups scm C) (scan-data T))
-(scm_version (groups scm C) (scan-data T))
-(scm_void_port (groups scm C) (scan-data T))
-(scm_wait_condition_variable (groups scm C) (scan-data T))
-(scm_waitpid (groups scm C) (scan-data T))
-(scm_weak_key_hash_table_p (groups scm C) (scan-data T))
-(scm_weak_value_hash_table_p (groups scm C) (scan-data T))
-(scm_weak_vector (groups scm C) (scan-data T))
-(scm_weak_vector_p (groups scm C) (scan-data T))
-(scm_weak_vectors (groups scm C) (scan-data B))
-(scm_weaks_prehistory (groups scm C) (scan-data T))
-(scm_with_fluids (groups scm C) (scan-data T))
-(scm_with_traps (groups scm C) (scan-data T))
-(scm_wrap_component (groups scm C) (scan-data T))
-(scm_wrap_object (groups scm C) (scan-data T))
-(scm_write (groups scm C) (scan-data T))
-(scm_write_char (groups scm C) (scan-data T))
-(scm_write_line (groups scm C) (scan-data T))
-(scm_write_string_partial (groups scm C) (scan-data T))
-(scm_wrong_num_args (groups scm C) (scan-data T))
-(scm_wrong_type_arg (groups scm C) (scan-data T))
-(scm_wrong_type_arg_msg (groups scm C) (scan-data T))
-(scm_yield (groups scm C) (scan-data T))
-(scm_your_base (groups scm C) (scan-data D))
-(scm_zero_p (groups scm C) (scan-data T))
-(search-path (groups Scheme) (scan-data "#<primitive-procedure search-path>"))
-(seed->random-state (groups Scheme) (scan-data "#<primitive-procedure seed->random-state>"))
-(seek (groups Scheme) (scan-data "#<primitive-procedure seek>"))
-(select (groups POSIX Scheme) (scan-data "#<primitive-procedure select>"))
-(send (groups Scheme) (scan-data "#<primitive-procedure send>"))
-(sendto (groups Scheme) (scan-data "#<primitive-procedure sendto>"))
-(servent:aliases (groups Scheme) (scan-data "#<procedure servent:aliases (obj)>"))
-(servent:name (groups Scheme) (scan-data "#<procedure servent:name (obj)>"))
-(servent:port (groups Scheme) (scan-data "#<procedure servent:port (obj)>"))
-(servent:proto (groups Scheme) (scan-data "#<procedure servent:proto (obj)>"))
-(set! (groups Scheme) (scan-data ""))
-(set-autoloaded! (groups Scheme) (scan-data "#<procedure set-autoloaded! (p m done?)>"))
-(set-batch-mode?! (groups Scheme) (scan-data "#<procedure set-batch-mode?! (arg)>"))
-(set-car! (groups Scheme) (scan-data "#<primitive-procedure set-car!>"))
-(set-cdr! (groups Scheme) (scan-data "#<primitive-procedure set-cdr!>"))
-(set-current-error-port (groups Scheme) (scan-data "#<primitive-procedure set-current-error-port>"))
-(set-current-input-port (groups Scheme) (scan-data "#<primitive-procedure set-current-input-port>"))
-(set-current-module (groups Scheme) (scan-data "#<primitive-procedure set-current-module>"))
-(set-current-output-port (groups Scheme) (scan-data "#<primitive-procedure set-current-output-port>"))
-(set-defmacro-transformer! (groups Scheme) (scan-data "#<procedure set-defmacro-transformer! (m t)>"))
-(set-module-binder! (groups Scheme) (scan-data "#<procedure set-module-binder! (obj val)>"))
-(set-module-eval-closure! (groups Scheme) (scan-data "#<procedure set-module-eval-closure! (module closure)>"))
-(set-module-kind! (groups Scheme) (scan-data "#<procedure set-module-kind! (obj val)>"))
-(set-module-name! (groups Scheme) (scan-data "#<procedure set-module-name! (obj val)>"))
-(set-module-obarray! (groups Scheme) (scan-data "#<procedure set-module-obarray! (obj val)>"))
-(set-module-observer-id! (groups Scheme) (scan-data "#<procedure set-module-observer-id! (obj val)>"))
-(set-module-observers! (groups Scheme) (scan-data "#<procedure set-module-observers! (obj val)>"))
-(set-module-public-interface! (groups Scheme) (scan-data "#<procedure set-module-public-interface! (m i)>"))
-(set-module-transformer! (groups Scheme) (scan-data "#<procedure set-module-transformer! (obj val)>"))
-(set-module-uses! (groups Scheme) (scan-data "#<procedure set-module-uses! (obj val)>"))
-(set-object-procedure! (groups Scheme) (scan-data "#<primitive-procedure set-object-procedure!>"))
-(set-object-properties! (groups Scheme) (scan-data "#<primitive-procedure set-object-properties!>"))
-(set-object-property! (groups Scheme) (scan-data "#<primitive-procedure set-object-property!>"))
-(set-port-column! (groups Scheme) (scan-data "#<primitive-procedure set-port-column!>"))
-(set-port-filename! (groups Scheme) (scan-data "#<primitive-procedure set-port-filename!>"))
-(set-port-line! (groups Scheme) (scan-data "#<primitive-procedure set-port-line!>"))
-(set-port-revealed! (groups POSIX Scheme) (scan-data "#<primitive-procedure set-port-revealed!>"))
-(set-procedure-properties! (groups Scheme) (scan-data "#<primitive-procedure set-procedure-properties!>"))
-(set-procedure-property! (groups Scheme) (scan-data "#<primitive-procedure set-procedure-property!>"))
-(set-repl-prompt! (groups Scheme) (scan-data "#<procedure set-repl-prompt! (v)>"))
-(set-source-properties! (groups Scheme) (scan-data "#<primitive-procedure set-source-properties!>"))
-(set-source-property! (groups Scheme) (scan-data "#<primitive-procedure set-source-property!>"))
-(set-struct-vtable-name! (groups Scheme) (scan-data "#<primitive-procedure set-struct-vtable-name!>"))
-(set-symbol-property! (groups Scheme) (scan-data "#<procedure set-symbol-property! (sym prop val)>"))
-(set-system-module! (groups Scheme) (scan-data "#<procedure set-system-module! (m s)>"))
-(set-tm:gmtoff (groups POSIX Scheme) (scan-data "#<procedure set-tm:gmtoff (obj val)>"))
-(set-tm:hour (groups POSIX Scheme) (scan-data "#<procedure set-tm:hour (obj val)>"))
-(set-tm:isdst (groups POSIX Scheme) (scan-data "#<procedure set-tm:isdst (obj val)>"))
-(set-tm:mday (groups POSIX Scheme) (scan-data "#<procedure set-tm:mday (obj val)>"))
-(set-tm:min (groups POSIX Scheme) (scan-data "#<procedure set-tm:min (obj val)>"))
-(set-tm:mon (groups POSIX Scheme) (scan-data "#<procedure set-tm:mon (obj val)>"))
-(set-tm:sec (groups POSIX Scheme) (scan-data "#<procedure set-tm:sec (obj val)>"))
-(set-tm:wday (groups POSIX Scheme) (scan-data "#<procedure set-tm:wday (obj val)>"))
-(set-tm:yday (groups POSIX Scheme) (scan-data "#<procedure set-tm:yday (obj val)>"))
-(set-tm:year (groups POSIX Scheme) (scan-data "#<procedure set-tm:year (obj val)>"))
-(set-tm:zone (groups POSIX Scheme) (scan-data "#<procedure set-tm:zone (obj val)>"))
-(setegid (groups POSIX Scheme) (scan-data "#<primitive-procedure setegid>"))
-(setenv (groups POSIX Scheme) (scan-data "#<procedure setenv (name value)>"))
-(seteuid (groups POSIX Scheme) (scan-data "#<primitive-procedure seteuid>"))
-(setgid (groups POSIX Scheme) (scan-data "#<primitive-procedure setgid>"))
-(setgr (groups POSIX Scheme) (scan-data "#<primitive-procedure setgr>"))
-(setgrent (groups POSIX Scheme) (scan-data "#<procedure setgrent ()>"))
-(sethost (groups Scheme) (scan-data "#<primitive-procedure sethost>"))
-(sethostent (groups Scheme) (scan-data "#<procedure sethostent stayopen>"))
-(sethostname (groups POSIX Scheme) (scan-data "#<primitive-procedure sethostname>"))
-(setitimer (groups POSIX Scheme) (scan-data "#<primitive-procedure setitimer>"))
-(setlocale (groups POSIX Scheme) (scan-data "#<primitive-procedure setlocale>"))
-(setnet (groups Scheme) (scan-data "#<primitive-procedure setnet>"))
-(setnetent (groups Scheme) (scan-data "#<procedure setnetent stayopen>"))
-(setpgid (groups POSIX Scheme) (scan-data "#<primitive-procedure setpgid>"))
-(setpriority (groups POSIX Scheme) (scan-data "#<primitive-procedure setpriority>"))
-(setproto (groups Scheme) (scan-data "#<primitive-procedure setproto>"))
-(setprotoent (groups Scheme) (scan-data "#<procedure setprotoent stayopen>"))
-(setpw (groups POSIX Scheme) (scan-data "#<primitive-procedure setpw>"))
-(setpwent (groups POSIX Scheme) (scan-data "#<procedure setpwent ()>"))
-(setserv (groups Scheme) (scan-data "#<primitive-procedure setserv>"))
-(setservent (groups Scheme) (scan-data "#<procedure setservent stayopen>"))
-(setsid (groups POSIX Scheme) (scan-data "#<primitive-procedure setsid>"))
-(setsockopt (groups Scheme) (scan-data "#<primitive-procedure setsockopt>"))
-(setter (groups Scheme) (scan-data "#<primitive-procedure setter>"))
-(setuid (groups POSIX Scheme) (scan-data "#<primitive-procedure setuid>"))
-(setvbuf (groups POSIX Scheme) (scan-data "#<primitive-procedure setvbuf>"))
-(shared-array-increments (groups Scheme) (scan-data "#<primitive-procedure shared-array-increments>"))
-(shared-array-offset (groups Scheme) (scan-data "#<primitive-procedure shared-array-offset>"))
-(shared-array-root (groups Scheme) (scan-data "#<primitive-procedure shared-array-root>"))
-(shutdown (groups Scheme) (scan-data "#<primitive-procedure shutdown>"))
-(sigaction (groups POSIX Scheme) (scan-data "#<primitive-procedure sigaction>"))
-(signal-condition-variable (groups Scheme) (scan-data "#<primitive-procedure signal-condition-variable>"))
-(signal-handlers (groups Scheme) (scan-data ""))
-(simple-format (groups Scheme) (scan-data "#<primitive-procedure simple-format>"))
-(sin (groups Scheme) (scan-data "#<procedure sin (z)>"))
-(single-active-thread? (groups Scheme) (scan-data "#<primitive-procedure single-active-thread?>"))
-(sinh (groups Scheme) (scan-data "#<procedure sinh (z)>"))
-(sleep (groups POSIX Scheme) (scan-data "#<primitive-procedure sleep>"))
-(sloppy-assoc (groups Scheme) (scan-data "#<primitive-procedure sloppy-assoc>"))
-(sloppy-assq (groups Scheme) (scan-data "#<primitive-procedure sloppy-assq>"))
-(sloppy-assv (groups Scheme) (scan-data "#<primitive-procedure sloppy-assv>"))
-(sockaddr:addr (groups Scheme) (scan-data "#<procedure sockaddr:addr (obj)>"))
-(sockaddr:fam (groups Scheme) (scan-data "#<procedure sockaddr:fam (obj)>"))
-(sockaddr:path (groups Scheme) (scan-data "#<procedure sockaddr:path (obj)>"))
-(sockaddr:port (groups Scheme) (scan-data "#<procedure sockaddr:port (obj)>"))
-(socket (groups Scheme) (scan-data "#<primitive-procedure socket>"))
-(socketpair (groups Scheme) (scan-data "#<primitive-procedure socketpair>"))
-(sort (groups Scheme) (scan-data "#<primitive-procedure sort>"))
-(sort! (groups Scheme) (scan-data "#<primitive-procedure sort!>"))
-(sort-list (groups Scheme) (scan-data "#<primitive-procedure sort-list>"))
-(sort-list! (groups Scheme) (scan-data "#<primitive-procedure sort-list!>"))
-(sorted? (groups Scheme) (scan-data "#<primitive-procedure sorted?>"))
-(source-properties (groups Scheme) (scan-data "#<primitive-procedure source-properties>"))
-(source-property (groups Scheme) (scan-data "#<primitive-procedure source-property>"))
-(source-whash (groups Scheme) (scan-data ""))
-(sqrt (groups Scheme) (scan-data "#<procedure sqrt (z)>"))
-(stable-sort (groups Scheme) (scan-data "#<primitive-procedure stable-sort>"))
-(stable-sort! (groups Scheme) (scan-data "#<primitive-procedure stable-sort!>"))
-(stack-id (groups Scheme) (scan-data "#<primitive-procedure stack-id>"))
-(stack-length (groups Scheme) (scan-data "#<primitive-procedure stack-length>"))
-(stack-ref (groups Scheme) (scan-data "#<primitive-procedure stack-ref>"))
-(stack-saved? (groups Scheme) (scan-data ""))
-(stack? (groups Scheme) (scan-data "#<primitive-procedure stack?>"))
-(standard-eval-closure (groups Scheme) (scan-data "#<primitive-procedure standard-eval-closure>"))
-(standard-interface-eval-closure (groups Scheme) (scan-data "#<primitive-procedure standard-interface-eval-closure>"))
-(start-stack (groups Scheme) (scan-data ""))
-(stat (groups POSIX Scheme) (scan-data "#<primitive-procedure stat>"))
-(stat:atime (groups POSIX Scheme) (scan-data "#<procedure stat:atime (f)>"))
-(stat:blksize (groups POSIX Scheme) (scan-data "#<procedure stat:blksize (f)>"))
-(stat:blocks (groups POSIX Scheme) (scan-data "#<procedure stat:blocks (f)>"))
-(stat:ctime (groups POSIX Scheme) (scan-data "#<procedure stat:ctime (f)>"))
-(stat:dev (groups POSIX Scheme) (scan-data "#<procedure stat:dev (f)>"))
-(stat:gid (groups POSIX Scheme) (scan-data "#<procedure stat:gid (f)>"))
-(stat:ino (groups POSIX Scheme) (scan-data "#<procedure stat:ino (f)>"))
-(stat:mode (groups POSIX Scheme) (scan-data "#<procedure stat:mode (f)>"))
-(stat:mtime (groups POSIX Scheme) (scan-data "#<procedure stat:mtime (f)>"))
-(stat:nlink (groups POSIX Scheme) (scan-data "#<procedure stat:nlink (f)>"))
-(stat:perms (groups POSIX Scheme) (scan-data "#<procedure stat:perms (f)>"))
-(stat:rdev (groups POSIX Scheme) (scan-data "#<procedure stat:rdev (f)>"))
-(stat:size (groups POSIX Scheme) (scan-data "#<procedure stat:size (f)>"))
-(stat:type (groups POSIX Scheme) (scan-data "#<procedure stat:type (f)>"))
-(stat:uid (groups POSIX Scheme) (scan-data "#<procedure stat:uid (f)>"))
-(status:exit-val (groups POSIX Scheme) (scan-data "#<primitive-procedure status:exit-val>"))
-(status:stop-sig (groups POSIX Scheme) (scan-data "#<primitive-procedure status:stop-sig>"))
-(status:term-sig (groups POSIX Scheme) (scan-data "#<primitive-procedure status:term-sig>"))
-(strerror (groups Scheme) (scan-data "#<primitive-procedure strerror>"))
-(strftime (groups POSIX Scheme) (scan-data "#<primitive-procedure strftime>"))
-(string (groups Scheme) (scan-data "#<primitive-procedure string>"))
-(string->list (groups Scheme) (scan-data "#<primitive-procedure string->list>"))
-(string->number (groups Scheme) (scan-data "#<primitive-procedure string->number>"))
-(string->symbol (groups Scheme) (scan-data "#<primitive-procedure string->symbol>"))
-(string-append (groups Scheme) (scan-data "#<primitive-procedure string-append>"))
-(string-capitalize (groups Scheme) (scan-data "#<primitive-procedure string-capitalize>"))
-(string-capitalize! (groups Scheme) (scan-data "#<primitive-procedure string-capitalize!>"))
-(string-ci->symbol (groups Scheme) (scan-data "#<primitive-procedure string-ci->symbol>"))
-(string-ci<=? (groups Scheme) (scan-data "#<primitive-procedure string-ci<=?>"))
-(string-ci<? (groups Scheme) (scan-data "#<primitive-procedure string-ci<?>"))
-(string-ci=? (groups Scheme) (scan-data "#<primitive-procedure string-ci=?>"))
-(string-ci>=? (groups Scheme) (scan-data "#<primitive-procedure string-ci>=?>"))
-(string-ci>? (groups Scheme) (scan-data "#<primitive-procedure string-ci>?>"))
-(string-copy (groups Scheme) (scan-data "#<primitive-procedure string-copy>"))
-(string-downcase (groups Scheme) (scan-data "#<primitive-procedure string-downcase>"))
-(string-downcase! (groups Scheme) (scan-data "#<primitive-procedure string-downcase!>"))
-(string-fill! (groups Scheme) (scan-data "#<primitive-procedure string-fill!>"))
-(string-index (groups Scheme) (scan-data "#<primitive-procedure string-index>"))
-(string-length (groups Scheme) (scan-data "#<primitive-procedure string-length>"))
-(string-null? (groups Scheme) (scan-data "#<primitive-procedure string-null?>"))
-(string-ref (groups Scheme) (scan-data "#<primitive-procedure string-ref>"))
-(string-rindex (groups Scheme) (scan-data "#<primitive-procedure string-rindex>"))
-(string-set! (groups Scheme) (scan-data "#<primitive-procedure string-set!>"))
-(string-split (groups Scheme) (scan-data "#<primitive-procedure string-split>"))
-(string-upcase (groups Scheme) (scan-data "#<primitive-procedure string-upcase>"))
-(string-upcase! (groups Scheme) (scan-data "#<primitive-procedure string-upcase!>"))
-(string<=? (groups Scheme) (scan-data "#<primitive-procedure string<=?>"))
-(string<? (groups Scheme) (scan-data "#<primitive-procedure string<?>"))
-(string=? (groups Scheme) (scan-data "#<primitive-procedure string=?>"))
-(string>=? (groups Scheme) (scan-data "#<primitive-procedure string>=?>"))
-(string>? (groups Scheme) (scan-data "#<primitive-procedure string>?>"))
-(string? (groups Scheme) (scan-data "#<primitive-procedure string?>"))
-(strptime (groups POSIX Scheme) (scan-data "#<primitive-procedure strptime>"))
-(struct-layout (groups Scheme) (scan-data "#<procedure struct-layout (s)>"))
-(struct-ref (groups Scheme) (scan-data "#<primitive-procedure struct-ref>"))
-(struct-set! (groups Scheme) (scan-data "#<primitive-procedure struct-set!>"))
-(struct-vtable (groups Scheme) (scan-data "#<primitive-procedure struct-vtable>"))
-(struct-vtable-name (groups Scheme) (scan-data "#<primitive-procedure struct-vtable-name>"))
-(struct-vtable-tag (groups Scheme) (scan-data "#<primitive-procedure struct-vtable-tag>"))
-(struct-vtable? (groups Scheme) (scan-data "#<primitive-procedure struct-vtable?>"))
-(struct? (groups Scheme) (scan-data "#<primitive-procedure struct?>"))
-(substring (groups Scheme) (scan-data "#<primitive-procedure substring>"))
-(substring-fill! (groups Scheme) (scan-data "#<primitive-procedure substring-fill!>"))
-(substring-move! (groups Scheme) (scan-data "#<primitive-procedure substring-move!>"))
-(symbol (groups Scheme) (scan-data "#<procedure symbol args>"))
-(symbol->keyword (groups Scheme) (scan-data "#<procedure symbol->keyword (symbol)>"))
-(symbol->string (groups Scheme) (scan-data "#<primitive-procedure symbol->string>"))
-(symbol-append (groups Scheme) (scan-data "#<procedure symbol-append args>"))
-(symbol-fref (groups Scheme) (scan-data "#<primitive-procedure symbol-fref>"))
-(symbol-fset! (groups Scheme) (scan-data "#<primitive-procedure symbol-fset!>"))
-(symbol-hash (groups Scheme) (scan-data "#<primitive-procedure symbol-hash>"))
-(symbol-interned? (groups Scheme) (scan-data "#<primitive-procedure symbol-interned?>"))
-(symbol-pref (groups Scheme) (scan-data "#<primitive-procedure symbol-pref>"))
-(symbol-prefix-proc (groups Scheme) (scan-data "#<procedure symbol-prefix-proc (prefix)>"))
-(symbol-property (groups Scheme) (scan-data "#<procedure symbol-property (sym prop)>"))
-(symbol-property-remove! (groups Scheme) (scan-data "#<procedure symbol-property-remove! (sym prop)>"))
-(symbol-pset! (groups Scheme) (scan-data "#<primitive-procedure symbol-pset!>"))
-(symbol? (groups Scheme) (scan-data "#<primitive-procedure symbol?>"))
-(symlink (groups POSIX Scheme) (scan-data "#<primitive-procedure symlink>"))
-(sync (groups POSIX Scheme) (scan-data "#<primitive-procedure sync>"))
-(system (groups POSIX Scheme) (scan-data "#<primitive-procedure system>"))
-(system-async (groups Scheme) (scan-data "#<primitive-procedure system-async>"))
-(system-async-mark (groups Scheme) (scan-data "#<primitive-procedure system-async-mark>"))
-(system-error-errno (groups Scheme) (scan-data "#<procedure system-error-errno (args)>"))
-(tan (groups Scheme) (scan-data "#<procedure tan (z)>"))
-(tanh (groups Scheme) (scan-data "#<procedure tanh (z)>"))
-(tcgetpgrp (groups POSIX Scheme) (scan-data "#<primitive-procedure tcgetpgrp>"))
-(tcsetpgrp (groups POSIX Scheme) (scan-data "#<primitive-procedure tcsetpgrp>"))
-(the-environment (groups Scheme) (scan-data ""))
-(the-eof-object (groups Scheme) (scan-data ""))
-(the-last-stack (groups Scheme) (scan-data ""))
-(the-root-environment (groups Scheme) (scan-data ""))
-(the-root-module (groups Scheme) (scan-data ""))
-(the-scm-module (groups Scheme) (scan-data ""))
-(throw (groups Scheme) (scan-data "#<primitive-procedure throw>"))
-(thunk? (groups Scheme) (scan-data "#<primitive-procedure thunk?>"))
-(times (groups POSIX Scheme) (scan-data "#<primitive-procedure times>"))
-(tm:gmtoff (groups POSIX Scheme) (scan-data "#<procedure tm:gmtoff (obj)>"))
-(tm:hour (groups POSIX Scheme) (scan-data "#<procedure tm:hour (obj)>"))
-(tm:isdst (groups POSIX Scheme) (scan-data "#<procedure tm:isdst (obj)>"))
-(tm:mday (groups POSIX Scheme) (scan-data "#<procedure tm:mday (obj)>"))
-(tm:min (groups POSIX Scheme) (scan-data "#<procedure tm:min (obj)>"))
-(tm:mon (groups POSIX Scheme) (scan-data "#<procedure tm:mon (obj)>"))
-(tm:sec (groups POSIX Scheme) (scan-data "#<procedure tm:sec (obj)>"))
-(tm:wday (groups POSIX Scheme) (scan-data "#<procedure tm:wday (obj)>"))
-(tm:yday (groups POSIX Scheme) (scan-data "#<procedure tm:yday (obj)>"))
-(tm:year (groups POSIX Scheme) (scan-data "#<procedure tm:year (obj)>"))
-(tm:zone (groups POSIX Scheme) (scan-data "#<procedure tm:zone (obj)>"))
-(tmpnam (groups POSIX Scheme) (scan-data "#<primitive-procedure tmpnam>"))
-(tms:clock (groups POSIX Scheme) (scan-data "#<procedure tms:clock (obj)>"))
-(tms:cstime (groups POSIX Scheme) (scan-data "#<procedure tms:cstime (obj)>"))
-(tms:cutime (groups POSIX Scheme) (scan-data "#<procedure tms:cutime (obj)>"))
-(tms:stime (groups POSIX Scheme) (scan-data "#<procedure tms:stime (obj)>"))
-(tms:utime (groups POSIX Scheme) (scan-data "#<procedure tms:utime (obj)>"))
-(top-repl (groups Scheme) (scan-data "#<procedure top-repl ()>"))
-(transform-usage-lambda (groups Scheme) (scan-data "#<procedure transform-usage-lambda (cases)>"))
-(transpose-array (groups Scheme) (scan-data "#<primitive-procedure transpose-array>"))
-(trap-disable (groups Scheme) (scan-data "#<procedure trap-disable flags>"))
-(trap-enable (groups Scheme) (scan-data "#<procedure trap-enable flags>"))
-(trap-set! (groups Scheme) (scan-data ""))
-(traps (groups Scheme) (scan-data "#<procedure traps args>"))
-(truncate (groups Scheme) (scan-data "#<primitive-procedure truncate>"))
-(truncate-file (groups Scheme) (scan-data "#<primitive-procedure truncate-file>"))
-(try-arbiter (groups Scheme) (scan-data "#<primitive-procedure try-arbiter>"))
-(try-load-module (groups Scheme) (scan-data "#<procedure try-load-module (name)>"))
-(try-module-autoload (groups Scheme) (scan-data "#<procedure try-module-autoload (module-name)>"))
-(ttyname (groups POSIX Scheme) (scan-data "#<primitive-procedure ttyname>"))
-(turn-on-debugging (groups Scheme) (scan-data "#<procedure turn-on-debugging ()>"))
-(tzset (groups POSIX Scheme) (scan-data "#<primitive-procedure tzset>"))
-(umask (groups POSIX Scheme) (scan-data "#<primitive-procedure umask>"))
-(uname (groups POSIX Scheme) (scan-data "#<primitive-procedure uname>"))
-(undefine (groups Scheme) (scan-data ""))
-(uniform-array-read! (groups Scheme) (scan-data "#<primitive-procedure uniform-array-read!>"))
-(uniform-array-set1! (groups Scheme) (scan-data "#<primitive-procedure uniform-array-set1!>"))
-(uniform-array-write (groups Scheme) (scan-data "#<primitive-procedure uniform-array-write>"))
-(uniform-vector-fill! (groups Scheme) (scan-data "#<primitive-procedure array-fill!>"))
-(uniform-vector-length (groups Scheme) (scan-data "#<primitive-procedure uniform-vector-length>"))
-(uniform-vector-read! (groups Scheme) (scan-data "#<primitive-procedure uniform-array-read!>"))
-(uniform-vector-ref (groups Scheme) (scan-data "#<primitive-procedure uniform-vector-ref>"))
-(uniform-vector-set! (groups Scheme) (scan-data "#<procedure uniform-vector-set! (u i o)>"))
-(uniform-vector-write (groups Scheme) (scan-data "#<primitive-procedure uniform-array-write>"))
-(uniform-vector? (groups Scheme) (scan-data "#<primitive-procedure array?>"))
-(unlock-mutex (groups Scheme) (scan-data "#<primitive-procedure unlock-mutex>"))
-(unmask-signals (groups Scheme) (scan-data "#<primitive-procedure unmask-signals>"))
-(unmemoize (groups Scheme) (scan-data "#<primitive-procedure unmemoize>"))
-(unread-char (groups POSIX Scheme) (scan-data "#<primitive-procedure unread-char>"))
-(unread-string (groups POSIX Scheme) (scan-data "#<primitive-procedure unread-string>"))
-(unsetenv (groups Scheme) (scan-data "#<procedure unsetenv (name)>"))
-(unspecified? (groups Scheme) (scan-data "#<procedure unspecified? (v)>"))
-(use-emacs-interface (groups Scheme) (scan-data ""))
-(use-modules (groups Scheme) (scan-data ""))
-(use-srfis (groups Scheme) (scan-data "#<procedure use-srfis (srfis)>"))
-(use-syntax (groups Scheme) (scan-data ""))
-(using-readline? (groups Scheme) (scan-data "#<procedure-with-setter>"))
-(usleep (groups POSIX Scheme) (scan-data "#<primitive-procedure usleep>"))
-(utime (groups POSIX Scheme) (scan-data "#<primitive-procedure utime>"))
-(utsname:machine (groups POSIX Scheme) (scan-data "#<procedure utsname:machine (obj)>"))
-(utsname:nodename (groups POSIX Scheme) (scan-data "#<procedure utsname:nodename (obj)>"))
-(utsname:release (groups POSIX Scheme) (scan-data "#<procedure utsname:release (obj)>"))
-(utsname:sysname (groups POSIX Scheme) (scan-data "#<procedure utsname:sysname (obj)>"))
-(utsname:version (groups POSIX Scheme) (scan-data "#<procedure utsname:version (obj)>"))
-(valid-object-procedure? (groups Scheme) (scan-data "#<primitive-procedure valid-object-procedure?>"))
-(values (groups Scheme) (scan-data "#<primitive-procedure values>"))
-(variable-bound? (groups Scheme) (scan-data "#<primitive-procedure variable-bound?>"))
-(variable-ref (groups Scheme) (scan-data "#<primitive-procedure variable-ref>"))
-(variable-set! (groups Scheme) (scan-data "#<primitive-procedure variable-set!>"))
-(variable? (groups Scheme) (scan-data "#<primitive-procedure variable?>"))
-(vector (groups Scheme) (scan-data "#<primitive-procedure vector>"))
-(vector->list (groups Scheme) (scan-data "#<primitive-procedure vector->list>"))
-(vector-fill! (groups Scheme) (scan-data "#<primitive-procedure vector-fill!>"))
-(vector-length (groups Scheme) (scan-data "#<primitive-procedure vector-length>"))
-(vector-move-left! (groups Scheme) (scan-data "#<primitive-procedure vector-move-left!>"))
-(vector-move-right! (groups Scheme) (scan-data "#<primitive-procedure vector-move-right!>"))
-(vector-ref (groups Scheme) (scan-data "#<primitive-procedure vector-ref>"))
-(vector-set! (groups Scheme) (scan-data "#<primitive-procedure vector-set!>"))
-(vector? (groups Scheme) (scan-data "#<primitive-procedure vector?>"))
-(version (groups Scheme) (scan-data "#<primitive-procedure version>"))
-(vtable-index-layout (groups Scheme) (scan-data ""))
-(vtable-index-printer (groups Scheme) (scan-data ""))
-(vtable-index-vtable (groups Scheme) (scan-data ""))
-(vtable-offset-user (groups Scheme) (scan-data ""))
-(wait-condition-variable (groups Scheme) (scan-data "#<primitive-procedure wait-condition-variable>"))
-(waitpid (groups POSIX Scheme) (scan-data "#<primitive-procedure waitpid>"))
-(warn (groups Scheme) (scan-data "#<procedure warn stuff>"))
-(weak-key-hash-table? (groups Scheme) (scan-data "#<primitive-procedure weak-key-hash-table?>"))
-(weak-value-hash-table? (groups Scheme) (scan-data "#<primitive-procedure weak-value-hash-table?>"))
-(weak-vector (groups Scheme) (scan-data "#<primitive-procedure weak-vector>"))
-(weak-vector? (groups Scheme) (scan-data "#<primitive-procedure weak-vector?>"))
-(while (groups Scheme) (scan-data ""))
-(with-error-to-file (groups Scheme) (scan-data "#<procedure with-error-to-file (file thunk)>"))
-(with-error-to-port (groups Scheme) (scan-data "#<procedure with-error-to-port (port thunk)>"))
-(with-error-to-string (groups Scheme) (scan-data "#<procedure with-error-to-string (thunk)>"))
-(with-fluids (groups Scheme) (scan-data ""))
-(with-fluids* (groups Scheme) (scan-data "#<primitive-procedure with-fluids*>"))
-(with-input-from-file (groups Scheme) (scan-data "#<procedure with-input-from-file (file thunk)>"))
-(with-input-from-port (groups Scheme) (scan-data "#<procedure with-input-from-port (port thunk)>"))
-(with-input-from-string (groups Scheme) (scan-data "#<procedure with-input-from-string (string thunk)>"))
-(with-output-to-file (groups Scheme) (scan-data "#<procedure with-output-to-file (file thunk)>"))
-(with-output-to-port (groups Scheme) (scan-data "#<procedure with-output-to-port (port thunk)>"))
-(with-output-to-string (groups Scheme) (scan-data "#<procedure with-output-to-string (thunk)>"))
-(with-traps (groups Scheme) (scan-data "#<primitive-procedure with-traps>"))
-(write (groups Scheme) (scan-data "#<primitive-procedure write>"))
-(write-char (groups Scheme) (scan-data "#<primitive-procedure write-char>"))
-(xformer-table (groups Scheme) (scan-data ""))
-(yield (groups Scheme) (scan-data "#<primitive-procedure yield>"))
-(zero? (groups Scheme) (scan-data "#<primitive-procedure zero?>"))
-) ;; end of interface
-) ;; eof
diff --git a/doc/guile.1 b/doc/guile.1
deleted file mode 100644
index ddf3cde1c..000000000
--- a/doc/guile.1
+++ /dev/null
@@ -1,93 +0,0 @@
-.\" Written by Robert Merkel (rgmerk@mira.net)
-.\" augmented by Rob Browning <rlb@cs.utexas.edu>
-.\" Process this file with
-.\" groff -man -Tascii foo.1
-.\"
-.TH GUILE 1 "January 2001" Version "1.4"
-.SH NAME
-guile \- a Scheme interpreter
-.SH SYNOPSIS
-.B guile [-q] [-ds] [--help] [--version] [--emacs] [--debug]
-.B [-l FILE] [-e FUNCTION] [\]
-.B [-c EXPR] [-s SCRIPT] [--]
-.SH DESCRIPTION
-Guile is an interpreter for the Scheme programming language. It
-implements a superset of R4RS, providing the additional features
-necessary for real-world use. It is extremely simple to embed guile
-into a C program, calling C from Scheme and Scheme from C. Guile's
-design makes it very suitable for use as an "extension" or "glue"
-language, but it also works well as a stand-alone scheme development
-environment.
-
-The
-.B guile
-executable itself provides a stand-alone interpreter for scheme
-programs, for either interactive use or executing scripts.
-
-This manpage provides only brief instruction in invoking
-.B guile
-from the command line. Please consult the guile info documentation
-(type
-.B info guile
-at a command prompt) for more information. There is also a tutorial
-.B (info guile-tut)
-available.
-
-.SH OPTIONS
-.IP -l FILE
-Load scheme source code from file.
-.IP -e FUNCTION
-After reading script, apply FUNCTION to command-line arguments
-.IP -ds
-do -s SCRIPT at this point (note that this argument must be used in
-conjuction with -s)
-.IP --help
-Describe command line options and exit
-.IP --debug
-Start guile with debugging evaluator and backtraces enabled
-(useful for debugging guile scripts)
-.IP --version
-Display guile version and exit.
-.IP --emacs
-Enable emacs protocol for use from within emacs (experimental)
-.IP --
-Stop argument processing, start guile in interactive mode.
-.IP -c EXPR
-Stop argument processing, evaluate EXPR as a scheme expression.
-.IP -s SCRIPT-FILE
-Load Scheme source from SCRIPT-FILE and execute as a script.
-
-.SH ENVIRONMENT
-.\".TP \w'MANROFFSEQ\ \ 'u
-.TP
-.B GUILE_LOAD_PATH
-If
-.RB $ GUILE_LOAD_PATH
-is set, its value is used to agument the path to search for scheme
-files when loading. It should be a colon separated list of
-directories which will be prepended to the default %load-path.
-
-.SH FILES
-.I ~/.guile
-is a guile script that is executed before any other processing occurs.
-For example, the following .guile activates guile's readline
-interface:
-
-.RS 4
-(use-modules (ice-9 readline))
-.RS 0
-(activate-readline)
-
-.SH "SEE ALSO"
-.B info guile, info guile-tut
-
-http://www.schemers.org provides a general introduction to the
-Scheme language.
-
-.SH AUTHORS
-Robert Merkel <rgmerk@mira.net> wrote this manpage.
-Rob Browning <rlb@cs.utexas.edu> has added to it.
-
-.B guile
-is GNU software. Guile is originally based on Aubrey Jaffer's
-SCM interpreter, and is the work of many individuals.
diff --git a/doc/hacks.el b/doc/hacks.el
deleted file mode 100644
index c5a3f576b..000000000
--- a/doc/hacks.el
+++ /dev/null
@@ -1,16 +0,0 @@
-;;;; hacks.el --- a few functions to help me work on the manual
-;;;; Jim Blandy <jimb@red-bean.com> --- October 1998
-
-(defun jh-exemplify-region (start end)
- (interactive "r")
- (save-excursion
- (save-restriction
- (narrow-to-region start end)
-
- ;; Texinfo doesn't handle tabs well.
- (untabify (point-min) (point-max))
-
- ;; Quote any characters special to texinfo.
- (goto-char (point-min))
- (while (re-search-forward "[{}@]" nil t)
- (replace-match "@\\&")))))
diff --git a/doc/maint/ChangeLog b/doc/maint/ChangeLog
deleted file mode 100644
index dc3bccbfe..000000000
--- a/doc/maint/ChangeLog
+++ /dev/null
@@ -1,59 +0,0 @@
-2002-07-10 Gary Houston <ghouston@arglist.com>
-
- * docstring.el: optional 2nd environment variable to locate
- built files.
-
-2002-07-09 Gary Houston <ghouston@arglist.com>
-
- * docstring.el: defined caddr, used in several places but missing
- for some reason.
-
-2002-04-02 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * doctring.el: List commands in commentary; nfc.
-
-2002-03-15 Neil Jerram <neil@ossau.uklinux.net>
-
- * guile.texi: Replaced by regenerated libguile version.
-
-2002-03-12 Neil Jerram <neil@ossau.uklinux.net>
-
- * guile.texi: Replaced by regenerated libguile version.
-
-2002-03-08 Neil Jerram <neil@ossau.uklinux.net>
-
- * docstring.el (docstring-libguile-directory,
- docstring-display-location, docstring-show-source): New.
-
-2001-11-16 Neil Jerram <neil@ossau.uklinux.net>
-
- * guile.texi: Replaced by regenerated libguile version.
-
- * docstring.el (make-module-description-list): Exclude @deffn's
- with category {C Function}.
- (docstring-process-alist): Bind key "d" to
- docstring-ediff-this-line in the docstring output buffer.
-
-2001-11-13 Neil Jerram <neil@ossau.uklinux.net>
-
- * guile.texi: Replaced by libguile version (after automatically
- updating docstrings in the reference manual).
-
-2001-11-07 Neil Jerram <neil@ossau.uklinux.net>
-
- * guile.texi: Replaced by libguile version (after automatically
- updating docstrings in the reference manual).
-
- * docstring.el (docstring-manual-directory): Added "/ref" to end.
- (docstring-manual-files): Now calculated automatically, since by
- definition all the .texi files in doc/ref are reference manual
- files.
-
-2001-04-03 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * guile.texi: Automated docstring merging.
-
-2001-03-23 Neil Jerram <neil@ossau.uklinux.net>
-
- * ChangeLog, README, docstring.el, guile.texi: New files.
-
diff --git a/doc/maint/README b/doc/maint/README
deleted file mode 100644
index adfa13f82..000000000
--- a/doc/maint/README
+++ /dev/null
@@ -1,35 +0,0 @@
-README for guile-core/doc/maint -*- text -*-
-
-The files in this directory are used by the maintainers to automate
-the process of updating the Guile reference manual when the docstrings
-in the libguile C source change.
-
-- ChangeLog is the change log for files in this directory.
-
-- README is this file.
-
-- docstring.el is a helpful Emacs Lisp library (see source for
- customization). The two key entry points are:
- `docstring-process-module' and
- `docstring-ediff-this-line'.
-
-- guile.texi is a snapshot of the built file libguile/guile.texi,
- copied last time the reference manual was determined to be in sync
- with the libguile source.
-
-docstring.el requires the setting of an environment variable, e.g.,
-
-export GUILE_MAINTAINER_GUILE_CORE_DIR=$HOME/guile/guile-core
-
-If the build directory differs from the source directory, an additional
-variable is required:
-
-export GUILE_MAINTAINER_BUILD_CORE_DIR=$HOME/guile/guile-core-build
-
-If you've just fixed a docstring in, say, ../libguile/strop.c, do in emacs:
-
- M-x load-file RET .../doc/maint/docstring.el RET
- M-x docstring-process-module RET (guile) RET
-
-Save all modified .texi files and copy the current ../libguile/guile.texi
-to ./guile.texi, then commit. See elisp var `docstring-snarfed-roots'.
diff --git a/doc/maint/docstring.el b/doc/maint/docstring.el
deleted file mode 100644
index a01558fbb..000000000
--- a/doc/maint/docstring.el
+++ /dev/null
@@ -1,622 +0,0 @@
-;;; docstring.el --- utilities for Guile docstring maintenance
-;;;
-;;; Copyright (C) 2001 Neil Jerram
-;;;
-;;; This file is not part of GNU Emacs, but the same permissions apply.
-;;;
-;;; GNU Emacs 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.
-;;;
-;;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the
-;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;;; Boston, MA 02111-1307, USA.
-
-;;; Commentary:
-
-;; The basic premise of these utilities is that - at least in the
-;; short term - we can get a lot of reference manual mileage by
-;; co-opting the docstrings that are snarfed automatically from
-;; Guile's C and Scheme source code. But this leads to problems of
-;; synchronization... How do you track when a docstring has been
-;; updated in the source and so needs updating in the reference
-;; manual. What if a procedure is removed from the Guile source? And
-;; so on. To complicate matters, the exact snarfed docstring text
-;; will probably need to be modified so that it fits into the flow of
-;; the manual section in which it appears. Can we design solutions to
-;; synchronization problems that continue to work even when the manual
-;; text has been enhanced in this way?
-;;
-;; This file implements an approach to this problem that I have found
-;; useful. It involves keeping track of three copies of each
-;; docstring:
-;;
-;; "MANUAL" = the docstring as it appears in the reference manual.
-;;
-;; "SNARFED" = the docstring as snarfed from the current C or Scheme
-;; source.
-;;
-;; "TRACKING" = the docstring as it appears in a tracking file whose
-;; purpose is to record the most recent snarfed docstrings
-;; that are known to be in sync with the reference manual.
-;;
-;; The approaches are as follows.
-;;
-;; 1. Comparison of MANUAL-DOC, SOURCE-DOC and TRACK-DOC, to produce a
-;; summary output buffer in which keystrokes are defined to bring up
-;; detailed comparisons.
-;;
-;; 2. Comparison of MANUAL-DOC, SOURCE-DOC and TRACK-DOC using Ediff.
-;;
-;; Here is a brief list of commands available (via "M-x COMMAND"):
-;;
-;; docstring-process-current-buffer
-;; docstring-process-current-region BEG END
-;; docstring-process-module MODULE
-;; docstring-ediff-this-line
-;; docstring-show-source
-
-
-(defvar guile-core-dir (or (getenv "GUILE_MAINTAINER_GUILE_CORE_DIR")
- (error "GUILE_MAINTAINER_GUILE_CORE_DIR not set"))
- "*Full path of guile-core source directory.")
-
-(defvar guile-build-dir (or (getenv "GUILE_MAINTAINER_BUILD_CORE_DIR")
- guile-core-dir)
- "*Full path of guile-core build directory. Defaults to guile-core-dir.")
-
-(defvar docstring-manual-directory (expand-file-name "doc/ref" guile-core-dir)
- "*The directory containing the Texinfo source for the Guile reference manual.")
-
-(defvar docstring-tracking-root (expand-file-name "doc/maint" guile-core-dir)
- "*Root directory for docstring tracking files. The tracking file
-for module (a b c) is expected to be in the file
-<docstring-tracking-root>/a/b/c.texi.")
-
-(defvar docstring-snarfed-roots (mapcar
- #'(lambda (frag)
- (expand-file-name frag guile-build-dir))
- '("libguile" "ice-9" "oop"))
- "*List of possible root directories for snarfed docstring files.
-For each entry in this list, the snarfed docstring file for module (a
-b c) is looked for in the file <entry>/a/b/c.texi.")
-
-(defvar docstring-manual-files
- (directory-files docstring-manual-directory nil "\\.texi$" t)
- "List of Texinfo source files that comprise the Guile reference manual.")
-
-(defvar docstring-new-docstrings-file "new-docstrings.texi"
- "The name of a file in the Guile reference manual source directory
-to which new docstrings should be added.")
-
-;; Apply FN in turn to each element in the list CANDIDATES until the
-;; first application that returns non-nil.
-(defun or-map (fn candidates args)
- (let ((result nil))
- (while candidates
- (setq result (apply fn (car candidates) args))
- (if result
- (setq result (cons (car candidates) result)
- candidates nil)
- (setq candidates (cdr candidates))))
- result))
-
-;; Return t if the current buffer position is in the scope of the
-;; specified MODULE, as determined by "@c module ..." comments in the
-;; buffer. DEFAULT-OK specifies the return value in the case that
-;; there are no preceding module comments at all.
-(defun docstring-in-module (module default-ok)
- (save-excursion
- (if (re-search-backward "^@c module " nil t)
- (progn
- (search-forward "@c module ")
- (equal module (read (current-buffer))))
- default-ok)))
-
-;; Find a docstring in the specified FILE-NAME for the item in module
-;; MODULE and with description DESCRIPTION. MODULE should be a list
-;; of symbols, Guile-style, for example: '(ice-9 session).
-;; DESCRIPTION should be the string that is expected after the @deffn,
-;; for example "primitive acons" or "syntax let*".
-(defun find-docstring (file-name module description)
- (and (file-exists-p file-name)
- (let ((buf (find-file-noselect file-name))
- (deffn-regexp (concat "^@deffnx? "
- (regexp-quote description)
- "[ \n\t]"))
- found
- result)
- (save-excursion
- (set-buffer buf)
- (goto-char (point-min))
- (while (and (not found)
- (re-search-forward deffn-regexp nil t))
- (save-excursion
- (goto-char (match-beginning 0))
- (beginning-of-line)
- (if (docstring-in-module module t)
- (setq found t))))
- (if found
- (setq result
- (list (current-buffer)
- (progn
- (re-search-backward "^@deffn ")
- (beginning-of-line)
- (point))
- (progn
- (re-search-forward "^@end deffn")
- (forward-line 1)
- (point))))))
- result)))
-
-;; Find the reference manual version of the specified docstring.
-;; MODULE and DESCRIPTION specify the docstring as per
-;; `find-docstring'. The set of files that `find-manual-docstring'
-;; searches is determined by the value of the `docstring-manual-files'
-;; variable.
-(defun find-manual-docstring (module description)
- (let* ((result
- (or-map 'find-docstring
- (mapcar (function (lambda (file-name)
- (concat docstring-manual-directory
- "/"
- file-name)))
- (cons docstring-new-docstrings-file
- docstring-manual-files))
- (list module
- description)))
- (matched-file-name (and (cdr result)
- (file-name-nondirectory (car result)))))
- (if matched-file-name
- (setq docstring-manual-files
- (cons matched-file-name
- (delete matched-file-name docstring-manual-files))))
- (cdr result)))
-
-;; Convert MODULE to a directory subpath.
-(defun module-to-path (module)
- (mapconcat (function (lambda (component)
- (symbol-name component)))
- module
- "/"))
-
-;; Find the current snarfed version of the specified docstring.
-;; MODULE and DESCRIPTION specify the docstring as per
-;; `find-docstring'. The file that `find-snarfed-docstring' looks in
-;; is automatically generated from MODULE.
-(defun find-snarfed-docstring (module description)
- (let ((modpath (module-to-path module)))
- (cdr (or-map (function (lambda (root)
- (find-docstring (concat root
- "/"
- modpath
- ".texi")
- module
- description)))
- docstring-snarfed-roots
- nil))))
-
-;; Find the tracking version of the specified docstring. MODULE and
-;; DESCRIPTION specify the docstring as per `find-docstring'. The
-;; file that `find-tracking-docstring' looks in is automatically
-;; generated from MODULE.
-(defun find-tracking-docstring (module description)
- (find-docstring (concat docstring-tracking-root
- "/"
- (module-to-path module)
- ".texi")
- module
- description))
-
-;; Extract an alist of modules and descriptions from the current
-;; buffer.
-(defun make-module-description-list ()
- (let ((alist nil)
- (module '(guile)))
- (save-excursion
- (goto-char (point-min))
- (while (re-search-forward "^\\(@c module \\|@deffnx? \\({[^}]+}\\|[^ ]+\\) \\([^ \n]+\\)\\)"
- nil
- t)
- (let ((matched (buffer-substring (match-beginning 1)
- (match-end 1))))
- (if (string-equal matched "@c module ")
- (setq module (read (current-buffer)))
- (let ((type (buffer-substring (match-beginning 2)
- (match-end 2))))
- (if (string-equal type "{C Function}")
- nil
- (setq matched
- (concat type
- " "
- (buffer-substring (match-beginning 3)
- (match-end 3))))
- (message "Found docstring: %S: %s" module matched)
- (let ((descriptions (assoc module alist)))
- (setq alist
- (cons (cons module (cons matched (cdr-safe descriptions)))
- (if descriptions
- (delete descriptions alist)
- alist))))))))))
- alist))
-
-;; missing in some environments?
-(defun caddr (list)
- (nth 2 list))
-
-;; Return the docstring from the specified LOCATION. LOCATION is a
-;; list of three elements: buffer, start position and end position.
-(defun location-to-docstring (location)
- (and location
- (save-excursion
- (set-buffer (car location))
- (buffer-substring (cadr location) (caddr location)))))
-
-;; Perform a comparison of the specified docstring. MODULE and
-;; DESCRIPTION are as per usual.
-(defun docstring-compare (module description)
- (let* ((manual-location (find-manual-docstring module description))
- (snarf-location (find-snarfed-docstring module description))
- (track-location (find-tracking-docstring module description))
-
- (manual-docstring (location-to-docstring manual-location))
- (snarf-docstring (location-to-docstring snarf-location))
- (track-docstring (location-to-docstring track-location))
-
- action
- issue)
-
- ;; Decide what to do.
- (cond ((null snarf-location)
- (setq action nil
- issue (if manual-location
- 'consider-removal
- nil)))
-
- ((null manual-location)
- (setq action 'add-to-manual issue nil))
-
- ((null track-location)
- (setq action nil
- issue (if (string-equal manual-docstring snarf-docstring)
- nil
- 'check-needed)))
-
- ((string-equal track-docstring snarf-docstring)
- (setq action nil issue nil))
-
- ((string-equal track-docstring manual-docstring)
- (setq action 'auto-update-manual issue nil))
-
- (t
- (setq action nil issue 'update-needed)))
-
- ;; Return a pair indicating any automatic action that can be
- ;; taken, and any issue for resolution.
- (cons action issue)))
-
-;; Add the specified docstring to the manual.
-(defun docstring-add-to-manual (module description)
- (let ((buf (find-file-noselect (concat docstring-manual-directory
- "/"
- docstring-new-docstrings-file))))
- (save-excursion
- (set-buffer buf)
- (goto-char (point-max))
- (or (docstring-in-module module nil)
- (insert "\n@c module " (prin1-to-string module) "\n"))
- (insert "\n" (location-to-docstring (find-snarfed-docstring module
- description))))))
-
-;; Auto-update the specified docstring in the manual.
-(defun docstring-auto-update-manual (module description)
- (let ((manual-location (find-manual-docstring module description))
- (track-location (find-tracking-docstring module description)))
- (save-excursion
- (set-buffer (car manual-location))
- (goto-char (cadr manual-location))
- (delete-region (cadr manual-location) (caddr manual-location))
- (insert (location-to-docstring (find-snarfed-docstring module
- description))))))
-
-;; Process an alist of modules and descriptions, and produce a summary
-;; buffer describing actions taken and issues to be resolved.
-(defun docstring-process-alist (alist)
- (let (check-needed-list
- update-needed-list
- consider-removal-list
- added-to-manual-list
- auto-updated-manual-list)
-
- (mapcar
- (function (lambda (module-list)
- (let ((module (car module-list)))
- (message "Module: %S" module)
- (mapcar
- (function (lambda (description)
- (message "Comparing docstring: %S: %s" module description)
- (let* ((ai (docstring-compare module description))
- (action (car ai))
- (issue (cdr ai)))
-
- (cond ((eq action 'add-to-manual)
- (docstring-add-to-manual module description)
- (setq added-to-manual-list
- (cons (cons module description)
- added-to-manual-list)))
-
- ((eq action 'auto-update-manual)
- (docstring-auto-update-manual module description)
- (setq auto-updated-manual-list
- (cons (cons module description)
- auto-updated-manual-list))))
-
- (cond ((eq issue 'check-needed)
- (setq check-needed-list
- (cons (cons module description)
- check-needed-list)))
-
- ((eq issue 'update-needed)
- (setq update-needed-list
- (cons (cons module description)
- update-needed-list)))
-
- ((eq issue 'consider-removal)
- (setq consider-removal-list
- (cons (cons module description)
- consider-removal-list)))))))
- (cdr module-list)))))
- alist)
-
- ;; Prepare a buffer describing the results.
- (set-buffer (get-buffer-create "*Docstring Results*"))
- (erase-buffer)
-
- (insert "
-The following items have been automatically added to the manual in
-file `" docstring-manual-directory "/" docstring-new-docstrings-file "'.\n\n")
- (if added-to-manual-list
- (mapcar (function (lambda (moddesc)
- (insert (prin1-to-string (car moddesc))
- ": "
- (cdr moddesc)
- "\n")))
- added-to-manual-list)
- (insert "(none)\n"))
-
- (insert "
-The following items have been automatically updated in the manual.\n\n")
- (if auto-updated-manual-list
- (mapcar (function (lambda (moddesc)
- (insert (prin1-to-string (car moddesc))
- ": "
- (cdr moddesc)
- "\n")))
- auto-updated-manual-list)
- (insert "(none)\n"))
-
- (insert "
-The following items are already documented in the manual but are not
-mentioned in the reference copy of the snarfed docstrings file.
-You should check that the manual documentation matches the docstring
-in the current snarfed docstrings file.\n\n")
- (if check-needed-list
- (mapcar (function (lambda (moddesc)
- (insert (prin1-to-string (car moddesc))
- ": "
- (cdr moddesc)
- "\n")))
- check-needed-list)
- (insert "(none)\n"))
-
- (insert "
-The following items have manual documentation that is different from
-the docstring in the reference copy of the snarfed docstrings file,
-and the snarfed docstring has changed. You need to update the manual
-documentation by hand with reference to the snarfed docstring changes.\n\n")
- (if update-needed-list
- (mapcar (function (lambda (moddesc)
- (insert (prin1-to-string (car moddesc))
- ": "
- (cdr moddesc)
- "\n")))
- update-needed-list)
- (insert "(none)\n"))
-
- (insert "
-The following items are documented in the manual but are no longer
-present in the snarfed docstrings file. You should consider whether
-the existing manual documentation is still pertinent. If it is, its
-docstring module comment may need updating, to connect it with a
-new snarfed docstring file.\n\n")
- (if consider-removal-list
- (mapcar (function (lambda (moddesc)
- (insert (prin1-to-string (car moddesc))
- ": "
- (cdr moddesc)
- "\n")))
- consider-removal-list)
- (insert "(none)\n"))
- (insert "\n")
-
- (goto-char (point-min))
- (local-set-key "d" 'docstring-ediff-this-line)
-
- ;; Popup the issues buffer.
- (let ((pop-up-frames t))
- (set-window-point (display-buffer (current-buffer))
- (point-min)))))
-
-(defun docstring-process-current-buffer ()
- (interactive)
- (docstring-process-alist (make-module-description-list)))
-
-(defun docstring-process-current-region (beg end)
- (interactive "r")
- (narrow-to-region beg end)
- (unwind-protect
- (save-excursion
- (docstring-process-alist (make-module-description-list)))
- (widen)))
-
-(defun docstring-process-module (module)
- (interactive "xModule: ")
- (let ((modpath (module-to-path module))
- (mdlist nil))
- (mapcar (function (lambda (root)
- (let ((fn (concat root
- "/"
- modpath
- ".texi")))
- (if (file-exists-p fn)
- (save-excursion
- (find-file fn)
- (message "Getting docstring list from %s" fn)
- (setq mdlist
- (append mdlist
- (make-module-description-list))))))))
- docstring-snarfed-roots)
- (docstring-process-alist mdlist)))
-
-(defun docstring-ediff-this-line ()
- (interactive)
- (let (module
- description)
- (save-excursion
- (beginning-of-line)
- (setq module (read (current-buffer)))
- (forward-char 2)
- (setq description (buffer-substring (point)
- (progn
- (end-of-line)
- (point)))))
-
- (message "Ediff docstring: %S: %s" module description)
-
- (let ((track-location (or (find-tracking-docstring module description)
- (docstring-temp-location "No docstring in tracking file")))
- (snarf-location (or (find-snarfed-docstring module description)
- (docstring-temp-location "No docstring in snarfed file")))
- (manual-location (or (find-manual-docstring module description)
- (docstring-temp-location "No docstring in manual"))))
-
- (setq docstring-ediff-buffers
- (list (car track-location)
- (car snarf-location)
- (car manual-location)))
-
- (docstring-narrow-to-location track-location)
- (docstring-narrow-to-location snarf-location)
- (docstring-narrow-to-location manual-location)
-
- (add-hook 'ediff-quit-hook 'docstring-widen-ediff-buffers)
-
- (ediff-buffers3 (nth 0 docstring-ediff-buffers)
- (nth 1 docstring-ediff-buffers)
- (nth 2 docstring-ediff-buffers)))))
-
-(defun docstring-narrow-to-location (location)
- (save-excursion
- (set-buffer (car location))
- (narrow-to-region (cadr location) (caddr location))))
-
-(defun docstring-temp-location (str)
- (let ((buf (generate-new-buffer "*Docstring Temp*")))
- (save-excursion
- (set-buffer buf)
- (erase-buffer)
- (insert str "\n")
- (list buf (point-min) (point-max)))))
-
-(require 'ediff)
-
-(defvar docstring-ediff-buffers '())
-
-(defun docstring-widen-ediff-buffers ()
- (remove-hook 'ediff-quit-hook 'docstring-widen-ediff-buffers)
- (save-excursion
- (mapcar (function (lambda (buffer)
- (set-buffer buffer)
- (widen)))
- docstring-ediff-buffers)))
-
-
-;;; Tests:
-
-;(find-docstring "/home/neil/Guile/cvs/guile-core/doc/maint/guile.texi" nil "primitive sloppy-assq")
-;(find-manual-docstring '(guile) "primitive sloppy-assq")
-;(find-tracking-docstring '(guile) "primitive sloppy-assq")
-;(find-snarfed-docstring '(guile) "primitive sloppy-assq")
-
-(defvar docstring-libguile-directory (expand-file-name "libguile"
- guile-core-dir)
- "*The directory containing the C source for libguile.")
-
-(defvar docstring-libguile-build-directory (expand-file-name "libguile"
- guile-build-dir)
- "*The directory containing the libguile build directory.")
-
-(defun docstring-display-location (file line)
- (let ((buffer (find-file-noselect
- (expand-file-name file docstring-libguile-directory))))
- (if buffer
- (let* ((window (or (get-buffer-window buffer)
- (display-buffer buffer)))
- (pos (save-excursion
- (set-buffer buffer)
- (goto-line line)
- (point))))
- (set-window-point window pos)))))
-
-(defun docstring-show-source ()
- "Given that point is sitting in a docstring in one of the Texinfo
-source files for the Guile manual, and that that docstring may be
-snarfed automatically from a libguile C file, determine whether the
-docstring is from libguile and, if it is, display the relevant C file
-at the line from which the docstring was snarfed.
-
-Why? When updating snarfed docstrings, you should usually edit the C
-source rather than the Texinfo source, so that your updates benefit
-Guile's online help as well. This function locates the C source for a
-docstring so that it is easy for you to do this."
- (interactive)
- (let* ((deffn-line
- (save-excursion
- (end-of-line)
- (or (re-search-backward "^@deffn " nil t)
- (error "No docstring here!"))
- (buffer-substring (point)
- (progn
- (end-of-line)
- (point)))))
- (guile-texi-file
- (expand-file-name "guile.texi" docstring-libguile-build-directory))
- (source-location
- (save-excursion
- (set-buffer (find-file-noselect guile-texi-file))
- (save-excursion
- (goto-char (point-min))
- (or (re-search-forward (concat "^"
- (regexp-quote deffn-line)
- "$")
- nil t)
- (error "Docstring not from libguile"))
- (forward-line -1)
- (if (looking-at "^@c snarfed from \\([^:]+\\):\\([0-9]+\\)$")
- (cons (match-string 1)
- (string-to-int (match-string 2)))
- (error "Corrupt docstring entry in guile.texi"))))))
- (docstring-display-location (car source-location)
- (cdr source-location))))
-
-
-(provide 'docstring)
-
-;;; docstring.el ends here
diff --git a/doc/maint/guile.texi b/doc/maint/guile.texi
deleted file mode 100644
index fa8125594..000000000
--- a/doc/maint/guile.texi
+++ /dev/null
@@ -1,7846 +0,0 @@
-
- acons
-@c snarfed from /home/ghouston/guile/guile-core/libguile/alist.c:59
-@deffn {Scheme Procedure} acons key value alist
-@deffnx {C Function} scm_acons (key, value, alist)
-Add a new key-value pair to @var{alist}. A new pair is
-created whose car is @var{key} and whose cdr is @var{value}, and the
-pair is consed onto @var{alist}, and the new list is returned. This
-function is @emph{not} destructive; @var{alist} is not modified.
-@end deffn
-
- sloppy-assq
-@c snarfed from /home/ghouston/guile/guile-core/libguile/alist.c:73
-@deffn {Scheme Procedure} sloppy-assq key alist
-@deffnx {C Function} scm_sloppy_assq (key, alist)
-Behaves like @code{assq} but does not do any error checking.
-Recommended only for use in Guile internals.
-@end deffn
-
- sloppy-assv
-@c snarfed from /home/ghouston/guile/guile-core/libguile/alist.c:91
-@deffn {Scheme Procedure} sloppy-assv key alist
-@deffnx {C Function} scm_sloppy_assv (key, alist)
-Behaves like @code{assv} but does not do any error checking.
-Recommended only for use in Guile internals.
-@end deffn
-
- sloppy-assoc
-@c snarfed from /home/ghouston/guile/guile-core/libguile/alist.c:109
-@deffn {Scheme Procedure} sloppy-assoc key alist
-@deffnx {C Function} scm_sloppy_assoc (key, alist)
-Behaves like @code{assoc} but does not do any error checking.
-Recommended only for use in Guile internals.
-@end deffn
-
- assq
-@c snarfed from /home/ghouston/guile/guile-core/libguile/alist.c:136
-@deffn {Scheme Procedure} assq key alist
-@deffnx {Scheme Procedure} assv key alist
-@deffnx {Scheme Procedure} assoc key alist
-@deffnx {C Function} scm_assq (key, alist)
-Fetch the entry in @var{alist} that is associated with @var{key}. To
-decide whether the argument @var{key} matches a particular entry in
-@var{alist}, @code{assq} compares keys with @code{eq?}, @code{assv}
-uses @code{eqv?} and @code{assoc} uses @code{equal?}. If @var{key}
-cannot be found in @var{alist} (according to whichever equality
-predicate is in use), then return @code{#f}. These functions
-return the entire alist entry found (i.e. both the key and the value).
-@end deffn
-
- assv
-@c snarfed from /home/ghouston/guile/guile-core/libguile/alist.c:157
-@deffn {Scheme Procedure} assv key alist
-@deffnx {C Function} scm_assv (key, alist)
-Behaves like @code{assq} but uses @code{eqv?} for key comparison.
-@end deffn
-
- assoc
-@c snarfed from /home/ghouston/guile/guile-core/libguile/alist.c:178
-@deffn {Scheme Procedure} assoc key alist
-@deffnx {C Function} scm_assoc (key, alist)
-Behaves like @code{assq} but uses @code{equal?} for key comparison.
-@end deffn
-
- assq-ref
-@c snarfed from /home/ghouston/guile/guile-core/libguile/alist.c:222
-@deffn {Scheme Procedure} assq-ref alist key
-@deffnx {Scheme Procedure} assv-ref alist key
-@deffnx {Scheme Procedure} assoc-ref alist key
-@deffnx {C Function} scm_assq_ref (alist, key)
-Like @code{assq}, @code{assv} and @code{assoc}, except that only the
-value associated with @var{key} in @var{alist} is returned. These
-functions are equivalent to
-
-@lisp
-(let ((ent (@var{associator} @var{key} @var{alist})))
- (and ent (cdr ent)))
-@end lisp
-
-where @var{associator} is one of @code{assq}, @code{assv} or @code{assoc}.
-@end deffn
-
- assv-ref
-@c snarfed from /home/ghouston/guile/guile-core/libguile/alist.c:239
-@deffn {Scheme Procedure} assv-ref alist key
-@deffnx {C Function} scm_assv_ref (alist, key)
-Behaves like @code{assq-ref} but uses @code{eqv?} for key comparison.
-@end deffn
-
- assoc-ref
-@c snarfed from /home/ghouston/guile/guile-core/libguile/alist.c:256
-@deffn {Scheme Procedure} assoc-ref alist key
-@deffnx {C Function} scm_assoc_ref (alist, key)
-Behaves like @code{assq-ref} but uses @code{equal?} for key comparison.
-@end deffn
-
- assq-set!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/alist.c:285
-@deffn {Scheme Procedure} assq-set! alist key val
-@deffnx {Scheme Procedure} assv-set! alist key value
-@deffnx {Scheme Procedure} assoc-set! alist key value
-@deffnx {C Function} scm_assq_set_x (alist, key, val)
-Reassociate @var{key} in @var{alist} with @var{value}: find any existing
-@var{alist} entry for @var{key} and associate it with the new
-@var{value}. If @var{alist} does not contain an entry for @var{key},
-add a new one. Return the (possibly new) alist.
-
-These functions do not attempt to verify the structure of @var{alist},
-and so may cause unusual results if passed an object that is not an
-association list.
-@end deffn
-
- assv-set!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/alist.c:303
-@deffn {Scheme Procedure} assv-set! alist key val
-@deffnx {C Function} scm_assv_set_x (alist, key, val)
-Behaves like @code{assq-set!} but uses @code{eqv?} for key comparison.
-@end deffn
-
- assoc-set!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/alist.c:321
-@deffn {Scheme Procedure} assoc-set! alist key val
-@deffnx {C Function} scm_assoc_set_x (alist, key, val)
-Behaves like @code{assq-set!} but uses @code{equal?} for key comparison.
-@end deffn
-
- assq-remove!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/alist.c:345
-@deffn {Scheme Procedure} assq-remove! alist key
-@deffnx {Scheme Procedure} assv-remove! alist key
-@deffnx {Scheme Procedure} assoc-remove! alist key
-@deffnx {C Function} scm_assq_remove_x (alist, key)
-Delete the first entry in @var{alist} associated with @var{key}, and return
-the resulting alist.
-@end deffn
-
- assv-remove!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/alist.c:361
-@deffn {Scheme Procedure} assv-remove! alist key
-@deffnx {C Function} scm_assv_remove_x (alist, key)
-Behaves like @code{assq-remove!} but uses @code{eqv?} for key comparison.
-@end deffn
-
- assoc-remove!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/alist.c:377
-@deffn {Scheme Procedure} assoc-remove! alist key
-@deffnx {C Function} scm_assoc_remove_x (alist, key)
-Behaves like @code{assq-remove!} but uses @code{equal?} for key comparison.
-@end deffn
-
- make-arbiter
-@c snarfed from /home/ghouston/guile/guile-core/libguile/arbiters.c:82
-@deffn {Scheme Procedure} make-arbiter name
-@deffnx {C Function} scm_make_arbiter (name)
-Return an object of type arbiter and name @var{name}. Its
-state is initially unlocked. Arbiters are a way to achieve
-process synchronization.
-@end deffn
-
- try-arbiter
-@c snarfed from /home/ghouston/guile/guile-core/libguile/arbiters.c:92
-@deffn {Scheme Procedure} try-arbiter arb
-@deffnx {C Function} scm_try_arbiter (arb)
-Return @code{#t} and lock the arbiter @var{arb} if the arbiter
-was unlocked. Otherwise, return @code{#f}.
-@end deffn
-
- release-arbiter
-@c snarfed from /home/ghouston/guile/guile-core/libguile/arbiters.c:113
-@deffn {Scheme Procedure} release-arbiter arb
-@deffnx {C Function} scm_release_arbiter (arb)
-Return @code{#t} and unlock the arbiter @var{arb} if the
-arbiter was locked. Otherwise, return @code{#f}.
-@end deffn
-
- async
-@c snarfed from /home/ghouston/guile/guile-core/libguile/async.c:289
-@deffn {Scheme Procedure} async thunk
-@deffnx {C Function} scm_async (thunk)
-Create a new async for the procedure @var{thunk}.
-@end deffn
-
- system-async
-@c snarfed from /home/ghouston/guile/guile-core/libguile/async.c:299
-@deffn {Scheme Procedure} system-async thunk
-@deffnx {C Function} scm_system_async (thunk)
-Create a new async for the procedure @var{thunk}. Also
-add it to the system's list of active async objects.
-@end deffn
-
- async-mark
-@c snarfed from /home/ghouston/guile/guile-core/libguile/async.c:310
-@deffn {Scheme Procedure} async-mark a
-@deffnx {C Function} scm_async_mark (a)
-Mark the async @var{a} for future execution.
-@end deffn
-
- system-async-mark
-@c snarfed from /home/ghouston/guile/guile-core/libguile/async.c:326
-@deffn {Scheme Procedure} system-async-mark a
-@deffnx {C Function} scm_system_async_mark (a)
-Mark the async @var{a} for future execution.
-@end deffn
-
- run-asyncs
-@c snarfed from /home/ghouston/guile/guile-core/libguile/async.c:351
-@deffn {Scheme Procedure} run-asyncs list_of_a
-@deffnx {C Function} scm_run_asyncs (list_of_a)
-Execute all thunks from the asyncs of the list @var{list_of_a}.
-@end deffn
-
- noop
-@c snarfed from /home/ghouston/guile/guile-core/libguile/async.c:385
-@deffn {Scheme Procedure} noop . args
-@deffnx {C Function} scm_noop (args)
-Do nothing. When called without arguments, return @code{#f},
-otherwise return the first argument.
-@end deffn
-
- unmask-signals
-@c snarfed from /home/ghouston/guile/guile-core/libguile/async.c:437
-@deffn {Scheme Procedure} unmask-signals
-@deffnx {C Function} scm_unmask_signals ()
-Unmask signals. The returned value is not specified.
-@end deffn
-
- mask-signals
-@c snarfed from /home/ghouston/guile/guile-core/libguile/async.c:448
-@deffn {Scheme Procedure} mask-signals
-@deffnx {C Function} scm_mask_signals ()
-Mask signals. The returned value is not specified.
-@end deffn
-
- display-error
-@c snarfed from /home/ghouston/guile/guile-core/libguile/backtrace.c:264
-@deffn {Scheme Procedure} display-error stack port subr message args rest
-@deffnx {C Function} scm_display_error (stack, port, subr, message, args, rest)
-Display an error message to the output port @var{port}.
-@var{stack} is the saved stack for the error, @var{subr} is
-the name of the procedure in which the error occurred and
-@var{message} is the actual error message, which may contain
-formatting instructions. These will format the arguments in
-the list @var{args} accordingly. @var{rest} is currently
-ignored.
-@end deffn
-
- display-application
-@c snarfed from /home/ghouston/guile/guile-core/libguile/backtrace.c:400
-@deffn {Scheme Procedure} display-application frame [port [indent]]
-@deffnx {C Function} scm_display_application (frame, port, indent)
-Display a procedure application @var{frame} to the output port
-@var{port}. @var{indent} specifies the indentation of the
-output.
-@end deffn
-
- display-backtrace
-@c snarfed from /home/ghouston/guile/guile-core/libguile/backtrace.c:711
-@deffn {Scheme Procedure} display-backtrace stack port [first [depth]]
-@deffnx {C Function} scm_display_backtrace (stack, port, first, depth)
-Display a backtrace to the output port @var{port}. @var{stack}
-is the stack to take the backtrace from, @var{first} specifies
-where in the stack to start and @var{depth} how much frames
-to display. Both @var{first} and @var{depth} can be @code{#f},
-which means that default values will be used.
-@end deffn
-
- backtrace
-@c snarfed from /home/ghouston/guile/guile-core/libguile/backtrace.c:734
-@deffn {Scheme Procedure} backtrace
-@deffnx {C Function} scm_backtrace ()
-Display a backtrace of the stack saved by the last error
-to the current output port.
-@end deffn
-
- not
-@c snarfed from /home/ghouston/guile/guile-core/libguile/boolean.c:55
-@deffn {Scheme Procedure} not x
-@deffnx {C Function} scm_not (x)
-Return @code{#t} iff @var{x} is @code{#f}, else return @code{#f}.
-@end deffn
-
- boolean?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/boolean.c:65
-@deffn {Scheme Procedure} boolean? obj
-@deffnx {C Function} scm_boolean_p (obj)
-Return @code{#t} iff @var{obj} is either @code{#t} or @code{#f}.
-@end deffn
-
- char?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/chars.c:54
-@deffn {Scheme Procedure} char? x
-@deffnx {C Function} scm_char_p (x)
-Return @code{#t} iff @var{x} is a character, else @code{#f}.
-@end deffn
-
- char=?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/chars.c:63
-@deffn {Scheme Procedure} char=? x y
-Return @code{#t} iff @var{x} is the same character as @var{y}, else @code{#f}.
-@end deffn
-
- char<?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/chars.c:76
-@deffn {Scheme Procedure} char<? x y
-Return @code{#t} iff @var{x} is less than @var{y} in the ASCII sequence,
-else @code{#f}.
-@end deffn
-
- char<=?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/chars.c:88
-@deffn {Scheme Procedure} char<=? x y
-Return @code{#t} iff @var{x} is less than or equal to @var{y} in the
-ASCII sequence, else @code{#f}.
-@end deffn
-
- char>?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/chars.c:100
-@deffn {Scheme Procedure} char>? x y
-Return @code{#t} iff @var{x} is greater than @var{y} in the ASCII
-sequence, else @code{#f}.
-@end deffn
-
- char>=?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/chars.c:112
-@deffn {Scheme Procedure} char>=? x y
-Return @code{#t} iff @var{x} is greater than or equal to @var{y} in the
-ASCII sequence, else @code{#f}.
-@end deffn
-
- char-ci=?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/chars.c:124
-@deffn {Scheme Procedure} char-ci=? x y
-Return @code{#t} iff @var{x} is the same character as @var{y} ignoring
-case, else @code{#f}.
-@end deffn
-
- char-ci<?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/chars.c:136
-@deffn {Scheme Procedure} char-ci<? x y
-Return @code{#t} iff @var{x} is less than @var{y} in the ASCII sequence
-ignoring case, else @code{#f}.
-@end deffn
-
- char-ci<=?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/chars.c:148
-@deffn {Scheme Procedure} char-ci<=? x y
-Return @code{#t} iff @var{x} is less than or equal to @var{y} in the
-ASCII sequence ignoring case, else @code{#f}.
-@end deffn
-
- char-ci>?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/chars.c:160
-@deffn {Scheme Procedure} char-ci>? x y
-Return @code{#t} iff @var{x} is greater than @var{y} in the ASCII
-sequence ignoring case, else @code{#f}.
-@end deffn
-
- char-ci>=?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/chars.c:172
-@deffn {Scheme Procedure} char-ci>=? x y
-Return @code{#t} iff @var{x} is greater than or equal to @var{y} in the
-ASCII sequence ignoring case, else @code{#f}.
-@end deffn
-
- char-alphabetic?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/chars.c:185
-@deffn {Scheme Procedure} char-alphabetic? chr
-@deffnx {C Function} scm_char_alphabetic_p (chr)
-Return @code{#t} iff @var{chr} is alphabetic, else @code{#f}.
-Alphabetic means the same thing as the isalpha C library function.
-@end deffn
-
- char-numeric?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/chars.c:196
-@deffn {Scheme Procedure} char-numeric? chr
-@deffnx {C Function} scm_char_numeric_p (chr)
-Return @code{#t} iff @var{chr} is numeric, else @code{#f}.
-Numeric means the same thing as the isdigit C library function.
-@end deffn
-
- char-whitespace?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/chars.c:207
-@deffn {Scheme Procedure} char-whitespace? chr
-@deffnx {C Function} scm_char_whitespace_p (chr)
-Return @code{#t} iff @var{chr} is whitespace, else @code{#f}.
-Whitespace means the same thing as the isspace C library function.
-@end deffn
-
- char-upper-case?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/chars.c:220
-@deffn {Scheme Procedure} char-upper-case? chr
-@deffnx {C Function} scm_char_upper_case_p (chr)
-Return @code{#t} iff @var{chr} is uppercase, else @code{#f}.
-Uppercase means the same thing as the isupper C library function.
-@end deffn
-
- char-lower-case?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/chars.c:232
-@deffn {Scheme Procedure} char-lower-case? chr
-@deffnx {C Function} scm_char_lower_case_p (chr)
-Return @code{#t} iff @var{chr} is lowercase, else @code{#f}.
-Lowercase means the same thing as the islower C library function.
-@end deffn
-
- char-is-both?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/chars.c:246
-@deffn {Scheme Procedure} char-is-both? chr
-@deffnx {C Function} scm_char_is_both_p (chr)
-Return @code{#t} iff @var{chr} is either uppercase or lowercase, else @code{#f}.
-Uppercase and lowercase are as defined by the isupper and islower
-C library functions.
-@end deffn
-
- char->integer
-@c snarfed from /home/ghouston/guile/guile-core/libguile/chars.c:260
-@deffn {Scheme Procedure} char->integer chr
-@deffnx {C Function} scm_char_to_integer (chr)
-Return the number corresponding to ordinal position of @var{chr} in the
-ASCII sequence.
-@end deffn
-
- integer->char
-@c snarfed from /home/ghouston/guile/guile-core/libguile/chars.c:272
-@deffn {Scheme Procedure} integer->char n
-@deffnx {C Function} scm_integer_to_char (n)
-Return the character at position @var{n} in the ASCII sequence.
-@end deffn
-
- char-upcase
-@c snarfed from /home/ghouston/guile/guile-core/libguile/chars.c:283
-@deffn {Scheme Procedure} char-upcase chr
-@deffnx {C Function} scm_char_upcase (chr)
-Return the uppercase character version of @var{chr}.
-@end deffn
-
- char-downcase
-@c snarfed from /home/ghouston/guile/guile-core/libguile/chars.c:294
-@deffn {Scheme Procedure} char-downcase chr
-@deffnx {C Function} scm_char_downcase (chr)
-Return the lowercase character version of @var{chr}.
-@end deffn
-
- debug-options-interface
-@c snarfed from /home/ghouston/guile/guile-core/libguile/debug.c:79
-@deffn {Scheme Procedure} debug-options-interface [setting]
-@deffnx {C Function} scm_debug_options (setting)
-Option interface for the debug options. Instead of using
-this procedure directly, use the procedures @code{debug-enable},
-@code{debug-disable}, @code{debug-set!} and @code{debug-options}.
-@end deffn
-
- with-traps
-@c snarfed from /home/ghouston/guile/guile-core/libguile/debug.c:122
-@deffn {Scheme Procedure} with-traps thunk
-@deffnx {C Function} scm_with_traps (thunk)
-Call @var{thunk} with traps enabled.
-@end deffn
-
- memoized?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/debug.c:164
-@deffn {Scheme Procedure} memoized? obj
-@deffnx {C Function} scm_memoized_p (obj)
-Return @code{#t} if @var{obj} is memoized.
-@end deffn
-
- unmemoize
-@c snarfed from /home/ghouston/guile/guile-core/libguile/debug.c:328
-@deffn {Scheme Procedure} unmemoize m
-@deffnx {C Function} scm_unmemoize (m)
-Unmemoize the memoized expression @var{m},
-@end deffn
-
- memoized-environment
-@c snarfed from /home/ghouston/guile/guile-core/libguile/debug.c:338
-@deffn {Scheme Procedure} memoized-environment m
-@deffnx {C Function} scm_memoized_environment (m)
-Return the environment of the memoized expression @var{m}.
-@end deffn
-
- procedure-name
-@c snarfed from /home/ghouston/guile/guile-core/libguile/debug.c:348
-@deffn {Scheme Procedure} procedure-name proc
-@deffnx {C Function} scm_procedure_name (proc)
-Return the name of the procedure @var{proc}
-@end deffn
-
- procedure-source
-@c snarfed from /home/ghouston/guile/guile-core/libguile/debug.c:374
-@deffn {Scheme Procedure} procedure-source proc
-@deffnx {C Function} scm_procedure_source (proc)
-Return the source of the procedure @var{proc}.
-@end deffn
-
- procedure-environment
-@c snarfed from /home/ghouston/guile/guile-core/libguile/debug.c:407
-@deffn {Scheme Procedure} procedure-environment proc
-@deffnx {C Function} scm_procedure_environment (proc)
-Return the environment of the procedure @var{proc}.
-@end deffn
-
- local-eval
-@c snarfed from /home/ghouston/guile/guile-core/libguile/debug.c:439
-@deffn {Scheme Procedure} local-eval exp [env]
-@deffnx {C Function} scm_local_eval (exp, env)
-Evaluate @var{exp} in its environment. If @var{env} is supplied,
-it is the environment in which to evaluate @var{exp}. Otherwise,
-@var{exp} must be a memoized code object (in which case, its environment
-is implicit).
-@end deffn
-
- debug-object?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/debug.c:526
-@deffn {Scheme Procedure} debug-object? obj
-@deffnx {C Function} scm_debug_object_p (obj)
-Return @code{#t} if @var{obj} is a debug object.
-@end deffn
-
- dynamic-link
-@c snarfed from /home/ghouston/guile/guile-core/libguile/dynl.c:212
-@deffn {Scheme Procedure} dynamic-link filename
-@deffnx {C Function} scm_dynamic_link (filename)
-Find the shared object (shared library) denoted by
-@var{filename} and link it into the running Guile
-application. The returned
-scheme object is a ``handle'' for the library which can
-be passed to @code{dynamic-func}, @code{dynamic-call} etc.
-
-Searching for object files is system dependent. Normally,
-if @var{filename} does have an explicit directory it will
-be searched for in locations
-such as @file{/usr/lib} and @file{/usr/local/lib}.
-@end deffn
-
- dynamic-object?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/dynl.c:227
-@deffn {Scheme Procedure} dynamic-object? obj
-@deffnx {C Function} scm_dynamic_object_p (obj)
-Return @code{#t} if @var{obj} is a dynamic object handle,
-or @code{#f} otherwise.
-@end deffn
-
- dynamic-unlink
-@c snarfed from /home/ghouston/guile/guile-core/libguile/dynl.c:241
-@deffn {Scheme Procedure} dynamic-unlink dobj
-@deffnx {C Function} scm_dynamic_unlink (dobj)
-Unlink a dynamic object from the application, if possible. The
-object must have been linked by @code{dynamic-link}, with
-@var{dobj} the corresponding handle. After this procedure
-is called, the handle can no longer be used to access the
-object.
-@end deffn
-
- dynamic-func
-@c snarfed from /home/ghouston/guile/guile-core/libguile/dynl.c:266
-@deffn {Scheme Procedure} dynamic-func name dobj
-@deffnx {C Function} scm_dynamic_func (name, dobj)
-Return a ``handle'' for the function @var{name} in the
-shared object referred to by @var{dobj}. The handle
-can be passed to @code{dynamic-call} to actually
-call the function.
-
-Regardless whether your C compiler prepends an underscore
-@samp{_} to the global names in a program, you should
-@strong{not} include this underscore in @var{name}
-since it will be added automatically when necessary.
-@end deffn
-
- dynamic-call
-@c snarfed from /home/ghouston/guile/guile-core/libguile/dynl.c:308
-@deffn {Scheme Procedure} dynamic-call func dobj
-@deffnx {C Function} scm_dynamic_call (func, dobj)
-Call a C function in a dynamic object. Two styles of
-invocation are supported:
-
-@itemize @bullet
-@item @var{func} can be a function handle returned by
-@code{dynamic-func}. In this case @var{dobj} is
-ignored
-@item @var{func} can be a string with the name of the
-function to call, with @var{dobj} the handle of the
-dynamic object in which to find the function.
-This is equivalent to
-@smallexample
-
-(dynamic-call (dynamic-func @var{func} @var{dobj}) #f)
-@end smallexample
-@end itemize
-
-In either case, the function is passed no arguments
-and its return value is ignored.
-@end deffn
-
- dynamic-args-call
-@c snarfed from /home/ghouston/guile/guile-core/libguile/dynl.c:363
-@deffn {Scheme Procedure} dynamic-args-call func dobj args
-@deffnx {C Function} scm_dynamic_args_call (func, dobj, args)
-Call the C function indicated by @var{func} and @var{dobj},
-just like @code{dynamic-call}, but pass it some arguments and
-return its return value. The C function is expected to take
-two arguments and return an @code{int}, just like @code{main}:
-@smallexample
-int c_func (int argc, char **argv);
-@end smallexample
-
-The parameter @var{args} must be a list of strings and is
-converted into an array of @code{char *}. The array is passed
-in @var{argv} and its size in @var{argc}. The return value is
-converted to a Scheme number and returned from the call to
-@code{dynamic-args-call}.
-@end deffn
-
- dynamic-wind
-@c snarfed from /home/ghouston/guile/guile-core/libguile/dynwind.c:119
-@deffn {Scheme Procedure} dynamic-wind in_guard thunk out_guard
-@deffnx {C Function} scm_dynamic_wind (in_guard, thunk, out_guard)
-All three arguments must be 0-argument procedures.
-@var{in_guard} is called, then @var{thunk}, then
-@var{out_guard}.
-
-If, any time during the execution of @var{thunk}, the
-continuation of the @code{dynamic_wind} expression is escaped
-non-locally, @var{out_guard} is called. If the continuation of
-the dynamic-wind is re-entered, @var{in_guard} is called. Thus
-@var{in_guard} and @var{out_guard} may be called any number of
-times.
-@lisp
-(define x 'normal-binding)
-@result{} x
-(define a-cont (call-with-current-continuation
- (lambda (escape)
- (let ((old-x x))
- (dynamic-wind
- ;; in-guard:
- ;;
- (lambda () (set! x 'special-binding))
-
- ;; thunk
- ;;
- (lambda () (display x) (newline)
- (call-with-current-continuation escape)
- (display x) (newline)
- x)
-
- ;; out-guard:
- ;;
- (lambda () (set! x old-x)))))))
-
-;; Prints:
-special-binding
-;; Evaluates to:
-@result{} a-cont
-x
-@result{} normal-binding
-(a-cont #f)
-;; Prints:
-special-binding
-;; Evaluates to:
-@result{} a-cont ;; the value of the (define a-cont...)
-x
-@result{} normal-binding
-a-cont
-@result{} special-binding
-@end lisp
-@end deffn
-
- environment?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:129
-@deffn {Scheme Procedure} environment? obj
-@deffnx {C Function} scm_environment_p (obj)
-Return @code{#t} if @var{obj} is an environment, or @code{#f}
-otherwise.
-@end deffn
-
- environment-bound?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:140
-@deffn {Scheme Procedure} environment-bound? env sym
-@deffnx {C Function} scm_environment_bound_p (env, sym)
-Return @code{#t} if @var{sym} is bound in @var{env}, or
-@code{#f} otherwise.
-@end deffn
-
- environment-ref
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:155
-@deffn {Scheme Procedure} environment-ref env sym
-@deffnx {C Function} scm_environment_ref (env, sym)
-Return the value of the location bound to @var{sym} in
-@var{env}. If @var{sym} is unbound in @var{env}, signal an
-@code{environment:unbound} error.
-@end deffn
-
- environment-fold
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:225
-@deffn {Scheme Procedure} environment-fold env proc init
-@deffnx {C Function} scm_environment_fold (env, proc, init)
-Iterate over all the bindings in @var{env}, accumulating some
-value.
-For each binding in @var{env}, apply @var{proc} to the symbol
-bound, its value, and the result from the previous application
-of @var{proc}.
-Use @var{init} as @var{proc}'s third argument the first time
-@var{proc} is applied.
-If @var{env} contains no bindings, this function simply returns
-@var{init}.
-If @var{env} binds the symbol sym1 to the value val1, sym2 to
-val2, and so on, then this procedure computes:
-@lisp
- (proc sym1 val1
- (proc sym2 val2
- ...
- (proc symn valn
- init)))
-@end lisp
-Each binding in @var{env} will be processed exactly once.
-@code{environment-fold} makes no guarantees about the order in
-which the bindings are processed.
-Here is a function which, given an environment, constructs an
-association list representing that environment's bindings,
-using environment-fold:
-@lisp
- (define (environment->alist env)
- (environment-fold env
- (lambda (sym val tail)
- (cons (cons sym val) tail))
- '()))
-@end lisp
-@end deffn
-
- environment-define
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:260
-@deffn {Scheme Procedure} environment-define env sym val
-@deffnx {C Function} scm_environment_define (env, sym, val)
-Bind @var{sym} to a new location containing @var{val} in
-@var{env}. If @var{sym} is already bound to another location
-in @var{env} and the binding is mutable, that binding is
-replaced. The new binding and location are both mutable. The
-return value is unspecified.
-If @var{sym} is already bound in @var{env}, and the binding is
-immutable, signal an @code{environment:immutable-binding} error.
-@end deffn
-
- environment-undefine
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:286
-@deffn {Scheme Procedure} environment-undefine env sym
-@deffnx {C Function} scm_environment_undefine (env, sym)
-Remove any binding for @var{sym} from @var{env}. If @var{sym}
-is unbound in @var{env}, do nothing. The return value is
-unspecified.
-If @var{sym} is already bound in @var{env}, and the binding is
-immutable, signal an @code{environment:immutable-binding} error.
-@end deffn
-
- environment-set!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:314
-@deffn {Scheme Procedure} environment-set! env sym val
-@deffnx {C Function} scm_environment_set_x (env, sym, val)
-If @var{env} binds @var{sym} to some location, change that
-location's value to @var{val}. The return value is
-unspecified.
-If @var{sym} is not bound in @var{env}, signal an
-@code{environment:unbound} error. If @var{env} binds @var{sym}
-to an immutable location, signal an
-@code{environment:immutable-location} error.
-@end deffn
-
- environment-cell
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:349
-@deffn {Scheme Procedure} environment-cell env sym for_write
-@deffnx {C Function} scm_environment_cell (env, sym, for_write)
-Return the value cell which @var{env} binds to @var{sym}, or
-@code{#f} if the binding does not live in a value cell.
-The argument @var{for-write} indicates whether the caller
-intends to modify the variable's value by mutating the value
-cell. If the variable is immutable, then
-@code{environment-cell} signals an
-@code{environment:immutable-location} error.
-If @var{sym} is unbound in @var{env}, signal an
-@code{environment:unbound} error.
-If you use this function, you should consider using
-@code{environment-observe}, to be notified when @var{sym} gets
-re-bound to a new value cell, or becomes undefined.
-@end deffn
-
- environment-observe
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:401
-@deffn {Scheme Procedure} environment-observe env proc
-@deffnx {C Function} scm_environment_observe (env, proc)
-Whenever @var{env}'s bindings change, apply @var{proc} to
-@var{env}.
-This function returns an object, token, which you can pass to
-@code{environment-unobserve} to remove @var{proc} from the set
-of procedures observing @var{env}. The type and value of
-token is unspecified.
-@end deffn
-
- environment-observe-weak
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:418
-@deffn {Scheme Procedure} environment-observe-weak env proc
-@deffnx {C Function} scm_environment_observe_weak (env, proc)
-This function is the same as environment-observe, except that
-the reference @var{env} retains to @var{proc} is a weak
-reference. This means that, if there are no other live,
-non-weak references to @var{proc}, it will be
-garbage-collected, and dropped from @var{env}'s
-list of observing procedures.
-@end deffn
-
- environment-unobserve
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:454
-@deffn {Scheme Procedure} environment-unobserve token
-@deffnx {C Function} scm_environment_unobserve (token)
-Cancel the observation request which returned the value
-@var{token}. The return value is unspecified.
-If a call @code{(environment-observe env proc)} returns
-@var{token}, then the call @code{(environment-unobserve token)}
-will cause @var{proc} to no longer be called when @var{env}'s
-bindings change.
-@end deffn
-
- make-leaf-environment
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:1031
-@deffn {Scheme Procedure} make-leaf-environment
-@deffnx {C Function} scm_make_leaf_environment ()
-Create a new leaf environment, containing no bindings.
-All bindings and locations created in the new environment
-will be mutable.
-@end deffn
-
- leaf-environment?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:1054
-@deffn {Scheme Procedure} leaf-environment? object
-@deffnx {C Function} scm_leaf_environment_p (object)
-Return @code{#t} if object is a leaf environment, or @code{#f}
-otherwise.
-@end deffn
-
- make-eval-environment
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:1419
-@deffn {Scheme Procedure} make-eval-environment local imported
-@deffnx {C Function} scm_make_eval_environment (local, imported)
-Return a new environment object eval whose bindings are the
-union of the bindings in the environments @var{local} and
-@var{imported}, with bindings from @var{local} taking
-precedence. Definitions made in eval are placed in @var{local}.
-Applying @code{environment-define} or
-@code{environment-undefine} to eval has the same effect as
-applying the procedure to @var{local}.
-Note that eval incorporates @var{local} and @var{imported} by
-reference:
-If, after creating eval, the program changes the bindings of
-@var{local} or @var{imported}, those changes will be visible
-in eval.
-Since most Scheme evaluation takes place in eval environments,
-they transparently cache the bindings received from @var{local}
-and @var{imported}. Thus, the first time the program looks up
-a symbol in eval, eval may make calls to @var{local} or
-@var{imported} to find their bindings, but subsequent
-references to that symbol will be as fast as references to
-bindings in finite environments.
-In typical use, @var{local} will be a finite environment, and
-@var{imported} will be an import environment
-@end deffn
-
- eval-environment?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:1456
-@deffn {Scheme Procedure} eval-environment? object
-@deffnx {C Function} scm_eval_environment_p (object)
-Return @code{#t} if object is an eval environment, or @code{#f}
-otherwise.
-@end deffn
-
- eval-environment-local
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:1466
-@deffn {Scheme Procedure} eval-environment-local env
-@deffnx {C Function} scm_eval_environment_local (env)
-Return the local environment of eval environment @var{env}.
-@end deffn
-
- eval-environment-set-local!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:1478
-@deffn {Scheme Procedure} eval-environment-set-local! env local
-@deffnx {C Function} scm_eval_environment_set_local_x (env, local)
-Change @var{env}'s local environment to @var{local}.
-@end deffn
-
- eval-environment-imported
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:1504
-@deffn {Scheme Procedure} eval-environment-imported env
-@deffnx {C Function} scm_eval_environment_imported (env)
-Return the imported environment of eval environment @var{env}.
-@end deffn
-
- eval-environment-set-imported!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:1516
-@deffn {Scheme Procedure} eval-environment-set-imported! env imported
-@deffnx {C Function} scm_eval_environment_set_imported_x (env, imported)
-Change @var{env}'s imported environment to @var{imported}.
-@end deffn
-
- make-import-environment
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:1839
-@deffn {Scheme Procedure} make-import-environment imports conflict_proc
-@deffnx {C Function} scm_make_import_environment (imports, conflict_proc)
-Return a new environment @var{imp} whose bindings are the union
-of the bindings from the environments in @var{imports};
-@var{imports} must be a list of environments. That is,
-@var{imp} binds a symbol to a location when some element of
-@var{imports} does.
-If two different elements of @var{imports} have a binding for
-the same symbol, the @var{conflict-proc} is called with the
-following parameters: the import environment, the symbol and
-the list of the imported environments that bind the symbol.
-If the @var{conflict-proc} returns an environment @var{env},
-the conflict is considered as resolved and the binding from
-@var{env} is used. If the @var{conflict-proc} returns some
-non-environment object, the conflict is considered unresolved
-and the symbol is treated as unspecified in the import
-environment.
-The checking for conflicts may be performed lazily, i. e. at
-the moment when a value or binding for a certain symbol is
-requested instead of the moment when the environment is
-created or the bindings of the imports change.
-All bindings in @var{imp} are immutable. If you apply
-@code{environment-define} or @code{environment-undefine} to
-@var{imp}, Guile will signal an
- @code{environment:immutable-binding} error. However,
-notice that the set of bindings in @var{imp} may still change,
-if one of its imported environments changes.
-@end deffn
-
- import-environment?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:1868
-@deffn {Scheme Procedure} import-environment? object
-@deffnx {C Function} scm_import_environment_p (object)
-Return @code{#t} if object is an import environment, or
-@code{#f} otherwise.
-@end deffn
-
- import-environment-imports
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:1879
-@deffn {Scheme Procedure} import-environment-imports env
-@deffnx {C Function} scm_import_environment_imports (env)
-Return the list of environments imported by the import
-environment @var{env}.
-@end deffn
-
- import-environment-set-imports!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:1892
-@deffn {Scheme Procedure} import-environment-set-imports! env imports
-@deffnx {C Function} scm_import_environment_set_imports_x (env, imports)
-Change @var{env}'s list of imported environments to
-@var{imports}, and check for conflicts.
-@end deffn
-
- make-export-environment
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:2159
-@deffn {Scheme Procedure} make-export-environment private signature
-@deffnx {C Function} scm_make_export_environment (private, signature)
-Return a new environment @var{exp} containing only those
-bindings in private whose symbols are present in
-@var{signature}. The @var{private} argument must be an
-environment.
-
-The environment @var{exp} binds symbol to location when
-@var{env} does, and symbol is exported by @var{signature}.
-
-@var{signature} is a list specifying which of the bindings in
-@var{private} should be visible in @var{exp}. Each element of
-@var{signature} should be a list of the form:
- (symbol attribute ...)
-where each attribute is one of the following:
-@table @asis
-@item the symbol @code{mutable-location}
- @var{exp} should treat the
- location bound to symbol as mutable. That is, @var{exp}
- will pass calls to @code{environment-set!} or
- @code{environment-cell} directly through to private.
-@item the symbol @code{immutable-location}
- @var{exp} should treat
- the location bound to symbol as immutable. If the program
- applies @code{environment-set!} to @var{exp} and symbol, or
- calls @code{environment-cell} to obtain a writable value
- cell, @code{environment-set!} will signal an
- @code{environment:immutable-location} error. Note that, even
- if an export environment treats a location as immutable, the
- underlying environment may treat it as mutable, so its
- value may change.
-@end table
-It is an error for an element of signature to specify both
-@code{mutable-location} and @code{immutable-location}. If
-neither is specified, @code{immutable-location} is assumed.
-
-As a special case, if an element of signature is a lone
-symbol @var{sym}, it is equivalent to an element of the form
-@code{(sym)}.
-
-All bindings in @var{exp} are immutable. If you apply
-@code{environment-define} or @code{environment-undefine} to
-@var{exp}, Guile will signal an
-@code{environment:immutable-binding} error. However,
-notice that the set of bindings in @var{exp} may still change,
-if the bindings in private change.
-@end deffn
-
- export-environment?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:2194
-@deffn {Scheme Procedure} export-environment? object
-@deffnx {C Function} scm_export_environment_p (object)
-Return @code{#t} if object is an export environment, or
-@code{#f} otherwise.
-@end deffn
-
- export-environment-private
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:2204
-@deffn {Scheme Procedure} export-environment-private env
-@deffnx {C Function} scm_export_environment_private (env)
-Return the private environment of export environment @var{env}.
-@end deffn
-
- export-environment-set-private!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:2216
-@deffn {Scheme Procedure} export-environment-set-private! env private
-@deffnx {C Function} scm_export_environment_set_private_x (env, private)
-Change the private environment of export environment @var{env}.
-@end deffn
-
- export-environment-signature
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:2238
-@deffn {Scheme Procedure} export-environment-signature env
-@deffnx {C Function} scm_export_environment_signature (env)
-Return the signature of export environment @var{env}.
-@end deffn
-
- export-environment-set-signature!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/environments.c:2312
-@deffn {Scheme Procedure} export-environment-set-signature! env signature
-@deffnx {C Function} scm_export_environment_set_signature_x (env, signature)
-Change the signature of export environment @var{env}.
-@end deffn
-
- eq?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/eq.c:62
-@deffn {Scheme Procedure} eq? x y
-Return @code{#t} iff @var{x} references the same object as @var{y}.
-@code{eq?} is similar to @code{eqv?} except that in some cases it is
-capable of discerning distinctions finer than those detectable by
-@code{eqv?}.
-@end deffn
-
- eqv?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/eq.c:85
-@deffn {Scheme Procedure} eqv? x y
-The @code{eqv?} procedure defines a useful equivalence relation on objects.
-Briefly, it returns @code{#t} if @var{x} and @var{y} should normally be
-regarded as the same object. This relation is left slightly open to
-interpretation, but works for comparing immediate integers, characters,
-and inexact numbers.
-@end deffn
-
- equal?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/eq.c:138
-@deffn {Scheme Procedure} equal? x y
-Return @code{#t} iff @var{x} and @var{y} are recursively @code{eqv?} equivalent.
-@code{equal?} recursively compares the contents of pairs,
-vectors, and strings, applying @code{eqv?} on other objects such as
-numbers and symbols. A rule of thumb is that objects are generally
-@code{equal?} if they print the same. @code{equal?} may fail to
-terminate if its arguments are circular data structures.
-@end deffn
-
- scm-error
-@c snarfed from /home/ghouston/guile/guile-core/libguile/error.c:117
-@deffn {Scheme Procedure} scm-error key subr message args data
-@deffnx {C Function} scm_error_scm (key, subr, message, args, data)
-Raise an error with key @var{key}. @var{subr} can be a string
-naming the procedure associated with the error, or @code{#f}.
-@var{message} is the error message string, possibly containing
-@code{~S} and @code{~A} escapes. When an error is reported,
-these are replaced by formatting the corresponding members of
-@var{args}: @code{~A} (was @code{%s} in older versions of
-Guile) formats using @code{display} and @code{~S} (was
-@code{%S}) formats using @code{write}. @var{data} is a list or
-@code{#f} depending on @var{key}: if @var{key} is
-@code{system-error} then it should be a list containing the
-Unix @code{errno} value; If @var{key} is @code{signal} then it
-should be a list containing the Unix signal number; otherwise
-it will usually be @code{#f}.
-@end deffn
-
- strerror
-@c snarfed from /home/ghouston/guile/guile-core/libguile/error.c:168
-@deffn {Scheme Procedure} strerror err
-@deffnx {C Function} scm_strerror (err)
-Return the Unix error message corresponding to @var{err}, which
-must be an integer value.
-@end deffn
-
- apply:nconc2last
-@c snarfed from /home/ghouston/guile/guile-core/libguile/eval.c:3409
-@deffn {Scheme Procedure} apply:nconc2last lst
-@deffnx {C Function} scm_nconc2last (lst)
-Given a list (@var{arg1} @dots{} @var{args}), this function
-conses the @var{arg1} @dots{} arguments onto the front of
-@var{args}, and returns the resulting list. Note that
-@var{args} is a list; thus, the argument to this function is
-a list whose last element is a list.
-Note: Rather than do new consing, @code{apply:nconc2last}
-destroys its argument, so use with care.
-@end deffn
-
- force
-@c snarfed from /home/ghouston/guile/guile-core/libguile/eval.c:3945
-@deffn {Scheme Procedure} force x
-@deffnx {C Function} scm_force (x)
-If the promise @var{x} has not been computed yet, compute and
-return @var{x}, otherwise just return the previously computed
-value.
-@end deffn
-
- promise?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/eval.c:3968
-@deffn {Scheme Procedure} promise? obj
-@deffnx {C Function} scm_promise_p (obj)
-Return true if @var{obj} is a promise, i.e. a delayed computation
-(@pxref{Delayed evaluation,,,r5rs.info,The Revised^5 Report on Scheme}).
-@end deffn
-
- cons-source
-@c snarfed from /home/ghouston/guile/guile-core/libguile/eval.c:3980
-@deffn {Scheme Procedure} cons-source xorig x y
-@deffnx {C Function} scm_cons_source (xorig, x, y)
-Create and return a new pair whose car and cdr are @var{x} and @var{y}.
-Any source properties associated with @var{xorig} are also associated
-with the new pair.
-@end deffn
-
- copy-tree
-@c snarfed from /home/ghouston/guile/guile-core/libguile/eval.c:4000
-@deffn {Scheme Procedure} copy-tree obj
-@deffnx {C Function} scm_copy_tree (obj)
-Recursively copy the data tree that is bound to @var{obj}, and return a
-pointer to the new data structure. @code{copy-tree} recurses down the
-contents of both pairs and vectors (since both cons cells and vector
-cells may point to arbitrary objects), and stops recursing when it hits
-any other object.
-@end deffn
-
- primitive-eval
-@c snarfed from /home/ghouston/guile/guile-core/libguile/eval.c:4093
-@deffn {Scheme Procedure} primitive-eval exp
-@deffnx {C Function} scm_primitive_eval (exp)
-Evaluate @var{exp} in the top-level environment specified by
-the current module.
-@end deffn
-
- eval
-@c snarfed from /home/ghouston/guile/guile-core/libguile/eval.c:4162
-@deffn {Scheme Procedure} eval exp module
-@deffnx {C Function} scm_eval (exp, module)
-Evaluate @var{exp}, a list representing a Scheme expression,
-in the top-level environment specified by @var{module}.
-While @var{exp} is evaluated (using @code{primitive-eval}),
-@var{module} is made the current module. The current module
-is reset to its previous value when @var{eval} returns.
-@end deffn
-
- eval-options-interface
-@c snarfed from /home/ghouston/guile/guile-core/libguile/eval.c:1747
-@deffn {Scheme Procedure} eval-options-interface [setting]
-@deffnx {C Function} scm_eval_options_interface (setting)
-Option interface for the evaluation options. Instead of using
-this procedure directly, use the procedures @code{eval-enable},
-@code{eval-disable}, @code{eval-set!} and @code{eval-options}.
-@end deffn
-
- evaluator-traps-interface
-@c snarfed from /home/ghouston/guile/guile-core/libguile/eval.c:1764
-@deffn {Scheme Procedure} evaluator-traps-interface [setting]
-@deffnx {C Function} scm_evaluator_traps (setting)
-Option interface for the evaluator trap options.
-@end deffn
-
- defined?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/evalext.c:75
-@deffn {Scheme Procedure} defined? sym [env]
-@deffnx {C Function} scm_definedp (sym, env)
-Return @code{#t} if @var{sym} is defined in the lexical environment @var{env}. When @var{env} is not specified, look in the top-level environment as defined by the current module.
-@end deffn
-
- map-in-order
-@c snarfed from /home/ghouston/guile/guile-core/libguile/evalext.c:144
-@deffn {Scheme Procedure} map-in-order
-implemented by the C function "scm_map"
-@end deffn
-
- load-extension
-@c snarfed from /home/ghouston/guile/guile-core/libguile/extensions.c:152
-@deffn {Scheme Procedure} load-extension lib init
-@deffnx {C Function} scm_load_extension (lib, init)
-Load and initialize the extension designated by LIB and INIT.
-When there is no pre-registered function for LIB/INIT, this is
-equivalent to
-
-@lisp
-(dynamic-call INIT (dynamic-link LIB))
-@end lisp
-
-When there is a pre-registered function, that function is called
-instead.
-
-Normally, there is no pre-registered function. This option exists
-only for situations where dynamic linking is unavailable or unwanted.
-In that case, you would statically link your program with the desired
-library, and register its init function right after Guile has been
-initialized.
-
-LIB should be a string denoting a shared library without any file type
-suffix such as ".so". The suffix is provided automatically. It
-should also not contain any directory components. Libraries that
-implement Guile Extensions should be put into the normal locations for
-shared libraries. We recommend to use the naming convention
-libguile-bla-blum for a extension related to a module `(bla blum)'.
-
-The normal way for a extension to be used is to write a small Scheme
-file that defines a module, and to load the extension into this
-module. When the module is auto-loaded, the extension is loaded as
-well. For example,
-
-@lisp
-(define-module (bla blum))
-
-(load-extension "libguile-bla-blum" "bla_init_blum")
-@end lisp
-@end deffn
-
- program-arguments
-@c snarfed from /home/ghouston/guile/guile-core/libguile/feature.c:77
-@deffn {Scheme Procedure} program-arguments
-@deffnx {Scheme Procedure} command-line
-@deffnx {C Function} scm_program_arguments ()
-Return the list of command line arguments passed to Guile, as a list of
-strings. The list includes the invoked program name, which is usually
-@code{"guile"}, but excludes switches and parameters for command line
-options like @code{-e} and @code{-l}.
-@end deffn
-
- make-fluid
-@c snarfed from /home/ghouston/guile/guile-core/libguile/fluids.c:124
-@deffn {Scheme Procedure} make-fluid
-@deffnx {C Function} scm_make_fluid ()
-Return a newly created fluid.
-Fluids are objects of a certain type (a smob) that can hold one SCM
-value per dynamic root. That is, modifications to this value are
-only visible to code that executes within the same dynamic root as
-the modifying code. When a new dynamic root is constructed, it
-inherits the values from its parent. Because each thread executes
-in its own dynamic root, you can use fluids for thread local storage.
-@end deffn
-
- fluid?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/fluids.c:137
-@deffn {Scheme Procedure} fluid? obj
-@deffnx {C Function} scm_fluid_p (obj)
-Return @code{#t} iff @var{obj} is a fluid; otherwise, return
-@code{#f}.
-@end deffn
-
- fluid-ref
-@c snarfed from /home/ghouston/guile/guile-core/libguile/fluids.c:148
-@deffn {Scheme Procedure} fluid-ref fluid
-@deffnx {C Function} scm_fluid_ref (fluid)
-Return the value associated with @var{fluid} in the current
-dynamic root. If @var{fluid} has not been set, then return
-@code{#f}.
-@end deffn
-
- fluid-set!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/fluids.c:164
-@deffn {Scheme Procedure} fluid-set! fluid value
-@deffnx {C Function} scm_fluid_set_x (fluid, value)
-Set the value associated with @var{fluid} in the current dynamic root.
-@end deffn
-
- with-fluids*
-@c snarfed from /home/ghouston/guile/guile-core/libguile/fluids.c:223
-@deffn {Scheme Procedure} with-fluids* fluids values thunk
-@deffnx {C Function} scm_with_fluids (fluids, values, thunk)
-Set @var{fluids} to @var{values} temporary, and call @var{thunk}.
-@var{fluids} must be a list of fluids and @var{values} must be the same
-number of their values to be applied. Each substitution is done
-one after another. @var{thunk} must be a procedure with no argument.
-@end deffn
-
- setvbuf
-@c snarfed from /home/ghouston/guile/guile-core/libguile/fports.c:156
-@deffn {Scheme Procedure} setvbuf port mode [size]
-@deffnx {C Function} scm_setvbuf (port, mode, size)
-Set the buffering mode for @var{port}. @var{mode} can be:
-@table @code
-@item _IONBF
-non-buffered
-@item _IOLBF
-line buffered
-@item _IOFBF
-block buffered, using a newly allocated buffer of @var{size} bytes.
-If @var{size} is omitted, a default size will be used.
-@end table
-@end deffn
-
- file-port?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/fports.c:245
-@deffn {Scheme Procedure} file-port? obj
-@deffnx {C Function} scm_file_port_p (obj)
-Determine whether @var{obj} is a port that is related to a file.
-@end deffn
-
- open-file
-@c snarfed from /home/ghouston/guile/guile-core/libguile/fports.c:299
-@deffn {Scheme Procedure} open-file filename mode
-@deffnx {C Function} scm_open_file (filename, mode)
-Open the file whose name is @var{filename}, and return a port
-representing that file. The attributes of the port are
-determined by the @var{mode} string. The way in which this is
-interpreted is similar to C stdio. The first character must be
-one of the following:
-@table @samp
-@item r
-Open an existing file for input.
-@item w
-Open a file for output, creating it if it doesn't already exist
-or removing its contents if it does.
-@item a
-Open a file for output, creating it if it doesn't already
-exist. All writes to the port will go to the end of the file.
-The "append mode" can be turned off while the port is in use
-@pxref{Ports and File Descriptors, fcntl}
-@end table
-The following additional characters can be appended:
-@table @samp
-@item +
-Open the port for both input and output. E.g., @code{r+}: open
-an existing file for both input and output.
-@item 0
-Create an "unbuffered" port. In this case input and output
-operations are passed directly to the underlying port
-implementation without additional buffering. This is likely to
-slow down I/O operations. The buffering mode can be changed
-while a port is in use @pxref{Ports and File Descriptors,
-setvbuf}
-@item l
-Add line-buffering to the port. The port output buffer will be
-automatically flushed whenever a newline character is written.
-@end table
-In theory we could create read/write ports which were buffered
-in one direction only. However this isn't included in the
-current interfaces. If a file cannot be opened with the access
-requested, @code{open-file} throws an exception.
-@end deffn
-
- gc-stats
-@c snarfed from /home/ghouston/guile/guile-core/libguile/gc.c:735
-@deffn {Scheme Procedure} gc-stats
-@deffnx {C Function} scm_gc_stats ()
-Return an association list of statistics about Guile's current
-use of storage.
-@end deffn
-
- object-address
-@c snarfed from /home/ghouston/guile/guile-core/libguile/gc.c:832
-@deffn {Scheme Procedure} object-address obj
-@deffnx {C Function} scm_object_address (obj)
-Return an integer that for the lifetime of @var{obj} is uniquely
-returned by this function for @var{obj}
-@end deffn
-
- gc
-@c snarfed from /home/ghouston/guile/guile-core/libguile/gc.c:843
-@deffn {Scheme Procedure} gc
-@deffnx {C Function} scm_gc ()
-Scans all of SCM objects and reclaims for further use those that are
-no longer accessible.
-@end deffn
-
- %compute-slots
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:291
-@deffn {Scheme Procedure} %compute-slots class
-@deffnx {C Function} scm_sys_compute_slots (class)
-Return a list consisting of the names of all slots belonging to
-class @var{class}, i. e. the slots of @var{class} and of all of
-its superclasses.
-@end deffn
-
- get-keyword
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:376
-@deffn {Scheme Procedure} get-keyword key l default_value
-@deffnx {C Function} scm_get_keyword (key, l, default_value)
-Determine an associated value for the keyword @var{key} from
-the list @var{l}. The list @var{l} has to consist of an even
-number of elements, where, starting with the first, every
-second element is a keyword, followed by its associated value.
-If @var{l} does not hold a value for @var{key}, the value
-@var{default_value} is returned.
-@end deffn
-
- %initialize-object
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:399
-@deffn {Scheme Procedure} %initialize-object obj initargs
-@deffnx {C Function} scm_sys_initialize_object (obj, initargs)
-Initialize the object @var{obj} with the given arguments
-@var{initargs}.
-@end deffn
-
- %prep-layout!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:479
-@deffn {Scheme Procedure} %prep-layout! class
-@deffnx {C Function} scm_sys_prep_layout_x (class)
-
-@end deffn
-
- %inherit-magic!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:556
-@deffn {Scheme Procedure} %inherit-magic! class dsupers
-@deffnx {C Function} scm_sys_inherit_magic_x (class, dsupers)
-
-@end deffn
-
- instance?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:799
-@deffn {Scheme Procedure} instance? obj
-@deffnx {C Function} scm_instance_p (obj)
-Return @code{#t} if @var{obj} is an instance.
-@end deffn
-
- class-name
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:814
-@deffn {Scheme Procedure} class-name obj
-@deffnx {C Function} scm_class_name (obj)
-Return the class name of @var{obj}.
-@end deffn
-
- class-direct-supers
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:824
-@deffn {Scheme Procedure} class-direct-supers obj
-@deffnx {C Function} scm_class_direct_supers (obj)
-Return the direct superclasses of the class @var{obj}.
-@end deffn
-
- class-direct-slots
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:834
-@deffn {Scheme Procedure} class-direct-slots obj
-@deffnx {C Function} scm_class_direct_slots (obj)
-Return the direct slots of the class @var{obj}.
-@end deffn
-
- class-direct-subclasses
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:844
-@deffn {Scheme Procedure} class-direct-subclasses obj
-@deffnx {C Function} scm_class_direct_subclasses (obj)
-Return the direct subclasses of the class @var{obj}.
-@end deffn
-
- class-direct-methods
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:854
-@deffn {Scheme Procedure} class-direct-methods obj
-@deffnx {C Function} scm_class_direct_methods (obj)
-Return the direct methods of the class @var{obj}
-@end deffn
-
- class-precedence-list
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:864
-@deffn {Scheme Procedure} class-precedence-list obj
-@deffnx {C Function} scm_class_precedence_list (obj)
-Return the class precedence list of the class @var{obj}.
-@end deffn
-
- class-slots
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:874
-@deffn {Scheme Procedure} class-slots obj
-@deffnx {C Function} scm_class_slots (obj)
-Return the slot list of the class @var{obj}.
-@end deffn
-
- class-environment
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:884
-@deffn {Scheme Procedure} class-environment obj
-@deffnx {C Function} scm_class_environment (obj)
-Return the environment of the class @var{obj}.
-@end deffn
-
- generic-function-name
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:895
-@deffn {Scheme Procedure} generic-function-name obj
-@deffnx {C Function} scm_generic_function_name (obj)
-Return the name of the generic function @var{obj}.
-@end deffn
-
- generic-function-methods
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:905
-@deffn {Scheme Procedure} generic-function-methods obj
-@deffnx {C Function} scm_generic_function_methods (obj)
-Return the methods of the generic function @var{obj}.
-@end deffn
-
- method-generic-function
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:916
-@deffn {Scheme Procedure} method-generic-function obj
-@deffnx {C Function} scm_method_generic_function (obj)
-Return the generic function for the method @var{obj}.
-@end deffn
-
- method-specializers
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:926
-@deffn {Scheme Procedure} method-specializers obj
-@deffnx {C Function} scm_method_specializers (obj)
-Return specializers of the method @var{obj}.
-@end deffn
-
- method-procedure
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:936
-@deffn {Scheme Procedure} method-procedure obj
-@deffnx {C Function} scm_method_procedure (obj)
-Return the procedure of the method @var{obj}.
-@end deffn
-
- accessor-method-slot-definition
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:946
-@deffn {Scheme Procedure} accessor-method-slot-definition obj
-@deffnx {C Function} scm_accessor_method_slot_definition (obj)
-Return the slot definition of the accessor @var{obj}.
-@end deffn
-
- %tag-body
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:956
-@deffn {Scheme Procedure} %tag-body body
-@deffnx {C Function} scm_sys_tag_body (body)
-Internal GOOPS magic---don't use this function!
-@end deffn
-
- make-unbound
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:971
-@deffn {Scheme Procedure} make-unbound
-@deffnx {C Function} scm_make_unbound ()
-Return the unbound value.
-@end deffn
-
- unbound?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:980
-@deffn {Scheme Procedure} unbound? obj
-@deffnx {C Function} scm_unbound_p (obj)
-Return @code{#t} if @var{obj} is unbound.
-@end deffn
-
- assert-bound
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:990
-@deffn {Scheme Procedure} assert-bound value obj
-@deffnx {C Function} scm_assert_bound (value, obj)
-Return @var{value} if it is bound, and invoke the
-@var{slot-unbound} method of @var{obj} if it is not.
-@end deffn
-
- @@assert-bound-ref
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:1002
-@deffn {Scheme Procedure} @@assert-bound-ref obj index
-@deffnx {C Function} scm_at_assert_bound_ref (obj, index)
-Like @code{assert-bound}, but use @var{index} for accessing
-the value from @var{obj}.
-@end deffn
-
- %fast-slot-ref
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:1014
-@deffn {Scheme Procedure} %fast-slot-ref obj index
-@deffnx {C Function} scm_sys_fast_slot_ref (obj, index)
-Return the slot value with index @var{index} from @var{obj}.
-@end deffn
-
- %fast-slot-set!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:1032
-@deffn {Scheme Procedure} %fast-slot-set! obj index value
-@deffnx {C Function} scm_sys_fast_slot_set_x (obj, index, value)
-Set the slot with index @var{index} in @var{obj} to
-@var{value}.
-@end deffn
-
- slot-ref-using-class
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:1162
-@deffn {Scheme Procedure} slot-ref-using-class class obj slot_name
-@deffnx {C Function} scm_slot_ref_using_class (class, obj, slot_name)
-
-@end deffn
-
- slot-set-using-class!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:1181
-@deffn {Scheme Procedure} slot-set-using-class! class obj slot_name value
-@deffnx {C Function} scm_slot_set_using_class_x (class, obj, slot_name, value)
-
-@end deffn
-
- slot-bound-using-class?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:1195
-@deffn {Scheme Procedure} slot-bound-using-class? class obj slot_name
-@deffnx {C Function} scm_slot_bound_using_class_p (class, obj, slot_name)
-
-@end deffn
-
- slot-exists-using-class?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:1210
-@deffn {Scheme Procedure} slot-exists-using-class? class obj slot_name
-@deffnx {C Function} scm_slot_exists_using_class_p (class, obj, slot_name)
-
-@end deffn
-
- slot-ref
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:1226
-@deffn {Scheme Procedure} slot-ref obj slot_name
-@deffnx {C Function} scm_slot_ref (obj, slot_name)
-Return the value from @var{obj}'s slot with the name
-@var{slot_name}.
-@end deffn
-
- slot-set!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:1243
-@deffn {Scheme Procedure} slot-set! obj slot_name value
-@deffnx {C Function} scm_slot_set_x (obj, slot_name, value)
-Set the slot named @var{slot_name} of @var{obj} to @var{value}.
-@end deffn
-
- slot-bound?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:1260
-@deffn {Scheme Procedure} slot-bound? obj slot_name
-@deffnx {C Function} scm_slot_bound_p (obj, slot_name)
-Return @code{#t} if the slot named @var{slot_name} of @var{obj}
-is bound.
-@end deffn
-
- slot-exists?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:1278
-@deffn {Scheme Procedure} slot-exists? obj slot_name
-@deffnx {C Function} scm_slot_exists_p (obj, slot_name)
-Return @code{#t} if @var{obj} has a slot named @var{slot_name}.
-@end deffn
-
- %allocate-instance
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:1317
-@deffn {Scheme Procedure} %allocate-instance class initargs
-@deffnx {C Function} scm_sys_allocate_instance (class, initargs)
-Create a new instance of class @var{class} and initialize it
-from the arguments @var{initargs}.
-@end deffn
-
- %set-object-setter!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:1387
-@deffn {Scheme Procedure} %set-object-setter! obj setter
-@deffnx {C Function} scm_sys_set_object_setter_x (obj, setter)
-
-@end deffn
-
- %modify-instance
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:1412
-@deffn {Scheme Procedure} %modify-instance old new
-@deffnx {C Function} scm_sys_modify_instance (old, new)
-
-@end deffn
-
- %modify-class
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:1438
-@deffn {Scheme Procedure} %modify-class old new
-@deffnx {C Function} scm_sys_modify_class (old, new)
-
-@end deffn
-
- %invalidate-class
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:1462
-@deffn {Scheme Procedure} %invalidate-class class
-@deffnx {C Function} scm_sys_invalidate_class (class)
-
-@end deffn
-
- %invalidate-method-cache!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:1589
-@deffn {Scheme Procedure} %invalidate-method-cache! gf
-@deffnx {C Function} scm_sys_invalidate_method_cache_x (gf)
-
-@end deffn
-
- generic-capability?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:1615
-@deffn {Scheme Procedure} generic-capability? proc
-@deffnx {C Function} scm_generic_capability_p (proc)
-
-@end deffn
-
- enable-primitive-generic!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:1628
-@deffn {Scheme Procedure} enable-primitive-generic! . subrs
-@deffnx {C Function} scm_enable_primitive_generic_x (subrs)
-
-@end deffn
-
- primitive-generic-generic
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:1649
-@deffn {Scheme Procedure} primitive-generic-generic subr
-@deffnx {C Function} scm_primitive_generic_generic (subr)
-
-@end deffn
-
- make
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:2010
-@deffn {Scheme Procedure} make . args
-@deffnx {C Function} scm_make (args)
-Make a new object. @var{args} must contain the class and
-all necessary initialization information.
-@end deffn
-
- find-method
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:2103
-@deffn {Scheme Procedure} find-method . l
-@deffnx {C Function} scm_find_method (l)
-
-@end deffn
-
- %method-more-specific?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:2123
-@deffn {Scheme Procedure} %method-more-specific? m1 m2 targs
-@deffnx {C Function} scm_sys_method_more_specific_p (m1, m2, targs)
-
-@end deffn
-
- %goops-loaded
-@c snarfed from /home/ghouston/guile/guile-core/libguile/goops.c:2648
-@deffn {Scheme Procedure} %goops-loaded
-@deffnx {C Function} scm_sys_goops_loaded ()
-Announce that GOOPS is loaded and perform initialization
-on the C level which depends on the loaded GOOPS modules.
-@end deffn
-
- make-guardian
-@c snarfed from /home/ghouston/guile/guile-core/libguile/guardians.c:330
-@deffn {Scheme Procedure} make-guardian [greedy_p]
-@deffnx {C Function} scm_make_guardian (greedy_p)
-Create a new guardian.
-A guardian protects a set of objects from garbage collection,
-allowing a program to apply cleanup or other actions.
-
-@code{make-guardian} returns a procedure representing the guardian.
-Calling the guardian procedure with an argument adds the
-argument to the guardian's set of protected objects.
-Calling the guardian procedure without an argument returns
-one of the protected objects which are ready for garbage
-collection, or @code{#f} if no such object is available.
-Objects which are returned in this way are removed from
-the guardian.
-
-@code{make-guardian} takes one optional argument that says whether the
-new guardian should be greedy or sharing. If there is any chance
-that any object protected by the guardian may be resurrected,
-then you should make the guardian greedy (this is the default).
-
-See R. Kent Dybvig, Carl Bruggeman, and David Eby (1993)
-"Guardians in a Generation-Based Garbage Collector".
-ACM SIGPLAN Conference on Programming Language Design
-and Implementation, June 1993.
-
-(the semantics are slightly different at this point, but the
-paper still (mostly) accurately describes the interface).
-@end deffn
-
- guardian-destroyed?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/guardians.c:358
-@deffn {Scheme Procedure} guardian-destroyed? guardian
-@deffnx {C Function} scm_guardian_destroyed_p (guardian)
-Return @code{#t} if @var{guardian} has been destroyed, otherwise @code{#f}.
-@end deffn
-
- guardian-greedy?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/guardians.c:376
-@deffn {Scheme Procedure} guardian-greedy? guardian
-@deffnx {C Function} scm_guardian_greedy_p (guardian)
-Return @code{#t} if @var{guardian} is a greedy guardian, otherwise @code{#f}.
-@end deffn
-
- destroy-guardian!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/guardians.c:387
-@deffn {Scheme Procedure} destroy-guardian! guardian
-@deffnx {C Function} scm_destroy_guardian_x (guardian)
-Destroys @var{guardian}, by making it impossible to put any more
-objects in it or get any objects from it. It also unguards any
-objects guarded by @var{guardian}.
-@end deffn
-
- hashq
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hash.c:200
-@deffn {Scheme Procedure} hashq key size
-@deffnx {C Function} scm_hashq (key, size)
-Determine a hash value for @var{key} that is suitable for
-lookups in a hashtable of size @var{size}, where @code{eq?} is
-used as the equality predicate. The function returns an
-integer in the range 0 to @var{size} - 1. Note that
-@code{hashq} may use internal addresses. Thus two calls to
-hashq where the keys are @code{eq?} are not guaranteed to
-deliver the same value if the key object gets garbage collected
-in between. This can happen, for example with symbols:
-@code{(hashq 'foo n) (gc) (hashq 'foo n)} may produce two
-different values, since @code{foo} will be garbage collected.
-@end deffn
-
- hashv
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hash.c:236
-@deffn {Scheme Procedure} hashv key size
-@deffnx {C Function} scm_hashv (key, size)
-Determine a hash value for @var{key} that is suitable for
-lookups in a hashtable of size @var{size}, where @code{eqv?} is
-used as the equality predicate. The function returns an
-integer in the range 0 to @var{size} - 1. Note that
-@code{(hashv key)} may use internal addresses. Thus two calls
-to hashv where the keys are @code{eqv?} are not guaranteed to
-deliver the same value if the key object gets garbage collected
-in between. This can happen, for example with symbols:
-@code{(hashv 'foo n) (gc) (hashv 'foo n)} may produce two
-different values, since @code{foo} will be garbage collected.
-@end deffn
-
- hash
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hash.c:259
-@deffn {Scheme Procedure} hash key size
-@deffnx {C Function} scm_hash (key, size)
-Determine a hash value for @var{key} that is suitable for
-lookups in a hashtable of size @var{size}, where @code{equal?}
-is used as the equality predicate. The function returns an
-integer in the range 0 to @var{size} - 1.
-@end deffn
-
- hashq-get-handle
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hashtab.c:173
-@deffn {Scheme Procedure} hashq-get-handle table key
-@deffnx {C Function} scm_hashq_get_handle (table, key)
-This procedure returns the @code{(key . value)} pair from the
-hash table @var{table}. If @var{table} does not hold an
-associated value for @var{key}, @code{#f} is returned.
-Uses @code{eq?} for equality testing.
-@end deffn
-
- hashq-create-handle!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hashtab.c:185
-@deffn {Scheme Procedure} hashq-create-handle! table key init
-@deffnx {C Function} scm_hashq_create_handle_x (table, key, init)
-This function looks up @var{key} in @var{table} and returns its handle.
-If @var{key} is not already present, a new handle is created which
-associates @var{key} with @var{init}.
-@end deffn
-
- hashq-ref
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hashtab.c:198
-@deffn {Scheme Procedure} hashq-ref table key [dflt]
-@deffnx {C Function} scm_hashq_ref (table, key, dflt)
-Look up @var{key} in the hash table @var{table}, and return the
-value (if any) associated with it. If @var{key} is not found,
-return @var{default} (or @code{#f} if no @var{default} argument
-is supplied). Uses @code{eq?} for equality testing.
-@end deffn
-
- hashq-set!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hashtab.c:212
-@deffn {Scheme Procedure} hashq-set! table key val
-@deffnx {C Function} scm_hashq_set_x (table, key, val)
-Find the entry in @var{table} associated with @var{key}, and
-store @var{value} there. Uses @code{eq?} for equality testing.
-@end deffn
-
- hashq-remove!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hashtab.c:224
-@deffn {Scheme Procedure} hashq-remove! table key
-@deffnx {C Function} scm_hashq_remove_x (table, key)
-Remove @var{key} (and any value associated with it) from
-@var{table}. Uses @code{eq?} for equality tests.
-@end deffn
-
- hashv-get-handle
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hashtab.c:240
-@deffn {Scheme Procedure} hashv-get-handle table key
-@deffnx {C Function} scm_hashv_get_handle (table, key)
-This procedure returns the @code{(key . value)} pair from the
-hash table @var{table}. If @var{table} does not hold an
-associated value for @var{key}, @code{#f} is returned.
-Uses @code{eqv?} for equality testing.
-@end deffn
-
- hashv-create-handle!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hashtab.c:252
-@deffn {Scheme Procedure} hashv-create-handle! table key init
-@deffnx {C Function} scm_hashv_create_handle_x (table, key, init)
-This function looks up @var{key} in @var{table} and returns its handle.
-If @var{key} is not already present, a new handle is created which
-associates @var{key} with @var{init}.
-@end deffn
-
- hashv-ref
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hashtab.c:266
-@deffn {Scheme Procedure} hashv-ref table key [dflt]
-@deffnx {C Function} scm_hashv_ref (table, key, dflt)
-Look up @var{key} in the hash table @var{table}, and return the
-value (if any) associated with it. If @var{key} is not found,
-return @var{default} (or @code{#f} if no @var{default} argument
-is supplied). Uses @code{eqv?} for equality testing.
-@end deffn
-
- hashv-set!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hashtab.c:280
-@deffn {Scheme Procedure} hashv-set! table key val
-@deffnx {C Function} scm_hashv_set_x (table, key, val)
-Find the entry in @var{table} associated with @var{key}, and
-store @var{value} there. Uses @code{eqv?} for equality testing.
-@end deffn
-
- hashv-remove!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hashtab.c:291
-@deffn {Scheme Procedure} hashv-remove! table key
-@deffnx {C Function} scm_hashv_remove_x (table, key)
-Remove @var{key} (and any value associated with it) from
-@var{table}. Uses @code{eqv?} for equality tests.
-@end deffn
-
- hash-get-handle
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hashtab.c:306
-@deffn {Scheme Procedure} hash-get-handle table key
-@deffnx {C Function} scm_hash_get_handle (table, key)
-This procedure returns the @code{(key . value)} pair from the
-hash table @var{table}. If @var{table} does not hold an
-associated value for @var{key}, @code{#f} is returned.
-Uses @code{equal?} for equality testing.
-@end deffn
-
- hash-create-handle!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hashtab.c:318
-@deffn {Scheme Procedure} hash-create-handle! table key init
-@deffnx {C Function} scm_hash_create_handle_x (table, key, init)
-This function looks up @var{key} in @var{table} and returns its handle.
-If @var{key} is not already present, a new handle is created which
-associates @var{key} with @var{init}.
-@end deffn
-
- hash-ref
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hashtab.c:331
-@deffn {Scheme Procedure} hash-ref table key [dflt]
-@deffnx {C Function} scm_hash_ref (table, key, dflt)
-Look up @var{key} in the hash table @var{table}, and return the
-value (if any) associated with it. If @var{key} is not found,
-return @var{default} (or @code{#f} if no @var{default} argument
-is supplied). Uses @code{equal?} for equality testing.
-@end deffn
-
- hash-set!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hashtab.c:346
-@deffn {Scheme Procedure} hash-set! table key val
-@deffnx {C Function} scm_hash_set_x (table, key, val)
-Find the entry in @var{table} associated with @var{key}, and
-store @var{value} there. Uses @code{equal?} for equality
-testing.
-@end deffn
-
- hash-remove!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hashtab.c:358
-@deffn {Scheme Procedure} hash-remove! table key
-@deffnx {C Function} scm_hash_remove_x (table, key)
-Remove @var{key} (and any value associated with it) from
-@var{table}. Uses @code{equal?} for equality tests.
-@end deffn
-
- hashx-get-handle
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hashtab.c:422
-@deffn {Scheme Procedure} hashx-get-handle hash assoc table key
-@deffnx {C Function} scm_hashx_get_handle (hash, assoc, table, key)
-This behaves the same way as the corresponding
-@code{-get-handle} function, but uses @var{hash} as a hash
-function and @var{assoc} to compare keys. @code{hash} must be
-a function that takes two arguments, a key to be hashed and a
-table size. @code{assoc} must be an associator function, like
-@code{assoc}, @code{assq} or @code{assv}.
-@end deffn
-
- hashx-create-handle!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hashtab.c:441
-@deffn {Scheme Procedure} hashx-create-handle! hash assoc table key init
-@deffnx {C Function} scm_hashx_create_handle_x (hash, assoc, table, key, init)
-This behaves the same way as the corresponding
-@code{-create-handle} function, but uses @var{hash} as a hash
-function and @var{assoc} to compare keys. @code{hash} must be
-a function that takes two arguments, a key to be hashed and a
-table size. @code{assoc} must be an associator function, like
-@code{assoc}, @code{assq} or @code{assv}.
-@end deffn
-
- hashx-ref
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hashtab.c:464
-@deffn {Scheme Procedure} hashx-ref hash assoc table key [dflt]
-@deffnx {C Function} scm_hashx_ref (hash, assoc, table, key, dflt)
-This behaves the same way as the corresponding @code{ref}
-function, but uses @var{hash} as a hash function and
-@var{assoc} to compare keys. @code{hash} must be a function
-that takes two arguments, a key to be hashed and a table size.
-@code{assoc} must be an associator function, like @code{assoc},
-@code{assq} or @code{assv}.
-
-By way of illustration, @code{hashq-ref table key} is
-equivalent to @code{hashx-ref hashq assq table key}.
-@end deffn
-
- hashx-set!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hashtab.c:490
-@deffn {Scheme Procedure} hashx-set! hash assoc table key val
-@deffnx {C Function} scm_hashx_set_x (hash, assoc, table, key, val)
-This behaves the same way as the corresponding @code{set!}
-function, but uses @var{hash} as a hash function and
-@var{assoc} to compare keys. @code{hash} must be a function
-that takes two arguments, a key to be hashed and a table size.
-@code{assoc} must be an associator function, like @code{assoc},
-@code{assq} or @code{assv}.
-
- By way of illustration, @code{hashq-set! table key} is
-equivalent to @code{hashx-set! hashq assq table key}.
-@end deffn
-
- hash-fold
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hashtab.c:528
-@deffn {Scheme Procedure} hash-fold proc init table
-@deffnx {C Function} scm_hash_fold (proc, init, table)
-An iterator over hash-table elements.
-Accumulates and returns a result by applying PROC successively.
-The arguments to PROC are "(key value prior-result)" where key
-and value are successive pairs from the hash table TABLE, and
-prior-result is either INIT (for the first application of PROC)
-or the return value of the previous application of PROC.
-For example, @code{(hash-fold acons '() tab)} will convert a hash
-table into an a-list of key-value pairs.
-@end deffn
-
- make-hook
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hooks.c:178
-@deffn {Scheme Procedure} make-hook [n_args]
-@deffnx {C Function} scm_make_hook (n_args)
-Create a hook for storing procedure of arity @var{n_args}.
-@var{n_args} defaults to zero. The returned value is a hook
-object to be used with the other hook procedures.
-@end deffn
-
- hook?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hooks.c:201
-@deffn {Scheme Procedure} hook? x
-@deffnx {C Function} scm_hook_p (x)
-Return @code{#t} if @var{x} is a hook, @code{#f} otherwise.
-@end deffn
-
- hook-empty?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hooks.c:212
-@deffn {Scheme Procedure} hook-empty? hook
-@deffnx {C Function} scm_hook_empty_p (hook)
-Return @code{#t} if @var{hook} is an empty hook, @code{#f}
-otherwise.
-@end deffn
-
- add-hook!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hooks.c:226
-@deffn {Scheme Procedure} add-hook! hook proc [append_p]
-@deffnx {C Function} scm_add_hook_x (hook, proc, append_p)
-Add the procedure @var{proc} to the hook @var{hook}. The
-procedure is added to the end if @var{append_p} is true,
-otherwise it is added to the front. The return value of this
-procedure is not specified.
-@end deffn
-
- remove-hook!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hooks.c:253
-@deffn {Scheme Procedure} remove-hook! hook proc
-@deffnx {C Function} scm_remove_hook_x (hook, proc)
-Remove the procedure @var{proc} from the hook @var{hook}. The
-return value of this procedure is not specified.
-@end deffn
-
- reset-hook!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hooks.c:267
-@deffn {Scheme Procedure} reset-hook! hook
-@deffnx {C Function} scm_reset_hook_x (hook)
-Remove all procedures from the hook @var{hook}. The return
-value of this procedure is not specified.
-@end deffn
-
- run-hook
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hooks.c:281
-@deffn {Scheme Procedure} run-hook hook . args
-@deffnx {C Function} scm_run_hook (hook, args)
-Apply all procedures from the hook @var{hook} to the arguments
-@var{args}. The order of the procedure application is first to
-last. The return value of this procedure is not specified.
-@end deffn
-
- hook->list
-@c snarfed from /home/ghouston/guile/guile-core/libguile/hooks.c:308
-@deffn {Scheme Procedure} hook->list hook
-@deffnx {C Function} scm_hook_to_list (hook)
-Convert the procedure list of @var{hook} to a list.
-@end deffn
-
- ftell
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ioext.c:73
-@deffn {Scheme Procedure} ftell fd_port
-@deffnx {C Function} scm_ftell (fd_port)
-Return an integer representing the current position of
-@var{fd/port}, measured from the beginning. Equivalent to:
-
-@lisp
-(seek port 0 SEEK_CUR)
-@end lisp
-@end deffn
-
- redirect-port
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ioext.c:91
-@deffn {Scheme Procedure} redirect-port old new
-@deffnx {C Function} scm_redirect_port (old, new)
-This procedure takes two ports and duplicates the underlying file
-descriptor from @var{old-port} into @var{new-port}. The
-current file descriptor in @var{new-port} will be closed.
-After the redirection the two ports will share a file position
-and file status flags.
-
-The return value is unspecified.
-
-Unexpected behaviour can result if both ports are subsequently used
-and the original and/or duplicate ports are buffered.
-
-This procedure does not have any side effects on other ports or
-revealed counts.
-@end deffn
-
- dup->fdes
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ioext.c:130
-@deffn {Scheme Procedure} dup->fdes fd_or_port [fd]
-@deffnx {C Function} scm_dup_to_fdes (fd_or_port, fd)
-Return a new integer file descriptor referring to the open file
-designated by @var{fd_or_port}, which must be either an open
-file port or a file descriptor.
-@end deffn
-
- dup2
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ioext.c:177
-@deffn {Scheme Procedure} dup2 oldfd newfd
-@deffnx {C Function} scm_dup2 (oldfd, newfd)
-A simple wrapper for the @code{dup2} system call.
-Copies the file descriptor @var{oldfd} to descriptor
-number @var{newfd}, replacing the previous meaning
-of @var{newfd}. Both @var{oldfd} and @var{newfd} must
-be integers.
-Unlike for dup->fdes or primitive-move->fdes, no attempt
-is made to move away ports which are using @var{newfd}.
-The return value is unspecified.
-@end deffn
-
- fileno
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ioext.c:196
-@deffn {Scheme Procedure} fileno port
-@deffnx {C Function} scm_fileno (port)
-Return the integer file descriptor underlying @var{port}. Does
-not change its revealed count.
-@end deffn
-
- isatty?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ioext.c:216
-@deffn {Scheme Procedure} isatty? port
-@deffnx {C Function} scm_isatty_p (port)
-Return @code{#t} if @var{port} is using a serial non--file
-device, otherwise @code{#f}.
-@end deffn
-
- fdopen
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ioext.c:238
-@deffn {Scheme Procedure} fdopen fdes modes
-@deffnx {C Function} scm_fdopen (fdes, modes)
-Return a new port based on the file descriptor @var{fdes}.
-Modes are given by the string @var{modes}. The revealed count
-of the port is initialized to zero. The modes string is the
-same as that accepted by @ref{File Ports, open-file}.
-@end deffn
-
- primitive-move->fdes
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ioext.c:262
-@deffn {Scheme Procedure} primitive-move->fdes port fd
-@deffnx {C Function} scm_primitive_move_to_fdes (port, fd)
-Moves the underlying file descriptor for @var{port} to the integer
-value @var{fdes} without changing the revealed count of @var{port}.
-Any other ports already using this descriptor will be automatically
-shifted to new descriptors and their revealed counts reset to zero.
-The return value is @code{#f} if the file descriptor already had the
-required value or @code{#t} if it was moved.
-@end deffn
-
- fdes->ports
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ioext.c:296
-@deffn {Scheme Procedure} fdes->ports fd
-@deffnx {C Function} scm_fdes_to_ports (fd)
-Return a list of existing ports which have @var{fdes} as an
-underlying file descriptor, without changing their revealed
-counts.
-@end deffn
-
- make-keyword-from-dash-symbol
-@c snarfed from /home/ghouston/guile/guile-core/libguile/keywords.c:74
-@deffn {Scheme Procedure} make-keyword-from-dash-symbol symbol
-@deffnx {C Function} scm_make_keyword_from_dash_symbol (symbol)
-Make a keyword object from a @var{symbol} that starts with a dash.
-@end deffn
-
- keyword?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/keywords.c:112
-@deffn {Scheme Procedure} keyword? obj
-@deffnx {C Function} scm_keyword_p (obj)
-Return @code{#t} if the argument @var{obj} is a keyword, else
-@code{#f}.
-@end deffn
-
- keyword-dash-symbol
-@c snarfed from /home/ghouston/guile/guile-core/libguile/keywords.c:123
-@deffn {Scheme Procedure} keyword-dash-symbol keyword
-@deffnx {C Function} scm_keyword_dash_symbol (keyword)
-Return the dash symbol for @var{keyword}.
-This is the inverse of @code{make-keyword-from-dash-symbol}.
-@end deffn
-
- list
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:127
-@deffn {Scheme Procedure} list . objs
-@deffnx {C Function} scm_list (objs)
-Return a list containing @var{objs}, the arguments to
-@code{list}.
-@end deffn
-
- cons*
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:142
-@deffn {Scheme Procedure} cons* arg . rest
-@deffnx {C Function} scm_cons_star (arg, rest)
-Like @code{list}, but the last arg provides the tail of the
-constructed list, returning @code{(cons @var{arg1} (cons
-@var{arg2} (cons @dots{} @var{argn})))}. Requires at least one
-argument. If given one argument, that argument is returned as
-result. This function is called @code{list*} in some other
-Schemes and in Common LISP.
-@end deffn
-
- null?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:166
-@deffn {Scheme Procedure} null? x
-@deffnx {C Function} scm_null_p (x)
-Return @code{#t} iff @var{x} is the empty list, else @code{#f}.
-@end deffn
-
- list?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:176
-@deffn {Scheme Procedure} list? x
-@deffnx {C Function} scm_list_p (x)
-Return @code{#t} iff @var{x} is a proper list, else @code{#f}.
-@end deffn
-
- length
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:217
-@deffn {Scheme Procedure} length lst
-@deffnx {C Function} scm_length (lst)
-Return the number of elements in list @var{lst}.
-@end deffn
-
- append
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:246
-@deffn {Scheme Procedure} append . args
-@deffnx {C Function} scm_append (args)
-Return a list consisting of the elements the lists passed as
-arguments.
-@lisp
-(append '(x) '(y)) @result{} (x y)
-(append '(a) '(b c d)) @result{} (a b c d)
-(append '(a (b)) '((c))) @result{} (a (b) (c))
-@end lisp
-The resulting list is always newly allocated, except that it
-shares structure with the last list argument. The last
-argument may actually be any object; an improper list results
-if the last argument is not a proper list.
-@lisp
-(append '(a b) '(c . d)) @result{} (a b c . d)
-(append '() 'a) @result{} a
-@end lisp
-@end deffn
-
- append!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:280
-@deffn {Scheme Procedure} append! . lists
-@deffnx {C Function} scm_append_x (lists)
-A destructive version of @code{append} (@pxref{Pairs and
-Lists,,,r5rs, The Revised^5 Report on Scheme}). The cdr field
-of each list's final pair is changed to point to the head of
-the next list, so no consing is performed. Return a pointer to
-the mutated list.
-@end deffn
-
- last-pair
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:306
-@deffn {Scheme Procedure} last-pair lst
-@deffnx {C Function} scm_last_pair (lst)
-Return a pointer to the last pair in @var{lst}, signalling an error if
-@var{lst} is circular.
-@end deffn
-
- reverse
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:336
-@deffn {Scheme Procedure} reverse lst
-@deffnx {C Function} scm_reverse (lst)
-Return a new list that contains the elements of @var{lst} but
-in reverse order.
-@end deffn
-
- reverse!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:370
-@deffn {Scheme Procedure} reverse! lst [new_tail]
-@deffnx {C Function} scm_reverse_x (lst, new_tail)
-A destructive version of @code{reverse} (@pxref{Pairs and Lists,,,r5rs,
-The Revised^5 Report on Scheme}). The cdr of each cell in @var{lst} is
-modified to point to the previous list element. Return a pointer to the
-head of the reversed list.
-
-Caveat: because the list is modified in place, the tail of the original
-list now becomes its head, and the head of the original list now becomes
-the tail. Therefore, the @var{lst} symbol to which the head of the
-original list was bound now points to the tail. To ensure that the head
-of the modified list is not lost, it is wise to save the return value of
-@code{reverse!}
-@end deffn
-
- list-ref
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:396
-@deffn {Scheme Procedure} list-ref list k
-@deffnx {C Function} scm_list_ref (list, k)
-Return the @var{k}th element from @var{list}.
-@end deffn
-
- list-set!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:420
-@deffn {Scheme Procedure} list-set! list k val
-@deffnx {C Function} scm_list_set_x (list, k, val)
-Set the @var{k}th element of @var{list} to @var{val}.
-@end deffn
-
- list-cdr-ref
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:443
-@deffn {Scheme Procedure} list-cdr-ref
-implemented by the C function "scm_list_tail"
-@end deffn
-
- list-tail
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:452
-@deffn {Scheme Procedure} list-tail lst k
-@deffnx {Scheme Procedure} list-cdr-ref lst k
-@deffnx {C Function} scm_list_tail (lst, k)
-Return the "tail" of @var{lst} beginning with its @var{k}th element.
-The first element of the list is considered to be element 0.
-
-@code{list-tail} and @code{list-cdr-ref} are identical. It may help to
-think of @code{list-cdr-ref} as accessing the @var{k}th cdr of the list,
-or returning the results of cdring @var{k} times down @var{lst}.
-@end deffn
-
- list-cdr-set!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:468
-@deffn {Scheme Procedure} list-cdr-set! list k val
-@deffnx {C Function} scm_list_cdr_set_x (list, k, val)
-Set the @var{k}th cdr of @var{list} to @var{val}.
-@end deffn
-
- list-head
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:497
-@deffn {Scheme Procedure} list-head lst k
-@deffnx {C Function} scm_list_head (lst, k)
-Copy the first @var{k} elements from @var{lst} into a new list, and
-return it.
-@end deffn
-
- list-copy
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:521
-@deffn {Scheme Procedure} list-copy lst
-@deffnx {C Function} scm_list_copy (lst)
-Return a (newly-created) copy of @var{lst}.
-@end deffn
-
- memq
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:575
-@deffn {Scheme Procedure} memq x lst
-@deffnx {C Function} scm_memq (x, lst)
-Return the first sublist of @var{lst} whose car is @code{eq?}
-to @var{x} where the sublists of @var{lst} are the non-empty
-lists returned by @code{(list-tail @var{lst} @var{k})} for
-@var{k} less than the length of @var{lst}. If @var{x} does not
-occur in @var{lst}, then @code{#f} (not the empty list) is
-returned.
-@end deffn
-
- memv
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:591
-@deffn {Scheme Procedure} memv x lst
-@deffnx {C Function} scm_memv (x, lst)
-Return the first sublist of @var{lst} whose car is @code{eqv?}
-to @var{x} where the sublists of @var{lst} are the non-empty
-lists returned by @code{(list-tail @var{lst} @var{k})} for
-@var{k} less than the length of @var{lst}. If @var{x} does not
-occur in @var{lst}, then @code{#f} (not the empty list) is
-returned.
-@end deffn
-
- member
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:612
-@deffn {Scheme Procedure} member x lst
-@deffnx {C Function} scm_member (x, lst)
-Return the first sublist of @var{lst} whose car is
-@code{equal?} to @var{x} where the sublists of @var{lst} are
-the non-empty lists returned by @code{(list-tail @var{lst}
-@var{k})} for @var{k} less than the length of @var{lst}. If
-@var{x} does not occur in @var{lst}, then @code{#f} (not the
-empty list) is returned.
-@end deffn
-
- delq!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:637
-@deffn {Scheme Procedure} delq! item lst
-@deffnx {Scheme Procedure} delv! item lst
-@deffnx {Scheme Procedure} delete! item lst
-@deffnx {C Function} scm_delq_x (item, lst)
-These procedures are destructive versions of @code{delq}, @code{delv}
-and @code{delete}: they modify the pointers in the existing @var{lst}
-rather than creating a new list. Caveat evaluator: Like other
-destructive list functions, these functions cannot modify the binding of
-@var{lst}, and so cannot be used to delete the first element of
-@var{lst} destructively.
-@end deffn
-
- delv!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:661
-@deffn {Scheme Procedure} delv! item lst
-@deffnx {C Function} scm_delv_x (item, lst)
-Destructively remove all elements from @var{lst} that are
-@code{eqv?} to @var{item}.
-@end deffn
-
- delete!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:686
-@deffn {Scheme Procedure} delete! item lst
-@deffnx {C Function} scm_delete_x (item, lst)
-Destructively remove all elements from @var{lst} that are
-@code{equal?} to @var{item}.
-@end deffn
-
- delq
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:715
-@deffn {Scheme Procedure} delq item lst
-@deffnx {C Function} scm_delq (item, lst)
-Return a newly-created copy of @var{lst} with elements
-@code{eq?} to @var{item} removed. This procedure mirrors
-@code{memq}: @code{delq} compares elements of @var{lst} against
-@var{item} with @code{eq?}.
-@end deffn
-
- delv
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:728
-@deffn {Scheme Procedure} delv item lst
-@deffnx {C Function} scm_delv (item, lst)
-Return a newly-created copy of @var{lst} with elements
-@code{eqv?} to @var{item} removed. This procedure mirrors
-@code{memv}: @code{delv} compares elements of @var{lst} against
-@var{item} with @code{eqv?}.
-@end deffn
-
- delete
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:741
-@deffn {Scheme Procedure} delete item lst
-@deffnx {C Function} scm_delete (item, lst)
-Return a newly-created copy of @var{lst} with elements
-@code{equal?} to @var{item} removed. This procedure mirrors
-@code{member}: @code{delete} compares elements of @var{lst}
-against @var{item} with @code{equal?}.
-@end deffn
-
- delq1!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:754
-@deffn {Scheme Procedure} delq1! item lst
-@deffnx {C Function} scm_delq1_x (item, lst)
-Like @code{delq!}, but only deletes the first occurrence of
-@var{item} from @var{lst}. Tests for equality using
-@code{eq?}. See also @code{delv1!} and @code{delete1!}.
-@end deffn
-
- delv1!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:782
-@deffn {Scheme Procedure} delv1! item lst
-@deffnx {C Function} scm_delv1_x (item, lst)
-Like @code{delv!}, but only deletes the first occurrence of
-@var{item} from @var{lst}. Tests for equality using
-@code{eqv?}. See also @code{delq1!} and @code{delete1!}.
-@end deffn
-
- delete1!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/list.c:810
-@deffn {Scheme Procedure} delete1! item lst
-@deffnx {C Function} scm_delete1_x (item, lst)
-Like @code{delete!}, but only deletes the first occurrence of
-@var{item} from @var{lst}. Tests for equality using
-@code{equal?}. See also @code{delq1!} and @code{delv1!}.
-@end deffn
-
- primitive-load
-@c snarfed from /home/ghouston/guile/guile-core/libguile/load.c:111
-@deffn {Scheme Procedure} primitive-load filename
-@deffnx {C Function} scm_primitive_load (filename)
-Load the file named @var{filename} and evaluate its contents in
-the top-level environment. The load paths are not searched;
-@var{filename} must either be a full pathname or be a pathname
-relative to the current directory. If the variable
-@code{%load-hook} is defined, it should be bound to a procedure
-that will be called before any code is loaded. See the
-documentation for @code{%load-hook} later in this section.
-@end deffn
-
- %package-data-dir
-@c snarfed from /home/ghouston/guile/guile-core/libguile/load.c:151
-@deffn {Scheme Procedure} %package-data-dir
-@deffnx {C Function} scm_sys_package_data_dir ()
-Return the name of the directory where Scheme packages, modules and
-libraries are kept. On most Unix systems, this will be
-@samp{/usr/local/share/guile}.
-@end deffn
-
- %library-dir
-@c snarfed from /home/ghouston/guile/guile-core/libguile/load.c:163
-@deffn {Scheme Procedure} %library-dir
-@deffnx {C Function} scm_sys_library_dir ()
-Return the directory where the Guile Scheme library files are installed.
-E.g., may return "/usr/share/guile/1.3.5".
-@end deffn
-
- %site-dir
-@c snarfed from /home/ghouston/guile/guile-core/libguile/load.c:175
-@deffn {Scheme Procedure} %site-dir
-@deffnx {C Function} scm_sys_site_dir ()
-Return the directory where the Guile site files are installed.
-E.g., may return "/usr/share/guile/site".
-@end deffn
-
- parse-path
-@c snarfed from /home/ghouston/guile/guile-core/libguile/load.c:227
-@deffn {Scheme Procedure} parse-path path [tail]
-@deffnx {C Function} scm_parse_path (path, tail)
-Parse @var{path}, which is expected to be a colon-separated
-string, into a list and return the resulting list with
-@var{tail} appended. If @var{path} is @code{#f}, @var{tail}
-is returned.
-@end deffn
-
- search-path
-@c snarfed from /home/ghouston/guile/guile-core/libguile/load.c:277
-@deffn {Scheme Procedure} search-path path filename [extensions]
-@deffnx {C Function} scm_search_path (path, filename, extensions)
-Search @var{path} for a directory containing a file named
-@var{filename}. The file must be readable, and not a directory.
-If we find one, return its full filename; otherwise, return
-@code{#f}. If @var{filename} is absolute, return it unchanged.
-If given, @var{extensions} is a list of strings; for each
-directory in @var{path}, we search for @var{filename}
-concatenated with each @var{extension}.
-@end deffn
-
- %search-load-path
-@c snarfed from /home/ghouston/guile/guile-core/libguile/load.c:423
-@deffn {Scheme Procedure} %search-load-path filename
-@deffnx {C Function} scm_sys_search_load_path (filename)
-Search @var{%load-path} for the file named @var{filename},
-which must be readable by the current user. If @var{filename}
-is found in the list of paths to search or is an absolute
-pathname, return its full pathname. Otherwise, return
-@code{#f}. Filenames may have any of the optional extensions
-in the @code{%load-extensions} list; @code{%search-load-path}
-will try each extension automatically.
-@end deffn
-
- primitive-load-path
-@c snarfed from /home/ghouston/guile/guile-core/libguile/load.c:444
-@deffn {Scheme Procedure} primitive-load-path filename
-@deffnx {C Function} scm_primitive_load_path (filename)
-Search @var{%load-path} for the file named @var{filename} and
-load it into the top-level environment. If @var{filename} is a
-relative pathname and is not found in the list of search paths,
-an error is signalled.
-@end deffn
-
- procedure->syntax
-@c snarfed from /home/ghouston/guile/guile-core/libguile/macros.c:104
-@deffn {Scheme Procedure} procedure->syntax code
-@deffnx {C Function} scm_makacro (code)
-Return a @dfn{macro} which, when a symbol defined to this value
-appears as the first symbol in an expression, returns the
-result of applying @var{code} to the expression and the
-environment.
-@end deffn
-
- procedure->macro
-@c snarfed from /home/ghouston/guile/guile-core/libguile/macros.c:125
-@deffn {Scheme Procedure} procedure->macro code
-@deffnx {C Function} scm_makmacro (code)
-Return a @dfn{macro} which, when a symbol defined to this value
-appears as the first symbol in an expression, evaluates the
-result of applying @var{code} to the expression and the
-environment. For example:
-
-@lisp
-(define trace
- (procedure->macro
- (lambda (x env) `(set! ,(cadr x) (tracef ,(cadr x) ',(cadr x))))))
-
-(trace @i{foo}) @equiv{} (set! @i{foo} (tracef @i{foo} '@i{foo})).
-@end lisp
-@end deffn
-
- procedure->memoizing-macro
-@c snarfed from /home/ghouston/guile/guile-core/libguile/macros.c:143
-@deffn {Scheme Procedure} procedure->memoizing-macro code
-@deffnx {C Function} scm_makmmacro (code)
-Return a @dfn{macro} which, when a symbol defined to this value
-appears as the first symbol in an expression, evaluates the
-result of applying @var{code} to the expression and the
-environment.
-
-@code{procedure->memoizing-macro} is the same as
-@code{procedure->macro}, except that the expression returned by
-@var{code} replaces the original macro expression in the memoized
-form of the containing code.
-@end deffn
-
- macro?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/macros.c:155
-@deffn {Scheme Procedure} macro? obj
-@deffnx {C Function} scm_macro_p (obj)
-Return @code{#t} if @var{obj} is a regular macro, a memoizing macro or a
-syntax transformer.
-@end deffn
-
- macro-type
-@c snarfed from /home/ghouston/guile/guile-core/libguile/macros.c:173
-@deffn {Scheme Procedure} macro-type m
-@deffnx {C Function} scm_macro_type (m)
-Return one of the symbols @code{syntax}, @code{macro} or
-@code{macro!}, depending on whether @var{m} is a syntax
-transformer, a regular macro, or a memoizing macro,
-respectively. If @var{m} is not a macro, @code{#f} is
-returned.
-@end deffn
-
- macro-name
-@c snarfed from /home/ghouston/guile/guile-core/libguile/macros.c:191
-@deffn {Scheme Procedure} macro-name m
-@deffnx {C Function} scm_macro_name (m)
-Return the name of the macro @var{m}.
-@end deffn
-
- macro-transformer
-@c snarfed from /home/ghouston/guile/guile-core/libguile/macros.c:202
-@deffn {Scheme Procedure} macro-transformer m
-@deffnx {C Function} scm_macro_transformer (m)
-Return the transformer of the macro @var{m}.
-@end deffn
-
- current-module
-@c snarfed from /home/ghouston/guile/guile-core/libguile/modules.c:69
-@deffn {Scheme Procedure} current-module
-@deffnx {C Function} scm_current_module ()
-Return the current module.
-@end deffn
-
- set-current-module
-@c snarfed from /home/ghouston/guile/guile-core/libguile/modules.c:81
-@deffn {Scheme Procedure} set-current-module module
-@deffnx {C Function} scm_set_current_module (module)
-Set the current module to @var{module} and return
-the previous current module.
-@end deffn
-
- interaction-environment
-@c snarfed from /home/ghouston/guile/guile-core/libguile/modules.c:104
-@deffn {Scheme Procedure} interaction-environment
-@deffnx {C Function} scm_interaction_environment ()
-Return a specifier for the environment that contains
-implementation--defined bindings, typically a superset of those
-listed in the report. The intent is that this procedure will
-return the environment in which the implementation would
-evaluate expressions dynamically typed by the user.
-@end deffn
-
- env-module
-@c snarfed from /home/ghouston/guile/guile-core/libguile/modules.c:271
-@deffn {Scheme Procedure} env-module env
-@deffnx {C Function} scm_env_module (env)
-Return the module of @var{ENV}, a lexical environment.
-@end deffn
-
- standard-eval-closure
-@c snarfed from /home/ghouston/guile/guile-core/libguile/modules.c:348
-@deffn {Scheme Procedure} standard-eval-closure module
-@deffnx {C Function} scm_standard_eval_closure (module)
-Return an eval closure for the module @var{module}.
-@end deffn
-
- standard-interface-eval-closure
-@c snarfed from /home/ghouston/guile/guile-core/libguile/modules.c:359
-@deffn {Scheme Procedure} standard-interface-eval-closure module
-@deffnx {C Function} scm_standard_interface_eval_closure (module)
-Return a interface eval closure for the module @var{module}. Such a closure does not allow new bindings to be added.
-@end deffn
-
- %get-pre-modules-obarray
-@c snarfed from /home/ghouston/guile/guile-core/libguile/modules.c:582
-@deffn {Scheme Procedure} %get-pre-modules-obarray
-@deffnx {C Function} scm_get_pre_modules_obarray ()
-Return the obarray that is used for all new bindings before the module system is booted. The first call to @code{set-current-module} will boot the module system.
-@end deffn
-
- exact?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:106
-@deffn {Scheme Procedure} exact? x
-@deffnx {C Function} scm_exact_p (x)
-Return @code{#t} if @var{x} is an exact number, @code{#f}
-otherwise.
-@end deffn
-
- odd?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:123
-@deffn {Scheme Procedure} odd? n
-@deffnx {C Function} scm_odd_p (n)
-Return @code{#t} if @var{n} is an odd number, @code{#f}
-otherwise.
-@end deffn
-
- even?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:142
-@deffn {Scheme Procedure} even? n
-@deffnx {C Function} scm_even_p (n)
-Return @code{#t} if @var{n} is an even number, @code{#f}
-otherwise.
-@end deffn
-
- inf?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:184
-@deffn {Scheme Procedure} inf? n
-@deffnx {C Function} scm_inf_p (n)
-Return @code{#t} if @var{n} is infinite, @code{#f}
-otherwise.
-@end deffn
-
- nan?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:201
-@deffn {Scheme Procedure} nan? n
-@deffnx {C Function} scm_nan_p (n)
-Return @code{#t} if @var{n} is a NaN, @code{#f}
-otherwise.
-@end deffn
-
- inf
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:263
-@deffn {Scheme Procedure} inf
-@deffnx {C Function} scm_inf ()
-Return Inf.
-@end deffn
-
- nan
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:278
-@deffn {Scheme Procedure} nan
-@deffnx {C Function} scm_nan ()
-Return NaN.
-@end deffn
-
- logand
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:891
-@deffn {Scheme Procedure} logand n1 n2
-Return the bitwise AND of the integer arguments.
-
-@lisp
-(logand) @result{} -1
-(logand 7) @result{} 7
-(logand #b111 #b011 #b001) @result{} 1
-@end lisp
-@end deffn
-
- logior
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:972
-@deffn {Scheme Procedure} logior n1 n2
-Return the bitwise OR of the integer arguments.
-
-@lisp
-(logior) @result{} 0
-(logior 7) @result{} 7
-(logior #b000 #b001 #b011) @result{} 3
-@end lisp
-@end deffn
-
- logxor
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:1054
-@deffn {Scheme Procedure} logxor n1 n2
-Return the bitwise XOR of the integer arguments. A bit is
-set in the result if it is set in an odd number of arguments.
-@lisp
-(logxor) @result{} 0
-(logxor 7) @result{} 7
-(logxor #b000 #b001 #b011) @result{} 2
-(logxor #b000 #b001 #b011 #b011) @result{} 1
-@end lisp
-@end deffn
-
- logtest
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:1118
-@deffn {Scheme Procedure} logtest j k
-@deffnx {C Function} scm_logtest (j, k)
-@lisp
-(logtest j k) @equiv{} (not (zero? (logand j k)))
-
-(logtest #b0100 #b1011) @result{} #f
-(logtest #b0100 #b0111) @result{} #t
-@end lisp
-@end deffn
-
- logbit?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:1175
-@deffn {Scheme Procedure} logbit? index j
-@deffnx {C Function} scm_logbit_p (index, j)
-@lisp
-(logbit? index j) @equiv{} (logtest (integer-expt 2 index) j)
-
-(logbit? 0 #b1101) @result{} #t
-(logbit? 1 #b1101) @result{} #f
-(logbit? 2 #b1101) @result{} #t
-(logbit? 3 #b1101) @result{} #t
-(logbit? 4 #b1101) @result{} #f
-@end lisp
-@end deffn
-
- lognot
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:1224
-@deffn {Scheme Procedure} lognot n
-@deffnx {C Function} scm_lognot (n)
-Return the integer which is the 2s-complement of the integer
-argument.
-
-@lisp
-(number->string (lognot #b10000000) 2)
- @result{} "-10000001"
-(number->string (lognot #b0) 2)
- @result{} "-1"
-@end lisp
-@end deffn
-
- integer-expt
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:1241
-@deffn {Scheme Procedure} integer-expt n k
-@deffnx {C Function} scm_integer_expt (n, k)
-Return @var{n} raised to the non-negative integer exponent
-@var{k}.
-
-@lisp
-(integer-expt 2 5)
- @result{} 32
-(integer-expt -3 3)
- @result{} -27
-@end lisp
-@end deffn
-
- ash
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:1296
-@deffn {Scheme Procedure} ash n cnt
-@deffnx {C Function} scm_ash (n, cnt)
-The function ash performs an arithmetic shift left by @var{cnt}
-bits (or shift right, if @var{cnt} is negative). 'Arithmetic'
-means, that the function does not guarantee to keep the bit
-structure of @var{n}, but rather guarantees that the result
-will always be rounded towards minus infinity. Therefore, the
-results of ash and a corresponding bitwise shift will differ if
-@var{n} is negative.
-
-Formally, the function returns an integer equivalent to
-@code{(inexact->exact (floor (* @var{n} (expt 2 @var{cnt}))))}.
-
-@lisp
-(number->string (ash #b1 3) 2) @result{} "1000"
-(number->string (ash #b1010 -1) 2) @result{} "101"
-@end lisp
-@end deffn
-
- bit-extract
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:1349
-@deffn {Scheme Procedure} bit-extract n start end
-@deffnx {C Function} scm_bit_extract (n, start, end)
-Return the integer composed of the @var{start} (inclusive)
-through @var{end} (exclusive) bits of @var{n}. The
-@var{start}th bit becomes the 0-th bit in the result.
-
-@lisp
-(number->string (bit-extract #b1101101010 0 4) 2)
- @result{} "1010"
-(number->string (bit-extract #b1101101010 4 9) 2)
- @result{} "10110"
-@end lisp
-@end deffn
-
- logcount
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:1421
-@deffn {Scheme Procedure} logcount n
-@deffnx {C Function} scm_logcount (n)
-Return the number of bits in integer @var{n}. If integer is
-positive, the 1-bits in its binary representation are counted.
-If negative, the 0-bits in its two's-complement binary
-representation are counted. If 0, 0 is returned.
-
-@lisp
-(logcount #b10101010)
- @result{} 4
-(logcount 0)
- @result{} 0
-(logcount -2)
- @result{} 1
-@end lisp
-@end deffn
-
- integer-length
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:1472
-@deffn {Scheme Procedure} integer-length n
-@deffnx {C Function} scm_integer_length (n)
-Return the number of bits necessary to represent @var{n}.
-
-@lisp
-(integer-length #b10101010)
- @result{} 8
-(integer-length 0)
- @result{} 0
-(integer-length #b1111)
- @result{} 4
-@end lisp
-@end deffn
-
- number->string
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:2330
-@deffn {Scheme Procedure} number->string n [radix]
-@deffnx {C Function} scm_number_to_string (n, radix)
-Return a string holding the external representation of the
-number @var{n} in the given @var{radix}. If @var{n} is
-inexact, a radix of 10 will be used.
-@end deffn
-
- string->number
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:2989
-@deffn {Scheme Procedure} string->number string [radix]
-@deffnx {C Function} scm_string_to_number (string, radix)
-Return a number of the maximally precise representation
-expressed by the given @var{string}. @var{radix} must be an
-exact integer, either 2, 8, 10, or 16. If supplied, @var{radix}
-is a default radix that may be overridden by an explicit radix
-prefix in @var{string} (e.g. "#o177"). If @var{radix} is not
-supplied, then the default radix is 10. If string is not a
-syntactically valid notation for a number, then
-@code{string->number} returns @code{#f}.
-@end deffn
-
- number?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:3058
-@deffn {Scheme Procedure} number?
-implemented by the C function "scm_number_p"
-@end deffn
-
- complex?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:3070
-@deffn {Scheme Procedure} complex? x
-@deffnx {C Function} scm_number_p (x)
-Return @code{#t} if @var{x} is a complex number, @code{#f}
-otherwise. Note that the sets of real, rational and integer
-values form subsets of the set of complex numbers, i. e. the
-predicate will also be fulfilled if @var{x} is a real,
-rational or integer number.
-@end deffn
-
- real?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:3078
-@deffn {Scheme Procedure} real?
-implemented by the C function "scm_real_p"
-@end deffn
-
- rational?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:3091
-@deffn {Scheme Procedure} rational? x
-@deffnx {C Function} scm_real_p (x)
-Return @code{#t} if @var{x} is a rational number, @code{#f}
-otherwise. Note that the set of integer values forms a subset of
-the set of rational numbers, i. e. the predicate will also be
-fulfilled if @var{x} is an integer number. Real numbers
-will also satisfy this predicate, because of their limited
-precision.
-@end deffn
-
- integer?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:3112
-@deffn {Scheme Procedure} integer? x
-@deffnx {C Function} scm_integer_p (x)
-Return @code{#t} if @var{x} is an integer number, @code{#f}
-else.
-@end deffn
-
- inexact?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:3137
-@deffn {Scheme Procedure} inexact? x
-@deffnx {C Function} scm_inexact_p (x)
-Return @code{#t} if @var{x} is an inexact number, @code{#f}
-else.
-@end deffn
-
- $expt
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:4297
-@deffn {Scheme Procedure} $expt x y
-@deffnx {C Function} scm_sys_expt (x, y)
-Return @var{x} raised to the power of @var{y}. This
-procedure does not accept complex arguments.
-@end deffn
-
- $atan2
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:4313
-@deffn {Scheme Procedure} $atan2 x y
-@deffnx {C Function} scm_sys_atan2 (x, y)
-Return the arc tangent of the two arguments @var{x} and
-@var{y}. This is similar to calculating the arc tangent of
-@var{x} / @var{y}, except that the signs of both arguments
-are used to determine the quadrant of the result. This
-procedure does not accept complex arguments.
-@end deffn
-
- make-rectangular
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:4326
-@deffn {Scheme Procedure} make-rectangular real imaginary
-@deffnx {C Function} scm_make_rectangular (real, imaginary)
-Return a complex number constructed of the given @var{real} and
-@var{imaginary} parts.
-@end deffn
-
- make-polar
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:4339
-@deffn {Scheme Procedure} make-polar x y
-@deffnx {C Function} scm_make_polar (x, y)
-Return the complex number @var{x} * e^(i * @var{y}).
-@end deffn
-
- inexact->exact
-@c snarfed from /home/ghouston/guile/guile-core/libguile/numbers.c:4474
-@deffn {Scheme Procedure} inexact->exact z
-@deffnx {C Function} scm_inexact_to_exact (z)
-Return an exact number that is numerically closest to @var{z}.
-@end deffn
-
- class-of
-@c snarfed from /home/ghouston/guile/guile-core/libguile/objects.c:86
-@deffn {Scheme Procedure} class-of x
-@deffnx {C Function} scm_class_of (x)
-Return the class of @var{x}.
-@end deffn
-
- entity?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/objects.c:360
-@deffn {Scheme Procedure} entity? obj
-@deffnx {C Function} scm_entity_p (obj)
-Return @code{#t} if @var{obj} is an entity.
-@end deffn
-
- operator?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/objects.c:369
-@deffn {Scheme Procedure} operator? obj
-@deffnx {C Function} scm_operator_p (obj)
-Return @code{#t} if @var{obj} is an operator.
-@end deffn
-
- valid-object-procedure?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/objects.c:385
-@deffn {Scheme Procedure} valid-object-procedure? proc
-@deffnx {C Function} scm_valid_object_procedure_p (proc)
-Return @code{#t} iff @var{proc} is a procedure that can be used with @code{set-object-procedure}. It is always valid to use a closure constructed by @code{lambda}.
-@end deffn
-
- set-object-procedure!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/objects.c:407
-@deffn {Scheme Procedure} set-object-procedure! obj proc
-@deffnx {C Function} scm_set_object_procedure_x (obj, proc)
-Set the object procedure of @var{obj} to @var{proc}.
-@var{obj} must be either an entity or an operator.
-@end deffn
-
- make-class-object
-@c snarfed from /home/ghouston/guile/guile-core/libguile/objects.c:467
-@deffn {Scheme Procedure} make-class-object metaclass layout
-@deffnx {C Function} scm_make_class_object (metaclass, layout)
-Create a new class object of class @var{metaclass}, with the
-slot layout specified by @var{layout}.
-@end deffn
-
- make-subclass-object
-@c snarfed from /home/ghouston/guile/guile-core/libguile/objects.c:482
-@deffn {Scheme Procedure} make-subclass-object class layout
-@deffnx {C Function} scm_make_subclass_object (class, layout)
-Create a subclass object of @var{class}, with the slot layout
-specified by @var{layout}.
-@end deffn
-
- object-properties
-@c snarfed from /home/ghouston/guile/guile-core/libguile/objprop.c:59
-@deffn {Scheme Procedure} object-properties obj
-@deffnx {C Function} scm_object_properties (obj)
-Return @var{obj}'s property list.
-@end deffn
-
- set-object-properties!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/objprop.c:69
-@deffn {Scheme Procedure} set-object-properties! obj alist
-@deffnx {C Function} scm_set_object_properties_x (obj, alist)
-Set @var{obj}'s property list to @var{alist}.
-@end deffn
-
- object-property
-@c snarfed from /home/ghouston/guile/guile-core/libguile/objprop.c:80
-@deffn {Scheme Procedure} object-property obj key
-@deffnx {C Function} scm_object_property (obj, key)
-Return the property of @var{obj} with name @var{key}.
-@end deffn
-
- set-object-property!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/objprop.c:92
-@deffn {Scheme Procedure} set-object-property! obj key value
-@deffnx {C Function} scm_set_object_property_x (obj, key, value)
-In @var{obj}'s property list, set the property named @var{key}
-to @var{value}.
-@end deffn
-
- cons
-@c snarfed from /home/ghouston/guile/guile-core/libguile/pairs.c:80
-@deffn {Scheme Procedure} cons x y
-@deffnx {C Function} scm_cons (x, y)
-Return a newly allocated pair whose car is @var{x} and whose
-cdr is @var{y}. The pair is guaranteed to be different (in the
-sense of @code{eq?}) from every previously existing object.
-@end deffn
-
- pair?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/pairs.c:98
-@deffn {Scheme Procedure} pair? x
-@deffnx {C Function} scm_pair_p (x)
-Return @code{#t} if @var{x} is a pair; otherwise return
-@code{#f}.
-@end deffn
-
- set-car!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/pairs.c:109
-@deffn {Scheme Procedure} set-car! pair value
-@deffnx {C Function} scm_set_car_x (pair, value)
-Stores @var{value} in the car field of @var{pair}. The value returned
-by @code{set-car!} is unspecified.
-@end deffn
-
- set-cdr!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/pairs.c:122
-@deffn {Scheme Procedure} set-cdr! pair value
-@deffnx {C Function} scm_set_cdr_x (pair, value)
-Stores @var{value} in the cdr field of @var{pair}. The value returned
-by @code{set-cdr!} is unspecified.
-@end deffn
-
- char-ready?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:259
-@deffn {Scheme Procedure} char-ready? [port]
-@deffnx {C Function} scm_char_ready_p (port)
-Return @code{#t} if a character is ready on input @var{port}
-and return @code{#f} otherwise. If @code{char-ready?} returns
-@code{#t} then the next @code{read-char} operation on
-@var{port} is guaranteed not to hang. If @var{port} is a file
-port at end of file then @code{char-ready?} returns @code{#t}.
-@footnote{@code{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 make sure that characters whose existence
-has been asserted by @code{char-ready?} cannot be rubbed out.
-If @code{char-ready?} were to return @code{#f} at end of file,
-a port at end of file would be indistinguishable from an
-interactive port that has no ready characters.}
-@end deffn
-
- drain-input
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:336
-@deffn {Scheme Procedure} drain-input port
-@deffnx {C Function} scm_drain_input (port)
-This procedure clears a port's input buffers, similar
-to the way that force-output clears the output buffer. The
-contents of the buffers are returned as a single string, e.g.,
-
-@lisp
-(define p (open-input-file ...))
-(drain-input p) => empty string, nothing buffered yet.
-(unread-char (read-char p) p)
-(drain-input p) => initial chars from p, up to the buffer size.
-@end lisp
-
-Draining the buffers may be useful for cleanly finishing
-buffered I/O so that the file descriptor can be used directly
-for further input.
-@end deffn
-
- current-input-port
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:363
-@deffn {Scheme Procedure} current-input-port
-@deffnx {C Function} scm_current_input_port ()
-Return the current input port. This is the default port used
-by many input procedures. Initially, @code{current-input-port}
-returns the @dfn{standard input} in Unix and C terminology.
-@end deffn
-
- current-output-port
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:375
-@deffn {Scheme Procedure} current-output-port
-@deffnx {C Function} scm_current_output_port ()
-Return the current output port. This is the default port used
-by many output procedures. Initially,
-@code{current-output-port} returns the @dfn{standard output} in
-Unix and C terminology.
-@end deffn
-
- current-error-port
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:385
-@deffn {Scheme Procedure} current-error-port
-@deffnx {C Function} scm_current_error_port ()
-Return the port to which errors and warnings should be sent (the
-@dfn{standard error} in Unix and C terminology).
-@end deffn
-
- current-load-port
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:395
-@deffn {Scheme Procedure} current-load-port
-@deffnx {C Function} scm_current_load_port ()
-Return the current-load-port.
-The load port is used internally by @code{primitive-load}.
-@end deffn
-
- set-current-input-port
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:408
-@deffn {Scheme Procedure} set-current-input-port port
-@deffnx {Scheme Procedure} set-current-output-port port
-@deffnx {Scheme Procedure} set-current-error-port port
-@deffnx {C Function} scm_set_current_input_port (port)
-Change the ports returned by @code{current-input-port},
-@code{current-output-port} and @code{current-error-port}, respectively,
-so that they use the supplied @var{port} for input or output.
-@end deffn
-
- set-current-output-port
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:421
-@deffn {Scheme Procedure} set-current-output-port port
-@deffnx {C Function} scm_set_current_output_port (port)
-Set the current default output port to @var{port}.
-@end deffn
-
- set-current-error-port
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:435
-@deffn {Scheme Procedure} set-current-error-port port
-@deffnx {C Function} scm_set_current_error_port (port)
-Set the current default error port to @var{port}.
-@end deffn
-
- port-revealed
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:578
-@deffn {Scheme Procedure} port-revealed port
-@deffnx {C Function} scm_port_revealed (port)
-Return the revealed count for @var{port}.
-@end deffn
-
- set-port-revealed!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:591
-@deffn {Scheme Procedure} set-port-revealed! port rcount
-@deffnx {C Function} scm_set_port_revealed_x (port, rcount)
-Sets the revealed count for a port to a given value.
-The return value is unspecified.
-@end deffn
-
- port-mode
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:634
-@deffn {Scheme Procedure} port-mode port
-@deffnx {C Function} scm_port_mode (port)
-Return the port modes associated with the open port @var{port}.
-These will not necessarily be identical to the modes used when
-the port was opened, since modes such as "append" which are
-used only during port creation are not retained.
-@end deffn
-
- close-port
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:671
-@deffn {Scheme Procedure} close-port port
-@deffnx {C Function} scm_close_port (port)
-Close the specified port object. Return @code{#t} if it
-successfully closes a port or @code{#f} if it was already
-closed. An exception may be raised if an error occurs, for
-example when flushing buffered output. See also @ref{Ports and
-File Descriptors, close}, for a procedure which can close file
-descriptors.
-@end deffn
-
- close-input-port
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:699
-@deffn {Scheme Procedure} close-input-port port
-@deffnx {C Function} scm_close_input_port (port)
-Close the specified input port object. The routine has no effect if
-the file has already been closed. An exception may be raised if an
-error occurs. The value returned is unspecified.
-
-See also @ref{Ports and File Descriptors, close}, for a procedure
-which can close file descriptors.
-@end deffn
-
- close-output-port
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:714
-@deffn {Scheme Procedure} close-output-port port
-@deffnx {C Function} scm_close_output_port (port)
-Close the specified output port object. The routine has no effect if
-the file has already been closed. An exception may be raised if an
-error occurs. The value returned is unspecified.
-
-See also @ref{Ports and File Descriptors, close}, for a procedure
-which can close file descriptors.
-@end deffn
-
- port-for-each
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:731
-@deffn {Scheme Procedure} port-for-each proc
-@deffnx {C Function} scm_port_for_each (proc)
-Apply @var{proc} to each port in the Guile port table
-in turn. The return value is unspecified. More specifically,
-@var{proc} is applied exactly once to every port that exists
-in the system at the time @var{port-for-each} is invoked.
-Changes to the port table while @var{port-for-each} is running
-have no effect as far as @var{port-for-each} is concerned.
-@end deffn
-
- input-port?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:772
-@deffn {Scheme Procedure} input-port? x
-@deffnx {C Function} scm_input_port_p (x)
-Return @code{#t} if @var{x} is an input port, otherwise return
-@code{#f}. Any object satisfying this predicate also satisfies
-@code{port?}.
-@end deffn
-
- output-port?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:783
-@deffn {Scheme Procedure} output-port? x
-@deffnx {C Function} scm_output_port_p (x)
-Return @code{#t} if @var{x} is an output port, otherwise return
-@code{#f}. Any object satisfying this predicate also satisfies
-@code{port?}.
-@end deffn
-
- port?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:795
-@deffn {Scheme Procedure} port? x
-@deffnx {C Function} scm_port_p (x)
-Return a boolean indicating whether @var{x} is a port.
-Equivalent to @code{(or (input-port? @var{x}) (output-port?
-@var{x}))}.
-@end deffn
-
- port-closed?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:805
-@deffn {Scheme Procedure} port-closed? port
-@deffnx {C Function} scm_port_closed_p (port)
-Return @code{#t} if @var{port} is closed or @code{#f} if it is
-open.
-@end deffn
-
- eof-object?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:816
-@deffn {Scheme Procedure} eof-object? x
-@deffnx {C Function} scm_eof_object_p (x)
-Return @code{#t} if @var{x} is an end-of-file object; otherwise
-return @code{#f}.
-@end deffn
-
- force-output
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:830
-@deffn {Scheme Procedure} force-output [port]
-@deffnx {C Function} scm_force_output (port)
-Flush the specified output port, or the current output port if @var{port}
-is omitted. The current output buffer contents are passed to the
-underlying port implementation (e.g., in the case of fports, the
-data will be written to the file and the output buffer will be cleared.)
-It has no effect on an unbuffered port.
-
-The return value is unspecified.
-@end deffn
-
- flush-all-ports
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:848
-@deffn {Scheme Procedure} flush-all-ports
-@deffnx {C Function} scm_flush_all_ports ()
-Equivalent to calling @code{force-output} on
-all open output ports. The return value is unspecified.
-@end deffn
-
- read-char
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:866
-@deffn {Scheme Procedure} read-char [port]
-@deffnx {C Function} scm_read_char (port)
-Return the next character available from @var{port}, updating
-@var{port} to point to the following character. If no more
-characters are available, the end-of-file object is returned.
-@end deffn
-
- peek-char
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:1192
-@deffn {Scheme Procedure} peek-char [port]
-@deffnx {C Function} scm_peek_char (port)
-Return the next character available from @var{port},
-@emph{without} updating @var{port} to point to the following
-character. If no more characters are available, the
-end-of-file object is returned.@footnote{The value returned by
-a call to @code{peek-char} is the same as the value that would
-have been returned by a call to @code{read-char} on the same
-port. The only difference is that the very next call to
-@code{read-char} or @code{peek-char} on that @var{port} will
-return the value returned by the preceding call to
-@code{peek-char}. In particular, a call to @code{peek-char} on
-an interactive port will hang waiting for input whenever a call
-to @code{read-char} would have hung.}
-@end deffn
-
- unread-char
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:1213
-@deffn {Scheme Procedure} unread-char cobj [port]
-@deffnx {C Function} scm_unread_char (cobj, port)
-Place @var{char} in @var{port} so that it will be read by the
-next read operation. If called multiple times, the unread characters
-will be read again in last-in first-out order. If @var{port} is
-not supplied, the current input port is used.
-@end deffn
-
- unread-string
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:1236
-@deffn {Scheme Procedure} unread-string str port
-@deffnx {C Function} scm_unread_string (str, port)
-Place the string @var{str} in @var{port} so that its characters will be
-read in subsequent read operations. If called multiple times, the
-unread characters will be read again in last-in first-out order. If
-@var{port} is not supplied, the current-input-port is used.
-@end deffn
-
- seek
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:1275
-@deffn {Scheme Procedure} seek fd_port offset whence
-@deffnx {C Function} scm_seek (fd_port, offset, whence)
-Sets the current position of @var{fd/port} to the integer
-@var{offset}, which is interpreted according to the value of
-@var{whence}.
-
-One of the following variables should be supplied for
-@var{whence}:
-@defvar SEEK_SET
-Seek from the beginning of the file.
-@end defvar
-@defvar SEEK_CUR
-Seek from the current position.
-@end defvar
-@defvar SEEK_END
-Seek from the end of the file.
-@end defvar
-If @var{fd/port} is a file descriptor, the underlying system
-call is @code{lseek}. @var{port} may be a string port.
-
-The value returned is the new position in the file. This means
-that the current position of a port can be obtained using:
-@lisp
-(seek port 0 SEEK_CUR)
-@end lisp
-@end deffn
-
- truncate-file
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:1330
-@deffn {Scheme Procedure} truncate-file object [length]
-@deffnx {C Function} scm_truncate_file (object, length)
-Truncates the object referred to by @var{object} to at most
-@var{length} bytes. @var{object} can be a string containing a
-file name or an integer file descriptor or a port.
-@var{length} may be omitted if @var{object} is not a file name,
-in which case the truncation occurs at the current port.
-position. The return value is unspecified.
-@end deffn
-
- port-line
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:1383
-@deffn {Scheme Procedure} port-line port
-@deffnx {C Function} scm_port_line (port)
-Return the current line number for @var{port}.
-@end deffn
-
- set-port-line!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:1394
-@deffn {Scheme Procedure} set-port-line! port line
-@deffnx {C Function} scm_set_port_line_x (port, line)
-Set the current line number for @var{port} to @var{line}.
-@end deffn
-
- port-column
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:1415
-@deffn {Scheme Procedure} port-column port
-@deffnx {Scheme Procedure} port-line port
-@deffnx {C Function} scm_port_column (port)
-Return the current column number or line number of @var{port},
-using the current input port if none is specified. If the number is
-unknown, the result is #f. Otherwise, the result is a 0-origin integer
-- i.e. the first character of the first line is line 0, column 0.
-(However, when you display a file position, for example in an error
-message, we recommend you add 1 to get 1-origin integers. This is
-because lines and column numbers traditionally start with 1, and that is
-what non-programmers will find most natural.)
-@end deffn
-
- set-port-column!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:1428
-@deffn {Scheme Procedure} set-port-column! port column
-@deffnx {Scheme Procedure} set-port-line! port line
-@deffnx {C Function} scm_set_port_column_x (port, column)
-Set the current column or line number of @var{port}, using the
-current input port if none is specified.
-@end deffn
-
- port-filename
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:1443
-@deffn {Scheme Procedure} port-filename port
-@deffnx {C Function} scm_port_filename (port)
-Return the filename associated with @var{port}. This function returns
-the strings "standard input", "standard output" and "standard error"
-when called on the current input, output and error ports respectively.
-@end deffn
-
- set-port-filename!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:1457
-@deffn {Scheme Procedure} set-port-filename! port filename
-@deffnx {C Function} scm_set_port_filename_x (port, filename)
-Change the filename associated with @var{port}, using the current input
-port if none is specified. Note that this does not change the port's
-source of data, but only the value that is returned by
-@code{port-filename} and reported in diagnostic output.
-@end deffn
-
- %make-void-port
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ports.c:1551
-@deffn {Scheme Procedure} %make-void-port mode
-@deffnx {C Function} scm_sys_make_void_port (mode)
-Create and return a new void port. A void port acts like
-@file{/dev/null}. The @var{mode} argument
-specifies the input/output modes for this port: see the
-documentation for @code{open-file} in @ref{File Ports}.
-@end deffn
-
- print-options-interface
-@c snarfed from /home/ghouston/guile/guile-core/libguile/print.c:142
-@deffn {Scheme Procedure} print-options-interface [setting]
-@deffnx {C Function} scm_print_options (setting)
-Option interface for the print options. Instead of using
-this procedure directly, use the procedures
-@code{print-enable}, @code{print-disable}, @code{print-set!}
-and @code{print-options}.
-@end deffn
-
- simple-format
-@c snarfed from /home/ghouston/guile/guile-core/libguile/print.c:921
-@deffn {Scheme Procedure} simple-format destination message . args
-@deffnx {C Function} scm_simple_format (destination, message, args)
-Write @var{message} to @var{destination}, defaulting to
-the current output port.
-@var{message} can contain @code{~A} (was @code{%s}) and
-@code{~S} (was @code{%S}) escapes. When printed,
-the escapes are replaced with corresponding members of
-@var{ARGS}:
-@code{~A} formats using @code{display} and @code{~S} formats
-using @code{write}.
-If @var{destination} is @code{#t}, then use the current output
-port, if @var{destination} is @code{#f}, then return a string
-containing the formatted text. Does not add a trailing newline.
-@end deffn
-
- newline
-@c snarfed from /home/ghouston/guile/guile-core/libguile/print.c:1009
-@deffn {Scheme Procedure} newline [port]
-@deffnx {C Function} scm_newline (port)
-Send a newline to @var{port}.
-If @var{port} is omitted, send to the current output port.
-@end deffn
-
- write-char
-@c snarfed from /home/ghouston/guile/guile-core/libguile/print.c:1024
-@deffn {Scheme Procedure} write-char chr [port]
-@deffnx {C Function} scm_write_char (chr, port)
-Send character @var{chr} to @var{port}.
-@end deffn
-
- port-with-print-state
-@c snarfed from /home/ghouston/guile/guile-core/libguile/print.c:1078
-@deffn {Scheme Procedure} port-with-print-state port pstate
-@deffnx {C Function} scm_port_with_print_state (port, pstate)
-Create a new port which behaves like @var{port}, but with an
-included print state @var{pstate}.
-@end deffn
-
- get-print-state
-@c snarfed from /home/ghouston/guile/guile-core/libguile/print.c:1093
-@deffn {Scheme Procedure} get-print-state port
-@deffnx {C Function} scm_get_print_state (port)
-Return the print state of the port @var{port}. If @var{port}
-has no associated print state, @code{#f} is returned.
-@end deffn
-
- procedure-properties
-@c snarfed from /home/ghouston/guile/guile-core/libguile/procprop.c:176
-@deffn {Scheme Procedure} procedure-properties proc
-@deffnx {C Function} scm_procedure_properties (proc)
-Return @var{obj}'s property list.
-@end deffn
-
- set-procedure-properties!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/procprop.c:189
-@deffn {Scheme Procedure} set-procedure-properties! proc new_val
-@deffnx {C Function} scm_set_procedure_properties_x (proc, new_val)
-Set @var{obj}'s property list to @var{alist}.
-@end deffn
-
- procedure-property
-@c snarfed from /home/ghouston/guile/guile-core/libguile/procprop.c:202
-@deffn {Scheme Procedure} procedure-property p k
-@deffnx {C Function} scm_procedure_property (p, k)
-Return the property of @var{obj} with name @var{key}.
-@end deffn
-
- set-procedure-property!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/procprop.c:225
-@deffn {Scheme Procedure} set-procedure-property! p k v
-@deffnx {C Function} scm_set_procedure_property_x (p, k, v)
-In @var{obj}'s property list, set the property named @var{key} to
-@var{value}.
-@end deffn
-
- procedure?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/procs.c:186
-@deffn {Scheme Procedure} procedure? obj
-@deffnx {C Function} scm_procedure_p (obj)
-Return @code{#t} if @var{obj} is a procedure.
-@end deffn
-
- closure?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/procs.c:213
-@deffn {Scheme Procedure} closure? obj
-@deffnx {C Function} scm_closure_p (obj)
-Return @code{#t} if @var{obj} is a closure.
-@end deffn
-
- thunk?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/procs.c:222
-@deffn {Scheme Procedure} thunk? obj
-@deffnx {C Function} scm_thunk_p (obj)
-Return @code{#t} if @var{obj} is a thunk.
-@end deffn
-
- procedure-documentation
-@c snarfed from /home/ghouston/guile/guile-core/libguile/procs.c:272
-@deffn {Scheme Procedure} procedure-documentation proc
-@deffnx {C Function} scm_procedure_documentation (proc)
-Return the documentation string associated with @code{proc}. By
-convention, if a procedure contains more than one expression and the
-first expression is a string constant, that string is assumed to contain
-documentation for that procedure.
-@end deffn
-
- procedure-with-setter?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/procs.c:308
-@deffn {Scheme Procedure} procedure-with-setter? obj
-@deffnx {C Function} scm_procedure_with_setter_p (obj)
-Return @code{#t} if @var{obj} is a procedure with an
-associated setter procedure.
-@end deffn
-
- make-procedure-with-setter
-@c snarfed from /home/ghouston/guile/guile-core/libguile/procs.c:318
-@deffn {Scheme Procedure} make-procedure-with-setter procedure setter
-@deffnx {C Function} scm_make_procedure_with_setter (procedure, setter)
-Create a new procedure which behaves like @var{procedure}, but
-with the associated setter @var{setter}.
-@end deffn
-
- procedure
-@c snarfed from /home/ghouston/guile/guile-core/libguile/procs.c:332
-@deffn {Scheme Procedure} procedure proc
-@deffnx {C Function} scm_procedure (proc)
-Return the procedure of @var{proc}, which must be either a
-procedure with setter, or an operator struct.
-@end deffn
-
- primitive-make-property
-@c snarfed from /home/ghouston/guile/guile-core/libguile/properties.c:64
-@deffn {Scheme Procedure} primitive-make-property not_found_proc
-@deffnx {C Function} scm_primitive_make_property (not_found_proc)
-Create a @dfn{property token} that can be used with
-@code{primitive-property-ref} and @code{primitive-property-set!}.
-See @code{primitive-property-ref} for the significance of
-@var{not_found_proc}.
-@end deffn
-
- primitive-property-ref
-@c snarfed from /home/ghouston/guile/guile-core/libguile/properties.c:82
-@deffn {Scheme Procedure} primitive-property-ref prop obj
-@deffnx {C Function} scm_primitive_property_ref (prop, obj)
-Return the property @var{prop} of @var{obj}. When no value
-has yet been associated with @var{prop} and @var{obj}, call
-@var{not-found-proc} instead (see @code{primitive-make-property})
-and use its return value. That value is also associated with
-@var{obj} via @code{primitive-property-set!}. When
-@var{not-found-proc} is @code{#f}, use @code{#f} as the
-default value of @var{prop}.
-@end deffn
-
- primitive-property-set!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/properties.c:113
-@deffn {Scheme Procedure} primitive-property-set! prop obj val
-@deffnx {C Function} scm_primitive_property_set_x (prop, obj, val)
-Associate @var{code} with @var{prop} and @var{obj}.
-@end deffn
-
- primitive-property-del!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/properties.c:134
-@deffn {Scheme Procedure} primitive-property-del! prop obj
-@deffnx {C Function} scm_primitive_property_del_x (prop, obj)
-Remove any value associated with @var{prop} and @var{obj}.
-@end deffn
-
- random
-@c snarfed from /home/ghouston/guile/guile-core/libguile/random.c:376
-@deffn {Scheme Procedure} random n [state]
-@deffnx {C Function} scm_random (n, state)
-Return a number in [0,N).
-
-Accepts a positive integer or real n and returns a
-number of the same type between zero (inclusive) and
-N (exclusive). The values returned have a uniform
-distribution.
-
-The optional argument @var{state} must be of the type produced
-by @code{seed->random-state}. It defaults to the value of the
-variable @var{*random-state*}. This object is used to maintain
-the state of the pseudo-random-number generator and is altered
-as a side effect of the random operation.
-@end deffn
-
- copy-random-state
-@c snarfed from /home/ghouston/guile/guile-core/libguile/random.c:399
-@deffn {Scheme Procedure} copy-random-state [state]
-@deffnx {C Function} scm_copy_random_state (state)
-Return a copy of the random state @var{state}.
-@end deffn
-
- seed->random-state
-@c snarfed from /home/ghouston/guile/guile-core/libguile/random.c:411
-@deffn {Scheme Procedure} seed->random-state seed
-@deffnx {C Function} scm_seed_to_random_state (seed)
-Return a new random state using @var{seed}.
-@end deffn
-
- random:uniform
-@c snarfed from /home/ghouston/guile/guile-core/libguile/random.c:425
-@deffn {Scheme Procedure} random:uniform [state]
-@deffnx {C Function} scm_random_uniform (state)
-Return a uniformly distributed inexact real random number in
-[0,1).
-@end deffn
-
- random:normal
-@c snarfed from /home/ghouston/guile/guile-core/libguile/random.c:440
-@deffn {Scheme Procedure} random:normal [state]
-@deffnx {C Function} scm_random_normal (state)
-Return an inexact real in a normal distribution. The
-distribution used has mean 0 and standard deviation 1. For a
-normal distribution with mean m and standard deviation d use
-@code{(+ m (* d (random:normal)))}.
-@end deffn
-
- random:solid-sphere!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/random.c:496
-@deffn {Scheme Procedure} random:solid-sphere! v [state]
-@deffnx {C Function} scm_random_solid_sphere_x (v, state)
-Fills vect with inexact real random numbers
-the sum of whose squares is less than 1.0.
-Thinking of vect as coordinates in space of
-dimension n = (vector-length vect), the coordinates
-are uniformly distributed within the unit n-sphere.
-The sum of the squares of the numbers is returned.
-@end deffn
-
- random:hollow-sphere!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/random.c:519
-@deffn {Scheme Procedure} random:hollow-sphere! v [state]
-@deffnx {C Function} scm_random_hollow_sphere_x (v, state)
-Fills vect with inexact real random numbers
-the sum of whose squares is equal to 1.0.
-Thinking of vect as coordinates in space of
-dimension n = (vector-length vect), the coordinates
-are uniformly distributed over the surface of the
-unit n-sphere.
-@end deffn
-
- random:normal-vector!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/random.c:537
-@deffn {Scheme Procedure} random:normal-vector! v [state]
-@deffnx {C Function} scm_random_normal_vector_x (v, state)
-Fills vect with inexact real random numbers that are
-independent and standard normally distributed
-(i.e., with mean 0 and variance 1).
-@end deffn
-
- random:exp
-@c snarfed from /home/ghouston/guile/guile-core/libguile/random.c:562
-@deffn {Scheme Procedure} random:exp [state]
-@deffnx {C Function} scm_random_exp (state)
-Return an inexact real in an exponential distribution with mean
-1. For an exponential distribution with mean u use (* u
-(random:exp)).
-@end deffn
-
- %read-delimited!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/rdelim.c:78
-@deffn {Scheme Procedure} %read-delimited! delims str gobble [port [start [end]]]
-@deffnx {C Function} scm_read_delimited_x (delims, str, gobble, port, start, end)
-Read characters from @var{port} into @var{str} until one of the
-characters in the @var{delims} string is encountered. If
-@var{gobble} is true, discard the delimiter character;
-otherwise, leave it in the input stream for the next read. If
-@var{port} is not specified, use the value of
-@code{(current-input-port)}. If @var{start} or @var{end} are
-specified, store data only into the substring of @var{str}
-bounded by @var{start} and @var{end} (which default to the
-beginning and end of the string, respectively).
-
- Return a pair consisting of the delimiter that terminated the
-string and the number of characters read. If reading stopped
-at the end of file, the delimiter returned is the
-@var{eof-object}; if the string was filled without encountering
-a delimiter, this value is @code{#f}.
-@end deffn
-
- %read-line
-@c snarfed from /home/ghouston/guile/guile-core/libguile/rdelim.c:222
-@deffn {Scheme Procedure} %read-line [port]
-@deffnx {C Function} scm_read_line (port)
-Read a newline-terminated line from @var{port}, allocating storage as
-necessary. The newline terminator (if any) is removed from the string,
-and a pair consisting of the line and its delimiter is returned. The
-delimiter may be either a newline or the @var{eof-object}; if
-@code{%read-line} is called at the end of file, it returns the pair
-@code{(#<eof> . #<eof>)}.
-@end deffn
-
- write-line
-@c snarfed from /home/ghouston/guile/guile-core/libguile/rdelim.c:275
-@deffn {Scheme Procedure} write-line obj [port]
-@deffnx {C Function} scm_write_line (obj, port)
-Display @var{obj} and a newline character to @var{port}. If
-@var{port} is not specified, @code{(current-output-port)} is
-used. This function is equivalent to:
-@lisp
-(display obj [port])
-(newline [port])
-@end lisp
-@end deffn
-
- read-options-interface
-@c snarfed from /home/ghouston/guile/guile-core/libguile/read.c:82
-@deffn {Scheme Procedure} read-options-interface [setting]
-@deffnx {C Function} scm_read_options (setting)
-Option interface for the read options. Instead of using
-this procedure directly, use the procedures @code{read-enable},
-@code{read-disable}, @code{read-set!} and @code{read-options}.
-@end deffn
-
- read
-@c snarfed from /home/ghouston/guile/guile-core/libguile/read.c:102
-@deffn {Scheme Procedure} read [port]
-@deffnx {C Function} scm_read (port)
-Read an s-expression from the input port @var{port}, or from
-the current input port if @var{port} is not specified.
-Any whitespace before the next token is discarded.
-@end deffn
-
- read-hash-extend
-@c snarfed from /home/ghouston/guile/guile-core/libguile/read.c:769
-@deffn {Scheme Procedure} read-hash-extend chr proc
-@deffnx {C Function} scm_read_hash_extend (chr, proc)
-Install the procedure @var{proc} for reading expressions
-starting with the character sequence @code{#} and @var{chr}.
-@var{proc} will be called with two arguments: the character
-@var{chr} and the port to read further data from. The object
-returned will be the return value of @code{read}.
-@end deffn
-
- call-with-dynamic-root
-@c snarfed from /home/ghouston/guile/guile-core/libguile/root.c:346
-@deffn {Scheme Procedure} call-with-dynamic-root thunk handler
-@deffnx {C Function} scm_call_with_dynamic_root (thunk, handler)
-Evaluate @code{(thunk)} in a new dynamic context, returning its value.
-
-If an error occurs during evaluation, apply @var{handler} to the
-arguments to the throw, just as @code{throw} would. If this happens,
-@var{handler} is called outside the scope of the new root -- it is
-called in the same dynamic context in which
-@code{call-with-dynamic-root} was evaluated.
-
-If @var{thunk} captures a continuation, the continuation is rooted at
-the call to @var{thunk}. In particular, the call to
-@code{call-with-dynamic-root} is not captured. Therefore,
-@code{call-with-dynamic-root} always returns at most one time.
-
-Before calling @var{thunk}, the dynamic-wind chain is un-wound back to
-the root and a new chain started for @var{thunk}. Therefore, this call
-may not do what you expect:
-
-@lisp
-;; Almost certainly a bug:
-(with-output-to-port
- some-port
-
- (lambda ()
- (call-with-dynamic-root
- (lambda ()
- (display 'fnord)
- (newline))
- (lambda (errcode) errcode))))
-@end lisp
-
-The problem is, on what port will @samp{fnord} be displayed? You
-might expect that because of the @code{with-output-to-port} that
-it will be displayed on the port bound to @code{some-port}. But it
-probably won't -- before evaluating the thunk, dynamic winds are
-unwound, including those created by @code{with-output-to-port}.
-So, the standard output port will have been re-set to its default value
-before @code{display} is evaluated.
-
-(This function was added to Guile mostly to help calls to functions in C
-libraries that can not tolerate non-local exits or calls that return
-multiple times. If such functions call back to the interpreter, it should
-be under a new dynamic root.)
-@end deffn
-
- dynamic-root
-@c snarfed from /home/ghouston/guile/guile-core/libguile/root.c:359
-@deffn {Scheme Procedure} dynamic-root
-@deffnx {C Function} scm_dynamic_root ()
-Return an object representing the current dynamic root.
-
-These objects are only useful for comparison using @code{eq?}.
-They are currently represented as numbers, but your code should
-in no way depend on this.
-@end deffn
-
- read-string!/partial
-@c snarfed from /home/ghouston/guile/guile-core/libguile/rw.c:121
-@deffn {Scheme Procedure} read-string!/partial str [port_or_fdes [start [end]]]
-@deffnx {C Function} scm_read_string_x_partial (str, port_or_fdes, start, end)
-Read characters from a port or file descriptor into a
-string @var{str}. A port must have an underlying file
-descriptor --- a so-called fport. This procedure is
-scsh-compatible and can efficiently read large strings.
-It will:
-
-@itemize
-@item
-attempt to fill the entire string, unless the @var{start}
-and/or @var{end} arguments are supplied. i.e., @var{start}
-defaults to 0 and @var{end} defaults to
-@code{(string-length str)}
-@item
-use the current input port if @var{port_or_fdes} is not
-supplied.
-@item
-return fewer than the requested number of characters in some
-cases, e.g., on end of file, if interrupted by a signal, or if
-not all the characters are immediately available.
-@item
-wait indefinitely for some input if no characters are
-currently available,
-unless the port is in non-blocking mode.
-@item
-read characters from the port's input buffers if available,
-instead from the underlying file descriptor.
-@item
-return @code{#f} if end-of-file is encountered before reading
-any characters, otherwise return the number of characters
-read.
-@item
-return 0 if the port is in non-blocking mode and no characters
-are immediately available.
-@item
-return 0 if the request is for 0 bytes, with no
-end-of-file check.
-@end itemize
-@end deffn
-
- write-string/partial
-@c snarfed from /home/ghouston/guile/guile-core/libguile/rw.c:215
-@deffn {Scheme Procedure} write-string/partial str [port_or_fdes [start [end]]]
-@deffnx {C Function} scm_write_string_partial (str, port_or_fdes, start, end)
-Write characters from a string @var{str} to a port or file
-descriptor. A port must have an underlying file descriptor
---- a so-called fport. This procedure is
-scsh-compatible and can efficiently write large strings.
-It will:
-
-@itemize
-@item
-attempt to write the entire string, unless the @var{start}
-and/or @var{end} arguments are supplied. i.e., @var{start}
-defaults to 0 and @var{end} defaults to
-@code{(string-length str)}
-@item
-use the current output port if @var{port_of_fdes} is not
-supplied.
-@item
-in the case of a buffered port, store the characters in the
-port's output buffer, if all will fit. If they will not fit
-then any existing buffered characters will be flushed
-before attempting
-to write the new characters directly to the underlying file
-descriptor. If the port is in non-blocking mode and
-buffered characters can not be flushed immediately, then an
-@code{EAGAIN} system-error exception will be raised (Note:
-scsh does not support the use of non-blocking buffered ports.)
-@item
-write fewer than the requested number of
-characters in some cases, e.g., if interrupted by a signal or
-if not all of the output can be accepted immediately.
-@item
-wait indefinitely for at least one character
-from @var{str} to be accepted by the port, unless the port is
-in non-blocking mode.
-@item
-return the number of characters accepted by the port.
-@item
-return 0 if the port is in non-blocking mode and can not accept
-at least one character from @var{str} immediately
-@item
-return 0 immediately if the request size is 0 bytes.
-@end itemize
-@end deffn
-
- sigaction
-@c snarfed from /home/ghouston/guile/guile-core/libguile/scmsigs.c:182
-@deffn {Scheme Procedure} sigaction signum [handler [flags]]
-@deffnx {C Function} scm_sigaction (signum, handler, flags)
-Install or report the signal handler for a specified signal.
-
-@var{signum} is the signal number, which can be specified using the value
-of variables such as @code{SIGINT}.
-
-If @var{action} is omitted, @code{sigaction} returns a pair: the
-CAR is the current
-signal hander, which will be either an integer with the value @code{SIG_DFL}
-(default action) or @code{SIG_IGN} (ignore), or the Scheme procedure which
-handles the signal, or @code{#f} if a non-Scheme procedure handles the
-signal. The CDR contains the current @code{sigaction} flags for the handler.
-
-If @var{action} is provided, it is installed as the new handler for
-@var{signum}. @var{action} can be a Scheme procedure taking one
-argument, or the value of @code{SIG_DFL} (default action) or
-@code{SIG_IGN} (ignore), or @code{#f} to restore whatever signal handler
-was installed before @code{sigaction} was first used. Flags can
-optionally be specified for the new handler (@code{SA_RESTART} will
-always be added if it's available and the system is using restartable
-system calls.) The return value is a pair with information about the
-old handler as described above.
-
-This interface does not provide access to the "signal blocking"
-facility. Maybe this is not needed, since the thread support may
-provide solutions to the problem of consistent access to data
-structures.
-@end deffn
-
- restore-signals
-@c snarfed from /home/ghouston/guile/guile-core/libguile/scmsigs.c:345
-@deffn {Scheme Procedure} restore-signals
-@deffnx {C Function} scm_restore_signals ()
-Return all signal handlers to the values they had before any call to
-@code{sigaction} was made. The return value is unspecified.
-@end deffn
-
- alarm
-@c snarfed from /home/ghouston/guile/guile-core/libguile/scmsigs.c:384
-@deffn {Scheme Procedure} alarm i
-@deffnx {C Function} scm_alarm (i)
-Set a timer to raise a @code{SIGALRM} signal after the specified
-number of seconds (an integer). It's advisable to install a signal
-handler for
-@code{SIGALRM} beforehand, since the default action is to terminate
-the process.
-
-The return value indicates the time remaining for the previous alarm,
-if any. The new value replaces the previous alarm. If there was
-no previous alarm, the return value is zero.
-@end deffn
-
- setitimer
-@c snarfed from /home/ghouston/guile/guile-core/libguile/scmsigs.c:414
-@deffn {Scheme Procedure} setitimer which_timer interval_seconds interval_microseconds value_seconds value_microseconds
-@deffnx {C Function} scm_setitimer (which_timer, interval_seconds, interval_microseconds, value_seconds, value_microseconds)
-Set the timer specified by @var{which_timer} according to the given
-@var{interval_seconds}, @var{interval_microseconds},
-@var{value_seconds}, and @var{value_microseconds} values.
-
-Return information about the timer's previous setting.
-Errors are handled as described in the guile info pages under ``POSIX
-Interface Conventions''.
-
-The timers available are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL},
-and @code{ITIMER_PROF}.
-
-The return value will be a list of two cons pairs representing the
-current state of the given timer. The first pair is the seconds and
-microseconds of the timer @code{it_interval}, and the second pair is
-the seconds and microseconds of the timer @code{it_value}.
-@end deffn
-
- getitimer
-@c snarfed from /home/ghouston/guile/guile-core/libguile/scmsigs.c:455
-@deffn {Scheme Procedure} getitimer which_timer
-@deffnx {C Function} scm_getitimer (which_timer)
-Return information about the timer specified by @var{which_timer}
-Errors are handled as described in the guile info pages under ``POSIX
-Interface Conventions''.
-
-The timers available are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL},
-and @code{ITIMER_PROF}.
-
-The return value will be a list of two cons pairs representing the
-current state of the given timer. The first pair is the seconds and
-microseconds of the timer @code{it_interval}, and the second pair is
-the seconds and microseconds of the timer @code{it_value}.
-@end deffn
-
- pause
-@c snarfed from /home/ghouston/guile/guile-core/libguile/scmsigs.c:482
-@deffn {Scheme Procedure} pause
-@deffnx {C Function} scm_pause ()
-Pause the current process (thread?) until a signal arrives whose
-action is to either terminate the current process or invoke a
-handler procedure. The return value is unspecified.
-@end deffn
-
- sleep
-@c snarfed from /home/ghouston/guile/guile-core/libguile/scmsigs.c:495
-@deffn {Scheme Procedure} sleep i
-@deffnx {C Function} scm_sleep (i)
-Wait for the given number of seconds (an integer) or until a signal
-arrives. The return value is zero if the time elapses or the number
-of seconds remaining otherwise.
-@end deffn
-
- usleep
-@c snarfed from /home/ghouston/guile/guile-core/libguile/scmsigs.c:513
-@deffn {Scheme Procedure} usleep i
-@deffnx {C Function} scm_usleep (i)
-Sleep for I microseconds. @code{usleep} is not available on
-all platforms.
-@end deffn
-
- raise
-@c snarfed from /home/ghouston/guile/guile-core/libguile/scmsigs.c:542
-@deffn {Scheme Procedure} raise sig
-@deffnx {C Function} scm_raise (sig)
-Sends a specified signal @var{sig} to the current process, where
-@var{sig} is as described for the kill procedure.
-@end deffn
-
- system
-@c snarfed from /home/ghouston/guile/guile-core/libguile/simpos.c:76
-@deffn {Scheme Procedure} system [cmd]
-@deffnx {C Function} scm_system (cmd)
-Execute @var{cmd} using the operating system's "command
-processor". Under Unix this is usually the default shell
-@code{sh}. The value returned is @var{cmd}'s exit status as
-returned by @code{waitpid}, which can be interpreted using the
-functions above.
-
-If @code{system} is called without arguments, return a boolean
-indicating whether the command processor is available.
-@end deffn
-
- getenv
-@c snarfed from /home/ghouston/guile/guile-core/libguile/simpos.c:103
-@deffn {Scheme Procedure} getenv nam
-@deffnx {C Function} scm_getenv (nam)
-Looks up the string @var{name} in the current environment. The return
-value is @code{#f} unless a string of the form @code{NAME=VALUE} is
-found, in which case the string @code{VALUE} is returned.
-@end deffn
-
- primitive-exit
-@c snarfed from /home/ghouston/guile/guile-core/libguile/simpos.c:118
-@deffn {Scheme Procedure} primitive-exit [status]
-@deffnx {C Function} scm_primitive_exit (status)
-Terminate the current process without unwinding the Scheme stack.
-This is would typically be useful after a fork. The exit status
-is @var{status} if supplied, otherwise zero.
-@end deffn
-
- restricted-vector-sort!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/sort.c:422
-@deffn {Scheme Procedure} restricted-vector-sort! vec less startpos endpos
-@deffnx {C Function} scm_restricted_vector_sort_x (vec, less, startpos, endpos)
-Sort the vector @var{vec}, using @var{less} for comparing
-the vector elements. @var{startpos} and @var{endpos} delimit
-the range of the vector which gets sorted. The return value
-is not specified.
-@end deffn
-
- sorted?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/sort.c:453
-@deffn {Scheme Procedure} sorted? items less
-@deffnx {C Function} scm_sorted_p (items, less)
-Return @code{#t} iff @var{items} is a list or a vector such that
-for all 1 <= i <= m, the predicate @var{less} returns true when
-applied to all elements i - 1 and i
-@end deffn
-
- merge
-@c snarfed from /home/ghouston/guile/guile-core/libguile/sort.c:526
-@deffn {Scheme Procedure} merge alist blist less
-@deffnx {C Function} scm_merge (alist, blist, less)
-Merge two already sorted lists into one.
-Given two lists @var{alist} and @var{blist}, such that
-@code{(sorted? alist less?)} and @code{(sorted? blist less?)},
-return a new list in which the elements of @var{alist} and
-@var{blist} have been stably interleaved so that
-@code{(sorted? (merge alist blist less?) less?)}.
-Note: this does _not_ accept vectors.
-@end deffn
-
- merge!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/sort.c:639
-@deffn {Scheme Procedure} merge! alist blist less
-@deffnx {C Function} scm_merge_x (alist, blist, less)
-Takes two lists @var{alist} and @var{blist} such that
-@code{(sorted? alist less?)} and @code{(sorted? blist less?)} and
-returns a new list in which the elements of @var{alist} and
-@var{blist} have been stably interleaved so that
- @code{(sorted? (merge alist blist less?) less?)}.
-This is the destructive variant of @code{merge}
-Note: this does _not_ accept vectors.
-@end deffn
-
- sort!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/sort.c:715
-@deffn {Scheme Procedure} sort! items less
-@deffnx {C Function} scm_sort_x (items, less)
-Sort the sequence @var{items}, which may be a list or a
-vector. @var{less} is used for comparing the sequence
-elements. The sorting is destructive, that means that the
-input sequence is modified to produce the sorted result.
-This is not a stable sort.
-@end deffn
-
- sort
-@c snarfed from /home/ghouston/guile/guile-core/libguile/sort.c:749
-@deffn {Scheme Procedure} sort items less
-@deffnx {C Function} scm_sort (items, less)
-Sort the sequence @var{items}, which may be a list or a
-vector. @var{less} is used for comparing the sequence
-elements. This is not a stable sort.
-@end deffn
-
- stable-sort!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/sort.c:845
-@deffn {Scheme Procedure} stable-sort! items less
-@deffnx {C Function} scm_stable_sort_x (items, less)
-Sort the sequence @var{items}, which may be a list or a
-vector. @var{less} is used for comparing the sequence elements.
-The sorting is destructive, that means that the input sequence
-is modified to produce the sorted result.
-This is a stable sort.
-@end deffn
-
- stable-sort
-@c snarfed from /home/ghouston/guile/guile-core/libguile/sort.c:885
-@deffn {Scheme Procedure} stable-sort items less
-@deffnx {C Function} scm_stable_sort (items, less)
-Sort the sequence @var{items}, which may be a list or a
-vector. @var{less} is used for comparing the sequence elements.
-This is a stable sort.
-@end deffn
-
- sort-list!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/sort.c:931
-@deffn {Scheme Procedure} sort-list! items less
-@deffnx {C Function} scm_sort_list_x (items, less)
-Sort the list @var{items}, using @var{less} for comparing the
-list elements. The sorting is destructive, that means that the
-input list is modified to produce the sorted result.
-This is a stable sort.
-@end deffn
-
- sort-list
-@c snarfed from /home/ghouston/guile/guile-core/libguile/sort.c:945
-@deffn {Scheme Procedure} sort-list items less
-@deffnx {C Function} scm_sort_list (items, less)
-Sort the list @var{items}, using @var{less} for comparing the
-list elements. This is a stable sort.
-@end deffn
-
- source-properties
-@c snarfed from /home/ghouston/guile/guile-core/libguile/srcprop.c:178
-@deffn {Scheme Procedure} source-properties obj
-@deffnx {C Function} scm_source_properties (obj)
-Return the source property association list of @var{obj}.
-@end deffn
-
- set-source-properties!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/srcprop.c:199
-@deffn {Scheme Procedure} set-source-properties! obj plist
-@deffnx {C Function} scm_set_source_properties_x (obj, plist)
-Install the association list @var{plist} as the source property
-list for @var{obj}.
-@end deffn
-
- source-property
-@c snarfed from /home/ghouston/guile/guile-core/libguile/srcprop.c:217
-@deffn {Scheme Procedure} source-property obj key
-@deffnx {C Function} scm_source_property (obj, key)
-Return the source property specified by @var{key} from
-@var{obj}'s source property list.
-@end deffn
-
- set-source-property!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/srcprop.c:248
-@deffn {Scheme Procedure} set-source-property! obj key datum
-@deffnx {C Function} scm_set_source_property_x (obj, key, datum)
-Set the source property of object @var{obj}, which is specified by
-@var{key} to @var{datum}. Normally, the key will be a symbol.
-@end deffn
-
- stack?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stacks.c:411
-@deffn {Scheme Procedure} stack? obj
-@deffnx {C Function} scm_stack_p (obj)
-Return @code{#t} if @var{obj} is a calling stack.
-@end deffn
-
- make-stack
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stacks.c:442
-@deffn {Scheme Procedure} make-stack obj . args
-@deffnx {C Function} scm_make_stack (obj, args)
-Create a new stack. If @var{obj} is @code{#t}, the current
-evaluation stack is used for creating the stack frames,
-otherwise the frames are taken from @var{obj} (which must be
-either a debug object or a continuation).
-
-@var{args} should be a list containing any combination of
-integer, procedure and @code{#t} values.
-
-These values specify various ways of cutting away uninteresting
-stack frames from the top and bottom of the stack that
-@code{make-stack} returns. They come in pairs like this:
-@code{(@var{inner_cut_1} @var{outer_cut_1} @var{inner_cut_2}
-@var{outer_cut_2} @dots{})}.
-
-Each @var{inner_cut_N} can be @code{#t}, an integer, or a
-procedure. @code{#t} means to cut away all frames up to but
-excluding the first user module frame. An integer means to cut
-away exactly that number of frames. A procedure means to cut
-away all frames up to but excluding the application frame whose
-procedure matches the specified one.
-
-Each @var{outer_cut_N} can be an integer or a procedure. An
-integer means to cut away that number of frames. A procedure
-means to cut away frames down to but excluding the application
-frame whose procedure matches the specified one.
-
-If the @var{outer_cut_N} of the last pair is missing, it is
-taken as 0.
-@end deffn
-
- stack-id
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stacks.c:534
-@deffn {Scheme Procedure} stack-id stack
-@deffnx {C Function} scm_stack_id (stack)
-Return the identifier given to @var{stack} by @code{start-stack}.
-@end deffn
-
- stack-ref
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stacks.c:575
-@deffn {Scheme Procedure} stack-ref stack index
-@deffnx {C Function} scm_stack_ref (stack, index)
-Return the @var{index}'th frame from @var{stack}.
-@end deffn
-
- stack-length
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stacks.c:591
-@deffn {Scheme Procedure} stack-length stack
-@deffnx {C Function} scm_stack_length (stack)
-Return the length of @var{stack}.
-@end deffn
-
- frame?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stacks.c:604
-@deffn {Scheme Procedure} frame? obj
-@deffnx {C Function} scm_frame_p (obj)
-Return @code{#t} if @var{obj} is a stack frame.
-@end deffn
-
- last-stack-frame
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stacks.c:615
-@deffn {Scheme Procedure} last-stack-frame obj
-@deffnx {C Function} scm_last_stack_frame (obj)
-Return a stack which consists of a single frame, which is the
-last stack frame for @var{obj}. @var{obj} must be either a
-debug object or a continuation.
-@end deffn
-
- frame-number
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stacks.c:657
-@deffn {Scheme Procedure} frame-number frame
-@deffnx {C Function} scm_frame_number (frame)
-Return the frame number of @var{frame}.
-@end deffn
-
- frame-source
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stacks.c:667
-@deffn {Scheme Procedure} frame-source frame
-@deffnx {C Function} scm_frame_source (frame)
-Return the source of @var{frame}.
-@end deffn
-
- frame-procedure
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stacks.c:678
-@deffn {Scheme Procedure} frame-procedure frame
-@deffnx {C Function} scm_frame_procedure (frame)
-Return the procedure for @var{frame}, or @code{#f} if no
-procedure is associated with @var{frame}.
-@end deffn
-
- frame-arguments
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stacks.c:690
-@deffn {Scheme Procedure} frame-arguments frame
-@deffnx {C Function} scm_frame_arguments (frame)
-Return the arguments of @var{frame}.
-@end deffn
-
- frame-previous
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stacks.c:701
-@deffn {Scheme Procedure} frame-previous frame
-@deffnx {C Function} scm_frame_previous (frame)
-Return the previous frame of @var{frame}, or @code{#f} if
-@var{frame} is the first frame in its stack.
-@end deffn
-
- frame-next
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stacks.c:717
-@deffn {Scheme Procedure} frame-next frame
-@deffnx {C Function} scm_frame_next (frame)
-Return the next frame of @var{frame}, or @code{#f} if
-@var{frame} is the last frame in its stack.
-@end deffn
-
- frame-real?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stacks.c:732
-@deffn {Scheme Procedure} frame-real? frame
-@deffnx {C Function} scm_frame_real_p (frame)
-Return @code{#t} if @var{frame} is a real frame.
-@end deffn
-
- frame-procedure?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stacks.c:742
-@deffn {Scheme Procedure} frame-procedure? frame
-@deffnx {C Function} scm_frame_procedure_p (frame)
-Return @code{#t} if a procedure is associated with @var{frame}.
-@end deffn
-
- frame-evaluating-args?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stacks.c:752
-@deffn {Scheme Procedure} frame-evaluating-args? frame
-@deffnx {C Function} scm_frame_evaluating_args_p (frame)
-Return @code{#t} if @var{frame} contains evaluated arguments.
-@end deffn
-
- frame-overflow?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stacks.c:762
-@deffn {Scheme Procedure} frame-overflow? frame
-@deffnx {C Function} scm_frame_overflow_p (frame)
-Return @code{#t} if @var{frame} is an overflow frame.
-@end deffn
-
- get-internal-real-time
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stime.c:143
-@deffn {Scheme Procedure} get-internal-real-time
-@deffnx {C Function} scm_get_internal_real_time ()
-Return the number of time units since the interpreter was
-started.
-@end deffn
-
- times
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stime.c:188
-@deffn {Scheme Procedure} times
-@deffnx {C Function} scm_times ()
-Return an object with information about real and processor
-time. The following procedures accept such an object as an
-argument and return a selected component:
-
-@table @code
-@item tms:clock
-The current real time, expressed as time units relative to an
-arbitrary base.
-@item tms:utime
-The CPU time units used by the calling process.
-@item tms:stime
-The CPU time units used by the system on behalf of the calling
-process.
-@item tms:cutime
-The CPU time units used by terminated child processes of the
-calling process, whose status has been collected (e.g., using
-@code{waitpid}).
-@item tms:cstime
-Similarly, the CPU times units used by the system on behalf of
-terminated child processes.
-@end table
-@end deffn
-
- get-internal-run-time
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stime.c:220
-@deffn {Scheme Procedure} get-internal-run-time
-@deffnx {C Function} scm_get_internal_run_time ()
-Return the number of time units of processor time used by the
-interpreter. Both @emph{system} and @emph{user} time are
-included but subprocesses are not.
-@end deffn
-
- current-time
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stime.c:230
-@deffn {Scheme Procedure} current-time
-@deffnx {C Function} scm_current_time ()
-Return the number of seconds since 1970-01-01 00:00:00 UTC,
-excluding leap seconds.
-@end deffn
-
- gettimeofday
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stime.c:248
-@deffn {Scheme Procedure} gettimeofday
-@deffnx {C Function} scm_gettimeofday ()
-Return a pair containing the number of seconds and microseconds
-since 1970-01-01 00:00:00 UTC, excluding leap seconds. Note:
-whether true microsecond resolution is available depends on the
-operating system.
-@end deffn
-
- localtime
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stime.c:347
-@deffn {Scheme Procedure} localtime time [zone]
-@deffnx {C Function} scm_localtime (time, zone)
-Return an object representing the broken down components of
-@var{time}, an integer like the one returned by
-@code{current-time}. The time zone for the calculation is
-optionally specified by @var{zone} (a string), otherwise the
-@code{TZ} environment variable or the system default is used.
-@end deffn
-
- gmtime
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stime.c:420
-@deffn {Scheme Procedure} gmtime time
-@deffnx {C Function} scm_gmtime (time)
-Return an object representing the broken down components of
-@var{time}, an integer like the one returned by
-@code{current-time}. The values are calculated for UTC.
-@end deffn
-
- mktime
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stime.c:482
-@deffn {Scheme Procedure} mktime sbd_time [zone]
-@deffnx {C Function} scm_mktime (sbd_time, zone)
-@var{bd-time} is an object representing broken down time and @code{zone}
-is an optional time zone specifier (otherwise the TZ environment variable
-or the system default is used).
-
-Returns a pair: the car is a corresponding
-integer time value like that returned
-by @code{current-time}; the cdr is a broken down time object, similar to
-as @var{bd-time} but with normalized values.
-@end deffn
-
- tzset
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stime.c:556
-@deffn {Scheme Procedure} tzset
-@deffnx {C Function} scm_tzset ()
-Initialize the timezone from the TZ environment variable
-or the system default. It's not usually necessary to call this procedure
-since it's done automatically by other procedures that depend on the
-timezone.
-@end deffn
-
- strftime
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stime.c:573
-@deffn {Scheme Procedure} strftime format stime
-@deffnx {C Function} scm_strftime (format, stime)
-Formats a time specification @var{time} using @var{template}. @var{time}
-is an object with time components in the form returned by @code{localtime}
-or @code{gmtime}. @var{template} is a string which can include formatting
-specifications introduced by a @code{%} character. The formatting of
-month and day names is dependent on the current locale. The value returned
-is the formatted string.
-@xref{Formatting Date and Time, , , libc, The GNU C Library Reference Manual}.)
-@end deffn
-
- strptime
-@c snarfed from /home/ghouston/guile/guile-core/libguile/stime.c:670
-@deffn {Scheme Procedure} strptime format string
-@deffnx {C Function} scm_strptime (format, string)
-Performs the reverse action to @code{strftime}, parsing
-@var{string} according to the specification supplied in
-@var{template}. The interpretation of month and day names is
-dependent on the current locale. The value returned is a pair.
-The car has an object with time components
-in the form returned by @code{localtime} or @code{gmtime},
-but the time zone components
-are not usefully set.
-The cdr reports the number of characters from @var{string}
-which were used for the conversion.
-@end deffn
-
- string?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strings.c:61
-@deffn {Scheme Procedure} string? obj
-@deffnx {C Function} scm_string_p (obj)
-Return @code{#t} if @var{obj} is a string, else @code{#f}.
-@end deffn
-
- list->string
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strings.c:69
-@deffn {Scheme Procedure} list->string
-implemented by the C function "scm_string"
-@end deffn
-
- string
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strings.c:75
-@deffn {Scheme Procedure} string . chrs
-@deffnx {Scheme Procedure} list->string chrs
-@deffnx {C Function} scm_string (chrs)
-Return a newly allocated string composed of the arguments,
-@var{chrs}.
-@end deffn
-
- make-string
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strings.c:209
-@deffn {Scheme Procedure} make-string k [chr]
-@deffnx {C Function} scm_make_string (k, chr)
-Return a newly allocated string of
-length @var{k}. If @var{chr} is given, then all elements of
-the string are initialized to @var{chr}, otherwise the contents
-of the @var{string} are unspecified.
-@end deffn
-
- string-length
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strings.c:242
-@deffn {Scheme Procedure} string-length string
-@deffnx {C Function} scm_string_length (string)
-Return the number of characters in @var{string}.
-@end deffn
-
- string-ref
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strings.c:253
-@deffn {Scheme Procedure} string-ref str k
-@deffnx {C Function} scm_string_ref (str, k)
-Return character @var{k} of @var{str} using zero-origin
-indexing. @var{k} must be a valid index of @var{str}.
-@end deffn
-
- string-set!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strings.c:270
-@deffn {Scheme Procedure} string-set! str k chr
-@deffnx {C Function} scm_string_set_x (str, k, chr)
-Store @var{chr} in element @var{k} of @var{str} and return
-an unspecified value. @var{k} must be a valid index of
-@var{str}.
-@end deffn
-
- substring
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strings.c:289
-@deffn {Scheme Procedure} substring str start [end]
-@deffnx {C Function} scm_substring (str, start, end)
-Return a newly allocated string formed from the characters
-of @var{str} beginning with index @var{start} (inclusive) and
-ending with index @var{end} (exclusive).
-@var{str} must be a string, @var{start} and @var{end} must be
-exact integers satisfying:
-
-0 <= @var{start} <= @var{end} <= (string-length @var{str}).
-@end deffn
-
- string-append
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strings.c:315
-@deffn {Scheme Procedure} string-append . args
-@deffnx {C Function} scm_string_append (args)
-Return a newly allocated string whose characters form the
-concatenation of the given strings, @var{args}.
-@end deffn
-
- string-index
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strop.c:138
-@deffn {Scheme Procedure} string-index str chr [frm [to]]
-@deffnx {C Function} scm_string_index (str, chr, frm, to)
-Return the index of the first occurrence of @var{chr} in
-@var{str}. The optional integer arguments @var{frm} and
-@var{to} limit the search to a portion of the string. This
-procedure essentially implements the @code{index} or
-@code{strchr} functions from the C library.
-
-@lisp
-(string-index "weiner" #\e)
-@result{} 1
-
-(string-index "weiner" #\e 2)
-@result{} 4
-
-(string-index "weiner" #\e 2 4)
-@result{} #f
-@end lisp
-@end deffn
-
- string-rindex
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strop.c:168
-@deffn {Scheme Procedure} string-rindex str chr [frm [to]]
-@deffnx {C Function} scm_string_rindex (str, chr, frm, to)
-Like @code{string-index}, but search from the right of the
-string rather than from the left. This procedure essentially
-implements the @code{rindex} or @code{strrchr} functions from
-the C library.
-
-@lisp
-(string-rindex "weiner" #\e)
-@result{} 4
-
-(string-rindex "weiner" #\e 2 4)
-@result{} #f
-
-(string-rindex "weiner" #\e 2 5)
-@result{} 4
-@end lisp
-@end deffn
-
- substring-move!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strop.c:188
-@deffn {Scheme Procedure} substring-move! str1 start1 end1 str2 start2
-@deffnx {C Function} scm_substring_move_x (str1, start1, end1, str2, start2)
-Copy the substring of @var{str1} bounded by @var{start1} and @var{end1}
-into @var{str2} beginning at position @var{start2}.
-@var{str1} and @var{str2} can be the same string.
-@end deffn
-
- substring-fill!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strop.c:224
-@deffn {Scheme Procedure} substring-fill! str start end fill
-@deffnx {C Function} scm_substring_fill_x (str, start, end, fill)
-Change every character in @var{str} between @var{start} and
-@var{end} to @var{fill}.
-
-@lisp
-(define y "abcdefg")
-(substring-fill! y 1 3 #\r)
-y
-@result{} "arrdefg"
-@end lisp
-@end deffn
-
- string-null?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strop.c:249
-@deffn {Scheme Procedure} string-null? str
-@deffnx {C Function} scm_string_null_p (str)
-Return @code{#t} if @var{str}'s length is zero, and
-@code{#f} otherwise.
-@lisp
-(string-null? "") @result{} #t
-y @result{} "foo"
-(string-null? y) @result{} #f
-@end lisp
-@end deffn
-
- string->list
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strop.c:263
-@deffn {Scheme Procedure} string->list str
-@deffnx {C Function} scm_string_to_list (str)
-Return a newly allocated list of the characters that make up
-the given string @var{str}. @code{string->list} and
-@code{list->string} are inverses as far as @samp{equal?} is
-concerned.
-@end deffn
-
- string-copy
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strop.c:292
-@deffn {Scheme Procedure} string-copy str
-@deffnx {C Function} scm_string_copy (str)
-Return a newly allocated copy of the given @var{string}.
-@end deffn
-
- string-fill!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strop.c:305
-@deffn {Scheme Procedure} string-fill! str chr
-@deffnx {C Function} scm_string_fill_x (str, chr)
-Store @var{char} in every element of the given @var{string} and
-return an unspecified value.
-@end deffn
-
- string-upcase!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strop.c:340
-@deffn {Scheme Procedure} string-upcase! str
-@deffnx {C Function} scm_string_upcase_x (str)
-Destructively upcase every character in @var{str} and return
-@var{str}.
-@lisp
-y @result{} "arrdefg"
-(string-upcase! y) @result{} "ARRDEFG"
-y @result{} "ARRDEFG"
-@end lisp
-@end deffn
-
- string-upcase
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strop.c:353
-@deffn {Scheme Procedure} string-upcase str
-@deffnx {C Function} scm_string_upcase (str)
-Return a freshly allocated string containing the characters of
-@var{str} in upper case.
-@end deffn
-
- string-downcase!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strop.c:385
-@deffn {Scheme Procedure} string-downcase! str
-@deffnx {C Function} scm_string_downcase_x (str)
-Destructively downcase every character in @var{str} and return
-@var{str}.
-@lisp
-y @result{} "ARRDEFG"
-(string-downcase! y) @result{} "arrdefg"
-y @result{} "arrdefg"
-@end lisp
-@end deffn
-
- string-downcase
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strop.c:398
-@deffn {Scheme Procedure} string-downcase str
-@deffnx {C Function} scm_string_downcase (str)
-Return a freshly allocation string containing the characters in
-@var{str} in lower case.
-@end deffn
-
- string-capitalize!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strop.c:443
-@deffn {Scheme Procedure} string-capitalize! str
-@deffnx {C Function} scm_string_capitalize_x (str)
-Upcase the first character of every word in @var{str}
-destructively and return @var{str}.
-
-@lisp
-y @result{} "hello world"
-(string-capitalize! y) @result{} "Hello World"
-y @result{} "Hello World"
-@end lisp
-@end deffn
-
- string-capitalize
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strop.c:457
-@deffn {Scheme Procedure} string-capitalize str
-@deffnx {C Function} scm_string_capitalize (str)
-Return a freshly allocated string with the characters in
-@var{str}, where the first character of every word is
-capitalized.
-@end deffn
-
- string-split
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strop.c:486
-@deffn {Scheme Procedure} string-split str chr
-@deffnx {C Function} scm_string_split (str, chr)
-Split the string @var{str} into the a list of the substrings delimited
-by appearances of the character @var{chr}. Note that an empty substring
-between separator characters will result in an empty string in the
-result list.
-
-@lisp
-(string-split "root:x:0:0:root:/root:/bin/bash" #\:)
-@result{}
-("root" "x" "0" "0" "root" "/root" "/bin/bash")
-
-(string-split "::" #\:)
-@result{}
-("" "" "")
-
-(string-split "" #\:)
-@result{}
-("")
-@end lisp
-@end deffn
-
- string-ci->symbol
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strop.c:521
-@deffn {Scheme Procedure} string-ci->symbol str
-@deffnx {C Function} scm_string_ci_to_symbol (str)
-Return the symbol whose name is @var{str}. @var{str} is
-converted to lowercase before the conversion is done, if Guile
-is currently reading symbols case-insensitively.
-@end deffn
-
- string=?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strorder.c:62
-@deffn {Scheme Procedure} string=? s1 s2
-Lexicographic equality predicate; return @code{#t} if the two
-strings are the same length and contain the same characters in
-the same positions, otherwise return @code{#f}.
-
-The procedure @code{string-ci=?} treats upper and lower case
-letters as though they were the same character, but
-@code{string=?} treats upper and lower case as distinct
-characters.
-@end deffn
-
- string-ci=?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strorder.c:97
-@deffn {Scheme Procedure} string-ci=? s1 s2
-Case-insensitive string equality predicate; return @code{#t} if
-the two strings are the same length and their component
-characters match (ignoring case) at each position; otherwise
-return @code{#f}.
-@end deffn
-
- string<?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strorder.c:154
-@deffn {Scheme Procedure} string<? s1 s2
-Lexicographic ordering predicate; return @code{#t} if @var{s1}
-is lexicographically less than @var{s2}.
-@end deffn
-
- string<=?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strorder.c:168
-@deffn {Scheme Procedure} string<=? s1 s2
-Lexicographic ordering predicate; return @code{#t} if @var{s1}
-is lexicographically less than or equal to @var{s2}.
-@end deffn
-
- string>?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strorder.c:182
-@deffn {Scheme Procedure} string>? s1 s2
-Lexicographic ordering predicate; return @code{#t} if @var{s1}
-is lexicographically greater than @var{s2}.
-@end deffn
-
- string>=?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strorder.c:196
-@deffn {Scheme Procedure} string>=? s1 s2
-Lexicographic ordering predicate; return @code{#t} if @var{s1}
-is lexicographically greater than or equal to @var{s2}.
-@end deffn
-
- string-ci<?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strorder.c:235
-@deffn {Scheme Procedure} string-ci<? s1 s2
-Case insensitive lexicographic ordering predicate; return
-@code{#t} if @var{s1} is lexicographically less than @var{s2}
-regardless of case.
-@end deffn
-
- string-ci<=?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strorder.c:250
-@deffn {Scheme Procedure} string-ci<=? s1 s2
-Case insensitive lexicographic ordering predicate; return
-@code{#t} if @var{s1} is lexicographically less than or equal
-to @var{s2} regardless of case.
-@end deffn
-
- string-ci>?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strorder.c:265
-@deffn {Scheme Procedure} string-ci>? s1 s2
-Case insensitive lexicographic ordering predicate; return
-@code{#t} if @var{s1} is lexicographically greater than
-@var{s2} regardless of case.
-@end deffn
-
- string-ci>=?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strorder.c:280
-@deffn {Scheme Procedure} string-ci>=? s1 s2
-Case insensitive lexicographic ordering predicate; return
-@code{#t} if @var{s1} is lexicographically greater than or
-equal to @var{s2} regardless of case.
-@end deffn
-
- object->string
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strports.c:321
-@deffn {Scheme Procedure} object->string obj [printer]
-@deffnx {C Function} scm_object_to_string (obj, printer)
-Return a Scheme string obtained by printing @var{obj}.
-Printing function can be specified by the optional second
-argument @var{printer} (default: @code{write}).
-@end deffn
-
- call-with-output-string
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strports.c:345
-@deffn {Scheme Procedure} call-with-output-string proc
-@deffnx {C Function} scm_call_with_output_string (proc)
-Calls the one-argument procedure @var{proc} with a newly created output
-port. When the function returns, the string composed of the characters
-written into the port is returned.
-@end deffn
-
- call-with-input-string
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strports.c:364
-@deffn {Scheme Procedure} call-with-input-string string proc
-@deffnx {C Function} scm_call_with_input_string (string, proc)
-Calls the one-argument procedure @var{proc} with a newly
-created input port from which @var{string}'s contents may be
-read. The value yielded by the @var{proc} is returned.
-@end deffn
-
- open-input-string
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strports.c:377
-@deffn {Scheme Procedure} open-input-string str
-@deffnx {C Function} scm_open_input_string (str)
-Take a string and return an input port that delivers characters
-from the string. The port can be closed by
-@code{close-input-port}, though its storage will be reclaimed
-by the garbage collector if it becomes inaccessible.
-@end deffn
-
- open-output-string
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strports.c:391
-@deffn {Scheme Procedure} open-output-string
-@deffnx {C Function} scm_open_output_string ()
-Return an output port that will accumulate characters for
-retrieval by @code{get-output-string}. The port can be closed
-by the procedure @code{close-output-port}, though its storage
-will be reclaimed by the garbage collector if it becomes
-inaccessible.
-@end deffn
-
- get-output-string
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strports.c:408
-@deffn {Scheme Procedure} get-output-string port
-@deffnx {C Function} scm_get_output_string (port)
-Given an output port created by @code{open-output-string},
-return a string consisting of the characters that have been
-output to the port so far.
-@end deffn
-
- eval-string
-@c snarfed from /home/ghouston/guile/guile-core/libguile/strports.c:467
-@deffn {Scheme Procedure} eval-string string
-@deffnx {C Function} scm_eval_string (string)
-Evaluate @var{string} as the text representation of a Scheme
-form or forms, and return whatever value they produce.
-Evaluation takes place in the environment returned by the
-procedure @code{interaction-environment}.
-@end deffn
-
- make-struct-layout
-@c snarfed from /home/ghouston/guile/guile-core/libguile/struct.c:77
-@deffn {Scheme Procedure} make-struct-layout fields
-@deffnx {C Function} scm_make_struct_layout (fields)
-Return a new structure layout object.
-
-@var{fields} must be a string made up of pairs of characters
-strung together. The first character of each pair describes a field
-type, the second a field protection. Allowed types are 'p' for
-GC-protected Scheme data, 'u' for unprotected binary data, and 's' for
-a field that points to the structure itself. Allowed protections
-are 'w' for mutable fields, 'r' for read-only fields, and 'o' for opaque
-fields. The last field protection specification may be capitalized to
-indicate that the field is a tail-array.
-@end deffn
-
- struct?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/struct.c:244
-@deffn {Scheme Procedure} struct? x
-@deffnx {C Function} scm_struct_p (x)
-Return @code{#t} iff @var{x} is a structure object, else
-@code{#f}.
-@end deffn
-
- struct-vtable?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/struct.c:253
-@deffn {Scheme Procedure} struct-vtable? x
-@deffnx {C Function} scm_struct_vtable_p (x)
-Return @code{#t} iff @var{x} is a vtable structure.
-@end deffn
-
- make-struct
-@c snarfed from /home/ghouston/guile/guile-core/libguile/struct.c:434
-@deffn {Scheme Procedure} make-struct vtable tail_array_size . init
-@deffnx {C Function} scm_make_struct (vtable, tail_array_size, init)
-Create a new structure.
-
-@var{type} must be a vtable structure (@pxref{Vtables}).
-
-@var{tail-elts} must be a non-negative integer. If the layout
-specification indicated by @var{type} includes a tail-array,
-this is the number of elements allocated to that array.
-
-The @var{init1}, @dots{} are optional arguments describing how
-successive fields of the structure should be initialized. Only fields
-with protection 'r' or 'w' can be initialized, except for fields of
-type 's', which are automatically initialized to point to the new
-structure itself; fields with protection 'o' can not be initialized by
-Scheme programs.
-
-If fewer optional arguments than initializable fields are supplied,
-fields of type 'p' get default value #f while fields of type 'u' are
-initialized to 0.
-
-Structs are currently the basic representation for record-like data
-structures in Guile. The plan is to eventually replace them with a
-new representation which will at the same time be easier to use and
-more powerful.
-
-For more information, see the documentation for @code{make-vtable-vtable}.
-@end deffn
-
- make-vtable-vtable
-@c snarfed from /home/ghouston/guile/guile-core/libguile/struct.c:519
-@deffn {Scheme Procedure} make-vtable-vtable user_fields tail_array_size . init
-@deffnx {C Function} scm_make_vtable_vtable (user_fields, tail_array_size, init)
-Return a new, self-describing vtable structure.
-
-@var{user-fields} is a string describing user defined fields of the
-vtable beginning at index @code{vtable-offset-user}
-(see @code{make-struct-layout}).
-
-@var{tail-size} specifies the size of the tail-array (if any) of
-this vtable.
-
-@var{init1}, @dots{} are the optional initializers for the fields of
-the vtable.
-
-Vtables have one initializable system field---the struct printer.
-This field comes before the user fields in the initializers passed
-to @code{make-vtable-vtable} and @code{make-struct}, and thus works as
-a third optional argument to @code{make-vtable-vtable} and a fourth to
-@code{make-struct} when creating vtables:
-
-If the value is a procedure, it will be called instead of the standard
-printer whenever a struct described by this vtable is printed.
-The procedure will be called with arguments STRUCT and PORT.
-
-The structure of a struct is described by a vtable, so the vtable is
-in essence the type of the struct. The vtable is itself a struct with
-a vtable. This could go on forever if it weren't for the
-vtable-vtables which are self-describing vtables, and thus terminate
-the chain.
-
-There are several potential ways of using structs, but the standard
-one is to use three kinds of structs, together building up a type
-sub-system: one vtable-vtable working as the root and one or several
-"types", each with a set of "instances". (The vtable-vtable should be
-compared to the class <class> which is the class of itself.)
-
-@lisp
-(define ball-root (make-vtable-vtable "pr" 0))
-
-(define (make-ball-type ball-color)
- (make-struct ball-root 0
- (make-struct-layout "pw")
- (lambda (ball port)
- (format port "#<a ~A ball owned by ~A>"
- (color ball)
- (owner ball)))
- ball-color))
-(define (color ball) (struct-ref (struct-vtable ball) vtable-offset-user))
-(define (owner ball) (struct-ref ball 0))
-
-(define red (make-ball-type 'red))
-(define green (make-ball-type 'green))
-
-(define (make-ball type owner) (make-struct type 0 owner))
-
-(define ball (make-ball green 'Nisse))
-ball @result{} #<a green ball owned by Nisse>
-@end lisp
-@end deffn
-
- struct-ref
-@c snarfed from /home/ghouston/guile/guile-core/libguile/struct.c:560
-@deffn {Scheme Procedure} struct-ref handle pos
-@deffnx {Scheme Procedure} struct-set! struct n value
-@deffnx {C Function} scm_struct_ref (handle, pos)
-Access (or modify) the @var{n}th field of @var{struct}.
-
-If the field is of type 'p', then it can be set to an arbitrary value.
-
-If the field is of type 'u', then it can only be set to a non-negative
-integer value small enough to fit in one machine word.
-@end deffn
-
- struct-set!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/struct.c:638
-@deffn {Scheme Procedure} struct-set! handle pos val
-@deffnx {C Function} scm_struct_set_x (handle, pos, val)
-Set the slot of the structure @var{handle} with index @var{pos}
-to @var{val}. Signal an error if the slot can not be written
-to.
-@end deffn
-
- struct-vtable
-@c snarfed from /home/ghouston/guile/guile-core/libguile/struct.c:708
-@deffn {Scheme Procedure} struct-vtable handle
-@deffnx {C Function} scm_struct_vtable (handle)
-Return the vtable structure that describes the type of @var{struct}.
-@end deffn
-
- struct-vtable-tag
-@c snarfed from /home/ghouston/guile/guile-core/libguile/struct.c:719
-@deffn {Scheme Procedure} struct-vtable-tag handle
-@deffnx {C Function} scm_struct_vtable_tag (handle)
-Return the vtable tag of the structure @var{handle}.
-@end deffn
-
- struct-vtable-name
-@c snarfed from /home/ghouston/guile/guile-core/libguile/struct.c:758
-@deffn {Scheme Procedure} struct-vtable-name vtable
-@deffnx {C Function} scm_struct_vtable_name (vtable)
-Return the name of the vtable @var{vtable}.
-@end deffn
-
- set-struct-vtable-name!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/struct.c:768
-@deffn {Scheme Procedure} set-struct-vtable-name! vtable name
-@deffnx {C Function} scm_set_struct_vtable_name_x (vtable, name)
-Set the name of the vtable @var{vtable} to @var{name}.
-@end deffn
-
- symbol?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/symbols.c:164
-@deffn {Scheme Procedure} symbol? obj
-@deffnx {C Function} scm_symbol_p (obj)
-Return @code{#t} if @var{obj} is a symbol, otherwise return
-@code{#f}.
-@end deffn
-
- symbol-interned?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/symbols.c:174
-@deffn {Scheme Procedure} symbol-interned? symbol
-@deffnx {C Function} scm_symbol_interned_p (symbol)
-Return @code{#t} if @var{symbol} is interned, otherwise return
-@code{#f}.
-@end deffn
-
- make-symbol
-@c snarfed from /home/ghouston/guile/guile-core/libguile/symbols.c:186
-@deffn {Scheme Procedure} make-symbol name
-@deffnx {C Function} scm_make_symbol (name)
-Return a new uninterned symbol with the name @var{name}. The returned symbol is guaranteed to be unique and future calls to @code{string->symbol} will not return it.
-@end deffn
-
- symbol->string
-@c snarfed from /home/ghouston/guile/guile-core/libguile/symbols.c:222
-@deffn {Scheme Procedure} symbol->string s
-@deffnx {C Function} scm_symbol_to_string (s)
-Return the name of @var{symbol} as a string. If the symbol was
-part of an object returned as the value of a literal expression
-(section @pxref{Literal expressions,,,r5rs, The Revised^5
-Report on Scheme}) or by a call to the @code{read} procedure,
-and its name contains alphabetic characters, then the string
-returned will contain characters in the implementation's
-preferred standard case---some implementations will prefer
-upper case, others lower case. If the symbol was returned by
-@code{string->symbol}, the case of characters in the string
-returned will be the same as the case in the string that was
-passed to @code{string->symbol}. It is an error to apply
-mutation procedures like @code{string-set!} to strings returned
-by this procedure.
-
-The following examples assume that the implementation's
-standard case is lower case:
-
-@lisp
-(symbol->string 'flying-fish) @result{} "flying-fish"
-(symbol->string 'Martin) @result{} "martin"
-(symbol->string
- (string->symbol "Malvina")) @result{} "Malvina"
-@end lisp
-@end deffn
-
- string->symbol
-@c snarfed from /home/ghouston/guile/guile-core/libguile/symbols.c:255
-@deffn {Scheme Procedure} string->symbol string
-@deffnx {C Function} scm_string_to_symbol (string)
-Return the symbol whose name is @var{string}. This procedure
-can create symbols with names containing special characters or
-letters in the non-standard case, but it is usually a bad idea
-to create such symbols because in some implementations of
-Scheme they cannot be read as themselves. See
-@code{symbol->string}.
-
-The following examples assume that the implementation's
-standard case is lower case:
-
-@lisp
-(eq? 'mISSISSIppi 'mississippi) @result{} #t
-(string->symbol "mISSISSIppi") @result{} @r{the symbol with name "mISSISSIppi"}
-(eq? 'bitBlt (string->symbol "bitBlt")) @result{} #f
-(eq? 'JollyWog
- (string->symbol (symbol->string 'JollyWog))) @result{} #t
-(string=? "K. Harper, M.D."
- (symbol->string
- (string->symbol "K. Harper, M.D."))) @result{}#t
-@end lisp
-@end deffn
-
- gensym
-@c snarfed from /home/ghouston/guile/guile-core/libguile/symbols.c:277
-@deffn {Scheme Procedure} gensym [prefix]
-@deffnx {C Function} scm_gensym (prefix)
-Create a new symbol with a name constructed from a prefix and
-a counter value. The string @var{prefix} can be specified as
-an optional argument. Default prefix is @code{ g}. The counter
-is increased by 1 at each call. There is no provision for
-resetting the counter.
-@end deffn
-
- symbol-hash
-@c snarfed from /home/ghouston/guile/guile-core/libguile/symbols.c:309
-@deffn {Scheme Procedure} symbol-hash symbol
-@deffnx {C Function} scm_symbol_hash (symbol)
-Return a hash value for @var{symbol}.
-@end deffn
-
- symbol-fref
-@c snarfed from /home/ghouston/guile/guile-core/libguile/symbols.c:319
-@deffn {Scheme Procedure} symbol-fref s
-@deffnx {C Function} scm_symbol_fref (s)
-Return the contents of @var{symbol}'s @dfn{function slot}.
-@end deffn
-
- symbol-pref
-@c snarfed from /home/ghouston/guile/guile-core/libguile/symbols.c:330
-@deffn {Scheme Procedure} symbol-pref s
-@deffnx {C Function} scm_symbol_pref (s)
-Return the @dfn{property list} currently associated with @var{symbol}.
-@end deffn
-
- symbol-fset!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/symbols.c:341
-@deffn {Scheme Procedure} symbol-fset! s val
-@deffnx {C Function} scm_symbol_fset_x (s, val)
-Change the binding of @var{symbol}'s function slot.
-@end deffn
-
- symbol-pset!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/symbols.c:353
-@deffn {Scheme Procedure} symbol-pset! s val
-@deffnx {C Function} scm_symbol_pset_x (s, val)
-Change the binding of @var{symbol}'s property slot.
-@end deffn
-
- catch
-@c snarfed from /home/ghouston/guile/guile-core/libguile/throw.c:534
-@deffn {Scheme Procedure} catch key thunk handler
-@deffnx {C Function} scm_catch (key, thunk, handler)
-Invoke @var{thunk} in the dynamic context of @var{handler} for
-exceptions matching @var{key}. If thunk throws to the symbol
-@var{key}, then @var{handler} is invoked this way:
-@lisp
-(handler key args ...)
-@end lisp
-
-@var{key} is a symbol or @code{#t}.
-
-@var{thunk} takes no arguments. If @var{thunk} returns
-normally, that is the return value of @code{catch}.
-
-Handler is invoked outside the scope of its own @code{catch}.
-If @var{handler} again throws to the same key, a new handler
-from further up the call chain is invoked.
-
-If the key is @code{#t}, then a throw to @emph{any} symbol will
-match this call to @code{catch}.
-@end deffn
-
- lazy-catch
-@c snarfed from /home/ghouston/guile/guile-core/libguile/throw.c:562
-@deffn {Scheme Procedure} lazy-catch key thunk handler
-@deffnx {C Function} scm_lazy_catch (key, thunk, handler)
-This behaves exactly like @code{catch}, except that it does
-not unwind the stack before invoking @var{handler}.
-The @var{handler} procedure is not allowed to return:
-it must throw to another catch, or otherwise exit non-locally.
-@end deffn
-
- throw
-@c snarfed from /home/ghouston/guile/guile-core/libguile/throw.c:595
-@deffn {Scheme Procedure} throw key . args
-@deffnx {C Function} scm_throw (key, args)
-Invoke the catch form matching @var{key}, passing @var{args} to the
-@var{handler}.
-
-@var{key} is a symbol. It will match catches of the same symbol or of
-@code{#t}.
-
-If there is no handler at all, Guile prints an error and then exits.
-@end deffn
-
- values
-@c snarfed from /home/ghouston/guile/guile-core/libguile/values.c:77
-@deffn {Scheme Procedure} values . args
-@deffnx {C Function} scm_values (args)
-Delivers all of its arguments to its continuation. Except for
-continuations created by the @code{call-with-values} procedure,
-all continuations take exactly one value. The effect of
-passing no value or more than one value to continuations that
-were not created by @code{call-with-values} is unspecified.
-@end deffn
-
- make-variable
-@c snarfed from /home/ghouston/guile/guile-core/libguile/variable.c:76
-@deffn {Scheme Procedure} make-variable init
-@deffnx {C Function} scm_make_variable (init)
-Return a variable initialized to value @var{init}.
-@end deffn
-
- make-undefined-variable
-@c snarfed from /home/ghouston/guile/guile-core/libguile/variable.c:86
-@deffn {Scheme Procedure} make-undefined-variable
-@deffnx {C Function} scm_make_undefined_variable ()
-Return a variable that is initially unbound.
-@end deffn
-
- variable?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/variable.c:97
-@deffn {Scheme Procedure} variable? obj
-@deffnx {C Function} scm_variable_p (obj)
-Return @code{#t} iff @var{obj} is a variable object, else
-return @code{#f}.
-@end deffn
-
- variable-ref
-@c snarfed from /home/ghouston/guile/guile-core/libguile/variable.c:109
-@deffn {Scheme Procedure} variable-ref var
-@deffnx {C Function} scm_variable_ref (var)
-Dereference @var{var} and return its value.
-@var{var} must be a variable object; see @code{make-variable}
-and @code{make-undefined-variable}.
-@end deffn
-
- variable-set!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/variable.c:125
-@deffn {Scheme Procedure} variable-set! var val
-@deffnx {C Function} scm_variable_set_x (var, val)
-Set the value of the variable @var{var} to @var{val}.
-@var{var} must be a variable object, @var{val} can be any
-value. Return an unspecified value.
-@end deffn
-
- variable-bound?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/variable.c:137
-@deffn {Scheme Procedure} variable-bound? var
-@deffnx {C Function} scm_variable_bound_p (var)
-Return @code{#t} iff @var{var} is bound to a value.
-Throws an error if @var{var} is not a variable object.
-@end deffn
-
- vector?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/vectors.c:59
-@deffn {Scheme Procedure} vector? obj
-@deffnx {C Function} scm_vector_p (obj)
-Return @code{#t} if @var{obj} is a vector, otherwise return
-@code{#f}.
-@end deffn
-
- list->vector
-@c snarfed from /home/ghouston/guile/guile-core/libguile/vectors.c:76
-@deffn {Scheme Procedure} list->vector
-implemented by the C function "scm_vector"
-@end deffn
-
- vector
-@c snarfed from /home/ghouston/guile/guile-core/libguile/vectors.c:93
-@deffn {Scheme Procedure} vector . l
-@deffnx {Scheme Procedure} list->vector l
-@deffnx {C Function} scm_vector (l)
-Return a newly allocated vector composed of the
-given arguments. Analogous to @code{list}.
-
-@lisp
-(vector 'a 'b 'c) @result{} #(a b c)
-@end lisp
-@end deffn
-
- make-vector
-@c snarfed from /home/ghouston/guile/guile-core/libguile/vectors.c:179
-@deffn {Scheme Procedure} make-vector k [fill]
-@deffnx {C Function} scm_make_vector (k, fill)
-Return a newly allocated vector of @var{k} elements. If a
-second argument is given, then each position is initialized to
-@var{fill}. Otherwise the initial contents of each position is
-unspecified.
-@end deffn
-
- vector->list
-@c snarfed from /home/ghouston/guile/guile-core/libguile/vectors.c:233
-@deffn {Scheme Procedure} vector->list v
-@deffnx {C Function} scm_vector_to_list (v)
-Return a newly allocated list composed of the elements of @var{v}.
-
-@lisp
-(vector->list '#(dah dah didah)) @result{} (dah dah didah)
-(list->vector '(dididit dah)) @result{} #(dididit dah)
-@end lisp
-@end deffn
-
- vector-fill!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/vectors.c:250
-@deffn {Scheme Procedure} vector-fill! v fill
-@deffnx {C Function} scm_vector_fill_x (v, fill)
-Store @var{fill} in every position of @var{vector}. The value
-returned by @code{vector-fill!} is unspecified.
-@end deffn
-
- vector-move-left!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/vectors.c:283
-@deffn {Scheme Procedure} vector-move-left! vec1 start1 end1 vec2 start2
-@deffnx {C Function} scm_vector_move_left_x (vec1, start1, end1, vec2, start2)
-Copy elements from @var{vec1}, positions @var{start1} to @var{end1},
-to @var{vec2} starting at position @var{start2}. @var{start1} and
-@var{start2} are inclusive indices; @var{end1} is exclusive.
-
-@code{vector-move-left!} copies elements in leftmost order.
-Therefore, in the case where @var{vec1} and @var{vec2} refer to the
-same vector, @code{vector-move-left!} is usually appropriate when
-@var{start1} is greater than @var{start2}.
-@end deffn
-
- vector-move-right!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/vectors.c:312
-@deffn {Scheme Procedure} vector-move-right! vec1 start1 end1 vec2 start2
-@deffnx {C Function} scm_vector_move_right_x (vec1, start1, end1, vec2, start2)
-Copy elements from @var{vec1}, positions @var{start1} to @var{end1},
-to @var{vec2} starting at position @var{start2}. @var{start1} and
-@var{start2} are inclusive indices; @var{end1} is exclusive.
-
-@code{vector-move-right!} copies elements in rightmost order.
-Therefore, in the case where @var{vec1} and @var{vec2} refer to the
-same vector, @code{vector-move-right!} is usually appropriate when
-@var{start1} is less than @var{start2}.
-@end deffn
-
- major-version
-@c snarfed from /home/ghouston/guile/guile-core/libguile/version.c:59
-@deffn {Scheme Procedure} major-version
-@deffnx {C Function} scm_major_version ()
-Return a string containing Guile's major version number.
-E.g., the 1 in "1.6.5".
-@end deffn
-
- minor-version
-@c snarfed from /home/ghouston/guile/guile-core/libguile/version.c:72
-@deffn {Scheme Procedure} minor-version
-@deffnx {C Function} scm_minor_version ()
-Return a string containing Guile's minor version number.
-E.g., the 6 in "1.6.5".
-@end deffn
-
- micro-version
-@c snarfed from /home/ghouston/guile/guile-core/libguile/version.c:85
-@deffn {Scheme Procedure} micro-version
-@deffnx {C Function} scm_micro_version ()
-Return a string containing Guile's micro version number.
-E.g., the 5 in "1.6.5".
-@end deffn
-
- version
-@c snarfed from /home/ghouston/guile/guile-core/libguile/version.c:107
-@deffn {Scheme Procedure} version
-@deffnx {Scheme Procedure} major-version
-@deffnx {Scheme Procedure} minor-version
-@deffnx {Scheme Procedure} micro-version
-@deffnx {C Function} scm_version ()
-Return a string describing Guile's version number, or its major, minor
-or micro version number, respectively.
-
-@lisp
-(version) @result{} "1.6.0"
-(major-version) @result{} "1"
-(minor-version) @result{} "6"
-(micro-version) @result{} "0"
-@end lisp
-@end deffn
-
- make-soft-port
-@c snarfed from /home/ghouston/guile/guile-core/libguile/vports.c:185
-@deffn {Scheme Procedure} make-soft-port pv modes
-@deffnx {C Function} scm_make_soft_port (pv, modes)
-Return a port capable of receiving or delivering characters as
-specified by the @var{modes} string (@pxref{File Ports,
-open-file}). @var{pv} must be a vector of length 5. Its
-components are as follows:
-
-@enumerate 0
-@item
-procedure accepting one character for output
-@item
-procedure accepting a string for output
-@item
-thunk for flushing output
-@item
-thunk for getting one character
-@item
-thunk for closing port (not by garbage collection)
-@end enumerate
-
-For an output-only port only elements 0, 1, 2, and 4 need be
-procedures. For an input-only port only elements 3 and 4 need
-be procedures. Thunks 2 and 4 can instead be @code{#f} if
-there is no useful operation for them to perform.
-
-If thunk 3 returns @code{#f} or an @code{eof-object}
-(@pxref{Input, eof-object?, ,r5rs, The Revised^5 Report on
-Scheme}) it indicates that the port has reached end-of-file.
-For example:
-
-@lisp
-(define stdout (current-output-port))
-(define p (make-soft-port
- (vector
- (lambda (c) (write c stdout))
- (lambda (s) (display s stdout))
- (lambda () (display "." stdout))
- (lambda () (char-upcase (read-char)))
- (lambda () (display "@@" stdout)))
- "rw"))
-
-(write p p) @result{} #<input-output: soft 8081e20>
-@end lisp
-@end deffn
-
- make-weak-vector
-@c snarfed from /home/ghouston/guile/guile-core/libguile/weaks.c:116
-@deffn {Scheme Procedure} make-weak-vector size [fill]
-@deffnx {C Function} scm_make_weak_vector (size, fill)
-Return a weak vector with @var{size} elements. If the optional
-argument @var{fill} is given, all entries in the vector will be
-set to @var{fill}. The default value for @var{fill} is the
-empty list.
-@end deffn
-
- list->weak-vector
-@c snarfed from /home/ghouston/guile/guile-core/libguile/weaks.c:124
-@deffn {Scheme Procedure} list->weak-vector
-implemented by the C function "scm_weak_vector"
-@end deffn
-
- weak-vector
-@c snarfed from /home/ghouston/guile/guile-core/libguile/weaks.c:132
-@deffn {Scheme Procedure} weak-vector . l
-@deffnx {Scheme Procedure} list->weak-vector l
-@deffnx {C Function} scm_weak_vector (l)
-Construct a weak vector from a list: @code{weak-vector} uses
-the list of its arguments while @code{list->weak-vector} uses
-its only argument @var{l} (a list) to construct a weak vector
-the same way @code{list->vector} would.
-@end deffn
-
- weak-vector?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/weaks.c:160
-@deffn {Scheme Procedure} weak-vector? obj
-@deffnx {C Function} scm_weak_vector_p (obj)
-Return @code{#t} if @var{obj} is a weak vector. Note that all
-weak hashes are also weak vectors.
-@end deffn
-
- make-weak-key-hash-table
-@c snarfed from /home/ghouston/guile/guile-core/libguile/weaks.c:178
-@deffn {Scheme Procedure} make-weak-key-hash-table size
-@deffnx {Scheme Procedure} make-weak-value-hash-table size
-@deffnx {Scheme Procedure} make-doubly-weak-hash-table size
-@deffnx {C Function} scm_make_weak_key_hash_table (size)
-Return a weak hash table with @var{size} buckets. As with any
-hash table, choosing a good size for the table requires some
-caution.
-
-You can modify weak hash tables in exactly the same way you
-would modify regular hash tables. (@pxref{Hash Tables})
-@end deffn
-
- make-weak-value-hash-table
-@c snarfed from /home/ghouston/guile/guile-core/libguile/weaks.c:189
-@deffn {Scheme Procedure} make-weak-value-hash-table size
-@deffnx {C Function} scm_make_weak_value_hash_table (size)
-Return a hash table with weak values with @var{size} buckets.
-(@pxref{Hash Tables})
-@end deffn
-
- make-doubly-weak-hash-table
-@c snarfed from /home/ghouston/guile/guile-core/libguile/weaks.c:200
-@deffn {Scheme Procedure} make-doubly-weak-hash-table size
-@deffnx {C Function} scm_make_doubly_weak_hash_table (size)
-Return a hash table with weak keys and values with @var{size}
-buckets. (@pxref{Hash Tables})
-@end deffn
-
- weak-key-hash-table?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/weaks.c:214
-@deffn {Scheme Procedure} weak-key-hash-table? obj
-@deffnx {Scheme Procedure} weak-value-hash-table? obj
-@deffnx {Scheme Procedure} doubly-weak-hash-table? obj
-@deffnx {C Function} scm_weak_key_hash_table_p (obj)
-Return @code{#t} if @var{obj} is the specified weak hash
-table. Note that a doubly weak hash table is neither a weak key
-nor a weak value hash table.
-@end deffn
-
- weak-value-hash-table?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/weaks.c:224
-@deffn {Scheme Procedure} weak-value-hash-table? obj
-@deffnx {C Function} scm_weak_value_hash_table_p (obj)
-Return @code{#t} if @var{obj} is a weak value hash table.
-@end deffn
-
- doubly-weak-hash-table?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/weaks.c:234
-@deffn {Scheme Procedure} doubly-weak-hash-table? obj
-@deffnx {C Function} scm_doubly_weak_hash_table_p (obj)
-Return @code{#t} if @var{obj} is a doubly weak hash table.
-@end deffn
-
- array-fill!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ramap.c:462
-@deffn {Scheme Procedure} array-fill! ra fill
-@deffnx {C Function} scm_array_fill_x (ra, fill)
-Store @var{fill} in every element of @var{array}. The value returned
-is unspecified.
-@end deffn
-
- array-copy-in-order!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ramap.c:827
-@deffn {Scheme Procedure} array-copy-in-order!
-implemented by the C function "scm_array_copy_x"
-@end deffn
-
- array-copy!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ramap.c:836
-@deffn {Scheme Procedure} array-copy! src dst
-@deffnx {Scheme Procedure} array-copy-in-order! src dst
-@deffnx {C Function} scm_array_copy_x (src, dst)
-Copy every element from vector or array @var{source} to the
-corresponding element of @var{destination}. @var{destination} must have
-the same rank as @var{source}, and be at least as large in each
-dimension. The order is unspecified.
-@end deffn
-
- array-map-in-order!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ramap.c:1510
-@deffn {Scheme Procedure} array-map-in-order!
-implemented by the C function "scm_array_map_x"
-@end deffn
-
- array-map!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ramap.c:1521
-@deffn {Scheme Procedure} array-map! ra0 proc . lra
-@deffnx {Scheme Procedure} array-map-in-order! ra0 proc . lra
-@deffnx {C Function} scm_array_map_x (ra0, proc, lra)
-@var{array1}, @dots{} must have the same number of dimensions as
-@var{array0} and have a range for each index which includes the range
-for the corresponding index in @var{array0}. @var{proc} is applied to
-each tuple of elements of @var{array1} @dots{} and the result is stored
-as the corresponding element in @var{array0}. The value returned is
-unspecified. The order of application is unspecified.
-@end deffn
-
- array-for-each
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ramap.c:1668
-@deffn {Scheme Procedure} array-for-each proc ra0 . lra
-@deffnx {C Function} scm_array_for_each (proc, ra0, lra)
-Apply @var{proc} to each tuple of elements of @var{array0} @dots{}
-in row-major order. The value returned is unspecified.
-@end deffn
-
- array-index-map!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/ramap.c:1696
-@deffn {Scheme Procedure} array-index-map! ra proc
-@deffnx {C Function} scm_array_index_map_x (ra, proc)
-Apply @var{proc} to the indices of each element of @var{array} in
-turn, storing the result in the corresponding element. The value
-returned and the order of application are unspecified.
-
-One can implement @var{array-indexes} as
-@lisp
-(define (array-indexes array)
- (let ((ra (apply make-array #f (array-shape array))))
- (array-index-map! ra (lambda x x))
- ra))
-@end lisp
-Another example:
-@lisp
-(define (apl:index-generator n)
- (let ((v (make-uniform-vector n 1)))
- (array-index-map! v (lambda (i) i))
- v))
-@end lisp
-@end deffn
-
- uniform-vector-length
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:250
-@deffn {Scheme Procedure} uniform-vector-length v
-@deffnx {C Function} scm_uniform_vector_length (v)
-Return the number of elements in @var{uve}.
-@end deffn
-
- array?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:284
-@deffn {Scheme Procedure} array? v [prot]
-@deffnx {C Function} scm_array_p (v, prot)
-Return @code{#t} if the @var{obj} is an array, and @code{#f} if
-not. The @var{prototype} argument is used with uniform arrays
-and is described elsewhere.
-@end deffn
-
- array-rank
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:355
-@deffn {Scheme Procedure} array-rank ra
-@deffnx {C Function} scm_array_rank (ra)
-Return the number of dimensions of @var{obj}. If @var{obj} is
-not an array, @code{0} is returned.
-@end deffn
-
- array-dimensions
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:393
-@deffn {Scheme Procedure} array-dimensions ra
-@deffnx {C Function} scm_array_dimensions (ra)
-@code{Array-dimensions} is similar to @code{array-shape} but replaces
-elements with a @code{0} minimum with one greater than the maximum. So:
-@lisp
-(array-dimensions (make-array 'foo '(-1 3) 5)) @result{} ((-1 3) 5)
-@end lisp
-@end deffn
-
- shared-array-root
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:440
-@deffn {Scheme Procedure} shared-array-root ra
-@deffnx {C Function} scm_shared_array_root (ra)
-Return the root vector of a shared array.
-@end deffn
-
- shared-array-offset
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:451
-@deffn {Scheme Procedure} shared-array-offset ra
-@deffnx {C Function} scm_shared_array_offset (ra)
-Return the root vector index of the first element in the array.
-@end deffn
-
- shared-array-increments
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:462
-@deffn {Scheme Procedure} shared-array-increments ra
-@deffnx {C Function} scm_shared_array_increments (ra)
-For each dimension, return the distance between elements in the root vector.
-@end deffn
-
- dimensions->uniform-array
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:581
-@deffn {Scheme Procedure} dimensions->uniform-array dims prot [fill]
-@deffnx {Scheme Procedure} make-uniform-vector length prototype [fill]
-@deffnx {C Function} scm_dimensions_to_uniform_array (dims, prot, fill)
-Create and return a uniform array or vector of type
-corresponding to @var{prototype} with dimensions @var{dims} or
-length @var{length}. If @var{fill} is supplied, it's used to
-fill the array, otherwise @var{prototype} is used.
-@end deffn
-
- make-shared-array
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:670
-@deffn {Scheme Procedure} make-shared-array oldra mapfunc . dims
-@deffnx {C Function} scm_make_shared_array (oldra, mapfunc, dims)
-@code{make-shared-array} can be used to create shared subarrays of other
-arrays. The @var{mapper} is a function that translates coordinates in
-the new array into coordinates in the old array. A @var{mapper} must be
-linear, and its range must stay within the bounds of the old array, but
-it can be otherwise arbitrary. A simple example:
-@lisp
-(define fred (make-array #f 8 8))
-(define freds-diagonal
- (make-shared-array fred (lambda (i) (list i i)) 8))
-(array-set! freds-diagonal 'foo 3)
-(array-ref fred 3 3) @result{} foo
-(define freds-center
- (make-shared-array fred (lambda (i j) (list (+ 3 i) (+ 3 j))) 2 2))
-(array-ref freds-center 0 0) @result{} foo
-@end lisp
-@end deffn
-
- transpose-array
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:802
-@deffn {Scheme Procedure} transpose-array ra . args
-@deffnx {C Function} scm_transpose_array (ra, args)
-Return an array sharing contents with @var{array}, but with
-dimensions arranged in a different order. There must be one
-@var{dim} argument for each dimension of @var{array}.
-@var{dim0}, @var{dim1}, @dots{} should be integers between 0
-and the rank of the array to be returned. Each integer in that
-range must appear at least once in the argument list.
-
-The values of @var{dim0}, @var{dim1}, @dots{} correspond to
-dimensions in the array to be returned, their positions in the
-argument list to dimensions of @var{array}. Several @var{dim}s
-may have the same value, in which case the returned array will
-have smaller rank than @var{array}.
-
-@lisp
-(transpose-array '#2((a b) (c d)) 1 0) @result{} #2((a c) (b d))
-(transpose-array '#2((a b) (c d)) 0 0) @result{} #1(a d)
-(transpose-array '#3(((a b c) (d e f)) ((1 2 3) (4 5 6))) 1 1 0) @result{}
- #2((a 4) (b 5) (c 6))
-@end lisp
-@end deffn
-
- enclose-array
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:911
-@deffn {Scheme Procedure} enclose-array ra . axes
-@deffnx {C Function} scm_enclose_array (ra, axes)
-@var{dim0}, @var{dim1} @dots{} should be nonnegative integers less than
-the rank of @var{array}. @var{enclose-array} returns an array
-resembling an array of shared arrays. The dimensions of each shared
-array are the same as the @var{dim}th dimensions of the original array,
-the dimensions of the outer array are the same as those of the original
-array that did not match a @var{dim}.
-
-An enclosed array is not a general Scheme array. Its elements may not
-be set using @code{array-set!}. Two references to the same element of
-an enclosed array will be @code{equal?} but will not in general be
-@code{eq?}. The value returned by @var{array-prototype} when given an
-enclosed array is unspecified.
-
-examples:
-@lisp
-(enclose-array '#3(((a b c) (d e f)) ((1 2 3) (4 5 6))) 1) @result{}
- #<enclosed-array (#1(a d) #1(b e) #1(c f)) (#1(1 4) #1(2 5) #1(3 6))>
-
-(enclose-array '#3(((a b c) (d e f)) ((1 2 3) (4 5 6))) 1 0) @result{}
- #<enclosed-array #2((a 1) (d 4)) #2((b 2) (e 5)) #2((c 3) (f 6))>
-@end lisp
-@end deffn
-
- array-in-bounds?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:995
-@deffn {Scheme Procedure} array-in-bounds? v . args
-@deffnx {C Function} scm_array_in_bounds_p (v, args)
-Return @code{#t} if its arguments would be acceptable to
-@code{array-ref}.
-@end deffn
-
- array-ref
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:1074
-@deffn {Scheme Procedure} array-ref
-implemented by the C function "scm_uniform_vector_ref"
-@end deffn
-
- uniform-vector-ref
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:1081
-@deffn {Scheme Procedure} uniform-vector-ref v args
-@deffnx {Scheme Procedure} array-ref v . args
-@deffnx {C Function} scm_uniform_vector_ref (v, args)
-Return the element at the @code{(index1, index2)} element in
-@var{array}.
-@end deffn
-
- uniform-array-set1!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:1250
-@deffn {Scheme Procedure} uniform-array-set1!
-implemented by the C function "scm_array_set_x"
-@end deffn
-
- array-set!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:1259
-@deffn {Scheme Procedure} array-set! v obj . args
-@deffnx {Scheme Procedure} uniform-array-set1! v obj args
-@deffnx {C Function} scm_array_set_x (v, obj, args)
-Set the element at the @code{(index1, index2)} element in @var{array} to
-@var{new-value}. The value returned by array-set! is unspecified.
-@end deffn
-
- array-contents
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:1374
-@deffn {Scheme Procedure} array-contents ra [strict]
-@deffnx {C Function} scm_array_contents (ra, strict)
-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{make-array} and
-@var{make-uniform-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
-be returned only if its elements are stored internally contiguous in
-memory.
-@end deffn
-
- uniform-array-read!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:1488
-@deffn {Scheme Procedure} uniform-array-read! ra [port_or_fd [start [end]]]
-@deffnx {Scheme Procedure} uniform-vector-read! uve [port-or-fdes] [start] [end]
-@deffnx {C Function} scm_uniform_array_read_x (ra, port_or_fd, start, end)
-Attempt to read all elements of @var{ura}, in lexicographic order, as
-binary objects from @var{port-or-fdes}.
-If an end of file is encountered,
-the objects up to that point are put into @var{ura}
-(starting at the beginning) and the remainder of the array is
-unchanged.
-
-The optional arguments @var{start} and @var{end} allow
-a specified region of a vector (or linearized array) to be read,
-leaving the remainder of the vector unchanged.
-
-@code{uniform-array-read!} returns the number of objects read.
-@var{port-or-fdes} may be omitted, in which case it defaults to the value
-returned by @code{(current-input-port)}.
-@end deffn
-
- uniform-array-write
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:1653
-@deffn {Scheme Procedure} uniform-array-write v [port_or_fd [start [end]]]
-@deffnx {Scheme Procedure} uniform-vector-write uve [port-or-fdes] [start] [end]
-@deffnx {C Function} scm_uniform_array_write (v, port_or_fd, start, end)
-Writes all elements of @var{ura} as binary objects to
-@var{port-or-fdes}.
-
-The optional arguments @var{start}
-and @var{end} allow
-a specified region of a vector (or linearized array) to be written.
-
-The number of objects actually written is returned.
-@var{port-or-fdes} may be
-omitted, in which case it defaults to the value returned by
-@code{(current-output-port)}.
-@end deffn
-
- bit-count
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:1780
-@deffn {Scheme Procedure} bit-count b bitvector
-@deffnx {C Function} scm_bit_count (b, bitvector)
-Return the number of occurrences of the boolean @var{b} in
-@var{bitvector}.
-@end deffn
-
- bit-position
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:1819
-@deffn {Scheme Procedure} bit-position item v k
-@deffnx {C Function} scm_bit_position (item, v, k)
-Return the minimum index of an occurrence of @var{bool} in
-@var{bv} which is at least @var{k}. If no @var{bool} occurs
-within the specified range @code{#f} is returned.
-@end deffn
-
- bit-set*!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:1887
-@deffn {Scheme Procedure} bit-set*! v kv obj
-@deffnx {C Function} scm_bit_set_star_x (v, kv, obj)
-If uve is a bit-vector @var{bv} and uve must be of the same
-length. If @var{bool} is @code{#t}, uve is OR'ed into
-@var{bv}; If @var{bool} is @code{#f}, the inversion of uve is
-AND'ed into @var{bv}.
-
-If uve is a unsigned long integer vector all the elements of uve
-must be between 0 and the @code{length} of @var{bv}. The bits
-of @var{bv} corresponding to the indexes in uve are set to
-@var{bool}. The return value is unspecified.
-@end deffn
-
- bit-count*
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:1941
-@deffn {Scheme Procedure} bit-count* v kv obj
-@deffnx {C Function} scm_bit_count_star (v, kv, obj)
-Return
-@lisp
-(bit-count (bit-set*! (if bool bv (bit-invert! bv)) uve #t) #t).
-@end lisp
-@var{bv} is not modified.
-@end deffn
-
- bit-invert!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:2005
-@deffn {Scheme Procedure} bit-invert! v
-@deffnx {C Function} scm_bit_invert_x (v)
-Modify @var{bv} by replacing each element with its negation.
-@end deffn
-
- array->list
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:2084
-@deffn {Scheme Procedure} array->list v
-@deffnx {C Function} scm_array_to_list (v)
-Return a list consisting of all the elements, in order, of
-@var{array}.
-@end deffn
-
- list->uniform-array
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:2185
-@deffn {Scheme Procedure} list->uniform-array ndim prot lst
-@deffnx {Scheme Procedure} list->uniform-vector prot lst
-@deffnx {C Function} scm_list_to_uniform_array (ndim, prot, lst)
-Return a uniform array of the type indicated by prototype
-@var{prot} with elements the same as those of @var{lst}.
-Elements must be of the appropriate type, no coercions are
-done.
-@end deffn
-
- array-prototype
-@c snarfed from /home/ghouston/guile/guile-core/libguile/unif.c:2536
-@deffn {Scheme Procedure} array-prototype ra
-@deffnx {C Function} scm_array_prototype (ra)
-Return an object that would produce an array of the same type
-as @var{array}, if used as the @var{prototype} for
-@code{make-uniform-array}.
-@end deffn
-
- chown
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:214
-@deffn {Scheme Procedure} chown object owner group
-@deffnx {C Function} scm_chown (object, owner, group)
-Change the ownership and group of the file referred to by @var{object} to
-the integer values @var{owner} and @var{group}. @var{object} can be
-a string containing a file name or, if the platform
-supports fchown, a port or integer file descriptor
-which is open on the file. The return value
-is unspecified.
-
-If @var{object} is a symbolic link, either the
-ownership of the link or the ownership of the referenced file will be
-changed depending on the operating system (lchown is
-unsupported at present). If @var{owner} or @var{group} is specified
-as @code{-1}, then that ID is not changed.
-@end deffn
-
- chmod
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:254
-@deffn {Scheme Procedure} chmod object mode
-@deffnx {C Function} scm_chmod (object, mode)
-Changes the permissions of the file referred to by @var{obj}.
-@var{obj} can be a string containing a file name or a port or integer file
-descriptor which is open on a file (in which case @code{fchmod} is used
-as the underlying system call).
-@var{mode} specifies
-the new permissions as a decimal number, e.g., @code{(chmod "foo" #o755)}.
-The return value is unspecified.
-@end deffn
-
- umask
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:287
-@deffn {Scheme Procedure} umask [mode]
-@deffnx {C Function} scm_umask (mode)
-If @var{mode} is omitted, returns a decimal number representing the current
-file creation mask. Otherwise the file creation mask is set to
-@var{mode} and the previous value is returned.
-
-E.g., @code{(umask #o022)} sets the mask to octal 22, decimal 18.
-@end deffn
-
- open-fdes
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:310
-@deffn {Scheme Procedure} open-fdes path flags [mode]
-@deffnx {C Function} scm_open_fdes (path, flags, mode)
-Similar to @code{open} but return a file descriptor instead of
-a port.
-@end deffn
-
- open
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:352
-@deffn {Scheme Procedure} open path flags [mode]
-@deffnx {C Function} scm_open (path, flags, mode)
-Open the file named by @var{path} for reading and/or writing.
-@var{flags} is an integer specifying how the file should be opened.
-@var{mode} is an integer specifying the permission bits of the file, if
-it needs to be created, before the umask is applied. The default is 666
-(Unix itself has no default).
-
-@var{flags} can be constructed by combining variables using @code{logior}.
-Basic flags are:
-
-@defvar O_RDONLY
-Open the file read-only.
-@end defvar
-@defvar O_WRONLY
-Open the file write-only.
-@end defvar
-@defvar O_RDWR
-Open the file read/write.
-@end defvar
-@defvar O_APPEND
-Append to the file instead of truncating.
-@end defvar
-@defvar O_CREAT
-Create the file if it does not already exist.
-@end defvar
-
-See the Unix documentation of the @code{open} system call
-for additional flags.
-@end deffn
-
- close
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:390
-@deffn {Scheme Procedure} close fd_or_port
-@deffnx {C Function} scm_close (fd_or_port)
-Similar to close-port (@pxref{Closing, close-port}),
-but also works on file descriptors. A side
-effect of closing a file descriptor is that any ports using that file
-descriptor are moved to a different file descriptor and have
-their revealed counts set to zero.
-@end deffn
-
- close-fdes
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:418
-@deffn {Scheme Procedure} close-fdes fd
-@deffnx {C Function} scm_close_fdes (fd)
-A simple wrapper for the @code{close} system call.
-Close file descriptor @var{fd}, which must be an integer.
-Unlike close (@pxref{Ports and File Descriptors, close}),
-the file descriptor will be closed even if a port is using it.
-The return value is unspecified.
-@end deffn
-
- stat
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:621
-@deffn {Scheme Procedure} stat object
-@deffnx {C Function} scm_stat (object)
-Return an object containing various information about the file
-determined by @var{obj}. @var{obj} can be a string containing
-a file name or a port or integer file descriptor which is open
-on a file (in which case @code{fstat} is used as the underlying
-system call).
-
-The object returned by @code{stat} can be passed as a single
-parameter to the following procedures, all of which return
-integers:
-
-@table @code
-@item stat:dev
-The device containing the file.
-@item stat:ino
-The file serial number, which distinguishes this file from all
-other files on the same device.
-@item stat:mode
-The mode of the file. This includes file type information and
-the file permission bits. See @code{stat:type} and
-@code{stat:perms} below.
-@item stat:nlink
-The number of hard links to the file.
-@item stat:uid
-The user ID of the file's owner.
-@item stat:gid
-The group ID of the file.
-@item stat:rdev
-Device ID; this entry is defined only for character or block
-special files.
-@item stat:size
-The size of a regular file in bytes.
-@item stat:atime
-The last access time for the file.
-@item stat:mtime
-The last modification time for the file.
-@item stat:ctime
-The last modification time for the attributes of the file.
-@item stat:blksize
-The optimal block size for reading or writing the file, in
-bytes.
-@item stat:blocks
-The amount of disk space that the file occupies measured in
-units of 512 byte blocks.
-@end table
-
-In addition, the following procedures return the information
-from stat:mode in a more convenient form:
-
-@table @code
-@item stat:type
-A symbol representing the type of file. Possible values are
-regular, directory, symlink, block-special, char-special, fifo,
-socket and unknown
-@item stat:perms
-An integer representing the access permission bits.
-@end table
-@end deffn
-
- link
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:684
-@deffn {Scheme Procedure} link oldpath newpath
-@deffnx {C Function} scm_link (oldpath, newpath)
-Creates a new name @var{newpath} in the file system for the
-file named by @var{oldpath}. If @var{oldpath} is a symbolic
-link, the link may or may not be followed depending on the
-system.
-@end deffn
-
- rename-file
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:705
-@deffn {Scheme Procedure} rename-file oldname newname
-@deffnx {C Function} scm_rename (oldname, newname)
-Renames the file specified by @var{oldname} to @var{newname}.
-The return value is unspecified.
-@end deffn
-
- delete-file
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:732
-@deffn {Scheme Procedure} delete-file str
-@deffnx {C Function} scm_delete_file (str)
-Deletes (or "unlinks") the file specified by @var{path}.
-@end deffn
-
- mkdir
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:750
-@deffn {Scheme Procedure} mkdir path [mode]
-@deffnx {C Function} scm_mkdir (path, mode)
-Create a new directory named by @var{path}. If @var{mode} is omitted
-then the permissions of the directory file are set using the current
-umask. Otherwise they are set to the decimal value specified with
-@var{mode}. The return value is unspecified.
-@end deffn
-
- rmdir
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:778
-@deffn {Scheme Procedure} rmdir path
-@deffnx {C Function} scm_rmdir (path)
-Remove the existing directory named by @var{path}. The directory must
-be empty for this to succeed. The return value is unspecified.
-@end deffn
-
- directory-stream?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:803
-@deffn {Scheme Procedure} directory-stream? obj
-@deffnx {C Function} scm_directory_stream_p (obj)
-Return a boolean indicating whether @var{object} is a directory
-stream as returned by @code{opendir}.
-@end deffn
-
- opendir
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:814
-@deffn {Scheme Procedure} opendir dirname
-@deffnx {C Function} scm_opendir (dirname)
-Open the directory specified by @var{path} and return a directory
-stream.
-@end deffn
-
- readdir
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:831
-@deffn {Scheme Procedure} readdir port
-@deffnx {C Function} scm_readdir (port)
-Return (as a string) the next directory entry from the directory stream
-@var{stream}. If there is no remaining entry to be read then the
-end of file object is returned.
-@end deffn
-
- rewinddir
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:854
-@deffn {Scheme Procedure} rewinddir port
-@deffnx {C Function} scm_rewinddir (port)
-Reset the directory port @var{stream} so that the next call to
-@code{readdir} will return the first directory entry.
-@end deffn
-
- closedir
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:871
-@deffn {Scheme Procedure} closedir port
-@deffnx {C Function} scm_closedir (port)
-Close the directory stream @var{stream}.
-The return value is unspecified.
-@end deffn
-
- chdir
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:921
-@deffn {Scheme Procedure} chdir str
-@deffnx {C Function} scm_chdir (str)
-Change the current working directory to @var{path}.
-The return value is unspecified.
-@end deffn
-
- getcwd
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:937
-@deffn {Scheme Procedure} getcwd
-@deffnx {C Function} scm_getcwd ()
-Return the name of the current working directory.
-@end deffn
-
- select
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:1133
-@deffn {Scheme Procedure} select reads writes excepts [secs [usecs]]
-@deffnx {C Function} scm_select (reads, writes, excepts, secs, usecs)
-This procedure has a variety of uses: waiting for the ability
-to provide input, accept output, or the existence of
-exceptional conditions on a collection of ports or file
-descriptors, or waiting for a timeout to occur.
-It also returns if interrupted by a signal.
-
-@var{reads}, @var{writes} and @var{excepts} can be lists or
-vectors, with each member a port or a file descriptor.
-The value returned is a list of three corresponding
-lists or vectors containing only the members which meet the
-specified requirement. The ability of port buffers to
-provide input or accept output is taken into account.
-Ordering of the input lists or vectors is not preserved.
-
-The optional arguments @var{secs} and @var{usecs} specify the
-timeout. Either @var{secs} can be specified alone, as
-either an integer or a real number, or both @var{secs} and
-@var{usecs} can be specified as integers, in which case
-@var{usecs} is an additional timeout expressed in
-microseconds. If @var{secs} is omitted or is @code{#f} then
-select will wait for as long as it takes for one of the other
-conditions to be satisfied.
-
-The scsh version of @code{select} differs as follows:
-Only vectors are accepted for the first three arguments.
-The @var{usecs} argument is not supported.
-Multiple values are returned instead of a list.
-Duplicates in the input vectors appear only once in output.
-An additional @code{select!} interface is provided.
-@end deffn
-
- fcntl
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:1279
-@deffn {Scheme Procedure} fcntl object cmd [value]
-@deffnx {C Function} scm_fcntl (object, cmd, value)
-Apply @var{command} to the specified file descriptor or the underlying
-file descriptor of the specified port. @var{value} is an optional
-integer argument.
-
-Values for @var{command} are:
-
-@table @code
-@item F_DUPFD
-Duplicate a file descriptor
-@item F_GETFD
-Get flags associated with the file descriptor.
-@item F_SETFD
-Set flags associated with the file descriptor to @var{value}.
-@item F_GETFL
-Get flags associated with the open file.
-@item F_SETFL
-Set flags associated with the open file to @var{value}
-@item F_GETOWN
-Get the process ID of a socket's owner, for @code{SIGIO} signals.
-@item F_SETOWN
-Set the process that owns a socket to @var{value}, for @code{SIGIO} signals.
-@item FD_CLOEXEC
-The value used to indicate the "close on exec" flag with @code{F_GETFL} or
-@code{F_SETFL}.
-@end table
-@end deffn
-
- fsync
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:1316
-@deffn {Scheme Procedure} fsync object
-@deffnx {C Function} scm_fsync (object)
-Copies any unwritten data for the specified output file descriptor to disk.
-If @var{port/fd} is a port, its buffer is flushed before the underlying
-file descriptor is fsync'd.
-The return value is unspecified.
-@end deffn
-
- symlink
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:1343
-@deffn {Scheme Procedure} symlink oldpath newpath
-@deffnx {C Function} scm_symlink (oldpath, newpath)
-Create a symbolic link named @var{path-to} with the value (i.e., pointing to)
-@var{path-from}. The return value is unspecified.
-@end deffn
-
- readlink
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:1362
-@deffn {Scheme Procedure} readlink path
-@deffnx {C Function} scm_readlink (path)
-Return the value of the symbolic link named by @var{path} (a
-string), i.e., the file that the link points to.
-@end deffn
-
- lstat
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:1391
-@deffn {Scheme Procedure} lstat str
-@deffnx {C Function} scm_lstat (str)
-Similar to @code{stat}, but does not follow symbolic links, i.e.,
-it will return information about a symbolic link itself, not the
-file it points to. @var{path} must be a string.
-@end deffn
-
- copy-file
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:1415
-@deffn {Scheme Procedure} copy-file oldfile newfile
-@deffnx {C Function} scm_copy_file (oldfile, newfile)
-Copy the file specified by @var{path-from} to @var{path-to}.
-The return value is unspecified.
-@end deffn
-
- dirname
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:1460
-@deffn {Scheme Procedure} dirname filename
-@deffnx {C Function} scm_dirname (filename)
-Return the directory name component of the file name
-@var{filename}. If @var{filename} does not contain a directory
-component, @code{.} is returned.
-@end deffn
-
- basename
-@c snarfed from /home/ghouston/guile/guile-core/libguile/filesys.c:1503
-@deffn {Scheme Procedure} basename filename [suffix]
-@deffnx {C Function} scm_basename (filename, suffix)
-Return the base name of the file name @var{filename}. The
-base name is the file name without any directory components.
-If @var{suffix} is provided, and is equal to the end of
-@var{basename}, it is removed also.
-@end deffn
-
- pipe
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:202
-@deffn {Scheme Procedure} pipe
-@deffnx {C Function} scm_pipe ()
-Return a newly created pipe: a pair of ports which are linked
-together on the local machine. The @emph{car} is the input
-port and the @emph{cdr} is the output port. Data written (and
-flushed) to the output port can be read from the input port.
-Pipes are commonly used for communication with a newly forked
-child process. The need to flush the output port can be
-avoided by making it unbuffered using @code{setvbuf}.
-
-Writes occur atomically provided the size of the data in bytes
-is not greater than the value of @code{PIPE_BUF}. Note that
-the output port is likely to block if too much data (typically
-equal to @code{PIPE_BUF}) has been written but not yet read
-from the input port.
-@end deffn
-
- getgroups
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:223
-@deffn {Scheme Procedure} getgroups
-@deffnx {C Function} scm_getgroups ()
-Return a vector of integers representing the current
-supplementary group IDs.
-@end deffn
-
- getpw
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:254
-@deffn {Scheme Procedure} getpw [user]
-@deffnx {C Function} scm_getpwuid (user)
-Look up an entry in the user database. @var{obj} can be an integer,
-a string, or omitted, giving the behaviour of getpwuid, getpwnam
-or getpwent respectively.
-@end deffn
-
- setpw
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:307
-@deffn {Scheme Procedure} setpw [arg]
-@deffnx {C Function} scm_setpwent (arg)
-If called with a true argument, initialize or reset the password data
-stream. Otherwise, close the stream. The @code{setpwent} and
-@code{endpwent} procedures are implemented on top of this.
-@end deffn
-
- getgr
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:326
-@deffn {Scheme Procedure} getgr [name]
-@deffnx {C Function} scm_getgrgid (name)
-Look up an entry in the group database. @var{obj} can be an integer,
-a string, or omitted, giving the behaviour of getgrgid, getgrnam
-or getgrent respectively.
-@end deffn
-
- setgr
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:366
-@deffn {Scheme Procedure} setgr [arg]
-@deffnx {C Function} scm_setgrent (arg)
-If called with a true argument, initialize or reset the group data
-stream. Otherwise, close the stream. The @code{setgrent} and
-@code{endgrent} procedures are implemented on top of this.
-@end deffn
-
- kill
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:402
-@deffn {Scheme Procedure} kill pid sig
-@deffnx {C Function} scm_kill (pid, sig)
-Sends a signal to the specified process or group of processes.
-
-@var{pid} specifies the processes to which the signal is sent:
-
-@table @r
-@item @var{pid} greater than 0
-The process whose identifier is @var{pid}.
-@item @var{pid} equal to 0
-All processes in the current process group.
-@item @var{pid} less than -1
-The process group whose identifier is -@var{pid}
-@item @var{pid} equal to -1
-If the process is privileged, all processes except for some special
-system processes. Otherwise, all processes with the current effective
-user ID.
-@end table
-
-@var{sig} should be specified using a variable corresponding to
-the Unix symbolic name, e.g.,
-
-@defvar SIGHUP
-Hang-up signal.
-@end defvar
-
-@defvar SIGINT
-Interrupt signal.
-@end defvar
-@end deffn
-
- waitpid
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:455
-@deffn {Scheme Procedure} waitpid pid [options]
-@deffnx {C Function} scm_waitpid (pid, options)
-This procedure collects status information from a child process which
-has terminated or (optionally) stopped. Normally it will
-suspend the calling process until this can be done. If more than one
-child process is eligible then one will be chosen by the operating system.
-
-The value of @var{pid} determines the behaviour:
-
-@table @r
-@item @var{pid} greater than 0
-Request status information from the specified child process.
-@item @var{pid} equal to -1 or WAIT_ANY
-Request status information for any child process.
-@item @var{pid} equal to 0 or WAIT_MYPGRP
-Request status information for any child process in the current process
-group.
-@item @var{pid} less than -1
-Request status information for any child process whose process group ID
-is -@var{PID}.
-@end table
-
-The @var{options} argument, if supplied, should be the bitwise OR of the
-values of zero or more of the following variables:
-
-@defvar WNOHANG
-Return immediately even if there are no child processes to be collected.
-@end defvar
-
-@defvar WUNTRACED
-Report status information for stopped processes as well as terminated
-processes.
-@end defvar
-
-The return value is a pair containing:
-
-@enumerate
-@item
-The process ID of the child process, or 0 if @code{WNOHANG} was
-specified and no process was collected.
-@item
-The integer status value.
-@end enumerate
-@end deffn
-
- status:exit-val
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:483
-@deffn {Scheme Procedure} status:exit-val status
-@deffnx {C Function} scm_status_exit_val (status)
-Return the exit status value, as would be set if a process
-ended normally through a call to @code{exit} or @code{_exit},
-if any, otherwise @code{#f}.
-@end deffn
-
- status:term-sig
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:503
-@deffn {Scheme Procedure} status:term-sig status
-@deffnx {C Function} scm_status_term_sig (status)
-Return the signal number which terminated the process, if any,
-otherwise @code{#f}.
-@end deffn
-
- status:stop-sig
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:521
-@deffn {Scheme Procedure} status:stop-sig status
-@deffnx {C Function} scm_status_stop_sig (status)
-Return the signal number which stopped the process, if any,
-otherwise @code{#f}.
-@end deffn
-
- getppid
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:541
-@deffn {Scheme Procedure} getppid
-@deffnx {C Function} scm_getppid ()
-Return an integer representing the process ID of the parent
-process.
-@end deffn
-
- getuid
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:553
-@deffn {Scheme Procedure} getuid
-@deffnx {C Function} scm_getuid ()
-Return an integer representing the current real user ID.
-@end deffn
-
- getgid
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:564
-@deffn {Scheme Procedure} getgid
-@deffnx {C Function} scm_getgid ()
-Return an integer representing the current real group ID.
-@end deffn
-
- geteuid
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:578
-@deffn {Scheme Procedure} geteuid
-@deffnx {C Function} scm_geteuid ()
-Return an integer representing the current effective user ID.
-If the system does not support effective IDs, then the real ID
-is returned. @code{(feature? 'EIDs)} reports whether the
-system supports effective IDs.
-@end deffn
-
- getegid
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:595
-@deffn {Scheme Procedure} getegid
-@deffnx {C Function} scm_getegid ()
-Return an integer representing the current effective group ID.
-If the system does not support effective IDs, then the real ID
-is returned. @code{(feature? 'EIDs)} reports whether the
-system supports effective IDs.
-@end deffn
-
- setuid
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:611
-@deffn {Scheme Procedure} setuid id
-@deffnx {C Function} scm_setuid (id)
-Sets both the real and effective user IDs to the integer @var{id}, provided
-the process has appropriate privileges.
-The return value is unspecified.
-@end deffn
-
- setgid
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:625
-@deffn {Scheme Procedure} setgid id
-@deffnx {C Function} scm_setgid (id)
-Sets both the real and effective group IDs to the integer @var{id}, provided
-the process has appropriate privileges.
-The return value is unspecified.
-@end deffn
-
- seteuid
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:641
-@deffn {Scheme Procedure} seteuid id
-@deffnx {C Function} scm_seteuid (id)
-Sets the effective user ID to the integer @var{id}, provided the process
-has appropriate privileges. If effective IDs are not supported, the
-real ID is set instead -- @code{(feature? 'EIDs)} reports whether the
-system supports effective IDs.
-The return value is unspecified.
-@end deffn
-
- setegid
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:667
-@deffn {Scheme Procedure} setegid id
-@deffnx {C Function} scm_setegid (id)
-Sets the effective group ID to the integer @var{id}, provided the process
-has appropriate privileges. If effective IDs are not supported, the
-real ID is set instead -- @code{(feature? 'EIDs)} reports whether the
-system supports effective IDs.
-The return value is unspecified.
-@end deffn
-
- getpgrp
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:691
-@deffn {Scheme Procedure} getpgrp
-@deffnx {C Function} scm_getpgrp ()
-Return an integer representing the current process group ID.
-This is the POSIX definition, not BSD.
-@end deffn
-
- setpgid
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:709
-@deffn {Scheme Procedure} setpgid pid pgid
-@deffnx {C Function} scm_setpgid (pid, pgid)
-Move the process @var{pid} into the process group @var{pgid}. @var{pid} or
-@var{pgid} must be integers: they can be zero to indicate the ID of the
-current process.
-Fails on systems that do not support job control.
-The return value is unspecified.
-@end deffn
-
- setsid
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:728
-@deffn {Scheme Procedure} setsid
-@deffnx {C Function} scm_setsid ()
-Creates a new session. The current process becomes the session leader
-and is put in a new process group. The process will be detached
-from its controlling terminal if it has one.
-The return value is an integer representing the new process group ID.
-@end deffn
-
- ttyname
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:743
-@deffn {Scheme Procedure} ttyname port
-@deffnx {C Function} scm_ttyname (port)
-Return a string with the name of the serial terminal device
-underlying @var{port}.
-@end deffn
-
- ctermid
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:767
-@deffn {Scheme Procedure} ctermid
-@deffnx {C Function} scm_ctermid ()
-Return a string containing the file name of the controlling
-terminal for the current process.
-@end deffn
-
- tcgetpgrp
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:790
-@deffn {Scheme Procedure} tcgetpgrp port
-@deffnx {C Function} scm_tcgetpgrp (port)
-Return the process group ID of the foreground process group
-associated with the terminal open on the file descriptor
-underlying @var{port}.
-
-If there is no foreground process group, the return value is a
-number greater than 1 that does not match the process group ID
-of any existing process group. This can happen if all of the
-processes in the job that was formerly the foreground job have
-terminated, and no other job has yet been moved into the
-foreground.
-@end deffn
-
- tcsetpgrp
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:814
-@deffn {Scheme Procedure} tcsetpgrp port pgid
-@deffnx {C Function} scm_tcsetpgrp (port, pgid)
-Set the foreground process group ID for the terminal used by the file
-descriptor underlying @var{port} to the integer @var{pgid}.
-The calling process
-must be a member of the same session as @var{pgid} and must have the same
-controlling terminal. The return value is unspecified.
-@end deffn
-
- execl
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:869
-@deffn {Scheme Procedure} execl filename . args
-@deffnx {C Function} scm_execl (filename, args)
-Executes the file named by @var{path} as a new process image.
-The remaining arguments are supplied to the process; from a C program
-they are accessible as the @code{argv} argument to @code{main}.
-Conventionally the first @var{arg} is the same as @var{path}.
-All arguments must be strings.
-
-If @var{arg} is missing, @var{path} is executed with a null
-argument list, which may have system-dependent side-effects.
-
-This procedure is currently implemented using the @code{execv} system
-call, but we call it @code{execl} because of its Scheme calling interface.
-@end deffn
-
- execlp
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:889
-@deffn {Scheme Procedure} execlp filename . args
-@deffnx {C Function} scm_execlp (filename, args)
-Similar to @code{execl}, however if
-@var{filename} does not contain a slash
-then the file to execute will be located by searching the
-directories listed in the @code{PATH} environment variable.
-
-This procedure is currently implemented using the @code{execvp} system
-call, but we call it @code{execlp} because of its Scheme calling interface.
-@end deffn
-
- execle
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:939
-@deffn {Scheme Procedure} execle filename env . args
-@deffnx {C Function} scm_execle (filename, env, args)
-Similar to @code{execl}, but the environment of the new process is
-specified by @var{env}, which must be a list of strings as returned by the
-@code{environ} procedure.
-
-This procedure is currently implemented using the @code{execve} system
-call, but we call it @code{execle} because of its Scheme calling interface.
-@end deffn
-
- primitive-fork
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:963
-@deffn {Scheme Procedure} primitive-fork
-@deffnx {C Function} scm_fork ()
-Creates a new "child" process by duplicating the current "parent" process.
-In the child the return value is 0. In the parent the return value is
-the integer process ID of the child.
-
-This procedure has been renamed from @code{fork} to avoid a naming conflict
-with the scsh fork.
-@end deffn
-
- uname
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:983
-@deffn {Scheme Procedure} uname
-@deffnx {C Function} scm_uname ()
-Return an object with some information about the computer
-system the program is running on.
-@end deffn
-
- environ
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:1013
-@deffn {Scheme Procedure} environ [env]
-@deffnx {C Function} scm_environ (env)
-If @var{env} is omitted, return the current environment (in the
-Unix sense) as a list of strings. Otherwise set the current
-environment, which is also the default environment for child
-processes, to the supplied list of strings. Each member of
-@var{env} should be of the form @code{NAME=VALUE} and values of
-@code{NAME} should not be duplicated. If @var{env} is supplied
-then the return value is unspecified.
-@end deffn
-
- tmpnam
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:1051
-@deffn {Scheme Procedure} tmpnam
-@deffnx {C Function} scm_tmpnam ()
-Return a name in the file system that does not match any
-existing file. However there is no guarantee that another
-process will not create the file after @code{tmpnam} is called.
-Care should be taken if opening the file, e.g., use the
-@code{O_EXCL} open flag or use @code{mkstemp!} instead.
-@end deffn
-
- mkstemp!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:1077
-@deffn {Scheme Procedure} mkstemp! tmpl
-@deffnx {C Function} scm_mkstemp (tmpl)
-Create a new unique file in the file system and returns a new
-buffered port open for reading and writing to the file.
-@var{tmpl} is a string specifying where the file should be
-created: it must end with @code{XXXXXX} and will be changed in
-place to return the name of the temporary file.
-@end deffn
-
- utime
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:1102
-@deffn {Scheme Procedure} utime pathname [actime [modtime]]
-@deffnx {C Function} scm_utime (pathname, actime, modtime)
-@code{utime} sets the access and modification times for the
-file named by @var{path}. If @var{actime} or @var{modtime} is
-not supplied, then the current time is used. @var{actime} and
-@var{modtime} must be integer time values as returned by the
-@code{current-time} procedure.
-@lisp
-(utime "foo" (- (current-time) 3600))
-@end lisp
-will set the access time to one hour in the past and the
-modification time to the current time.
-@end deffn
-
- access?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:1150
-@deffn {Scheme Procedure} access? path how
-@deffnx {C Function} scm_access (path, how)
-Return @code{#t} if @var{path} corresponds to an existing file
-and the current process has the type of access specified by
-@var{how}, otherwise @code{#f}. @var{how} should be specified
-using the values of the variables listed below. Multiple
-values can be combined using a bitwise or, in which case
-@code{#t} will only be returned if all accesses are granted.
-
-Permissions are checked using the real id of the current
-process, not the effective id, although it's the effective id
-which determines whether the access would actually be granted.
-
-@defvar R_OK
-test for read permission.
-@end defvar
-@defvar W_OK
-test for write permission.
-@end defvar
-@defvar X_OK
-test for execute permission.
-@end defvar
-@defvar F_OK
-test for existence of the file.
-@end defvar
-@end deffn
-
- getpid
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:1164
-@deffn {Scheme Procedure} getpid
-@deffnx {C Function} scm_getpid ()
-Return an integer representing the current process ID.
-@end deffn
-
- putenv
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:1181
-@deffn {Scheme Procedure} putenv str
-@deffnx {C Function} scm_putenv (str)
-Modifies the environment of the current process, which is
-also the default environment inherited by child processes.
-
-If @var{string} is of the form @code{NAME=VALUE} then it will be written
-directly into the environment, replacing any existing environment string
-with
-name matching @code{NAME}. If @var{string} does not contain an equal
-sign, then any existing string with name matching @var{string} will
-be removed.
-
-The return value is unspecified.
-@end deffn
-
- setlocale
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:1223
-@deffn {Scheme Procedure} setlocale category [locale]
-@deffnx {C Function} scm_setlocale (category, locale)
-If @var{locale} is omitted, return the current value of the
-specified locale category as a system-dependent string.
-@var{category} should be specified using the values
-@code{LC_COLLATE}, @code{LC_ALL} etc.
-
-Otherwise the specified locale category is set to the string
-@var{locale} and the new value is returned as a
-system-dependent string. If @var{locale} is an empty string,
-the locale will be set using environment variables.
-@end deffn
-
- mknod
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:1263
-@deffn {Scheme Procedure} mknod path type perms dev
-@deffnx {C Function} scm_mknod (path, type, perms, dev)
-Creates a new special file, such as a file corresponding to a device.
-@var{path} specifies the name of the file. @var{type} should
-be one of the following symbols:
-regular, directory, symlink, block-special, char-special,
-fifo, or socket. @var{perms} (an integer) specifies the file permissions.
-@var{dev} (an integer) specifies which device the special file refers
-to. Its exact interpretation depends on the kind of special file
-being created.
-
-E.g.,
-@lisp
-(mknod "/dev/fd0" 'block-special #o660 (+ (* 2 256) 2))
-@end lisp
-
-The return value is unspecified.
-@end deffn
-
- nice
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:1309
-@deffn {Scheme Procedure} nice incr
-@deffnx {C Function} scm_nice (incr)
-Increment the priority of the current process by @var{incr}. A higher
-priority value means that the process runs less often.
-The return value is unspecified.
-@end deffn
-
- sync
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:1324
-@deffn {Scheme Procedure} sync
-@deffnx {C Function} scm_sync ()
-Flush the operating system disk buffers.
-The return value is unspecified.
-@end deffn
-
- crypt
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:1337
-@deffn {Scheme Procedure} crypt key salt
-@deffnx {C Function} scm_crypt (key, salt)
-Encrypt @var{key} using @var{salt} as the salt value to the
-crypt(3) library call.
-@end deffn
-
- chroot
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:1358
-@deffn {Scheme Procedure} chroot path
-@deffnx {C Function} scm_chroot (path)
-Change the root directory to that specified in @var{path}.
-This directory will be used for path names beginning with
-@file{/}. The root directory is inherited by all children
-of the current process. Only the superuser may change the
-root directory.
-@end deffn
-
- getlogin
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:1390
-@deffn {Scheme Procedure} getlogin
-@deffnx {C Function} scm_getlogin ()
-Return a string containing the name of the user logged in on
-the controlling terminal of the process, or @code{#f} if this
-information cannot be obtained.
-@end deffn
-
- cuserid
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:1408
-@deffn {Scheme Procedure} cuserid
-@deffnx {C Function} scm_cuserid ()
-Return a string containing a user name associated with the
-effective user id of the process. Return @code{#f} if this
-information cannot be obtained.
-@end deffn
-
- getpriority
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:1433
-@deffn {Scheme Procedure} getpriority which who
-@deffnx {C Function} scm_getpriority (which, who)
-Return the scheduling priority of the process, process group
-or user, as indicated by @var{which} and @var{who}. @var{which}
-is one of the variables @code{PRIO_PROCESS}, @code{PRIO_PGRP}
-or @code{PRIO_USER}, and @var{who} is interpreted relative to
-@var{which} (a process identifier for @code{PRIO_PROCESS},
-process group identifier for @code{PRIO_PGRP}, and a user
-identifier for @code{PRIO_USER}. A zero value of @var{who}
-denotes the current process, process group, or user. Return
-the highest priority (lowest numerical value) of any of the
-specified processes.
-@end deffn
-
- setpriority
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:1467
-@deffn {Scheme Procedure} setpriority which who prio
-@deffnx {C Function} scm_setpriority (which, who, prio)
-Set the scheduling priority of the process, process group
-or user, as indicated by @var{which} and @var{who}. @var{which}
-is one of the variables @code{PRIO_PROCESS}, @code{PRIO_PGRP}
-or @code{PRIO_USER}, and @var{who} is interpreted relative to
-@var{which} (a process identifier for @code{PRIO_PROCESS},
-process group identifier for @code{PRIO_PGRP}, and a user
-identifier for @code{PRIO_USER}. A zero value of @var{who}
-denotes the current process, process group, or user.
-@var{prio} is a value in the range -20 and 20, the default
-priority is 0; lower priorities cause more favorable
-scheduling. Sets the priority of all of the specified
-processes. Only the super-user may lower priorities.
-The return value is not specified.
-@end deffn
-
- getpass
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:1492
-@deffn {Scheme Procedure} getpass prompt
-@deffnx {C Function} scm_getpass (prompt)
-Display @var{prompt} to the standard error output and read
-a password from @file{/dev/tty}. If this file is not
-accessible, it reads from standard input. The password may be
-up to 127 characters in length. Additional characters and the
-terminating newline character are discarded. While reading
-the password, echoing and the generation of signals by special
-characters is disabled.
-@end deffn
-
- flock
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:1596
-@deffn {Scheme Procedure} flock file operation
-@deffnx {C Function} scm_flock (file, operation)
-Apply or remove an advisory lock on an open file.
-@var{operation} specifies the action to be done:
-@table @code
-@item LOCK_SH
-Shared lock. More than one process may hold a shared lock
-for a given file at a given time.
-@item LOCK_EX
-Exclusive lock. Only one process may hold an exclusive lock
-for a given file at a given time.
-@item LOCK_UN
-Unlock the file.
-@item LOCK_NB
-Don't block when locking. May be specified by bitwise OR'ing
-it to one of the other operations.
-@end table
-The return value is not specified. @var{file} may be an open
-file descriptor or an open file descriptor port.
-@end deffn
-
- sethostname
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:1622
-@deffn {Scheme Procedure} sethostname name
-@deffnx {C Function} scm_sethostname (name)
-Set the host name of the current processor to @var{name}. May
-only be used by the superuser. The return value is not
-specified.
-@end deffn
-
- gethostname
-@c snarfed from /home/ghouston/guile/guile-core/libguile/posix.c:1637
-@deffn {Scheme Procedure} gethostname
-@deffnx {C Function} scm_gethostname ()
-Return the host name of the current processor.
-@end deffn
-
- gethost
-@c snarfed from /home/ghouston/guile/guile-core/libguile/net_db.c:154
-@deffn {Scheme Procedure} gethost [host]
-@deffnx {Scheme Procedure} gethostbyname hostname
-@deffnx {Scheme Procedure} gethostbyaddr address
-@deffnx {C Function} scm_gethost (host)
-Look up a host by name or address, returning a host object. The
-@code{gethost} procedure will accept either a string name or an integer
-address; if given no arguments, it behaves like @code{gethostent} (see
-below). If a name or address is supplied but the address can not be
-found, an error will be thrown to one of the keys:
-@code{host-not-found}, @code{try-again}, @code{no-recovery} or
-@code{no-data}, corresponding to the equivalent @code{h_error} values.
-Unusual conditions may result in errors thrown to the
-@code{system-error} or @code{misc_error} keys.
-@end deffn
-
- getnet
-@c snarfed from /home/ghouston/guile/guile-core/libguile/net_db.c:233
-@deffn {Scheme Procedure} getnet [net]
-@deffnx {Scheme Procedure} getnetbyname net-name
-@deffnx {Scheme Procedure} getnetbyaddr net-number
-@deffnx {C Function} scm_getnet (net)
-Look up a network by name or net number in the network database. The
-@var{net-name} argument must be a string, and the @var{net-number}
-argument must be an integer. @code{getnet} will accept either type of
-argument, behaving like @code{getnetent} (see below) if no arguments are
-given.
-@end deffn
-
- getproto
-@c snarfed from /home/ghouston/guile/guile-core/libguile/net_db.c:282
-@deffn {Scheme Procedure} getproto [protocol]
-@deffnx {Scheme Procedure} getprotobyname name
-@deffnx {Scheme Procedure} getprotobynumber number
-@deffnx {C Function} scm_getproto (protocol)
-Look up a network protocol by name or by number. @code{getprotobyname}
-takes a string argument, and @code{getprotobynumber} takes an integer
-argument. @code{getproto} will accept either type, behaving like
-@code{getprotoent} (see below) if no arguments are supplied.
-@end deffn
-
- getserv
-@c snarfed from /home/ghouston/guile/guile-core/libguile/net_db.c:348
-@deffn {Scheme Procedure} getserv [name [protocol]]
-@deffnx {Scheme Procedure} getservbyname name protocol
-@deffnx {Scheme Procedure} getservbyport port protocol
-@deffnx {C Function} scm_getserv (name, protocol)
-Look up a network service by name or by service number, and return a
-network service object. The @var{protocol} argument specifies the name
-of the desired protocol; if the protocol found in the network service
-database does not match this name, a system error is signalled.
-
-The @code{getserv} procedure will take either a service name or number
-as its first argument; if given no arguments, it behaves like
-@code{getservent} (see below).
-@end deffn
-
- sethost
-@c snarfed from /home/ghouston/guile/guile-core/libguile/net_db.c:385
-@deffn {Scheme Procedure} sethost [stayopen]
-@deffnx {C Function} scm_sethost (stayopen)
-If @var{stayopen} is omitted, this is equivalent to @code{endhostent}.
-Otherwise it is equivalent to @code{sethostent stayopen}.
-@end deffn
-
- setnet
-@c snarfed from /home/ghouston/guile/guile-core/libguile/net_db.c:401
-@deffn {Scheme Procedure} setnet [stayopen]
-@deffnx {C Function} scm_setnet (stayopen)
-If @var{stayopen} is omitted, this is equivalent to @code{endnetent}.
-Otherwise it is equivalent to @code{setnetent stayopen}.
-@end deffn
-
- setproto
-@c snarfed from /home/ghouston/guile/guile-core/libguile/net_db.c:417
-@deffn {Scheme Procedure} setproto [stayopen]
-@deffnx {C Function} scm_setproto (stayopen)
-If @var{stayopen} is omitted, this is equivalent to @code{endprotoent}.
-Otherwise it is equivalent to @code{setprotoent stayopen}.
-@end deffn
-
- setserv
-@c snarfed from /home/ghouston/guile/guile-core/libguile/net_db.c:433
-@deffn {Scheme Procedure} setserv [stayopen]
-@deffnx {C Function} scm_setserv (stayopen)
-If @var{stayopen} is omitted, this is equivalent to @code{endservent}.
-Otherwise it is equivalent to @code{setservent stayopen}.
-@end deffn
-
- htons
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:109
-@deffn {Scheme Procedure} htons value
-@deffnx {C Function} scm_htons (value)
-Convert a 16 bit quantity from host to network byte ordering.
-@var{value} is packed into 2 bytes, which are then converted
-and returned as a new integer.
-@end deffn
-
- ntohs
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:126
-@deffn {Scheme Procedure} ntohs value
-@deffnx {C Function} scm_ntohs (value)
-Convert a 16 bit quantity from network to host byte ordering.
-@var{value} is packed into 2 bytes, which are then converted
-and returned as a new integer.
-@end deffn
-
- htonl
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:143
-@deffn {Scheme Procedure} htonl value
-@deffnx {C Function} scm_htonl (value)
-Convert a 32 bit quantity from host to network byte ordering.
-@var{value} is packed into 4 bytes, which are then converted
-and returned as a new integer.
-@end deffn
-
- ntohl
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:156
-@deffn {Scheme Procedure} ntohl value
-@deffnx {C Function} scm_ntohl (value)
-Convert a 32 bit quantity from network to host byte ordering.
-@var{value} is packed into 4 bytes, which are then converted
-and returned as a new integer.
-@end deffn
-
- inet-aton
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:176
-@deffn {Scheme Procedure} inet-aton address
-@deffnx {C Function} scm_inet_aton (address)
-Convert an IPv4 Internet address from printable string
-(dotted decimal notation) to an integer. E.g.,
-
-@lisp
-(inet-aton "127.0.0.1") @result{} 2130706433
-@end lisp
-@end deffn
-
- inet-ntoa
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:195
-@deffn {Scheme Procedure} inet-ntoa inetid
-@deffnx {C Function} scm_inet_ntoa (inetid)
-Convert an IPv4 Internet address to a printable
-(dotted decimal notation) string. E.g.,
-
-@lisp
-(inet-ntoa 2130706433) @result{} "127.0.0.1"
-@end lisp
-@end deffn
-
- inet-netof
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:215
-@deffn {Scheme Procedure} inet-netof address
-@deffnx {C Function} scm_inet_netof (address)
-Return the network number part of the given IPv4
-Internet address. E.g.,
-
-@lisp
-(inet-netof 2130706433) @result{} 127
-@end lisp
-@end deffn
-
- inet-lnaof
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:233
-@deffn {Scheme Procedure} inet-lnaof address
-@deffnx {C Function} scm_lnaof (address)
-Return the local-address-with-network part of the given
-IPv4 Internet address, using the obsolete class A/B/C system.
-E.g.,
-
-@lisp
-(inet-lnaof 2130706433) @result{} 1
-@end lisp
-@end deffn
-
- inet-makeaddr
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:251
-@deffn {Scheme Procedure} inet-makeaddr net lna
-@deffnx {C Function} scm_inet_makeaddr (net, lna)
-Make an IPv4 Internet address by combining the network number
-@var{net} with the local-address-within-network number
-@var{lna}. E.g.,
-
-@lisp
-(inet-makeaddr 127 1) @result{} 2130706433
-@end lisp
-@end deffn
-
- inet-pton
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:369
-@deffn {Scheme Procedure} inet-pton family address
-@deffnx {C Function} scm_inet_pton (family, address)
-Convert a string containing a printable network address to
-an integer address. Note that unlike the C version of this
-function,
-the result is an integer with normal host byte ordering.
-@var{family} can be @code{AF_INET} or @code{AF_INET6}. E.g.,
-
-@lisp
-(inet-pton AF_INET "127.0.0.1") @result{} 2130706433
-(inet-pton AF_INET6 "::1") @result{} 1
-@end lisp
-@end deffn
-
- inet-ntop
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:404
-@deffn {Scheme Procedure} inet-ntop family address
-@deffnx {C Function} scm_inet_ntop (family, address)
-Convert a network address into a printable string.
-Note that unlike the C version of this function,
-the input is an integer with normal host byte ordering.
-@var{family} can be @code{AF_INET} or @code{AF_INET6}. E.g.,
-
-@lisp
-(inet-ntop AF_INET 2130706433) @result{} "127.0.0.1"
-(inet-ntop AF_INET6 (- (expt 2 128) 1)) @result{}
-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
-@end lisp
-@end deffn
-
- socket
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:449
-@deffn {Scheme Procedure} socket family style proto
-@deffnx {C Function} scm_socket (family, style, proto)
-Return a new socket port of the type specified by @var{family},
-@var{style} and @var{proto}. All three parameters are
-integers. Supported values for @var{family} are
-@code{AF_UNIX}, @code{AF_INET} and @code{AF_INET6}.
-Typical values for @var{style} are @code{SOCK_STREAM},
-@code{SOCK_DGRAM} and @code{SOCK_RAW}.
-
-@var{proto} can be obtained from a protocol name using
-@code{getprotobyname}. A value of zero specifies the default
-protocol, which is usually right.
-
-A single socket port cannot by used for communication until it
-has been connected to another socket.
-@end deffn
-
- socketpair
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:471
-@deffn {Scheme Procedure} socketpair family style proto
-@deffnx {C Function} scm_socketpair (family, style, proto)
-Return a pair of connected (but unnamed) socket ports of the
-type specified by @var{family}, @var{style} and @var{proto}.
-Many systems support only socket pairs of the @code{AF_UNIX}
-family. Zero is likely to be the only meaningful value for
-@var{proto}.
-@end deffn
-
- getsockopt
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:500
-@deffn {Scheme Procedure} getsockopt sock level optname
-@deffnx {C Function} scm_getsockopt (sock, level, optname)
-Return the value of a particular socket option for the socket
-port @var{sock}. @var{level} is an integer code for type of
-option being requested, e.g., @code{SOL_SOCKET} for
-socket-level options. @var{optname} is an integer code for the
-option required and should be specified using one of the
-symbols @code{SO_DEBUG}, @code{SO_REUSEADDR} etc.
-
-The returned value is typically an integer but @code{SO_LINGER}
-returns a pair of integers.
-@end deffn
-
- setsockopt
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:568
-@deffn {Scheme Procedure} setsockopt sock level optname value
-@deffnx {C Function} scm_setsockopt (sock, level, optname, value)
-Set the value of a particular socket option for the socket
-port @var{sock}. @var{level} is an integer code for type of option
-being set, e.g., @code{SOL_SOCKET} for socket-level options.
-@var{optname} is an
-integer code for the option to set and should be specified using one of
-the symbols @code{SO_DEBUG}, @code{SO_REUSEADDR} etc.
-@var{value} is the value to which the option should be set. For
-most options this must be an integer, but for @code{SO_LINGER} it must
-be a pair.
-
-The return value is unspecified.
-@end deffn
-
- shutdown
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:672
-@deffn {Scheme Procedure} shutdown sock how
-@deffnx {C Function} scm_shutdown (sock, how)
-Sockets can be closed simply by using @code{close-port}. The
-@code{shutdown} procedure allows reception or transmission on a
-connection to be shut down individually, according to the parameter
-@var{how}:
-
-@table @asis
-@item 0
-Stop receiving data for this socket. If further data arrives, reject it.
-@item 1
-Stop trying to transmit data from this socket. Discard any
-data waiting to be sent. Stop looking for acknowledgement of
-data already sent; don't retransmit it if it is lost.
-@item 2
-Stop both reception and transmission.
-@end table
-
-The return value is unspecified.
-@end deffn
-
- connect
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:816
-@deffn {Scheme Procedure} connect sock fam address . args
-@deffnx {C Function} scm_connect (sock, fam, address, args)
-Initiate a connection from a socket using a specified address
-family to the address
-specified by @var{address} and possibly @var{args}.
-The format required for @var{address}
-and @var{args} depends on the family of the socket.
-
-For a socket of family @code{AF_UNIX},
-only @var{address} is specified and must be a string with the
-filename where the socket is to be created.
-
-For a socket of family @code{AF_INET},
-@var{address} must be an integer IPv4 host address and
-@var{args} must be a single integer port number.
-
-For a socket of family @code{AF_INET6},
-@var{address} must be an integer IPv6 host address and
-@var{args} may be up to three integers:
-port [flowinfo] [scope_id],
-where flowinfo and scope_id default to zero.
-
-The return value is unspecified.
-@end deffn
-
- bind
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:876
-@deffn {Scheme Procedure} bind sock fam address . args
-@deffnx {C Function} scm_bind (sock, fam, address, args)
-Assign an address to the socket port @var{sock}.
-Generally this only needs to be done for server sockets,
-so they know where to look for incoming connections. A socket
-without an address will be assigned one automatically when it
-starts communicating.
-
-The format of @var{address} and @var{args} depends
-on the family of the socket.
-
-For a socket of family @code{AF_UNIX}, only @var{address}
-is specified and must be a string with the filename where
-the socket is to be created.
-
-For a socket of family @code{AF_INET}, @var{address}
-must be an integer IPv4 address and @var{args}
-must be a single integer port number.
-
-The values of the following variables can also be used for
-@var{address}:
-
-@defvar INADDR_ANY
-Allow connections from any address.
-@end defvar
-
-@defvar INADDR_LOOPBACK
-The address of the local host using the loopback device.
-@end defvar
-
-@defvar INADDR_BROADCAST
-The broadcast address on the local network.
-@end defvar
-
-@defvar INADDR_NONE
-No address.
-@end defvar
-
-For a socket of family @code{AF_INET6}, @var{address}
-must be an integer IPv6 address and @var{args}
-may be up to three integers:
-port [flowinfo] [scope_id],
-where flowinfo and scope_id default to zero.
-
-The return value is unspecified.
-@end deffn
-
- listen
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:910
-@deffn {Scheme Procedure} listen sock backlog
-@deffnx {C Function} scm_listen (sock, backlog)
-Enable @var{sock} to accept connection
-requests. @var{backlog} is an integer specifying
-the maximum length of the queue for pending connections.
-If the queue fills, new clients will fail to connect until
-the server calls @code{accept} to accept a connection from
-the queue.
-
-The return value is unspecified.
-@end deffn
-
- accept
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:1015
-@deffn {Scheme Procedure} accept sock
-@deffnx {C Function} scm_accept (sock)
-Accept a connection on a bound, listening socket.
-If there
-are no pending connections in the queue, wait until
-one is available unless the non-blocking option has been
-set on the socket.
-
-The return value is a
-pair in which the @emph{car} is a new socket port for the
-connection and
-the @emph{cdr} is an object with address information about the
-client which initiated the connection.
-
-@var{sock} does not become part of the
-connection and will continue to accept new requests.
-@end deffn
-
- getsockname
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:1042
-@deffn {Scheme Procedure} getsockname sock
-@deffnx {C Function} scm_getsockname (sock)
-Return the address of @var{sock}, in the same form as the
-object returned by @code{accept}. On many systems the address
-of a socket in the @code{AF_FILE} namespace cannot be read.
-@end deffn
-
- getpeername
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:1064
-@deffn {Scheme Procedure} getpeername sock
-@deffnx {C Function} scm_getpeername (sock)
-Return the address that @var{sock}
-is connected to, in the same form as the object returned by
-@code{accept}. On many systems the address of a socket in the
-@code{AF_FILE} namespace cannot be read.
-@end deffn
-
- recv!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:1099
-@deffn {Scheme Procedure} recv! sock buf [flags]
-@deffnx {C Function} scm_recv (sock, buf, flags)
-Receive data from a socket port.
-@var{sock} must already
-be bound to the address from which data is to be received.
-@var{buf} is a string into which
-the data will be written. The size of @var{buf} limits
-the amount of
-data which can be received: in the case of packet
-protocols, if a packet larger than this limit is encountered
-then some data
-will be irrevocably lost.
-
-The optional @var{flags} argument is a value or
-bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc.
-
-The value returned is the number of bytes read from the
-socket.
-
-Note that the data is read directly from the socket file
-descriptor:
-any unread buffered port data is ignored.
-@end deffn
-
- send
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:1132
-@deffn {Scheme Procedure} send sock message [flags]
-@deffnx {C Function} scm_send (sock, message, flags)
-Transmit the string @var{message} on a socket port @var{sock}.
-@var{sock} must already be bound to a destination address. The
-value returned is the number of bytes transmitted --
-it's possible for
-this to be less than the length of @var{message}
-if the socket is
-set to be non-blocking. The optional @var{flags} argument
-is a value or
-bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc.
-
-Note that the data is written directly to the socket
-file descriptor:
-any unflushed buffered port data is ignored.
-@end deffn
-
- recvfrom!
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:1172
-@deffn {Scheme Procedure} recvfrom! sock str [flags [start [end]]]
-@deffnx {C Function} scm_recvfrom (sock, str, flags, start, end)
-Return data from the socket port @var{sock} and also
-information about where the data was received from.
-@var{sock} must already be bound to the address from which
-data is to be received. @code{str}, is a string into which the
-data will be written. The size of @var{str} limits the amount
-of data which can be received: in the case of packet protocols,
-if a packet larger than this limit is encountered then some
-data will be irrevocably lost.
-
-The optional @var{flags} argument is a value or bitwise OR of
-@code{MSG_OOB}, @code{MSG_PEEK}, @code{MSG_DONTROUTE} etc.
-
-The value returned is a pair: the @emph{car} is the number of
-bytes read from the socket and the @emph{cdr} an address object
-in the same form as returned by @code{accept}. The address
-will given as @code{#f} if not available, as is usually the
-case for stream sockets.
-
-The @var{start} and @var{end} arguments specify a substring of
-@var{str} to which the data should be written.
-
-Note that the data is read directly from the socket file
-descriptor: any unread buffered port data is ignored.
-@end deffn
-
- sendto
-@c snarfed from /home/ghouston/guile/guile-core/libguile/socket.c:1230
-@deffn {Scheme Procedure} sendto sock message fam address . args_and_flags
-@deffnx {C Function} scm_sendto (sock, message, fam, address, args_and_flags)
-Transmit the string @var{message} on the socket port
-@var{sock}. The
-destination address is specified using the @var{fam},
-@var{address} and
-@var{args_and_flags} arguments, in a similar way to the
-@code{connect} procedure. @var{args_and_flags} contains
-the usual connection arguments optionally followed by
-a flags argument, which is a value or
-bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc.
-
-The value returned is the number of bytes transmitted --
-it's possible for
-this to be less than the length of @var{message} if the
-socket is
-set to be non-blocking.
-Note that the data is written directly to the socket
-file descriptor:
-any unflushed buffered port data is ignored.
-@end deffn
-
- regexp?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/regex-posix.c:137
-@deffn {Scheme Procedure} regexp? obj
-@deffnx {C Function} scm_regexp_p (obj)
-Return @code{#t} if @var{obj} is a compiled regular expression,
-or @code{#f} otherwise.
-@end deffn
-
- make-regexp
-@c snarfed from /home/ghouston/guile/guile-core/libguile/regex-posix.c:182
-@deffn {Scheme Procedure} make-regexp pat . flags
-@deffnx {C Function} scm_make_regexp (pat, flags)
-Compile the regular expression described by @var{pat}, and
-return the compiled regexp structure. If @var{pat} does not
-describe a legal regular expression, @code{make-regexp} throws
-a @code{regular-expression-syntax} error.
-
-The @var{flags} arguments change the behavior of the compiled
-regular expression. The following flags may be supplied:
-
-@table @code
-@item regexp/icase
-Consider uppercase and lowercase letters to be the same when
-matching.
-@item regexp/newline
-If a newline appears in the target string, then permit the
-@samp{^} and @samp{$} operators to match immediately after or
-immediately before the newline, respectively. Also, the
-@samp{.} and @samp{[^...]} operators will never match a newline
-character. The intent of this flag is to treat the target
-string as a buffer containing many lines of text, and the
-regular expression as a pattern that may match a single one of
-those lines.
-@item regexp/basic
-Compile a basic (``obsolete'') regexp instead of the extended
-(``modern'') regexps that are the default. Basic regexps do
-not consider @samp{|}, @samp{+} or @samp{?} to be special
-characters, and require the @samp{@{...@}} and @samp{(...)}
-metacharacters to be backslash-escaped (@pxref{Backslash
-Escapes}). There are several other differences between basic
-and extended regular expressions, but these are the most
-significant.
-@item regexp/extended
-Compile an extended regular expression rather than a basic
-regexp. This is the default behavior; this flag will not
-usually be needed. If a call to @code{make-regexp} includes
-both @code{regexp/basic} and @code{regexp/extended} flags, the
-one which comes last will override the earlier one.
-@end table
-@end deffn
-
- regexp-exec
-@c snarfed from /home/ghouston/guile/guile-core/libguile/regex-posix.c:243
-@deffn {Scheme Procedure} regexp-exec rx str [start [flags]]
-@deffnx {C Function} scm_regexp_exec (rx, str, start, flags)
-Match the compiled regular expression @var{rx} against
-@code{str}. If the optional integer @var{start} argument is
-provided, begin matching from that position in the string.
-Return a match structure describing the results of the match,
-or @code{#f} if no match could be found.
-
-The @var{flags} arguments change the matching behavior.
-The following flags may be supplied:
-
-@table @code
-@item regexp/notbol
-Operator @samp{^} always fails (unless @code{regexp/newline}
-is used). Use this when the beginning of the string should
-not be considered the beginning of a line.
-@item regexp/noteol
-Operator @samp{$} always fails (unless @code{regexp/newline}
-is used). Use this when the end of the string should not be
-considered the end of a line.
-@end table
-@end deffn
-
- single-active-thread?
-@c snarfed from /home/ghouston/guile/guile-core/libguile/threads.c:79
-@deffn {Scheme Procedure} single-active-thread?
-implemented by the C function "scm_single_thread_p"
-@end deffn
-
- yield
-@c snarfed from /home/ghouston/guile/guile-core/libguile/threads.c:85
-@deffn {Scheme Procedure} yield
-implemented by the C function "scm_yield"
-@end deffn
-
- call-with-new-thread
-@c snarfed from /home/ghouston/guile/guile-core/libguile/threads.c:90
-@deffn {Scheme Procedure} call-with-new-thread
-implemented by the C function "scm_call_with_new_thread"
-@end deffn
-
- join-thread
-@c snarfed from /home/ghouston/guile/guile-core/libguile/threads.c:104
-@deffn {Scheme Procedure} join-thread
-implemented by the C function "scm_join_thread"
-@end deffn
-
- make-mutex
-@c snarfed from /home/ghouston/guile/guile-core/libguile/threads.c:109
-@deffn {Scheme Procedure} make-mutex
-implemented by the C function "scm_make_mutex"
-@end deffn
-
- lock-mutex
-@c snarfed from /home/ghouston/guile/guile-core/libguile/threads.c:112
-@deffn {Scheme Procedure} lock-mutex
-implemented by the C function "scm_lock_mutex"
-@end deffn
-
- unlock-mutex
-@c snarfed from /home/ghouston/guile/guile-core/libguile/threads.c:117
-@deffn {Scheme Procedure} unlock-mutex
-implemented by the C function "scm_unlock_mutex"
-@end deffn
-
- make-condition-variable
-@c snarfed from /home/ghouston/guile/guile-core/libguile/threads.c:123
-@deffn {Scheme Procedure} make-condition-variable
-implemented by the C function "scm_make_condition_variable"
-@end deffn
-
- wait-condition-variable
-@c snarfed from /home/ghouston/guile/guile-core/libguile/threads.c:125
-@deffn {Scheme Procedure} wait-condition-variable
-implemented by the C function "scm_wait_condition_variable"
-@end deffn
-
- signal-condition-variable
-@c snarfed from /home/ghouston/guile/guile-core/libguile/threads.c:127
-@deffn {Scheme Procedure} signal-condition-variable
-implemented by the C function "scm_signal_condition_variable"
-@end deffn
diff --git a/doc/mbapi.texi b/doc/mbapi.texi
deleted file mode 100644
index 3f53ccdb2..000000000
--- a/doc/mbapi.texi
+++ /dev/null
@@ -1,987 +0,0 @@
-\input texinfo
-@setfilename mbapi.info
-@settitle Multibyte API
-@setchapternewpage off
-
-@c Open issues:
-
-@c What's the best way to report errors? Should functions return a
-@c magic value, according to C tradition, or should they signal a
-@c Guile exception?
-
-@c
-
-
-@node Working With Multibyte Strings in C
-@chapter Working With Multibyte Strings in C
-
-Guile allows strings to contain characters drawn from a wide variety of
-languages, including many Asian, Eastern European, and Middle Eastern
-languages, in a uniform and unrestricted way. The string representation
-normally used in C code --- an array of @sc{ASCII} characters --- is not
-sufficient for Guile strings, since they may contain characters not
-present in @sc{ASCII}.
-
-Instead, Guile uses a very large character set, and encodes each
-character as a sequence of one or more bytes. We call this
-variable-width encoding a @dfn{multibyte} encoding. Guile uses this
-single encoding internally for all strings, symbol names, error
-messages, etc., and performs appropriate conversions upon input and
-output.
-
-The use of this variable-width encoding is almost invisible to Scheme
-code. Strings are still indexed by character number, not by byte
-offset; @code{string-length} still returns the length of a string in
-characters, not in bytes. @code{string-ref} and @code{string-set!} are
-no longer guaranteed to be constant-time operations, but Guile uses
-various strategies to reduce the impact of this change.
-
-However, the encoding is visible via Guile's C interface, which gives
-the user direct access to a string's bytes. This chapter explains how
-to work with Guile multibyte text in C code. Since variable-width
-encodings are clumsier to work with than simple fixed-width encodings,
-Guile provides a set of standard macros and functions for manipulating
-multibyte text to make the job easier. Furthermore, Guile makes some
-promises about the encoding which you can use in writing your own text
-processing code.
-
-While we discuss guaranteed properties of Guile's encoding, and provide
-functions to operate on its character set, we do not actually specify
-either the character set or encoding here. This is because we expect
-both of them to change in the future: currently, Guile uses the same
-encoding as GNU Emacs 20.4, but we hope to change Guile (and GNU Emacs
-as well) to use Unicode and UTF-8, with some extensions. This will make
-it more comfortable to use Guile with other systems which use UTF-8,
-like the GTk user interface toolkit.
-
-@menu
-* Multibyte String Terminology::
-* Promised Properties of the Guile Multibyte Encoding::
-* Functions for Operating on Multibyte Text::
-* Multibyte Text Processing Errors::
-* Why Guile Does Not Use a Fixed-Width Encoding::
-@end menu
-
-
-@node Multibyte String Terminology, Promised Properties of the Guile Multibyte Encoding, Working With Multibyte Strings in C, Working With Multibyte Strings in C
-@section Multibyte String Terminology
-
-In the descriptions which follow, we make the following definitions:
-@table @dfn
-
-@item byte
-A @dfn{byte} is a number between 0 and 255. It has no inherent textual
-interpretation. So 65 is a byte, not a character.
-
-@item character
-A @dfn{character} is a unit of text. It has no inherent numeric value.
-@samp{A} and @samp{.} are characters, not bytes. (This is different
-from the C language's definition of @dfn{character}; in this chapter, we
-will always use a phrase like ``the C language's @code{char} type'' when
-that's what we mean.)
-
-@item character set
-A @dfn{character set} is an invertible mapping between numbers and a
-given set of characters. @sc{ASCII} is a character set assigning
-characters to the numbers 0 through 127. It maps @samp{A} onto the
-number 65, and @samp{.} onto 46.
-
-Note that a character set maps characters onto numbers, @emph{not
-necessarily} onto bytes. For example, the Unicode character set maps
-the Greek lower-case @samp{alpha} character onto the number 945, which
-is not a byte.
-
-(This is what Internet standards would call a "coding character set".)
-
-@item encoding
-An encoding maps numbers onto sequences of bytes. For example, the
-UTF-8 encoding, defined in the Unicode Standard, would map the number
-945 onto the sequence of bytes @samp{206 177}. When using the
-@sc{ASCII} character set, every number assigned also happens to be a
-byte, so there is an obvious trivial encoding for @sc{ASCII} in bytes.
-
-(This is what Internet standards would call a "character encoding
-scheme".)
-
-@end table
-
-Thus, to turn a character into a sequence of bytes, you need a character
-set to assign a number to that character, and then an encoding to turn
-that number into a sequence of bytes.
-
-Likewise, to interpret a sequence of bytes as a sequence of characters,
-you use an encoding to extract a sequence of numbers from the bytes, and
-then a character set to turn the numbers into characters.
-
-Errors can occur while carrying out either of these processes. For
-example, under a particular encoding, a given string of bytes might not
-correspond to any number. For example, the byte sequence @samp{128 128}
-is not a valid encoding of any number under UTF-8.
-
-Having carefully defined our terminology, we will now abuse it.
-
-We will sometimes use the word @dfn{character} to refer to the number
-assigned to a character by a character set, in contexts where it's
-obvious we mean a number.
-
-Sometimes there is a close association between a particular encoding and
-a particular character set. Thus, we may sometimes refer to the
-character set and encoding together as an @dfn{encoding}.
-
-
-@node Promised Properties of the Guile Multibyte Encoding, Functions for Operating on Multibyte Text, Multibyte String Terminology, Working With Multibyte Strings in C
-@section Promised Properties of the Guile Multibyte Encoding
-
-Internally, Guile uses a single encoding for all text --- symbols,
-strings, error messages, etc. Here we list a number of helpful
-properties of Guile's encoding. It is correct to write code which
-assumes these properties; code which uses these assumptions will be
-portable to all future versions of Guile, as far as we know.
-
-@b{Every @sc{ASCII} character is encoded as a single byte from 0 to 127, in
-the obvious way.} This means that a standard C string containing only
-@sc{ASCII} characters is a valid Guile string (except for the terminator;
-Guile strings store the length explicitly, so they can contain null
-characters).
-
-@b{The encodings of non-@sc{ASCII} characters use only bytes between 128
-and 255.} That is, when we turn a non-@sc{ASCII} character into a
-series of bytes, none of those bytes can ever be mistaken for the
-encoding of an @sc{ASCII} character. This means that you can search a
-Guile string for an @sc{ASCII} character using the standard
-@code{memchr} library function. By extension, you can search for an
-@sc{ASCII} substring in a Guile string using a traditional substring
-search algorithm --- you needn't add special checks to verify encoding
-boundaries, etc.
-
-@b{No character encoding is a subsequence of any other character
-encoding.} (This is just a stronger version of the previous promise.)
-This means that you can search for occurrences of one Guile string
-within another Guile string just as if they were raw byte strings. You
-can use the stock @code{memmem} function (provided on GNU systems, at
-least) for such searches. If you don't need the ability to represent
-null characters in your text, you can still use null-termination for
-strings, and use the traditional string-handling functions like
-@code{strlen}, @code{strstr}, and @code{strcat}.
-
-@b{You can always determine the full length of a character's encoding
-from its first byte.} Guile provides the macro @code{scm_mb_len} which
-computes the encoding's length from its first byte. Given the first
-rule, you can see that @code{scm_mb_len (@var{b})}, for any @code{0 <=
-@var{b} <= 127}, returns 1.
-
-@b{Given an arbitrary byte position in a Guile string, you can always
-find the beginning and end of the character containing that byte without
-scanning too far in either direction.} This means that, if you are sure
-a byte sequence is a valid encoding of a character sequence, you can
-find character boundaries without keeping track of the beginning and
-ending of the overall string. This promise relies on the fact that, in
-addition to storing the string's length explicitly, Guile always either
-terminates the string's storage with a zero byte, or shares it with
-another string which is terminated this way.
-
-
-@node Functions for Operating on Multibyte Text, Multibyte Text Processing Errors, Promised Properties of the Guile Multibyte Encoding, Working With Multibyte Strings in C
-@section Functions for Operating on Multibyte Text
-
-Guile provides a variety of functions, variables, and types for working
-with multibyte text.
-
-@menu
-* Basic Multibyte Character Processing::
-* Finding Character Encoding Boundaries::
-* Multibyte String Functions::
-* Exchanging Guile Text With the Outside World in C::
-* Implementing Your Own Text Conversions::
-@end menu
-
-
-@node Basic Multibyte Character Processing, Finding Character Encoding Boundaries, Functions for Operating on Multibyte Text, Functions for Operating on Multibyte Text
-@subsection Basic Multibyte Character Processing
-
-Here are the essential types and functions for working with Guile text.
-Guile uses the C type @code{unsigned char *} to refer to text encoded
-with Guile's encoding.
-
-Note that any operation marked here as a ``Libguile Macro'' might
-evaluate its argument multiple times.
-
-@deftp {Libguile Type} scm_char_t
-This is a signed integral type large enough to hold any character in
-Guile's character set. All character numbers are positive.
-@end deftp
-
-@deftypefn {Libguile Macro} scm_char_t scm_mb_get (const unsigned char *@var{p})
-Return the character whose encoding starts at @var{p}. If @var{p} does
-not point at a valid character encoding, the behavior is undefined.
-@end deftypefn
-
-@deftypefn {Libguile Macro} int scm_mb_put (unsigned char *@var{p}, scm_char_t @var{c})
-Place the encoded form of the Guile character @var{c} at @var{p}, and
-return its length in bytes. If @var{c} is not a Guile character, the
-behavior is undefined.
-@end deftypefn
-
-@deftypevr {Libguile Constant} int scm_mb_max_len
-The maximum length of any character's encoding, in bytes. You may
-assume this is relatively small --- less than a dozen or so.
-@end deftypevr
-
-@deftypefn {Libguile Macro} int scm_mb_len (unsigned char @var{b})
-If @var{b} is the first byte of a character's encoding, return the full
-length of the character's encoding, in bytes. If @var{b} is not a valid
-leading byte, the behavior is undefined.
-@end deftypefn
-
-@deftypefn {Libguile Macro} int scm_mb_char_len (scm_char_t @var{c})
-Return the length of the encoding of the character @var{c}, in bytes.
-If @var{c} is not a valid Guile character, the behavior is undefined.
-@end deftypefn
-
-@deftypefn {Libguile Function} scm_char_t scm_mb_get_func (const unsigned char *@var{p})
-@deftypefnx {Libguile Function} int scm_mb_put_func (unsigned char *@var{p}, scm_char_t @var{c})
-@deftypefnx {Libguile Function} int scm_mb_len_func (unsigned char @var{b})
-@deftypefnx {Libguile Function} int scm_mb_char_len_func (scm_char_t @var{c})
-These are functions identical to the corresponding macros. You can use
-them in situations where the overhead of a function call is acceptable,
-and the cleaner semantics of function application are desireable.
-@end deftypefn
-
-
-@node Finding Character Encoding Boundaries, Multibyte String Functions, Basic Multibyte Character Processing, Functions for Operating on Multibyte Text
-@subsection Finding Character Encoding Boundaries
-
-These are functions for finding the boundaries between characters in
-multibyte text.
-
-Note that any operation marked here as a ``Libguile Macro'' might
-evaluate its argument multiple times, unless the definition promises
-otherwise.
-
-@deftypefn {Libguile Macro} int scm_mb_boundary_p (const unsigned char *@var{p})
-Return non-zero iff @var{p} points to the start of a character in
-multibyte text.
-
-This macro will evaluate its argument only once.
-@end deftypefn
-
-@deftypefn {Libguile Function} {const unsigned char *} scm_mb_floor (const unsigned char *@var{p})
-``Round'' @var{p} to the previous character boundary. That is, if
-@var{p} points to the middle of the encoding of a Guile character,
-return a pointer to the first byte of the encoding. If @var{p} points
-to the start of the encoding of a Guile character, return @var{p}
-unchanged.
-@end deftypefn
-
-@deftypefn {libguile Function} {const unsigned char *} scm_mb_ceiling (const unsigned char *@var{p})
-``Round'' @var{p} to the next character boundary. That is, if @var{p}
-points to the middle of the encoding of a Guile character, return a
-pointer to the first byte of the encoding of the next character. If
-@var{p} points to the start of the encoding of a Guile character, return
-@var{p} unchanged.
-@end deftypefn
-
-Note that it is usually not friendly for functions to silently correct
-byte offsets that point into the middle of a character's encoding. Such
-offsets almost always indicate a programming error, and they should be
-reported as early as possible. So, when you write code which operates
-on multibyte text, you should not use functions like these to ``clean
-up'' byte offsets which the originator believes to be correct; instead,
-your code should signal a @code{text:not-char-boundary} error as soon as
-it detects an invalid offset. @xref{Multibyte Text Processing Errors}.
-
-
-@node Multibyte String Functions, Exchanging Guile Text With the Outside World in C, Finding Character Encoding Boundaries, Functions for Operating on Multibyte Text
-@subsection Multibyte String Functions
-
-These functions allow you to operate on multibyte strings: sequences of
-character encodings.
-
-@deftypefn {Libguile Function} int scm_mb_count (const unsigned char *@var{p}, int @var{len})
-Return the number of Guile characters encoded by the @var{len} bytes at
-@var{p}.
-
-If the sequence contains any invalid character encodings, or ends with
-an incomplete character encoding, signal a @code{text:bad-encoding}
-error.
-@end deftypefn
-
-@deftypefn {Libguile Macro} scm_char_t scm_mb_walk (unsigned char **@var{pp})
-Return the character whose encoding starts at @code{*@var{pp}}, and
-advance @code{*@var{pp}} to the start of the next character. Return -1
-if @code{*@var{pp}} does not point to a valid character encoding.
-@end deftypefn
-
-@deftypefn {Libguile Function} {const unsigned char *} scm_mb_prev (const unsigned char *@var{p})
-If @var{p} points to the middle of the encoding of a Guile character,
-return a pointer to the first byte of the encoding. If @var{p} points
-to the start of the encoding of a Guile character, return the start of
-the previous character's encoding.
-
-This is like @code{scm_mb_floor}, but the returned pointer will always
-be before @var{p}. If you use this function to drive an iteration, it
-guarantees backward progress.
-@end deftypefn
-
-@deftypefn {Libguile Function} {const unsigned char *} scm_mb_next (const unsigned char *@var{p})
-If @var{p} points to the encoding of a Guile character, return a pointer
-to the first byte of the encoding of the next character.
-
-This is like @code{scm_mb_ceiling}, but the returned pointer will always
-be after @var{p}. If you use this function to drive an iteration, it
-guarantees forward progress.
-@end deftypefn
-
-@deftypefn {Libguile Function} {const unsigned char *} scm_mb_index (const unsigned char *@var{p}, int @var{len}, int @var{i})
-Assuming that the @var{len} bytes starting at @var{p} are a
-concatenation of valid character encodings, return a pointer to the
-start of the @var{i}'th character encoding in the sequence.
-
-This function scans the sequence from the beginning to find the
-@var{i}'th character, and will generally require time proportional to
-the distance from @var{p} to the returned address.
-
-If the sequence contains any invalid character encodings, or ends with
-an incomplete character encoding, signal a @code{text:bad-encoding}
-error.
-@end deftypefn
-
-It is common to process the characters in a string from left to right.
-However, if you fetch each character using @code{scm_mb_index}, each
-call will scan the text from the beginning, so your loop will require
-time proportional to at least the square of the length of the text. To
-avoid this poor performance, you can use an @code{scm_mb_cache}
-structure and the @code{scm_mb_index_cached} macro.
-
-@deftp {Libguile Type} {struct scm_mb_cache}
-This structure holds information that allows a string scanning operation
-to use the results from a previous scan of the string. It has the
-following members:
-@table @code
-
-@item character
-An index, in characters, into the string.
-
-@item byte
-The index, in bytes, of the start of that character.
-
-@end table
-
-In other words, @code{byte} is the byte offset of the
-@code{character}'th character of the string. Note that if @code{byte}
-and @code{character} are equal, then all characters before that point
-must have encodings exactly one byte long, and the string can be indexed
-normally.
-
-All elements of a @code{struct scm_mb_cache} structure should be
-initialized to zero before its first use, and whenever the string's text
-changes.
-@end deftp
-
-@deftypefn {Libguile Macro} const unsigned char *scm_mb_index_cached (const unsigned char *@var{p}, int @var{len}, int @var{i}, struct scm_mb_cache *@var{cache})
-@deftypefnx {Libguile Function} const unsigned char *scm_mb_index_cached_func (const unsigned char *@var{p}, int @var{len}, int @var{i}, struct scm_mb_cache *@var{cache})
-This macro and this function are identical to @code{scm_mb_index},
-except that they may consult and update *@var{cache} in order to avoid
-scanning the string from the beginning. @code{scm_mb_index_cached} is a
-macro, so it may have less overhead than
-@code{scm_mb_index_cached_func}, but it may evaluate its arguments more
-than once.
-
-Using @code{scm_mb_index_cached} or @code{scm_mb_index_cached_func}, you
-can scan a string from left to right, or from right to left, in time
-proportional to the length of the string. As long as each character
-fetched is less than some constant distance before or after the previous
-character fetched with @var{cache}, each access will require constant
-time.
-@end deftypefn
-
-Guile also provides functions to convert between an encoded sequence of
-characters, and an array of @code{scm_char_t} objects.
-
-@deftypefn {Libguile Function} scm_char_t *scm_mb_multibyte_to_fixed (const unsigned char *@var{p}, int @var{len}, int *@var{result_len})
-Convert the variable-width text in the @var{len} bytes at @var{p}
-to an array of @code{scm_char_t} values. Return a pointer to the array,
-and set @code{*@var{result_len}} to the number of elements it contains.
-The returned array is allocated with @code{malloc}, and it is the
-caller's responsibility to free it.
-
-If the text is not a sequence of valid character encodings, this
-function will signal a @code{text:bad-encoding} error.
-@end deftypefn
-
-@deftypefn {Libguile Function} unsigned char *scm_mb_fixed_to_multibyte (const scm_char_t *@var{fixed}, int @var{len}, int *@var{result_len})
-Convert the array of @code{scm_char_t} values to a sequence of
-variable-width character encodings. Return a pointer to the array of
-bytes, and set @code{*@var{result_len}} to its length, in bytes.
-
-The returned byte sequence is terminated with a zero byte, which is not
-counted in the length returned in @code{*@var{result_len}}.
-
-The returned byte sequence is allocated with @code{malloc}; it is the
-caller's responsibility to free it.
-
-If the text is not a sequence of valid character encodings, this
-function will signal a @code{text:bad-encoding} error.
-@end deftypefn
-
-
-@node Exchanging Guile Text With the Outside World in C, Implementing Your Own Text Conversions, Multibyte String Functions, Functions for Operating on Multibyte Text
-@subsection Exchanging Guile Text With the Outside World in C
-
-[[This is kind of a heavy-weight model, given that one end of the
-conversion is always going to be the Guile encoding. Any way to shorten
-things a bit?]]
-
-Guile provides functions for converting between Guile's internal text
-representation and encodings popular in the outside world. These
-functions are closely modeled after the @code{iconv} functions available
-on some systems.
-
-To convert text between two encodings, you should first call
-@code{scm_mb_iconv_open} to indicate the source and destination
-encodings; this function returns a context object which records the
-conversion to perform.
-
-Then, you should call @code{scm_mb_iconv} to actually convert the text.
-This function expects input and output buffers, and a pointer to the
-context you got from @var{scm_mb_iconv_open}. You don't need to pass
-all your input to @code{scm_mb_iconv} at once; you can invoke it on
-successive blocks of input (as you read it from a file, say), and it
-will convert as much as it can each time, indicating when you should
-grow your output buffer.
-
-An encoding may be @dfn{stateless}, or @dfn{stateful}. In most
-encodings, a contiguous group of bytes from the sequence completely
-specifies a particular character; these are stateless encodings.
-However, some encodings require you to look back an unbounded number of
-bytes in the stream to assign a meaning to a particular byte sequence;
-such encodings are stateful.
-
-For example, in the @samp{ISO-2022-JP} encoding for Japanese text, the
-byte sequence @samp{27 36 66} indicates that subsequent bytes should be
-taken in pairs and interpreted as characters from the JIS-0208 character
-set. An arbitrary number of byte pairs may follow this sequence. The
-byte sequence @samp{27 40 66} indicates that subsequent bytes should be
-interpreted as @sc{ASCII}. In this encoding, you cannot tell whether a
-given byte is an @sc{ASCII} character without looking back an arbitrary
-distance for the most recent escape sequence, so it is a stateful
-encoding.
-
-In Guile, if a conversion involves a stateful encoding, the context
-object carries any necessary state. Thus, you can have many independent
-conversions to or from stateful encodings taking place simultaneously,
-as long as each data stream uses its own context object for the
-conversion.
-
-@deftp {Libguile Type} {struct scm_mb_iconv}
-This is the type for context objects, which represent the encodings and
-current state of an ongoing text conversion. A @code{struct
-scm_mb_iconv} records the source and destination encodings, and keeps
-track of any information needed to handle stateful encodings.
-@end deftp
-
-@deftypefn {Libguile Function} {struct scm_mb_iconv *} scm_mb_iconv_open (const char *@var{tocode}, const char *@var{fromcode})
-Return a pointer to a new @code{struct scm_mb_iconv} context object,
-ready to convert from the encoding named @var{fromcode} to the encoding
-named @var{tocode}. For stateful encodings, the context object is in
-some appropriate initial state, ready for use with the
-@code{scm_mb_iconv} function.
-
-When you are done using a context object, you may call
-@code{scm_mb_iconv_close} to free it.
-
-If either @var{tocode} or @var{fromcode} is not the name of a known
-encoding, this function will signal the @code{text:unknown-conversion}
-error, described below.
-
-@c Try to use names here from the IANA list:
-@c see ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets
-Guile supports at least these encodings:
-@table @samp
-
-@item US-ASCII
-@sc{US-ASCII}, in the standard one-character-per-byte encoding.
-
-@item ISO-8859-1
-The usual character set for Western European languages, in its usual
-one-character-per-byte encoding.
-
-@item Guile-MB
-Guile's current internal multibyte encoding. The actual encoding this
-name refers to will change from one version of Guile to the next. You
-should use this when converting data between external sources and the
-encoding used by Guile objects.
-
-You should @emph{not} use this as the encoding for data presented to the
-outside world, for two reasons. 1) Its meaning will change over time,
-so data written using the @samp{guile} encoding with one version of
-Guile might not be readable with the @samp{guile} encoding in another
-version of Guile. 2) It currently corresponds to @samp{Emacs-Mule},
-which invented for Emacs's internal use, and was never intended to serve
-as an exchange medium.
-
-@item Guile-Wide
-Guile's character set, as an array of @code{scm_char_t} values.
-
-Note that this encoding is even less suitable for public use than
-@samp{Guile}, since the exact sequence of bytes depends heavily on the
-size and endianness the host system uses for @code{scm_char_t}. Using
-this encoding is very much like calling the
-@code{scm_mb_multibyte_to_fixed} or @code{scm_mb_fixed_to_multibyte}
-functions, except that @code{scm_mb_iconv} gives you more control over
-buffer allocation and management.
-
-@item Emacs-Mule
-This is the variable-length encoding for multi-lingual text by GNU
-Emacs, at least through version 20.4. You probably should not use this
-encoding, as it is designed only for Emacs's internal use. However, we
-provide it here because it's trivial to support, and some people
-probably do have @samp{emacs-mule}-format files lying around.
-
-@end table
-
-(At the moment, this list doesn't include any character sets suitable for
-external use that can actually handle multilingual data; this is
-unfortunate, as it encourages users to write data in Emacs-Mule format,
-which nobody but Emacs and Guile understands. We hope to add support
-for Unicode in UTF-8 soon, which should solve this problem.)
-
-Case is not significant in encoding names.
-
-You can define your own conversions; see @ref{Implementing Your Own Text
-Conversions}.
-@end deftypefn
-
-@deftypefn {Libguile Function} int scm_mb_have_encoding (const char *@var{encoding})
-Return a non-zero value if Guile supports the encoding named @var{encoding}[[]]
-@end deftypefn
-
-@deftypefn {Libguile Function} size_t scm_mb_iconv (struct scm_mb_iconv *@var{context}, const char **@var{inbuf}, size_t *@var{inbytesleft}, char **@var{outbuf}, size_t *@var{outbytesleft})
-Convert a sequence of characters from one encoding to another. The
-argument @var{context} specifies the encodings to use for the input and
-output, and carries state for stateful encodings; use
-@code{scm_mb_iconv_open} to create a @var{context} object for a
-particular conversion.
-
-Upon entry to the function, @code{*@var{inbuf}} should point to the
-input buffer, and @code{*@var{inbytesleft}} should hold the number of
-input bytes present in the buffer; @code{*@var{outbuf}} should point to
-the output buffer, and @code{*@var{outbytesleft}} should hold the number
-of bytes available to hold the conversion results in that buffer.
-
-Upon exit from the function, @code{*@var{inbuf}} points to the first
-unconsumed byte of input, and @code{*@var{inbytesleft}} holds the number
-of unconsumed input bytes; @code{*@var{outbuf}} points to the byte after
-the last output byte, and @code{*@var{outbyteleft}} holds the number of
-bytes left unused in the output buffer.
-
-For stateful encodings, @var{context} carries encoding state from one
-call to @code{scm_mb_iconv} to the next. Thus, successive calls to
-@var{scm_mb_iconv} which use the same context object can convert a
-stream of data one chunk at a time.
-
-If @var{inbuf} is zero or @code{*@var{inbuf}} is zero, then the call is
-taken as a request to reset the states of the input and the output
-encodings. If @var{outbuf} is non-zero and @code{*@var{outbuf}} is
-non-zero, then @code{scm_mb_iconv} stores a byte sequence in the output
-buffer to put the output encoding in its initial state. If the output
-buffer is not large enough to hold this byte sequence,
-@code{scm_mb_iconv} returns @code{scm_mb_iconv_too_big}, and leaves
-the shift states of @var{context}'s input and output encodings
-unchanged.
-
-The @code{scm_mb_iconv} function always consumes only complete
-characters or shift sequences from the input buffer, and the output
-buffer always contains a sequence of complete characters or escape
-sequences.
-
-If the input sequence contains characters which are not expressible in
-the output encoding, @code{scm_mb_iconv} converts it in an
-implementation-defined way. It may simply delete the character.
-
-Some encodings use byte sequences which do not correspond to any textual
-character. For example, the escape sequence of a stateful encoding has
-no textual meaning. When converting from such an encoding, a call to
-@code{scm_mb_iconv} might consume input but produce no output, since the
-input sequence might contain only escape sequences.
-
-Normally, @code{scm_mb_iconv} returns the number of input characters it
-could not convert perfectly to the ouput encoding. However, it may
-return one of the @code{scm_mb_iconv_} codes described below, to
-indicate an error. All of these codes are negative values.
-
-If the input sequence contains an invalid character encoding, conversion
-stops before the invalid input character, and @code{scm_mb_iconv}
-returns the constant value @code{scm_mb_iconv_bad_encoding}.
-
-If the input sequence ends with an incomplete character encoding,
-@code{scm_mb_iconv} will leave it in the input buffer, unconsumed, and
-return the constant value @code{scm_mb_iconv_incomplete_encoding}. This
-is not necessarily an error, if you expect to call @code{scm_mb_iconv}
-again with more data which might contain the rest of the encoding
-fragment.
-
-If the output buffer does not contain enough room to hold the converted
-form of the complete input text, @code{scm_mb_iconv} converts as much as
-it can, changes the input and output pointers to reflect the amount of
-text successfully converted, and then returns
-@code{scm_mb_iconv_too_big}.
-@end deftypefn
-
-Here are the status codes that might be returned by @code{scm_mb_iconv}.
-They are all negative integers.
-@table @code
-
-@item scm_mb_iconv_too_big
-The conversion needs more room in the output buffer. Some characters
-may have been consumed from the input buffer, and some characters may
-have been placed in the available space in the output buffer.
-
-@item scm_mb_iconv_bad_encoding
-@code{scm_mb_iconv} encountered an invalid character encoding in the
-input buffer. Conversion stopped before the invalid character, so there
-may be some characters consumed from the input buffer, and some
-converted text in the output buffer.
-
-@item scm_mb_iconv_incomplete_encoding
-The input buffer ends with an incomplete character encoding. The
-incomplete encoding is left in the input buffer, unconsumed. This is
-not necessarily an error, if you expect to call @code{scm_mb_iconv}
-again with more data which might contain the rest of the incomplete
-encoding.
-
-@end table
-
-
-Finally, Guile provides a function for destroying conversion contexts.
-
-@deftypefn {Libguile Function} void scm_mb_iconv_close (struct scm_mb_iconv *@var{context})
-Deallocate the conversion context object @var{context}, and all other
-resources allocated by the call to @code{scm_mb_iconv_open} which
-returned @var{context}.
-@end deftypefn
-
-
-@node Implementing Your Own Text Conversions, , Exchanging Guile Text With the Outside World in C, Functions for Operating on Multibyte Text
-@subsection Implementing Your Own Text Conversions
-
-[[note that conversions to and from Guile must produce streams
-containing only valid character encodings, or else Guile will crash]]
-
-This section describes the interface for adding your own encoding
-conversions for use with @code{scm_mb_iconv}. The interface here is
-borrowed from the GNOME Project's @file{libunicode} library.
-
-Guile's @code{scm_mb_iconv} function works by converting the input text
-to a stream of @code{scm_char_t} characters, and then converting
-those characters to the desired output encoding. This makes it easy
-for Guile to choose the appropriate conversion back ends for an
-arbitrary pair of input and output encodings, but it also means that the
-accuracy and quality of the conversions depends on the fidelity of
-Guile's internal character set to the source and destination encodings.
-Since @code{scm_mb_iconv} will be used almost exclusively for converting
-to and from Guile's internal character set, this shouldn't be a problem.
-
-To add support for a particular encoding to Guile, you must provide one
-function (called the @dfn{read} function) which converts from your
-encoding to an array of @code{scm_char_t}'s, and another function
-(called the @dfn{write} function) to convert from an array of
-@code{scm_char_t}'s back into your encoding. To convert from some
-encoding @var{a} to some other encoding @var{b}, Guile pairs up
-@var{a}'s read function with @var{b}'s write function. Each call to
-@code{scm_mb_iconv} passes text in encoding @var{a} through the read
-function, to produce an array of @code{scm_char_t}'s, and then passes
-that array to the write function, to produce text in encoding @var{b}.
-
-For stateful encodings, a read or write function can hang its own data
-structures off the conversion object, and provide its own functions to
-allocate and destroy them; this allows read and write functions to
-maintain whatever state they like.
-
-The Guile conversion back end represents each available encoding with a
-@code{struct scm_mb_encoding} object.
-
-@deftp {Libguile Type} {struct scm_mb_encoding}
-This data structure describes an encoding. It has the following
-members:
-
-@table @code
-
-@item char **names
-An array of strings, giving the various names for this encoding. The
-array should be terminated by a zero pointer. Case is not significant
-in encoding names.
-
-The @code{scm_mb_iconv_open} function searches the list of registered
-encodings for an encoding whose @code{names} array matches its
-@var{tocode} or @var{fromcode} argument.
-
-@item int (*init) (void **@var{cookie})
-An initialization function for the encoding's private data.
-@code{scm_mb_iconv_open} will call this function, passing it the address
-of the cookie for this encoding in this context. (We explain cookies
-below.) There is no way for the @code{init} function to tell whether
-the encoding will be used for reading or writing.
-
-Note that @code{init} receives a @emph{pointer} to the cookie, not the
-cookie itself. Because the type of @var{cookie} is @code{void **}, the
-C compiler will not check it as carefully as it would other types.
-
-The @code{init} member may be zero, indicating that no initialization is
-necessary for this encoding.
-
-@item int (*destroy) (void **@var{cookie})
-A deallocation function for the encoding's private data.
-@code{scm_mb_iconv_close} calls this function, passing it the address of
-the cookie for this encoding in this context. The @code{destroy}
-function should free any data the @code{init} function allocated.
-
-Note that @code{destroy} receives a @emph{pointer} to the cookie, not the
-cookie itself. Because the type of @var{cookie} is @code{void **}, the
-C compiler will not check it as carefully as it would other types.
-
-The @code{destroy} member may be zero, indicating that this encoding
-doesn't need to perform any special action to destroy its local data.
-
-@item int (*reset) (void *@var{cookie}, char **@var{outbuf}, size_t *@var{outbytesleft})
-Put the encoding into its initial shift state. Guile calls this
-function whether the encoding is being used for input or output, so this
-should take appropriate steps for both directions. If @var{outbuf} and
-@var{outbytesleft} are valid, the reset function should emit an escape
-sequence to reset the output stream to its initial state; @var{outbuf}
-and @var{outbytesleft} should be handled just as for
-@code{scm_mb_iconv}.
-
-This function can return an @code{scm_mb_iconv_} error code
-(@pxref{Exchanging Guile Text With the Outside World in C}). If it
-returns @code{scm_mb_iconv_too_big}, then the output buffer's shift
-state must be left unchanged.
-
-Note that @code{reset} receives the cookie's value itself, not a pointer
-to the cookie, as the @code{init} and @code{destroy} functions do.
-
-The @code{reset} member may be zero, indicating that this encoding
-doesn't use a shift state.
-
-@item enum scm_mb_read_result (*read) (void *@var{cookie}, const char **@var{inbuf}, size_t *@var{inbytesleft}, scm_char_t **@var{outbuf}, size_t *@var{outcharsleft})
-Read some bytes and convert into an array of Guile characters. This is
-the encoding's read function.
-
-On entry, there are *@var{inbytesleft} bytes of text at *@var{inbuf} to
-be converted, and *@var{outcharsleft} characters available at
-*@var{outbuf} to hold the results.
-
-On exit, *@var{inbytesleft} and *@var{inbuf} indicate the input bytes
-still not consumed. *@var{outcharsleft} and *@var{outbuf} indicate the
-output buffer space still not filled. (By exclusion, these indicate
-which input bytes were consumed, and which output characters were
-produced.)
-
-Return one of the @code{enum scm_mb_read_result} values, described below.
-
-Note that @code{read} receives the cookie's value itself, not a pointer
-to the cookie, as the @code{init} and @code{destroy} functions do.
-
-@item enum scm_mb_write_result (*write) (void *@var{cookie}, scm_char_t **@var{inbuf}, size_t *@var{incharsleft}, **@var{outbuf}, size_t *@var{outbytesleft})
-Convert an array of Guile characters to output bytes. This is
-the encoding's write function.
-
-On entry, there are *@var{incharsleft} Guile characters available at
-*@var{inbuf}, and *@var{outbytesleft} bytes available to store output at
-*@var{outbuf}.
-
-On exit, *@var{incharsleft} and *@var{inbuf} indicate the number of
-Guile characters left unconverted (because there was insufficient room
-in the output buffer to hold their converted forms), and
-*@var{outbytesleft} and *@var{outbuf} indicate the unused portion of the
-output buffer.
-
-Return one of the @code{scm_mb_write_result} values, described below.
-
-Note that @code{write} receives the cookie's value itself, not a pointer
-to the cookie, as the @code{init} and @code{destroy} functions do.
-
-@item struct scm_mb_encoding *next
-This is used by Guile to maintain a linked list of encodings. It is
-filled in when you call @code{scm_mb_register_encoding} to add your
-encoding to the list.
-
-@end table
-@end deftp
-
-Here is the enumerated type for the values an encoding's read function
-can return:
-
-@deftp {Libguile Type} {enum scm_mb_read_result}
-This type represents the result of a call to an encoding's read
-function. It has the following values:
-
-@table @code
-
-@item scm_mb_read_ok
-The read function consumed at least one byte of input.
-
-@item scm_mb_read_incomplete
-The data present in the input buffer does not contain a complete
-character encoding. No input was consumed, and no characters were
-produced as output. This is not necessarily an error status, if there
-is more data to pass through.
-
-@item scm_mb_read_error
-The input contains an invalid character encoding.
-
-@end table
-@end deftp
-
-Here is the enumerated type for the values an encoding's write function
-can return:
-
-@deftp {Libguile Type} {enum scm_mb_write_result}
-This type represents the result of a call to an encoding's write
-function. It has the following values:
-
-@table @code
-
-@item scm_mb_write_ok
-The write function was able to convert all the characters in @var{inbuf}
-successfully.
-
-@item scm_mb_write_too_big
-The write function filled the output buffer, but there are still
-characters in @var{inbuf} left unconsumed; @var{inbuf} and
-@var{incharsleft} indicate the unconsumed portion of the input buffer.
-
-@end table
-@end deftp
-
-
-Conversions to or from stateful encodings need to keep track of each
-encoding's current state. Each conversion context contains two
-@code{void *} variables called @dfn{cookies}, one for the input
-encoding, and one for the output encoding. These cookies are passed to
-the encodings' functions, for them to use however they please. A
-stateful encoding can use its cookie to hold a pointer to some object
-which maintains the context's current shift state. Stateless encodings
-will probably not use their cookies.
-
-The cookies' lifetime is the same as that of the context object. When
-the user calls @code{scm_mb_iconv_close} to destroy a context object,
-@code{scm_mb_iconv_close} calls the input and output encodings'
-@code{destroy} functions, passing them their respective cookies, so each
-encoding can free any data it allocated for that context.
-
-Note that, if a read or write function returns a successful result code
-like @code{scm_mb_read_ok} or @code{scm_mb_write_ok}, then the remaining
-input, together with the output, must together represent the complete
-input text; the encoding may not store any text temporarily in its
-cookie. This is because, if @code{scm_mb_iconv} returns a successful
-result to the user, it is correct for the user to assume that all the
-consumed input has been converted and placed in the output buffer.
-There is no ``flush'' operation to push any final results out of the
-encodings' buffers.
-
-Here is the function you call to register a new encoding with the
-conversion system:
-
-@deftypefn {Libguile Function} void scm_mb_register_encoding (struct scm_mb_encoding *@var{encoding})
-Add the encoding described by @code{*@var{encoding}} to the set
-understood by @code{scm_mb_iconv_open}. Once you have registered your
-encoding, you can use it by calling @code{scm_mb_iconv_open} with one of
-the names in @code{@var{encoding}->names}.
-@end deftypefn
-
-
-@node Multibyte Text Processing Errors, Why Guile Does Not Use a Fixed-Width Encoding, Functions for Operating on Multibyte Text, Working With Multibyte Strings in C
-@section Multibyte Text Processing Errors
-
-This section describes error conditions which code can signal to
-indicate problems encountered while processing multibyte text. In each
-case, the arguments @var{message} and @var{args} are an error format
-string and arguments to be substituted into the string, as accepted by
-the @code{display-error} function.
-
-@deffn Condition text:not-char-boundary func message args object offset
-By calling @var{func}, the program attempted to access a character at
-byte offset @var{offset} in the Guile object @var{object}, but
-@var{offset} is not the start of a character's encoding in @var{object}.
-
-Typically, @var{object} is a string or symbol. If the function signalling
-the error cannot find the Guile object that contains the text it is
-inspecting, it should use @code{#f} for @var{object}.
-@end deffn
-
-@deffn Condition text:bad-encoding func message args object
-By calling @var{func}, the program attempted to interpret the text in
-@var{object}, but @var{object} contains a byte sequence which is not a
-valid encoding for any character.
-@end deffn
-
-@deffn Condition text:not-guile-char func message args number
-By calling @var{func}, the program attempted to treat @var{number} as the
-number of a character in the Guile character set, but @var{number} does
-not correspond to any character in the Guile character set.
-@end deffn
-
-@deffn Condition text:unknown-conversion func message args from to
-By calling @var{func}, the program attempted to convert from an encoding
-named @var{from} to an encoding named @var{to}, but Guile does not
-support such a conversion.
-@end deffn
-
-@deftypevr {Libguile Variable} SCM scm_text_not_char_boundary
-@deftypevrx {Libguile Variable} SCM scm_text_bad_encoding
-@deftypevrx {Libguile Variable} SCM scm_text_not_guile_char
-These variables hold the scheme symbol objects whose names are the
-condition symbols above. You can use these when signalling these
-errors, instead of looking them up yourself.
-@end deftypevr
-
-
-@node Why Guile Does Not Use a Fixed-Width Encoding, , Multibyte Text Processing Errors, Working With Multibyte Strings in C
-@section Why Guile Does Not Use a Fixed-Width Encoding
-
-Multibyte encodings are clumsier to work with than encodings which use a
-fixed number of bytes for every character. For example, using a
-fixed-width encoding, we can extract the @var{i}th character of a string
-in constant time, and we can always substitute the @var{i}th character
-of a string with any other character without reallocating or copying the
-string.
-
-However, there are no fixed-width encodings which include the characters
-we wish to include, and also fit in a reasonable amount of space.
-Despite the Unicode standard's claims to the contrary, Unicode is not
-really a fixed-width encoding. Unicode uses surrogate pairs to
-represent characters outside the 16-bit range; a surrogate pair must be
-treated as a single character, but occupies two 16-bit spaces. As of
-this writing, there are already plans to assign characters to the
-surrogate character codes. Three- and four-byte encodings are
-too wasteful for a majority of Guile's users, who only need @sc{ASCII}
-and a few accented characters.
-
-Another alternative would be to have several different fixed-width
-string representations, each with a different element size. For each
-string, Guile would use the smallest element size capable of
-accomodating the string's text. This would allow users of English and
-the Western European languages to use the traditional memory-efficient
-encodings. However, if Guile has @var{n} string representations, then
-users must write @var{n} versions of any code which manipulates text
-directly --- one for each element size. And if a user wants to operate
-on two strings simultaneously, and wants to avoid testing the string
-sizes within the loop, she must make @var{n}*@var{n} copies of the loop.
-Most users will simply not bother. Instead, they will write code which
-supports only one string size, leaving us back where we started. By
-using a single internal representation, Guile makes it easier for users
-to write multilingual code.
-
-[[What about tagging each string with its encoding?
-"Every extension must be written to deal with every encoding"]]
-
-[[You don't really want to index strings anyway.]]
-
-Finally, Guile's multibyte encoding is not so bad. Unlike a two- or
-four-byte encoding, it is efficient in space for American and European
-users. Furthermore, the properties described above mean that many
-functions can be coded just as they would for a single-byte encoding;
-see @ref{Promised Properties of the Guile Multibyte Encoding}.
-
-@bye
diff --git a/doc/mltext.texi b/doc/mltext.texi
deleted file mode 100644
index 73071f501..000000000
--- a/doc/mltext.texi
+++ /dev/null
@@ -1,146 +0,0 @@
-@node Working with Multilingual Text
-@chapter Working with Multilingual Text
-
-@node Guile Character Properties, Exchanging Text With The Outside World, Multibyte String Functions, Functions for Operating on Multibyte Text
-@section Guile Character Properties
-
-These functions give information about the nature of a given Guile
-character. These are defined for any @code{scm_mb_char_t} value.
-
-@deftypefn {Libguile Function} int scm_mb_isalnum (scm_mb_char_t @var{c})
-Return non-zero iff @var{c} is an alphabetic or numeric character.
-@end deftypefn
-
-@deftypefn {Libguile Function} int scm_mb_is_alpha (scm_mb_char_t @var{c})
-Return non-zero iff @var{c} is an alphabetic character.
-@end deftypefn
-
-@deftypefn {Libguile Function} int scm_mb_iscntrl (scm_mb_char_t @var{c})
-Return non-zero iff @var{c} is a control character.
-@end deftypefn
-
-@deftypefn {Libguile Function} int scm_mb_isdigit (scm_mb_char_t @var{c})
-Return non-zero iff @var{c} is a digit.
-@end deftypefn
-
-@deftypefn {Libguile Function} int scm_mb_isgraph (scm_mb_char_t @var{c})
-Return non-zero iff @var{c} is a visible character.
-@end deftypefn
-
-@deftypefn {Libguile Function} int scm_mb_isupper (scm_mb_char_t @var{c})
-Return non-zero iff @var{c} is an upper-case character.
-@end deftypefn
-
-@deftypefn {Libguile Function} int scm_mb_islower (scm_mb_char_t @var{c})
-Return non-zero iff @var{c} is a lower-case character.
-@end deftypefn
-
-@deftypefn {Libguile Function} int scm_mb_istitle (scm_mb_char_t @var{c})
-Return non-zero iff @var{c} is a title-case character. See the Unicode
-standard for an explanation of title case.
-@end deftypefn
-
-@deftypefn {Libguile Function} int scm_mb_isprint (scm_mb_char_t @var{c})
-Return non-zero iff @var{c} is a printable character.
-@end deftypefn
-
-@deftypefn {Libguile Function} int scm_mb_ispunct (scm_mb_char_t @var{c})
-Return non-zero iff @var{c} is a punctuation character.
-@end deftypefn
-
-@deftypefn {Libguile Function} int scm_mb_isspace (scm_mb_char_t @var{c})
-Return non-zero iff @var{c} is a whitespace character.
-@end deftypefn
-
-@deftypefn {Libguile Function} int scm_mb_isxdigit (scm_mb_char_t @var{c})
-Return non-zero iff @var{c} is a hexadecimal digit.
-@end deftypefn
-
-@deftypefn {Libguile Function} int scm_mb_isdefined (scm_mb_char_t @var{c})
-Return non-zero iff @var{c} is a valid character.
-@end deftypefn
-
-@deftypefn {Libguile Function} scm_mb_char_t scm_mb_char_toupper (scm_mb_char_t @var{c})
-@deftypefnx {Libguile Function} scm_mb_char_t scm_mb_char_tolower (scm_mb_char_t @var{c})
-@deftypefnx {Libguile Function} scm_mb_char_t scm_mb_char_totitle (scm_mb_char_t @var{c})
-Convert @var{c} to upper, lower, or title case. If @var{c} has no
-equivalent in the requested case, or is already in that case, return it
-unchanged.
-@end deftypefn
-
-@deftypefn {Libguile Function} in scm_mb_digit_value (scm_mb_char_t @var{c})
-If @var{c} is a hexadecimal digit (according to
-@code{scm_mb_isxdigit}), then return its numeric value. Otherwise
-return -1.
-@end deftypefn
-
-@deftypefn {Libguile Function} in scm_mb_digit_value (scm_mb_char_t @var{c})
-If @var{c} is a digit (according to @code{scm_mb_isdigit}), then
-return its numeric value. Otherwise return -1.
-@end deftypefn
-
-
-@node Multibyte Character Tables, Multibyte Character Categories, Exchanging Text With The Outside World, Functions for Operating on Multibyte Text
-@section Multibyte Character Tables
-
-A @dfn{character table} is a table mapping @code{scm_mb_char_t} values
-onto Guile objects. Guile provides functions for creating character
-tables, setting entries, and looking up characters. Character tables
-are Guile objects, so they are managed by Guile's garbage collector.
-
-A character table can have a ``parent'' table, from which it inherits
-values for characters. If a character table @var{child}, with a parent
-table @var{parent} maps some character @var{c} to the value
-@code{SCM_UNDEFINED}, then @code{scm_c_char_table_ref (@var{child},
-@var{c})} will look up @var{c} in @var{parent}, and return the value it
-finds there.
-
-This section describes only the C API for working with character tables.
-For the Scheme-level API, see @ref{some other section}.
-
-@deftypefn {Libguile Function} scm_make_char_table (SCM @var{init}, SCM @var{parent})
-Return a new character table object which maps every character to
-@var{init}. If @var{parent} is a character table, then @var{parent} is
-the new table's parent. If @var{parent} table is @code{SCM_UNDEFINED},
-then the new table has no parent. Otherwise, signal a type error.
-@end deffn
-
-@deftypefn {Libguile Function} SCM scm_c_char_table_ref (SCM @var{table}, scm_mb_char_t @var{c})
-Look up the character @var{c} in the character table @var{table}, and
-return the value found there. If @var{table} maps @var{c} to
-@code{SCM_UNDEFINED}, and @var{table} has a parent, then look up @var{c}
-in the parent.
-
-If @var{table} is not a character table, signal an error.
-@end deftypefn
-
-@deftypefn {Libguile Function} SCM scm_c_char_table_set_x (SCM @var{table}, scm_mb_char_t @var{c}, SCM @var{value})
-Set @var{table}'s value for the character @var{c} to @var{value}.
-If @var{value} is @code{SCM_UNDEFINED}, then @var{table}'s parent's
-value will show through for @var{c}.
-
-If @var{table} is not a character table, signal an error.
-
-This function changes only @var{table} itself, never @var{table}'s
-parent.
-@end deftypefn
-
-[[this is all wrong. what about default values?]]
-
-
-
-
-
-@node Multibyte Character Categories, , Multibyte Character Tables, Functions for Operating on Multibyte Text
-@section Multibyte Character Categories
-
-[[This will describe an ADT representing subsets of the Guile character
-set.]]
-
-
-
-
-@node Exchanging Guile Text With the Outside World
-@subsection Exchanging Guile Text With the Outside World
-
-[[Scheme-level functions for converting between encodings]]
diff --git a/doc/oldfmt.c b/doc/oldfmt.c
deleted file mode 100644
index 19fbffcc5..000000000
--- a/doc/oldfmt.c
+++ /dev/null
@@ -1,218 +0,0 @@
-/* Copyright (C) 2000,2001 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, 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 GUILE.
- *
- * The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
- * code from other Free Software Foundation releases into a copy of
- * GUILE, 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 GUILE, it is your choice
- * whether to permit this exception to apply to your modifications.
- * If you do not wish that, delete this exception notice.
- */
-
-
-
-/* From NEWS:
- *
- * * New primitive: `simple-format', affects `scm-error', scm_display_error, & scm_error message strings
- *
- * (ice-9 boot) makes `format' an alias for `simple-format' until possibly
- * extended by the more sophisticated version in (ice-9 format)
- *
- * (simple-format port message . args)
- * Write MESSAGE to DESTINATION, defaulting to `current-output-port'.
- * MESSAGE can contain ~A (was %s) and ~S (was %S) escapes. When printed,
- * the escapes are replaced with corresponding members of ARGS:
- * ~A formats using `display' and ~S formats using `write'.
- * If DESTINATION is #t, then use the `current-output-port',
- * if DESTINATION is #f, then return a string containing the formatted text.
- * Does not add a trailing newline."
- *
- * The two C procedures: scm_display_error and scm_error, as well as the
- * primitive `scm-error', now use scm_format to do their work. This means
- * that the message strings of all code must be updated to use ~A where %s
- * was used before, and ~S where %S was used before.
- *
- * During the period when there still are a lot of old Guiles out there,
- * you might want to support both old and new versions of Guile.
- *
- * There are basically two methods to achieve this. Both methods use
- * autoconf. Put
- *
- * AC_CHECK_FUNCS(scm_simple_format)
- *
- * in your configure.in.
- *
- * Method 1: Use the string concatenation features of ANSI C's
- * preprocessor.
- *
- * In C:
- *
- * #ifdef HAVE_SCM_SIMPLE_FORMAT
- * #define FMT_S "~S"
- * #else
- * #define FMT_S "%S"
- * #endif
- *
- * Then represent each of your error messages using a preprocessor macro:
- *
- * #define E_SPIDER_ERROR "There's a spider in your " ## FMT_S ## "!!!"
- *
- * In Scheme:
- *
- * (define fmt-s (if (defined? 'simple-format) "~S" "%S"))
- * (define make-message string-append)
- *
- * (define e-spider-error
- * (make-message "There's a spider in your " fmt-s "!!!"))
- *
- * Method 2: Use the oldfmt function found in doc/oldfmt.c.
- *
- * In C:
- *
- * scm_misc_error ("picnic", scm_c_oldfmt0 ("There's a spider in your ~S!!!"),
- * ...);
- *
- * In Scheme:
- *
- * (scm-error 'misc-error "picnic" (oldfmt "There's a spider in your ~S!!!")
- * ...)
- *
- */
-
-/*
- * Take a format string FROM adhering to the new standard format (~A and ~S
- * as placeholders) of length N and return a string which is adapted
- * to the format used by the Guile interpreter which you are running.
- *
- * On successive calls with similar strings but different storage, the
- * same string with same storage is returned. This is necessary since
- * the existence of a garbage collector in the system may cause the same
- * format string to be represented with different storage at different
- * calls.
- */
-
-char *
-scm_c_oldfmt (char *from, int n)
-{
-#ifdef HAVE_SCM_SIMPLE_FORMAT
- return from;
-#else
- static struct { int n; char *from; char *to; } *strings;
- static int size = 0;
- static int n_strings = 0;
- char *to;
- int i;
-
- for (i = 0; i < n_strings; ++i)
- if (n == strings[i].n && strncmp (from, strings[i].from, n) == 0)
- return strings[i].to;
-
- if (n_strings == size)
- {
- if (size == 0)
- {
- size = 10;
- strings = scm_must_malloc (size * sizeof (*strings), s_oldfmt);
- }
- else
- {
- int oldsize = size;
- size = 3 * oldsize / 2;
- strings = scm_must_realloc (strings,
- oldsize * sizeof (*strings),
- size * sizeof (*strings),
- s_oldfmt);
- }
- }
-
- strings[n_strings].n = n;
- strings[n_strings].from = strncpy (scm_must_malloc (n, s_oldfmt), from, n);
- to = strings[n_strings].to = scm_must_malloc (n + 1, s_oldfmt);
- n_strings++;
-
- for (i = 0; i < n; ++i)
- {
- if (from[i] == '~' && ++i < n)
- {
- if (from[i] == 'A')
- {
- to[i - 1] = '%';
- to[i] = 's';
- }
- else if (from[i] == 'S')
- {
- to[i - 1] = '%';
- to[i] = 'S';
- }
- else
- {
- to[i - 1] = '~';
- to[i] = from[i];
- }
- continue;
- }
- to[i] = from[i];
- }
- to[i] = '\0';
-
- return to;
-#endif
-}
-
-char *
-scm_c_oldfmt0 (char *s)
-{
-#ifdef HAVE_SCM_SIMPLE_FORMAT
- return s;
-#else
- return scm_c_oldfmt (s, strlen (s));
-#endif
-}
-
-SCM_PROC (s_oldfmt, "oldfmt", 1, 0, 0, scm_oldfmt);
-
-SCM
-scm_oldfmt (SCM s)
-{
-#ifdef HAVE_SCM_SIMPLE_FORMAT
- return s;
-#else
- int n;
- SCM_ASSERT (SCM_NIMP (s) && SCM_STRINGP (s), s, 1, s_oldfmt);
- n = SCM_LENGTH (s);
- return scm_return_first (scm_mem2string (scm_c_oldfmt (SCM_ROCHARS (s), n),
- n),
- s);
-#endif
-}
diff --git a/doc/r5rs/.cvsignore b/doc/r5rs/.cvsignore
deleted file mode 100644
index 407face4c..000000000
--- a/doc/r5rs/.cvsignore
+++ /dev/null
@@ -1,22 +0,0 @@
-Makefile
-Makefile.in
-stamp-vti
-stamp-vti.1
-*.log
-*.dvi
-*.aux
-*.toc
-*.cp
-*.fn
-*.vr
-*.tp
-*.ky
-*.pg
-*.pgs
-*.cps
-*.fns
-*.tps
-*.vrs
-*.ps
-*.info*
-*.html
diff --git a/doc/r5rs/ChangeLog b/doc/r5rs/ChangeLog
deleted file mode 100644
index 4b0973487..000000000
--- a/doc/r5rs/ChangeLog
+++ /dev/null
@@ -1,10 +0,0 @@
-2001-08-27 Neil Jerram <neil@ossau.uklinux.net>
-
- * Makefile.am (TEXINFO_TEX): Added; avoids shipping multiple copies of
- texinfo.tex in a single distribution.
-
-2001-08-27 Neil Jerram <neil@ossau.uklinux.net>
-
- The change log for files in this directory continues backwards
- from 2001-08-27 in ../ChangeLog, as all the Guile documentation
- prior to this date was contained in a single directory.
diff --git a/doc/r5rs/Makefile.am b/doc/r5rs/Makefile.am
deleted file mode 100644
index 2b3d40a67..000000000
--- a/doc/r5rs/Makefile.am
+++ /dev/null
@@ -1,26 +0,0 @@
-## Process this file with Automake to create Makefile.in
-##
-## Copyright (C) 1998 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-AUTOMAKE_OPTIONS = gnu
-
-info_TEXINFOS = r5rs.texi
-
-TEXINFO_TEX = ../ref/texinfo.tex
diff --git a/doc/r5rs/r5rs.texi b/doc/r5rs/r5rs.texi
deleted file mode 100644
index a33771190..000000000
--- a/doc/r5rs/r5rs.texi
+++ /dev/null
@@ -1,8538 +0,0 @@
-\input texinfo @c -*-texinfo-*-
-@c %**start of header
-@setfilename r5rs.info
-@settitle Revised(5) Scheme
-
-@c This copy of r5rs.texi differs from Aubrey Jaffer's master copy
-@c by a set of changes to allow the building of r5rs.dvi from r5rs.texi.
-@c Aubrey Jaffer's view - which I agree with - is that, given that
-@c people have the option of building r5rs.dvi from the original
-@c LaTeX distribution for R5RS, it is not worth fixing his master
-@c copy of r5rs.texi and the tool which autogenerates it. On the
-@c other hand, it is a marginal convenience for people to be able to
-@c build hardcopy from r5rs.texi, even if the results are less good
-@c than with the original LaTeX. Hence the following fixes.
-@c (lines 714, 725, 728, 1614, 2258): Remove invalid parentheses from
-@c @deffn statements.
-@c (line 2316): Change @deffnx to @deffn, and insert `@end deffn' to
-@c terminate preceding @deffn.
-@c (line 7320): Insert `@c ' at beginning of lines that are intended
-@c to be @ignore'd.
-@c
-@c NJ 2001/1/26
-
-@c \documentclass[twoside]{algol60}
-
-@c \pagestyle{headings}
-@c \showboxdepth=0
-
-
-
-@c \def\headertitle{Revised$^{5}$ Scheme}
-@c \def\integerversion{5}
-
-@c Sizes and dimensions
-
-@c \topmargin -.375in % Nominal distance from top of page to top of
-
-@c box containing running head.
-@c \headsep 15pt % Space between running head and text.
-
-@c \textheight 663pt % Height of text (including footnotes and figures,
-
-@c excluding running head and foot).
-
-@c \textwidth 523pt % Width of text line.
-@c \columnsep 15pt % Space between columns
-@c \columnseprule 0pt % Width of rule between columns.
-
-@c \parskip 5pt plus 2pt minus 2pt % Extra vertical space between paragraphs.
-@c \parindent 0pt % Width of paragraph indentation.
-@c \topsep 0pt plus 2pt % Extra vertical space, in addition to
-
-@c \parskip, added above and below list and
-
-@c paragraphing environments.
-
-@c \oddsidemargin -.5in % Left margin on odd-numbered pages.
-@c \evensidemargin -.5in % Left margin on even-numbered pages.
-
-@c % End of sizes and dimensions
-
-@paragraphindent 0
-@c %**end of header
-@c syncodeindex fn cp
-
-@ifinfo
-@dircategory The Algorithmic Language Scheme
-@direntry
-* R5RS: (r5rs). The Revised(5) Report on Scheme.
-@end direntry
-@end ifinfo
-
-
-@c \parindent 0pt %!! 15pt % Width of paragraph indentation.
-
- @b{20 February 1998}
-@c \hfil \today{}
-
-@c @include{first}
-@titlepage
-
-@c HTML first page
-@title Scheme
-@subtitle Revised(5) Report on the Algorithmic Language Scheme
-@c First page
-
-@c \thispagestyle{empty}
-
-@c \todo{"another" report?}
-
-
-@author R@sc{ICHARD} K@sc{ELSEY}, W@sc{ILLIAM} C@sc{LINGER, AND} J@sc{ONATHAN} R@sc{EES} (@i{Editors})
-@author H. A@sc{BELSON}
-@author R. K. D@sc{YBVIG}
-@author C. T. H@sc{AYNES}
-@author G. J. R@sc{OZAS}
-@author N. I. A@sc{DAMS IV}
-@author D. P. F@sc{RIEDMAN}
-@author E. K@sc{OHLBECKER}
-@author G. L. S@sc{TEELE} J@sc{R}.
-@author D. H. B@sc{ARTLEY}
-@author R. H@sc{ALSTEAD}
-@author D. O@sc{XLEY}
-@author G. J. S@sc{USSMAN}
-@author G. B@sc{ROOKS}
-@author C. H@sc{ANSON}
-@author K. M. P@sc{ITMAN}
-@author M. W@sc{AND}
-@author
-
-
-@c {\it Dedicated to the Memory of ALGOL 60}
-@i{Dedicated to the Memory of Robert Hieb}
-@c [For the macros in R5RS -RK]
-
-
-
-
-@unnumbered Summary
-
-
-The report gives a defining description of the programming language
-Scheme. Scheme is a statically scoped and properly tail-recursive
-dialect of the Lisp programming language invented by Guy Lewis
-Steele Jr.@: and Gerald Jay Sussman. It was designed to have an
-exceptionally clear and simple semantics and few different ways to
-form expressions. A wide variety of programming paradigms, including
-imperative, functional, and message passing styles, find convenient
-expression in Scheme.
-
-The introduction offers a brief history of the language and of
-the report.
-
-The first three chapters present the fundamental ideas of the
-language and describe the notational conventions used for describing the
-language and for writing programs in the language.
-
-Chapters @ref{Expressions} and @ref{Program structure} describe
-the syntax and semantics of expressions, programs, and definitions.
-
-Chapter @ref{Standard procedures} describes Scheme's built-in
-procedures, which include all of the language's data manipulation and
-input/output primitives.
-
-Chapter @ref{Formal syntax and semantics} provides a formal syntax for Scheme
-written in extended BNF, along with a formal denotational semantics.
-An example of the use of the language follows the formal syntax and
-semantics.
-
-The report concludes with a list of references and an
-alphabetic index.
-
-@ignore todo
-expand the summary so that it fills up the column.
-@end ignore
-
-
-@c \vfill
-@c \begin{center}
-@c {\large \bf
-@c *** DRAFT*** \\
-@c %August 31, 1989
-@c \today
-@c }\end{center}
-
-
-
-
-
-@c \addvspace{3.5pt} % don't shrink this gap
-@c \renewcommand{\tocshrink}{-3.5pt} % value determined experimentally
-
-
-
-
-
-
-@page
-
-@end titlepage
-
-@c INFO first page
-@ifinfo
-
-@c First page
-
-@c \thispagestyle{empty}
-
-@c \todo{"another" report?}
-
-
-@node top, Introduction, (dir), (dir)
-@top Revised(5) Report on the Algorithmic Language Scheme
-
-@sp 1
-
-
-@center @c begin-tabular
-@quotation
-@multitable @columnfractions 0.25 0.25 0.25 0.25
-@item
-@center R@sc{ICHARD} K@sc{ELSEY}, W@sc{ILLIAM} C@sc{LINGER, AND} J@sc{ONATHAN} R@sc{EES} (@i{Editors})
-@item H. A@sc{BELSON} @tab R. K. D@sc{YBVIG} @tab C. T. H@sc{AYNES} @tab G. J. R@sc{OZAS}
-@item N. I. A@sc{DAMS IV} @tab D. P. F@sc{RIEDMAN} @tab E. K@sc{OHLBECKER} @tab G. L. S@sc{TEELE} J@sc{R}.
-@item D. H. B@sc{ARTLEY} @tab R. H@sc{ALSTEAD} @tab D. O@sc{XLEY} @tab G. J. S@sc{USSMAN}
-@item G. B@sc{ROOKS} @tab C. H@sc{ANSON} @tab K. M. P@sc{ITMAN} @tab M. W@sc{AND}
-@item
-@end multitable
-@end quotation
-
-
-@sp 2
-
-@c {\it Dedicated to the Memory of ALGOL 60}
-@i{Dedicated to the Memory of Robert Hieb}
-@c [For the macros in R5RS -RK]
-
-@sp 3
-
-
-
-
-@majorheading Summary
-
-
-The report gives a defining description of the programming language
-Scheme. Scheme is a statically scoped and properly tail-recursive
-dialect of the Lisp programming language invented by Guy Lewis
-Steele Jr.@: and Gerald Jay Sussman. It was designed to have an
-exceptionally clear and simple semantics and few different ways to
-form expressions. A wide variety of programming paradigms, including
-imperative, functional, and message passing styles, find convenient
-expression in Scheme.
-
-The introduction offers a brief history of the language and of
-the report.
-
-The first three chapters present the fundamental ideas of the
-language and describe the notational conventions used for describing the
-language and for writing programs in the language.
-
-Chapters @ref{Expressions} and @ref{Program structure} describe
-the syntax and semantics of expressions, programs, and definitions.
-
-Chapter @ref{Standard procedures} describes Scheme's built-in
-procedures, which include all of the language's data manipulation and
-input/output primitives.
-
-Chapter @ref{Formal syntax and semantics} provides a formal syntax for Scheme
-written in extended BNF, along with a formal denotational semantics.
-An example of the use of the language follows the formal syntax and
-semantics.
-
-The report concludes with a list of references and an
-alphabetic index.
-
-@ignore todo
-expand the summary so that it fills up the column.
-@end ignore
-
-
-@c \vfill
-@c \begin{center}
-@c {\large \bf
-@c *** DRAFT*** \\
-@c %August 31, 1989
-@c \today
-@c }\end{center}
-
-
-
-
-
-@c \addvspace{3.5pt} % don't shrink this gap
-@c \renewcommand{\tocshrink}{-3.5pt} % value determined experimentally
-
-@unnumbered Contents
-
-@menu
-* Introduction::
-* Overview of Scheme::
-* Lexical conventions::
-* Basic concepts::
-* Expressions::
-* Program structure::
-* Standard procedures::
-* Formal syntax and semantics::
-* Notes::
-* Additional material::
-* Example::
-* Bibliography::
-* Index::
-@end menu
-
-
-
-
-
-@page
-
-@end ifinfo
-
-
-@c @include{intro}
-@node Introduction, Overview of Scheme, top, top
-@unnumbered Introduction
-
-@menu
-* Background::
-* Acknowledgements::
-@end menu
-
-
-
-
-Programming languages should be designed not by piling feature on top of
-feature, but by removing the weaknesses and restrictions that make additional
-features appear necessary. Scheme demonstrates that a very small number
-of rules for forming expressions, with no restrictions on how they are
-composed, suffice to form a practical and efficient programming language
-that is flexible enough to support most of the major programming
-paradigms in use today.
-
-@c Scheme has influenced the evolution of Lisp.
-Scheme
-was one of the first programming languages to incorporate first class
-procedures as in the lambda calculus, thereby proving the usefulness of
-static scope rules and block structure in a dynamically typed language.
-Scheme was the first major dialect of Lisp to distinguish procedures
-from lambda expressions and symbols, to use a single lexical
-environment for all variables, and to evaluate the operator position
-of a procedure call in the same way as an operand position. By relying
-entirely on procedure calls to express iteration, Scheme emphasized the
-fact that tail-recursive procedure calls are essentially goto's that
-pass arguments. Scheme was the first widely used programming language to
-embrace first class escape procedures, from which all previously known
-sequential control structures can be synthesized. A subsequent
-version of Scheme introduced the concept of exact and inexact numbers,
-an extension of Common Lisp's generic arithmetic.
-More recently, Scheme became the first programming language to support
-hygienic macros, which permit the syntax of a block-structured language
-to be extended in a consistent and reliable manner.
-@c A few
-@c of these innovations have recently been incorporated into Common Lisp, while
-@c others remain to be adopted.
-
-@ignore todo
-Ramsdell:
-I would like to make a few comments on presentation. The most
-important comment is about section organization. Newspaper writers
-spend most of their time writing the first three paragraphs of any
-article. This part of the article is often the only part read by
-readers, and is important in enticing readers to continue. In the
-same way, The first page is most likely to be the only page read by
-many SIGPLAN readers. If I had my choice of what I would ask them to
-read, it would be the material in section 1.1, the Semantics section
-that notes that scheme is lexically scoped, tail recursive, weakly
-typed, ... etc. I would expand on the discussion on continuations,
-as they represent one important difference between Scheme and other
-languages. The introduction, with its history of scheme, its history
-of scheme reports and meetings, and acknowledgements giving names of
-people that the reader will not likely know, is not that one page I
-would like all to read. I suggest moving the history to the back of
-the report, and use the first couple of pages to convince the reader
-that the language documented in this report is worth studying.
-
-@end ignore
-
-
-@node Background, Acknowledgements, Introduction, Introduction
-@unnumberedsec Background
-
-
-The first description of Scheme was written in
-1975 [Scheme75]. A revised report [Scheme78]
-@ignore todo
-italicize or not?
-@end ignore
- appeared in 1978, which described the evolution
-of the language as its MIT implementation was upgraded to support an
-innovative compiler [Rabbit]. Three distinct projects began in
-1981 and 1982 to use variants of Scheme for courses at MIT, Yale, and
-Indiana University [Rees82], [MITScheme], [Scheme311]. An introductory
-computer science textbook using Scheme was published in
-1984 [SICP].
-
-@c \vest As might be expected of a language used primarily for education and
-@c research, Scheme has always evolved rapidly. This was no problem when
-@c Scheme was used only within MIT, but
-As Scheme became more widespread,
-local dialects began to diverge until students and researchers
-occasionally found it difficult to understand code written at other
-sites.
-Fifteen representatives of the major implementations of Scheme therefore
-met in October 1984 to work toward a better and more widely accepted
-standard for Scheme.
-@c Participating in this workshop were Hal Abelson, Norman Adams, David
-@c Bartley, Gary Brooks, William Clinger, Daniel Friedman, Robert Halstead,
-@c Chris Hanson, Christopher Haynes, Eugene Kohlbecker, Don Oxley, Jonathan Rees,
-@c Guillermo Rozas, Gerald Jay Sussman, and Mitchell Wand. Kent Pitman
-@c made valuable contributions to the agenda for the workshop but was
-@c unable to attend the sessions.
-
-@c Subsequent electronic mail discussions and committee work completed the
-@c definition of the language.
-@c Gerry Sussman drafted the section on numbers, Chris Hanson drafted the
-@c sections on characters and strings, and Gary Brooks and William Clinger
-@c drafted the sections on input and output.
-@c William Clinger recorded the decisions of the workshop and
-@c compiled the pieces into a coherent document.
-@c The ``Revised revised report on Scheme''~\cite{RRRS}
-Their report [RRRS]
-was published at MIT and Indiana University in the summer of 1985.
-Further revision took place in the spring of 1986 [R3RS],
-@c , again accomplished
-@c almost entirely by electronic mail, resulted in the present report.
-and in the spring of 1988 [R4RS].
-The present report reflects further revisions agreed upon in a meeting
-at Xerox PARC in June 1992.
-
-@c \vest The number 3 in the title is part of the title, not a reference to
-@c a footnote. The word ``revised'' is raised to the third power because
-@c the report is a revision of a report that was already twice revised.
-
-@ignore todo
-Write an editors' note?
-@end ignore
-
-
-
-@sp 3
-
-We intend this report to belong to the entire Scheme community, and so
-we grant permission to copy it in whole or in part without fee. In
-particular, we encourage implementors of Scheme to use this report as
-a starting point for manuals and other documentation, modifying it as
-necessary.
-
-
-
-
-@node Acknowledgements, , Background, Introduction
-@unnumberedsec Acknowledgements
-
-
-We would like to thank the following people for their help: Alan Bawden, Michael
-Blair, George Carrette, Andy Cromarty, Pavel Curtis, Jeff Dalton, Olivier Danvy,
-Ken Dickey, Bruce Duba, Marc Feeley,
-Andy Freeman, Richard Gabriel, Yekta G"ursel, Ken Haase, Robert
-Hieb, Paul Hudak, Morry Katz, Chris Lindblad, Mark Meyer, Jim Miller, Jim Philbin,
-John Ramsdell, Mike Shaff, Jonathan Shapiro, Julie Sussman,
-Perry Wagle, Daniel Weise, Henry Wu, and Ozan Yigit.
-We thank Carol Fessenden, Daniel
-Friedman, and Christopher Haynes for permission to use text from the Scheme 311
-version 4 reference manual. We thank Texas Instruments, Inc. for permission to
-use text from the @emph{TI Scheme Language Reference Manual}[TImanual85].
-We gladly acknowledge the influence of manuals for MIT Scheme[MITScheme],
-T[Rees84], Scheme 84[Scheme84],Common Lisp[CLtL],
-and Algol 60[Naur63].
-
-We also thank Betty Dexter for the extreme effort she put into
-setting this report in @TeX{}, and Donald Knuth for designing the program
-that caused her troubles.
-
-The Artificial Intelligence Laboratory of the
-Massachusetts Institute of Technology, the Computer Science
-Department of Indiana University, the Computer and Information
-Sciences Department of the University of Oregon, and the NEC Research
-Institute supported the preparation of this report. Support for the MIT
-work was provided in part by
-the Advanced Research Projects Agency of the Department of Defense under Office
-of Naval Research contract N00014-80-C-0505. Support for the Indiana
-University work was provided by NSF grants NCS 83-04567 and NCS
-83-03325.
-
-
-
-
-@sp 2
-
-@c \clearchapterstar{Description of the language} %\unskip\vskip -2ex
-@c @include{struct}
-
-@c 1. Structure of the language
-
-@node Overview of Scheme, Lexical conventions, Introduction, top
-@chapter Overview of Scheme
-
-@menu
-* Semantics::
-* Syntax::
-* Notation and terminology::
-@end menu
-
-
-@node Semantics, Syntax, Overview of Scheme, Overview of Scheme
-@section Semantics
-
-
-
-This section gives an overview of Scheme's semantics. A
-detailed informal semantics is the subject of
-chapters @ref{Basic concepts} through @ref{Standard procedures}. For reference
-purposes, section @ref{Formal semantics} provides a formal
-semantics of Scheme.
-
-Following Algol, Scheme is a statically scoped programming
-language. Each use of a variable is associated with a lexically
-apparent binding of that variable.
-
-Scheme has latent as opposed to manifest types. Types
-are associated with values (also called objects) rather than
-@cindex @w{object}
-with variables. (Some authors refer to languages with latent types as
-weakly typed or dynamically typed languages.) Other languages with
-latent types are APL, Snobol, and other dialects of Lisp. Languages
-with manifest types (sometimes referred to as strongly typed or
-statically typed languages) include Algol 60, Pascal, and C.
-
-All objects created in the course of a Scheme computation, including
-procedures and continuations, have unlimited extent.
-No Scheme object is ever destroyed. The reason that
-implementations of Scheme do not (usually!) run out of storage is that
-they are permitted to reclaim the storage occupied by an object if
-they can prove that the object cannot possibly matter to any future
-computation. Other languages in which most objects have unlimited
-extent include APL and other Lisp dialects.
-
-Implementations of Scheme are required to be properly tail-recursive.
-This allows the execution of an iterative computation in constant space,
-even if the iterative computation is described by a syntactically
-recursive procedure. Thus with a properly tail-recursive implementation,
-iteration can be expressed using the ordinary procedure-call
-mechanics, so that special iteration constructs are useful only as
-syntactic sugar. See section @ref{Proper tail recursion}.
-
-Scheme procedures are objects in their own right. Procedures can be
-created dynamically, stored in data structures, returned as results of
-procedures, and so on. Other languages with these properties include
-Common Lisp and ML.
-@ignore todo
-Rozas: Scheme had them first.
-@end ignore
-
-
-One distinguishing feature of Scheme is that continuations, which
-in most other languages only operate behind the scenes, also have
-``first-class'' status. Continuations are useful for implementing a
-wide variety of advanced control constructs, including non-local exits,
-backtracking, and coroutines. See section @ref{Control features}.
-
-Arguments to Scheme procedures are always passed by value, which
-means that the actual argument expressions are evaluated before the
-procedure gains control, whether the procedure needs the result of the
-evaluation or not. ML, C, and APL are three other languages that always
-pass arguments by value.
-This is distinct from the lazy-evaluation semantics of Haskell,
-or the call-by-name semantics of Algol 60, where an argument
-expression is not evaluated unless its value is needed by the
-procedure.
-
-@ignore todo
-Lisp's call by value should be explained more
-accurately. What's funny is that all values are references.
-@end ignore
-
-
-Scheme's model of arithmetic is designed to remain as independent as
-possible of the particular ways in which numbers are represented within a
-computer. In Scheme, every integer is a rational number, every rational is a
-real, and every real is a complex number. Thus the distinction between integer
-and real arithmetic, so important to many programming languages, does not
-appear in Scheme. In its place is a distinction between exact arithmetic,
-which corresponds to the mathematical ideal, and inexact arithmetic on
-approximations. As in Common Lisp, exact arithmetic is not limited to
-integers.
-
-@node Syntax, Notation and terminology, Semantics, Overview of Scheme
-@section Syntax
-
-
-Scheme, like most dialects of Lisp, employs a fully parenthesized prefix
-notation for programs and (other) data; the grammar of Scheme generates a
-sublanguage of the language used for data. An important
-consequence of this simple, uniform representation is the susceptibility of
-Scheme programs and data to uniform treatment by other Scheme programs.
-For example, the @samp{eval} procedure evaluates a Scheme program expressed
-as data.
-
-The @samp{read} procedure performs syntactic as well as lexical decomposition of
-the data it reads. The @samp{read} procedure parses its input as data
-(section @pxref{External representation}), not as program.
-
-The formal syntax of Scheme is described in section @ref{Formal syntax}.
-
-
-@node Notation and terminology, , Syntax, Overview of Scheme
-@section Notation and terminology
-
-@menu
-* Primitive; library; and optional features::
-* Error situations and unspecified behavior::
-* Entry format::
-* Evaluation examples::
-* Naming conventions::
-@end menu
-
-
-
-@node Primitive; library; and optional features, Error situations and unspecified behavior, Notation and terminology, Notation and terminology
-@subsection Primitive; library; and optional features
-
-
-
-It is required that every implementation of Scheme support all
-features that are not marked as being @dfn{optional}. Implementations are
-@cindex @w{optional}
-free to omit optional features of Scheme or to add extensions,
-provided the extensions are not in conflict with the language reported
-here. In particular, implementations must support portable code by
-providing a syntactic mode that preempts no lexical conventions of this
-report.
-
-To aid in understanding and implementing Scheme, some features are marked
-as @dfn{library}. These can be easily implemented in terms of the other,
-@cindex @w{library}
-primitive, features. They are redundant in the strict sense of
-the word, but they capture common patterns of usage, and are therefore
-provided as convenient abbreviations.
-
-@node Error situations and unspecified behavior, Entry format, Primitive; library; and optional features, Notation and terminology
-@subsection Error situations and unspecified behavior
-
-
-
-@cindex @w{error}
-When speaking of an error situation, this report uses the phrase ``an
-error is signalled'' to indicate that implementations must detect and
-report the error. If such wording does not appear in the discussion of
-an error, then implementations are not required to detect or report the
-error, though they are encouraged to do so. An error situation that
-implementations are not required to detect is usually referred to simply
-as ``an error.''
-
-For example, it is an error for a procedure to be passed an argument that
-the procedure is not explicitly specified to handle, even though such
-domain errors are seldom mentioned in this report. Implementations may
-extend a procedure's domain of definition to include such arguments.
-
-This report uses the phrase ``may report a violation of an
-implementation restriction'' to indicate circumstances under which an
-implementation is permitted to report that it is unable to continue
-execution of a correct program because of some restriction imposed by the
-implementation. Implementation restrictions are of course discouraged,
-but implementations are encouraged to report violations of implementation
-restrictions.
-@cindex @w{implementation restriction}
-
-For example, an implementation may report a violation of an
-implementation restriction if it does not have enough storage to run a
-program.
-
-If the value of an expression is said to be ``unspecified,'' then
-the expression must evaluate to some object without signalling an error,
-but the value depends on the implementation; this report explicitly does
-not say what value should be returned.
-@cindex @w{unspecified}
-
-@ignore todo
-Talk about unspecified behavior vs. unspecified values.
-@end ignore
-
-
-@ignore todo
-Look at KMP's situations paper.
-@end ignore
-
-
-
-@node Entry format, Evaluation examples, Error situations and unspecified behavior, Notation and terminology
-@subsection Entry format
-
-
-Chapters @ref{Expressions} and @ref{Standard procedures} are organized
-into entries. Each entry describes one language feature or a group of
-related features, where a feature is either a syntactic construct or a
-built-in procedure. An entry begins with one or more header lines of the form
-
-
-@noindent
-@deffn {@var{category}} @var{template}
-
-@end deffn
-
-for required, primitive features, or
-
-
-@noindent
-@deffn {@var{qualifier} @var{category}} @var{template}
-
-@end deffn
-
-where @var{qualifier} is either ``library'' or ``optional'' as defined
- in section @ref{Primitive; library; and optional features}.
-
-If @var{category} is ``syntax'', the entry describes an expression
-type, and the template gives the syntax of the expression type.
-Components of expressions are designated by syntactic variables, which
-are written using angle brackets, for example, @r{<expression>},
-@r{<variable>}. Syntactic variables should be understood to denote segments of
-program text; for example, @r{<expression>} stands for any string of
-characters which is a syntactically valid expression. The notation
-
-@format
- @r{<thing1>} @dots{}
-@end format
-
-indicates zero or more occurrences of a @r{<thing>}, and
-
-@format
- @r{<thing1>} @r{<thing2>} @dots{}
-@end format
-
-indicates one or more occurrences of a @r{<thing>}.
-
-If @var{category} is ``procedure'', then the entry describes a procedure, and
-the header line gives a template for a call to the procedure. Argument
-names in the template are @var{italicized}. Thus the header line
-
-
-@noindent
-@deffn {procedure} vector-ref @var{vector} @var{k}
-
-@end deffn
-
-indicates that the built-in procedure @t{vector-ref} takes
-two arguments, a vector @var{vector} and an exact non-negative integer
-@var{k} (see below). The header lines
-
-
-@noindent
-
-@deffn {procedure} make-vector @var{k}
-
-
-@deffnx {procedure} make-vector @var{k} @var{fill}
-
-@end deffn
-
-indicate that the @t{make-vector} procedure must be defined to take
-either one or two arguments.
-
-
-It is an error for an operation to be presented with an argument that it
-is not specified to handle. For succinctness, we follow the convention
-that if an argument name is also the name of a type listed in
-section @ref{Disjointness of types}, then that argument must be of the named type.
-For example, the header line for @t{vector-ref} given above dictates that the
-first argument to @t{vector-ref} must be a vector. The following naming
-conventions also imply type restrictions:
-@c \newcommand{\foo}[1]{\vr{#1}, \vri{#1}, $\ldots$ \vrj{#1}, $\ldots$}
-
-
-@center @c begin-tabular
-@quotation
-@table @asis
-@item @var{obj}
-any object
-@item @var{list}, @var{list1}, @dots{} @var{listj}, @dots{}
-list (see section @pxref{Pairs and lists})
-@item @var{z}, @var{z1}, @dots{} @var{zj}, @dots{}
-complex number
-@item @var{x}, @var{x1}, @dots{} @var{xj}, @dots{}
-real number
-@item @var{y}, @var{y1}, @dots{} @var{yj}, @dots{}
-real number
-@item @var{q}, @var{q1}, @dots{} @var{qj}, @dots{}
-rational number
-@item @var{n}, @var{n1}, @dots{} @var{nj}, @dots{}
-integer
-@item @var{k}, @var{k1}, @dots{} @var{kj}, @dots{}
-exact non-negative integer
-@item
-@end table
-@end quotation
-
-
-
-
-@ignore todo
-Provide an example entry??
-@end ignore
-
-
-
-@node Evaluation examples, Naming conventions, Entry format, Notation and terminology
-@subsection Evaluation examples
-
-
-The symbol ``@result{}'' used in program examples should be read
-``evaluates to.'' For example,
-
-
-@example
-
-(* 5 8) ==> 40
-
-@end example
-
-
-means that the expression @t{(* 5 8)} evaluates to the object @t{40}.
-Or, more precisely: the expression given by the sequence of characters
-``@t{(* 5 8)}'' evaluates, in the initial environment, to an object
-that may be represented externally by the sequence of characters ``@t{40}''. See section @ref{External representations} for a discussion of external
-representations of objects.
-
-@node Naming conventions, , Evaluation examples, Notation and terminology
-@subsection Naming conventions
-
-
-By convention, the names of procedures that always return a boolean
-value usually end
-in ``@code{?}''. Such procedures are called predicates.
-@vindex @w{?}
-
-By convention, the names of procedures that store values into previously
-allocated locations (see section @pxref{Storage model}) usually end in
-``@code{!}''.
-@vindex @w{!}
-Such procedures are called mutation procedures.
-By convention, the value returned by a mutation procedure is unspecified.
-
-By convention, ``@code{->}'' appears within the names of procedures that
-@vindex @w{->}
-take an object of one type and return an analogous object of another type.
-For example, @samp{list->vector} takes a list and returns a vector whose
-elements are the same as those of the list.
-
-
-
-@ignore todo
-Terms that need defining: thunk, command (what else?).
-@end ignore
-
-
-@c @include{lex}
-
-@c Lexical structure
-
-@c %\vfill\eject
-@node Lexical conventions, Basic concepts, Overview of Scheme, top
-@chapter Lexical conventions
-
-@menu
-* Identifiers::
-* Whitespace and comments::
-* Other notations::
-@end menu
-
-
-This section gives an informal account of some of the lexical
-conventions used in writing Scheme programs. For a formal syntax of
-Scheme, see section @ref{Formal syntax}.
-
-Upper and lower case forms of a letter are never distinguished
-except within character and string constants. For example, @samp{Foo} is
-the same identifier as @samp{FOO}, and @t{#x1AB} is the same number as
-@t{#X1ab}.
-
-@node Identifiers, Whitespace and comments, Lexical conventions, Lexical conventions
-@section Identifiers
-
-
-
-Most identifiers allowed by other programming
-@cindex @w{identifier}
-languages are also acceptable to Scheme. The precise rules for forming
-identifiers vary among implementations of Scheme, but in all
-implementations a sequence of letters, digits, and ``extended alphabetic
-characters'' that begins with a character that cannot begin a number is
-an identifier. In addition, @code{+}, @code{-}, and @code{...} are identifiers.
-@vindex @w{...}
-@vindex @w{-}
-@vindex @w{+}
-Here are some examples of identifiers:
-
-
-@example
-
-lambda q
-list->vector soup
-+ V17a
-<=? a34kTMNs
-the-word-recursion-has-many-meanings
-
-@end example
-
-
-Extended alphabetic characters may be used within identifiers as if
-they were letters. The following are extended alphabetic characters:
-
-
-@example
-
-! $ % & * + - . / : < = > ? @@ ^ _ ~
-@end example
-
-
-See section @ref{Lexical structure} for a formal syntax of identifiers.
-
-Identifiers have two uses within Scheme programs:
-
-
-@itemize @bullet
-
-@item
-Any identifier may be used as a variable
-or as a syntactic keyword
-(see sections @pxref{Variables; syntactic keywords; and regions} and @pxref{Macros}).
-
-@item
-When an identifier appears as a literal or within a literal
-(see section @pxref{Literal expressions}), it is being used to denote a @emph{symbol}
-(see section @pxref{Symbols}).
-
-
-@end itemize
-
-@cindex @w{syntactic keyword}
-@cindex @w{variable}
-
-@c \label{keywordsection}
-@c The following identifiers are syntactic keywords, and should not be used
-@c as variables:
-
-@c \begin{scheme}
-@c => do or
-@c and else quasiquote
-@c begin if quote
-@c case lambda set!
-@c cond let unquote
-@c define let* unquote-splicing
-@c delay letrec%
-@c \end{scheme}
-
-@c Some implementations allow all identifiers, including syntactic
-@c keywords, to be used as variables. This is a compatible extension to
-@c the language, but ambiguities in the language result when the
-@c restriction is relaxed, and the ways in which these ambiguities are
-@c resolved vary between implementations.
-
-
-@node Whitespace and comments, Other notations, Identifiers, Lexical conventions
-@section Whitespace and comments
-
-
-@dfn{Whitespace} characters are spaces and newlines.
-@cindex @w{Whitespace}
-(Implementations typically provide additional whitespace characters such
-as tab or page break.) Whitespace is used for improved readability and
-as necessary to separate tokens from each other, a token being an
-indivisible lexical unit such as an identifier or number, but is
-otherwise insignificant. Whitespace may occur between any two tokens,
-but not within a token. Whitespace may also occur inside a string,
-where it is significant.
-
-A semicolon (@t{;}) indicates the start of a
-comment. The comment continues to the
-@cindex @w{;}
-@cindex @w{comment}
-end of the line on which the semicolon appears. Comments are invisible
-to Scheme, but the end of the line is visible as whitespace. This
-prevents a comment from appearing in the middle of an identifier or
-number.
-
-
-@example
-
-;;; The FACT procedure computes the factorial
-;;; of a non-negative integer.
-(define fact
- (lambda (n)
- (if (= n 0)
- 1 ;Base case: return 1
- (* n (fact (- n 1))))))
-
-@end example
-
-
-
-@node Other notations, , Whitespace and comments, Lexical conventions
-@section Other notations
-
-
-@ignore todo
-Rewrite?
-@end ignore
-
-
-For a description of the notations used for numbers, see
-section @ref{Numbers}.
-
-
-@table @t
-
-
-@item @t{.@: + -}
-These are used in numbers, and may also occur anywhere in an identifier
-except as the first character. A delimited plus or minus sign by itself
-is also an identifier.
-A delimited period (not occurring within a number or identifier) is used
-in the notation for pairs (section @pxref{Pairs and lists}), and to indicate a
-rest-parameter in a formal parameter list (section @pxref{Procedures}).
-A delimited sequence of three successive periods is also an identifier.
-
-@item @t{( )}
-Parentheses are used for grouping and to notate lists
-(section @pxref{Pairs and lists}).
-
-@item @t{'}
-The single quote character is used to indicate literal data (section @pxref{Literal expressions}).
-
-@item @t{`}
-The backquote character is used to indicate almost-constant
-data (section @pxref{Quasiquotation}).
-
-@item @t{, ,@@}
-The character comma and the sequence comma at-sign are used in conjunction
-with backquote (section @pxref{Quasiquotation}).
-
-@item @t{"}
-The double quote character is used to delimit strings (section @pxref{Strings}).
-
-@item \
-Backslash is used in the syntax for character constants
-(section @pxref{Characters}) and as an escape character within string
-constants (section @pxref{Strings}).
-
-@c A box used because \verb is not allowed in command arguments.
-
-@item @w{@t{[ ] @{ @} |}}
-Left and right square brackets and curly braces and vertical bar
-are reserved for possible future extensions to the language.
-
-@item #
- Sharp sign is used for a variety of purposes depending on
-the character that immediately follows it:
-
-@item @t{#t} @t{#f}
-These are the boolean constants (section @pxref{Booleans}).
-
-@item #\
-This introduces a character constant (section @pxref{Characters}).
-
-@item #@t{(}
-This introduces a vector constant (section @pxref{Vectors}). Vector constants
-are terminated by @t{)} .
-
-@item @t{#e #i #b #o #d #x}
-These are used in the notation for numbers (section @pxref{Syntax of numerical constants}).
-
-@end table
-
-
-@c @include{basic}
-
-@c \vfill\eject
-@node Basic concepts, Expressions, Lexical conventions, top
-@chapter Basic concepts
-
-@menu
-* Variables; syntactic keywords; and regions::
-* Disjointness of types::
-* External representations::
-* Storage model::
-* Proper tail recursion::
-@end menu
-
-
-
-@node Variables; syntactic keywords; and regions, Disjointness of types, Basic concepts, Basic concepts
-@section Variables; syntactic keywords; and regions
-
-
-
-
-An identifier may name a type of syntax, or it may name
-@cindex @w{identifier}
-a location where a value can be stored. An identifier that names a type
-of syntax is called a @emph{syntactic keyword}
-@cindex @w{syntactic keyword}
-and is said to be @emph{bound} to that syntax. An identifier that names a
-location is called a @emph{variable} and is said to be
-@cindex @w{variable}
-@emph{bound} to that location. The set of all visible
-bindings in effect at some point in a program is
-@cindex @w{binding}
-known as the @emph{environment} in effect at that point. The value
-stored in the location to which a variable is bound is called the
-variable's value. By abuse of terminology, the variable is sometimes
-said to name the value or to be bound to the value. This is not quite
-accurate, but confusion rarely results from this practice.
-
-@ignore todo
-Define ``assigned'' and ``unassigned'' perhaps?
-@end ignore
-
-
-@ignore todo
-In programs without side effects, one can safely pretend that the
-variables are bound directly to the arguments. Or:
-In programs without @code{set!}, one can safely pretend that the
-@vindex @w{set!}
-variable is bound directly to the value.
-@end ignore
-
-
-Certain expression types are used to create new kinds of syntax
-and bind syntactic keywords to those new syntaxes, while other
-expression types create new locations and bind variables to those
-locations. These expression types are called @emph{binding constructs}.
-
-@cindex @w{binding construct}
-Those that bind syntactic keywords are listed in section @ref{Macros}.
-The most fundamental of the variable binding constructs is the
-@samp{lambda} expression, because all other variable binding constructs
-can be explained in terms of @samp{lambda} expressions. The other
-variable binding constructs are @samp{let}, @samp{let*}, @samp{letrec},
-and @samp{do} expressions (see sections @pxref{Procedures}, @pxref{Binding constructs}, and
-@pxref{Iteration}).
-
-@c Note: internal definitions not mentioned here.
-
-Like Algol and Pascal, and unlike most other dialects of Lisp
-except for Common Lisp, Scheme is a statically scoped language with
-block structure. To each place where an identifier is bound in a program
-there corresponds a @dfn{region} of the program text within which
-@cindex @w{region}
-the binding is visible. The region is determined by the particular
-binding construct that establishes the binding; if the binding is
-established by a @samp{lambda} expression, for example, then its region
-is the entire @samp{lambda} expression. Every mention of an identifier
-refers to the binding of the identifier that established the
-innermost of the regions containing the use. If there is no binding of
-the identifier whose region contains the use, then the use refers to the
-binding for the variable in the top level environment, if any
-(chapters @pxref{Expressions} and @pxref{Standard procedures}); if there is no
-binding for the identifier,
-it is said to be @dfn{unbound}.
-@cindex @w{top level environment}
-@cindex @w{bound}
-@cindex @w{unbound}
-
-@ignore todo
-Mention that some implementations have multiple top level environments?
-@end ignore
-
-
-@ignore todo
-Pitman sez: needs elaboration in case of @t{(let ...)}
-@end ignore
-
-
-@ignore todo
-Pitman asks: say something about vars created after scheme starts?
-@t{(define x 3) (define (f) x) (define (g) y) (define y 4)}
-Clinger replies: The language was explicitly
-designed to permit a view in which no variables are created after
-Scheme starts. In files, you can scan out the definitions beforehand.
-I think we're agreed on the principle that interactive use should
-approximate that behavior as closely as possible, though we don't yet
-agree on which programming environment provides the best approximation.
-@end ignore
-
-
-@node Disjointness of types, External representations, Variables; syntactic keywords; and regions, Basic concepts
-@section Disjointness of types
-
-
-
-No object satisfies more than one of the following predicates:
-
-
-@example
-
-boolean? pair?
-symbol? number?
-char? string?
-vector? port?
-procedure?
-
-@end example
-
-
-These predicates define the types @emph{boolean}, @emph{pair}, @emph{symbol}, @emph{number}, @emph{char} (or @emph{character}), @emph{string}, @emph{vector}, @emph{port}, and @emph{procedure}. The empty list is a special
-object of its own type; it satisfies none of the above predicates.
-
-@vindex symbol?
-@vindex pair?
-@vindex boolean?
-@cindex @w{type}
-
-@vindex vector?
-@vindex string?
-@vindex char?
-@vindex number?
-
-@cindex @w{empty list}
-@vindex procedure?
-@vindex port?
-
-Although there is a separate boolean type,
-any Scheme value can be used as a boolean value for the purpose of a
-conditional test. As explained in section @ref{Booleans}, all
-values count as true in such a test except for @t{#f}.
-@c and possibly the empty list.
-@c The only value that is guaranteed to count as
-@c false is \schfalse{}. It is explicitly unspecified whether the empty list
-@c counts as true or as false.
-This report uses the word ``true'' to refer to any
-Scheme value except @t{#f}, and the word ``false'' to refer to
-@t{#f}.
-@cindex @w{false}
-@cindex @w{true}
-
-@node External representations, Storage model, Disjointness of types, Basic concepts
-@section External representations
-
-
-
-An important concept in Scheme (and Lisp) is that of the @emph{external
-representation} of an object as a sequence of characters. For example,
-an external representation of the integer 28 is the sequence of
-characters ``@t{28}'', and an external representation of a list consisting
-of the integers 8 and 13 is the sequence of characters ``@t{(8 13)}''.
-
-The external representation of an object is not necessarily unique. The
-integer 28 also has representations ``@t{#e28.000}'' and ``@t{#x1c}'', and the
-list in the previous paragraph also has the representations ``@t{( 08 13
-)}'' and ``@t{(8 .@: (13 .@: ()))}'' (see section @pxref{Pairs and lists}).
-
-Many objects have standard external representations, but some, such as
-procedures, do not have standard representations (although particular
-implementations may define representations for them).
-
-An external representation may be written in a program to obtain the
-corresponding object (see @samp{quote}, section @pxref{Literal expressions}).
-
-External representations can also be used for input and output. The
-procedure @samp{read} (section @pxref{Input}) parses external
-representations, and the procedure @samp{write} (section @pxref{Output})
-generates them. Together, they provide an elegant and powerful
-input/output facility.
-
-Note that the sequence of characters ``@t{(+ 2 6)}'' is @emph{not} an
-external representation of the integer 8, even though it @emph{is} an
-expression evaluating to the integer 8; rather, it is an external
-representation of a three-element list, the elements of which are the symbol
-@t{+} and the integers 2 and 6. Scheme's syntax has the property that
-any sequence of characters that is an expression is also the external
-representation of some object. This can lead to confusion, since it may
-not be obvious out of context whether a given sequence of characters is
-intended to denote data or program, but it is also a source of power,
-since it facilitates writing programs such as interpreters and
-compilers that treat programs as data (or vice versa).
-
-The syntax of external representations of various kinds of objects
-accompanies the description of the primitives for manipulating the
-objects in the appropriate sections of chapter @ref{Standard procedures}.
-
-@node Storage model, Proper tail recursion, External representations, Basic concepts
-@section Storage model
-
-
-
-Variables and objects such as pairs, vectors, and strings implicitly
-denote locations or sequences of locations. A string, for
-@cindex @w{location}
-example, denotes as many locations as there are characters in the string.
-(These locations need not correspond to a full machine word.) A new value may be
-stored into one of these locations using the @t{string-set!} procedure, but
-the string continues to denote the same locations as before.
-
-An object fetched from a location, by a variable reference or by
-a procedure such as @samp{car}, @samp{vector-ref}, or @samp{string-ref}, is
-equivalent in the sense of @code{eqv?}
-@c and \ide{eq?} ??
-(section @pxref{Equivalence predicates})
-@vindex @w{eqv?}
-to the object last stored in the location before the fetch.
-
-Every location is marked to show whether it is in use.
-No variable or object ever refers to a location that is not in use.
-Whenever this report speaks of storage being allocated for a variable
-or object, what is meant is that an appropriate number of locations are
-chosen from the set of locations that are not in use, and the chosen
-locations are marked to indicate that they are now in use before the variable
-or object is made to denote them.
-
-In many systems it is desirable for constants (i.e. the values of
-@cindex @w{constant}
-literal expressions) to reside in read-only-memory. To express this, it is
-convenient to imagine that every object that denotes locations is associated
-with a flag telling whether that object is mutable or
-@cindex @w{mutable}
-immutable. In such systems literal constants and the strings
-@cindex @w{immutable}
-returned by @code{symbol->string} are immutable objects, while all objects
-@vindex @w{symbol->string}
-created by the other procedures listed in this report are mutable. It is an
-error to attempt to store a new value into a location that is denoted by an
-immutable object.
-
-@node Proper tail recursion, , Storage model, Basic concepts
-@section Proper tail recursion
-
-
-
-Implementations of Scheme are required to be
-@emph{properly tail-recursive}.
-@cindex @w{proper tail recursion}
-Procedure calls that occur in certain syntactic
-contexts defined below are `tail calls'. A Scheme implementation is
-properly tail-recursive if it supports an unbounded number of active
-tail calls. A call is @emph{active} if the called procedure may still
-return. Note that this includes calls that may be returned from either
-by the current continuation or by continuations captured earlier by
-@samp{call-with-current-continuation} that are later invoked.
-In the absence of captured continuations, calls could
-return at most once and the active calls would be those that had not
-yet returned.
-A formal definition of proper tail recursion can be found
-in [propertailrecursion].
-
-
-@quotation
-@emph{Rationale:}
-
-Intuitively, no space is needed for an active tail call because the
-continuation that is used in the tail call has the same semantics as the
-continuation passed to the procedure containing the call. Although an improper
-implementation might use a new continuation in the call, a return
-to this new continuation would be followed immediately by a return
-to the continuation passed to the procedure. A properly tail-recursive
-implementation returns to that continuation directly.
-
-Proper tail recursion was one of the central ideas in Steele and
-Sussman's original version of Scheme. Their first Scheme interpreter
-implemented both functions and actors. Control flow was expressed using
-actors, which differed from functions in that they passed their results
-on to another actor instead of returning to a caller. In the terminology
-of this section, each actor finished with a tail call to another actor.
-
-Steele and Sussman later observed that in their interpreter the code
-for dealing with actors was identical to that for functions and thus
-there was no need to include both in the language.
-
-@end quotation
-
-
-A @emph{tail call} is a procedure call that occurs
-@cindex @w{tail call}
-in a @emph{tail context}. Tail contexts are defined inductively. Note
-that a tail context is always determined with respect to a particular lambda
-expression.
-
-
-
-@itemize @bullet
-
-@item
-The last expression within the body of a lambda expression,
-shown as @r{<tail expression>} below, occurs in a tail context.
-
-@format
-@t{(lambda <formals>
- <definition>* <expression>* <tail expression>)
-}
-
-@end format
-
-
-
-@item
-If one of the following expressions is in a tail context,
-then the subexpressions shown as <tail expression> are in a tail context.
-These were derived from rules in the grammar given in
-chapter @ref{Formal syntax and semantics} by replacing some occurrences of <expression>
-with <tail expression>. Only those rules that contain tail contexts
-are shown here.
-
-
-@format
-@t{(if <expression> <tail expression> <tail expression>)
-(if <expression> <tail expression>)
-
-(cond <cond clause>+)
-(cond <cond clause>* (else <tail sequence>))
-
-(case <expression>
- <case clause>+)
-(case <expression>
- <case clause>*
- (else <tail sequence>))
-
-(and <expression>* <tail expression>)
-(or <expression>* <tail expression>)
-
-(let (<binding spec>*) <tail body>)
-(let <variable> (<binding spec>*) <tail body>)
-(let* (<binding spec>*) <tail body>)
-(letrec (<binding spec>*) <tail body>)
-
-(let-syntax (<syntax spec>*) <tail body>)
-(letrec-syntax (<syntax spec>*) <tail body>)
-
-(begin <tail sequence>)
-
-(do (<iteration spec>*)
- (<test> <tail sequence>)
- <expression>*)
-
-@r{where}
-
-<cond clause> --> (<test> <tail sequence>)
-<case clause> --> ((<datum>*) <tail sequence>)
-
-<tail body> --> <definition>* <tail sequence>
-<tail sequence> --> <expression>* <tail expression>
-}
-
-@end format
-
-
-
-@item
-If a @samp{cond} expression is in a tail context, and has a clause of
-the form @samp{(@r{<expression1>} => @r{<expression2>})}
-then the (implied) call to
-the procedure that results from the evaluation of @r{<expression2>} is in a
-tail context. @r{<expression2>} itself is not in a tail context.
-
-
-@end itemize
-
-
-Certain built-in procedures are also required to perform tail calls.
-The first argument passed to @code{apply} and to
-@vindex @w{apply}
-@code{call-with-current-continuation}, and the second argument passed to
-@vindex @w{call-with-current-continuation}
-@code{call-with-values}, must be called via a tail call.
-@vindex @w{call-with-values}
-Similarly, @code{eval} must evaluate its argument as if it
-@vindex @w{eval}
-were in tail position within the @code{eval} procedure.
-@vindex @w{eval}
-
-In the following example the only tail call is the call to @samp{f}.
-None of the calls to @samp{g} or @samp{h} are tail calls. The reference to
-@samp{x} is in a tail context, but it is not a call and thus is not a
-tail call.
-
-@example
-
-(lambda ()
- (if (g)
- (let ((x (h)))
- x)
- (and (g) (f))))
-
-@end example
-
-
-
-@quotation
-@emph{Note:}
-Implementations are allowed, but not required, to
-recognize that some non-tail calls, such as the call to @samp{h}
-above, can be evaluated as though they were tail calls.
-In the example above, the @samp{let} expression could be compiled
-as a tail call to @samp{h}. (The possibility of @samp{h} returning
-an unexpected number of values can be ignored, because in that
-case the effect of the @samp{let} is explicitly unspecified and
-implementation-dependent.)
-@end quotation
-
-
-
-@c @include{expr}
-
-@c \vfill\eject
-@node Expressions, Program structure, Basic concepts, top
-@chapter Expressions
-
-@menu
-* Primitive expression types::
-* Derived expression types::
-* Macros::
-@end menu
-
-
-
-@c \newcommand{\syntax}{{\em Syntax: }}
-@c \newcommand{\semantics}{{\em Semantics: }}
-
-@c [Deleted for R5RS because of multiple-value returns. -RK]
-@c A Scheme expression is a construct that returns a value, such as a
-@c variable reference, literal, procedure call, or conditional.
-
-Expression types are categorized as @emph{primitive} or @emph{derived}.
-Primitive expression types include variables and procedure calls.
-Derived expression types are not semantically primitive, but can instead
-be defined as macros.
-With the exception of @samp{quasiquote}, whose macro definition is complex,
-the derived expressions are classified as library features.
-Suitable definitions are given in section @ref{Derived expression type}.
-
-@node Primitive expression types, Derived expression types, Expressions, Expressions
-@section Primitive expression types
-
-@menu
-* Variable references::
-* Literal expressions::
-* Procedure calls::
-* Procedures::
-* Conditionals::
-* Assignments::
-@end menu
-
-
-
-@node Variable references, Literal expressions, Primitive expression types, Primitive expression types
-@subsection Variable references
-
-
-
-@deffn {syntax} @r{<variable>}
-
-
-An expression consisting of a variable
-@cindex @w{variable}
-(section @pxref{Variables; syntactic keywords; and regions}) is a variable reference. The value of
-the variable reference is the value stored in the location to which the
-variable is bound. It is an error to reference an
-unbound variable.
-@cindex @w{unbound}
-
-
-@format
-@t{(define x 28)
-x ==> 28
-}
-@end format
-
-@end deffn
-
-@node Literal expressions, Procedure calls, Variable references, Primitive expression types
-@subsection Literal expressions
-
-
-
-
-@deffn {syntax} quote @r{<datum>}
-
-@deffnx {syntax} @t{'}@r{<datum>}
-
-
-@deffnx {syntax} @r{<constant>}
-
-
-@samp{(quote @r{<datum>})} evaluates to @r{<datum>}.
-@cindex @w{'}
-@r{<Datum>}
-may be any external representation of a Scheme object (see
-section @pxref{External representations}). This notation is used to include literal
-constants in Scheme code.
-
-
-@format
-@t{
-(quote a) ==> a
-(quote #(a b c)) ==> #(a b c)
-(quote (+ 1 2)) ==> (+ 1 2)
-}
-@end format
-
-
-@samp{(quote @r{<datum>})} may be abbreviated as
-@t{'}@r{<datum>}. The two notations are equivalent in all
-respects.
-
-
-@format
-@t{'a ==> a
-'#(a b c) ==> #(a b c)
-'() ==> ()
-'(+ 1 2) ==> (+ 1 2)
-'(quote a) ==> (quote a)
-''a ==> (quote a)
-}
-@end format
-
-
-Numerical constants, string constants, character constants, and boolean
-constants evaluate ``to themselves''; they need not be quoted.
-
-
-@format
-@t{'"abc" ==> "abc"
-"abc" ==> "abc"
-'145932 ==> 145932
-145932 ==> 145932
-'#t ==> #t
-#t ==> #t
-}
-@end format
-
-
-As noted in section @ref{Storage model}, it is an error to alter a constant
-(i.e. the value of a literal expression) using a mutation procedure like
-@samp{set-car!} or @samp{string-set!}.
-
-@end deffn
-
-
-@node Procedure calls, Procedures, Literal expressions, Primitive expression types
-@subsection Procedure calls
-
-
-
-@deffn {syntax} @r{<operator>} @r{<operand1>} @dots{},
-
-
-A procedure call is written by simply enclosing in parentheses
-expressions for the procedure to be called and the arguments to be
-passed to it. The operator and operand expressions are evaluated (in an
-unspecified order) and the resulting procedure is passed the resulting
-arguments.
-@cindex @w{procedure call}
-@cindex @w{call}
-
-@format
-@t{
-(+ 3 4) ==> 7
-((if #f + *) 3 4) ==> 12
-}
-@end format
-
-
-A number of procedures are available as the values of variables in the
-initial environment; for example, the addition and multiplication
-procedures in the above examples are the values of the variables @samp{+}
-and @samp{*}. New procedures are created by evaluating lambda expressions
-(see section @pxref{Procedures}).
-@ignore todo
-At Friedman's request, flushed mention of other ways.
-@end ignore
-
-@c or definitions (see section~\ref{define}).
-
-Procedure calls may return any number of values (see @code{values} in
-@vindex @w{values}
-section @pxref{Control features}). With the exception of @samp{values}
-the procedures available in the initial environment return one
-value or, for procedures such as @samp{apply}, pass on the values returned
-by a call to one of their arguments.
-
-Procedure calls are also called @emph{combinations}.
-
-@cindex @w{combination}
-
-
-@quotation
-@emph{Note:} In contrast to other dialects of Lisp, the order of
-evaluation is unspecified, and the operator expression and the operand
-expressions are always evaluated with the same evaluation rules.
-@end quotation
-
-
-
-@quotation
-@emph{Note:}
-Although the order of evaluation is otherwise unspecified, the effect of
-any concurrent evaluation of the operator and operand expressions is
-constrained to be consistent with some sequential order of evaluation.
-The order of evaluation may be chosen differently for each procedure call.
-@end quotation
-
-
-
-@quotation
-@emph{Note:} In many dialects of Lisp, the empty combination, @t{()}, is a legitimate expression. In Scheme, combinations must have at
-least one subexpression, so @t{()} is not a syntactically valid
-expression.
-@ignore todo
-Dybvig: ``it should be obvious from the syntax.''
-@end ignore
-
-@end quotation
-
-
-@ignore todo
-Freeman:
-I think an explanation as to why evaluation order is not specified
-should be included. It should not include any reference to parallel
-evaluation. Does any existing compiler generate better code because
-the evaluation order is unspecified? Clinger: yes: T3, MacScheme v2,
-probably MIT Scheme and Chez Scheme. But that's not the main reason
-for leaving the order unspecified.
-@end ignore
-
-
-@end deffn
-
-
-@node Procedures, Conditionals, Procedure calls, Primitive expression types
-@subsection Procedures
-
-
-
-
-@deffn {syntax} lambda @r{<formals>} @r{<body>}
-
-@emph{Syntax:}
-@r{<Formals>} should be a formal arguments list as described below,
-and @r{<body>} should be a sequence of one or more expressions.
-
-@emph{Semantics:}
-A lambda expression evaluates to a procedure. The environment in
-effect when the lambda expression was evaluated is remembered as part of the
-procedure. When the procedure is later called with some actual
-arguments, the environment in which the lambda expression was evaluated will
-be extended by binding the variables in the formal argument list to
-fresh locations, the corresponding actual argument values will be stored
-in those locations, and the expressions in the body of the lambda expression
-will be evaluated sequentially in the extended environment.
-The result(s) of the last expression in the body will be returned as
-the result(s) of the procedure call.
-
-
-@format
-@t{(lambda (x) (+ x x)) ==> @emph{}a procedure
-((lambda (x) (+ x x)) 4) ==> 8
-
-(define reverse-subtract
- (lambda (x y) (- y x)))
-(reverse-subtract 7 10) ==> 3
-
-(define add4
- (let ((x 4))
- (lambda (y) (+ x y))))
-(add4 6) ==> 10
-}
-@end format
-
-
-@r{<Formals>} should have one of the following forms:
-
-
-
-@itemize @bullet
-
-@item
-@t{(@r{<variable1>} @dots{},)}:
-The procedure takes a fixed number of arguments; when the procedure is
-called, the arguments will be stored in the bindings of the
-corresponding variables.
-
-@item
-@r{<variable>}:
-The procedure takes any number of arguments; when the procedure is
-called, the sequence of actual arguments is converted into a newly
-allocated list, and the list is stored in the binding of the
-@r{<variable>}.
-
-@item
-@t{(@r{<variable1>} @dots{}, @r{<variable_n>} @b{.}
-@r{<variable_n+1>})}:
-If a space-delimited period precedes the last variable, then
-the procedure takes n or more arguments, where n is the
-number of formal arguments before the period (there must
-be at least one).
-The value stored in the binding of the last variable will be a
-newly allocated
-list of the actual arguments left over after all the other actual
-arguments have been matched up against the other formal arguments.
-
-@end itemize
-
-
-It is an error for a @r{<variable>} to appear more than once in
-@r{<formals>}.
-
-
-@format
-@t{((lambda x x) 3 4 5 6) ==> (3 4 5 6)
-((lambda (x y . z) z)
- 3 4 5 6) ==> (5 6)
-}
-@end format
-
-
-Each procedure created as the result of evaluating a lambda expression is
-(conceptually) tagged
-with a storage location, in order to make @code{eqv?} and
-@vindex @w{eqv?}
-@code{eq?} work on procedures (see section @pxref{Equivalence predicates}).
-@vindex @w{eq?}
-
-@end deffn
-
-
-@node Conditionals, Assignments, Procedures, Primitive expression types
-@subsection Conditionals
-
-
-
-@deffn {syntax} if @r{<test>} @r{<consequent>} @r{<alternate>}
-@deffnx {syntax} if @r{<test>} @r{<consequent>}
-@c \/ if hyper = italic
-
-@emph{Syntax:}
-@r{<Test>}, @r{<consequent>}, and @r{<alternate>} may be arbitrary
-expressions.
-
-@emph{Semantics:}
-An @samp{if} expression is evaluated as follows: first,
-@r{<test>} is evaluated. If it yields a true value (see
-@cindex @w{true}
-section @pxref{Booleans}), then @r{<consequent>} is evaluated and
-its value(s) is(are) returned. Otherwise @r{<alternate>} is evaluated and its
-value(s) is(are) returned. If @r{<test>} yields a false value and no
-@r{<alternate>} is specified, then the result of the expression is
-unspecified.
-
-
-@format
-@t{(if (> 3 2) 'yes 'no) ==> yes
-(if (> 2 3) 'yes 'no) ==> no
-(if (> 3 2)
- (- 3 2)
- (+ 3 2)) ==> 1
-}
-@end format
-
-
-@end deffn
-
-
-@node Assignments, , Conditionals, Primitive expression types
-@subsection Assignments
-
-
-
-
-@deffn {syntax} set! @r{<variable>} @r{<expression>}
-
-@r{<Expression>} is evaluated, and the resulting value is stored in
-the location to which @r{<variable>} is bound. @r{<Variable>} must
-be bound either in some region enclosing the @samp{set!} expression
-@cindex @w{region}
-or at top level. The result of the @samp{set!} expression is
-unspecified.
-
-
-@format
-@t{(define x 2)
-(+ x 1) ==> 3
-(set! x 4) ==> @emph{unspecified}
-(+ x 1) ==> 5
-}
-@end format
-
-
-@end deffn
-
-
-@node Derived expression types, Macros, Primitive expression types, Expressions
-@section Derived expression types
-
-@menu
-* Conditional::
-* Binding constructs::
-* Sequencing::
-* Iteration::
-* Delayed evaluation::
-* Quasiquotation::
-@end menu
-
-
-
-The constructs in this section are hygienic, as discussed in
-section @ref{Macros}.
-For reference purposes, section @ref{Derived expression type} gives macro definitions
-that will convert most of the constructs described in this section
-into the primitive constructs described in the previous section.
-
-@ignore todo
-Mention that no definition of backquote is provided?
-@end ignore
-
-
-@node Conditional, Binding constructs, Derived expression types, Derived expression types
-@subsection Conditionals
-
-
-
-@deffn {library syntax} cond <clause1> <clause2> @dots{},
-
-@emph{Syntax:}
-Each @r{<clause>} should be of the form
-
-@format
-@t{(@r{<test>} @r{<expression1>} @dots{},)
-}
-@end format
-
-where @r{<test>} is any expression. Alternatively, a @r{<clause>} may be
-of the form
-
-@format
-@t{(@r{<test>} => @r{<expression>})
-}
-@end format
-
-The last @r{<clause>} may be
-an ``else clause,'' which has the form
-
-@format
-@t{(else @r{<expression1>} @r{<expression2>} @dots{},)@r{.}
-}
-@end format
-
-
-@cindex @w{else}
-
-@cindex @w{=>}
-
-@emph{Semantics:}
-A @samp{cond} expression is evaluated by evaluating the @r{<test>}
-expressions of successive @r{<clause>}s in order until one of them
-evaluates to a true value (see
-@cindex @w{true}
-section @pxref{Booleans}). When a @r{<test>} evaluates to a true
-value, then the remaining @r{<expression>}s in its @r{<clause>} are
-evaluated in order, and the result(s) of the last @r{<expression>} in the
-@r{<clause>} is(are) returned as the result(s) of the entire @samp{cond}
-expression. If the selected @r{<clause>} contains only the
-@r{<test>} and no @r{<expression>}s, then the value of the
-@r{<test>} is returned as the result. If the selected @r{<clause>} uses the
-@code{=>} alternate form, then the @r{<expression>} is evaluated.
-@vindex @w{=>}
-Its value must be a procedure that accepts one argument; this procedure is then
-called on the value of the @r{<test>} and the value(s) returned by this
-procedure is(are) returned by the @samp{cond} expression.
-If all @r{<test>}s evaluate
-to false values, and there is no else clause, then the result of
-the conditional expression is unspecified; if there is an else
-clause, then its @r{<expression>}s are evaluated, and the value(s) of
-the last one is(are) returned.
-
-
-@format
-@t{(cond ((> 3 2) 'greater)
- ((< 3 2) 'less)) ==> greater
-
-(cond ((> 3 3) 'greater)
- ((< 3 3) 'less)
- (else 'equal)) ==> equal
-
-(cond ((assv 'b '((a 1) (b 2))) => cadr)
- (else #f)) ==> 2
-}
-@end format
-
-
-
-@end deffn
-
-
-
-@deffn {library syntax} case @r{<key>} <clause1> <clause2> @dots{},
-
-@emph{Syntax:}
-@r{<Key>} may be any expression. Each @r{<clause>} should have
-the form
-
-@format
-@t{((@r{<datum1>} @dots{},) @r{<expression1>} @r{<expression2>} @dots{},)@r{,}
-}
-@end format
-
-where each @r{<datum>} is an external representation of some object.
-All the @r{<datum>}s must be distinct.
-The last @r{<clause>} may be an ``else clause,'' which has the form
-
-@format
-@t{(else @r{<expression1>} @r{<expression2>} @dots{},)@r{.}
-}
-@end format
-
-
-@vindex else
-
-@emph{Semantics:}
-A @samp{case} expression is evaluated as follows. @r{<Key>} is
-evaluated and its result is compared against each @r{<datum>}. If the
-result of evaluating @r{<key>} is equivalent (in the sense of
-@samp{eqv?}; see section @pxref{Equivalence predicates}) to a @r{<datum>}, then the
-expressions in the corresponding @r{<clause>} are evaluated from left
-to right and the result(s) of the last expression in the @r{<clause>} is(are)
-returned as the result(s) of the @samp{case} expression. If the result of
-evaluating @r{<key>} is different from every @r{<datum>}, then if
-there is an else clause its expressions are evaluated and the
-result(s) of the last is(are) the result(s) of the @samp{case} expression;
-otherwise the result of the @samp{case} expression is unspecified.
-
-
-@format
-@t{(case (* 2 3)
- ((2 3 5 7) 'prime)
- ((1 4 6 8 9) 'composite)) ==> composite
-(case (car '(c d))
- ((a) 'a)
- ((b) 'b)) ==> @emph{unspecified}
-(case (car '(c d))
- ((a e i o u) 'vowel)
- ((w y) 'semivowel)
- (else 'consonant)) ==> consonant
-}
-@end format
-
-
-@end deffn
-
-
-
-@deffn {library syntax} and <test1> @dots{},
-
-The @r{<test>} expressions are evaluated from left to right, and the
-value of the first expression that evaluates to a false value (see
-section @pxref{Booleans}) is returned. Any remaining expressions
-are not evaluated. If all the expressions evaluate to true values, the
-value of the last expression is returned. If there are no expressions
-then @t{#t} is returned.
-
-
-@format
-@t{(and (= 2 2) (> 2 1)) ==> #t
-(and (= 2 2) (< 2 1)) ==> #f
-(and 1 2 'c '(f g)) ==> (f g)
-(and) ==> #t
-}
-@end format
-
-
-@end deffn
-
-
-
-@deffn {library syntax} or <test1> @dots{},
-
-The @r{<test>} expressions are evaluated from left to right, and the value of the
-first expression that evaluates to a true value (see
-section @pxref{Booleans}) is returned. Any remaining expressions
-are not evaluated. If all expressions evaluate to false values, the
-value of the last expression is returned. If there are no
-expressions then @t{#f} is returned.
-
-
-@format
-@t{(or (= 2 2) (> 2 1)) ==> #t
-(or (= 2 2) (< 2 1)) ==> #t
-(or #f #f #f) ==> #f
-(or (memq 'b '(a b c))
- (/ 3 0)) ==> (b c)
-}
-@end format
-
-
-@end deffn
-
-
-@node Binding constructs, Sequencing, Conditional, Derived expression types
-@subsection Binding constructs
-
-
-The three binding constructs @samp{let}, @samp{let*}, and @samp{letrec}
-give Scheme a block structure, like Algol 60. The syntax of the three
-constructs is identical, but they differ in the regions they establish
-@cindex @w{region}
-for their variable bindings. In a @samp{let} expression, the initial
-values are computed before any of the variables become bound; in a
-@samp{let*} expression, the bindings and evaluations are performed
-sequentially; while in a @samp{letrec} expression, all the bindings are in
-effect while their initial values are being computed, thus allowing
-mutually recursive definitions.
-
-
-@deffn {library syntax} let @r{<bindings>} @r{<body>}
-
-@emph{Syntax:}
-@r{<Bindings>} should have the form
-
-@format
-@t{((@r{<variable1>} @r{<init1>}) @dots{},)@r{,}
-}
-@end format
-
-where each @r{<init>} is an expression, and @r{<body>} should be a
-sequence of one or more expressions. It is
-an error for a @r{<variable>} to appear more than once in the list of variables
-being bound.
-
-@emph{Semantics:}
-The @r{<init>}s are evaluated in the current environment (in some
-unspecified order), the @r{<variable>}s are bound to fresh locations
-holding the results, the @r{<body>} is evaluated in the extended
-environment, and the value(s) of the last expression of @r{<body>}
-is(are) returned. Each binding of a @r{<variable>} has @r{<body>} as its
-region.
-@cindex @w{region}
-
-
-@format
-@t{(let ((x 2) (y 3))
- (* x y)) ==> 6
-
-(let ((x 2) (y 3))
- (let ((x 7)
- (z (+ x y)))
- (* z x))) ==> 35
-}
-@end format
-
-
-See also named @samp{let}, section @ref{Iteration}.
-
-@end deffn
-
-
-
-@deffn {library syntax} let* @r{<bindings>} @r{<body>}
-
-
-@emph{Syntax:}
-@r{<Bindings>} should have the form
-
-@format
-@t{((@r{<variable1>} @r{<init1>}) @dots{},)@r{,}
-}
-@end format
-
-and @r{<body>} should be a sequence of
-one or more expressions.
-
-@emph{Semantics:}
-@samp{Let*} is similar to @samp{let}, but the bindings are performed
-sequentially from left to right, and the region of a binding indicated
-@cindex @w{region}
-by @samp{(@r{<variable>} @r{<init>})} is that part of the @samp{let*}
-expression to the right of the binding. Thus the second binding is done
-in an environment in which the first binding is visible, and so on.
-
-
-@format
-@t{(let ((x 2) (y 3))
- (let* ((x 7)
- (z (+ x y)))
- (* z x))) ==> 70
-}
-@end format
-
-
-@end deffn
-
-
-
-@deffn {library syntax} letrec @r{<bindings>} @r{<body>}
-
-@emph{Syntax:}
-@r{<Bindings>} should have the form
-
-@format
-@t{((@r{<variable1>} @r{<init1>}) @dots{},)@r{,}
-}
-@end format
-
-and @r{<body>} should be a sequence of
-one or more expressions. It is an error for a @r{<variable>} to appear more
-than once in the list of variables being bound.
-
-@emph{Semantics:}
-The @r{<variable>}s are bound to fresh locations holding undefined
-values, the @r{<init>}s are evaluated in the resulting environment (in
-some unspecified order), each @r{<variable>} is assigned to the result
-of the corresponding @r{<init>}, the @r{<body>} is evaluated in the
-resulting environment, and the value(s) of the last expression in
-@r{<body>} is(are) returned. Each binding of a @r{<variable>} has the
-entire @samp{letrec} expression as its region, making it possible to
-@cindex @w{region}
-define mutually recursive procedures.
-
-
-@format
-@t{(letrec ((even?
- (lambda (n)
- (if (zero? n)
- #t
- (odd? (- n 1)))))
- (odd?
- (lambda (n)
- (if (zero? n)
- #f
- (even? (- n 1))))))
- (even? 88))
- ==> #t
-}
-@end format
-
-
-One restriction on @samp{letrec} is very important: it must be possible
-to evaluate each @r{<init>} without assigning or referring to the value of any
-@r{<variable>}. If this restriction is violated, then it is an error. The
-restriction is necessary because Scheme passes arguments by value rather than by
-name. In the most common uses of @samp{letrec}, all the @r{<init>}s are
-lambda expressions and the restriction is satisfied automatically.
-
-@c \todo{use or uses? --- Jinx.}
-
-@end deffn
-
-
-@node Sequencing, Iteration, Binding constructs, Derived expression types
-@subsection Sequencing
-
-
-
-@deffn {library syntax} begin <expression1> <expression2> @dots{},
-
-The @r{<expression>}s are evaluated sequentially from left to right,
-and the value(s) of the last @r{<expression>} is(are) returned. This
-expression type is used to sequence side effects such as input and
-output.
-
-
-@format
-@t{(define x 0)
-
-(begin (set! x 5)
- (+ x 1)) ==> 6
-
-(begin (display "4 plus 1 equals ")
- (display (+ 4 1))) ==> @emph{unspecified}
- @emph{and prints} 4 plus 1 equals 5
-}
-@end format
-
-
-@end deffn
-
-
-@node Iteration, Delayed evaluation, Sequencing, Derived expression types
-@subsection Iteration
-
-@c \unsection
-
-
-@noindent
-
-@deffn {library syntax} do ((@r{<variable1>} @r{<init1>} @r{<step1>}) @dots{}) (@r{<test>} @r{<expression>} @dots{}) @r{<command>} @dots{}
-@cindex @w{do}
-
-@samp{Do} is an iteration construct. It specifies a set of variables to
-be bound, how they are to be initialized at the start, and how they are
-to be updated on each iteration. When a termination condition is met,
-the loop exits after evaluating the @r{<expression>}s.
-
-@samp{Do} expressions are evaluated as follows:
-The @r{<init>} expressions are evaluated (in some unspecified order),
-the @r{<variable>}s are bound to fresh locations, the results of the
-@r{<init>} expressions are stored in the bindings of the
-@r{<variable>}s, and then the iteration phase begins.
-
-Each iteration begins by evaluating @r{<test>}; if the result is
-false (see section @pxref{Booleans}), then the @r{<command>}
-expressions are evaluated in order for effect, the @r{<step>}
-expressions are evaluated in some unspecified order, the
-@r{<variable>}s are bound to fresh locations, the results of the
-@r{<step>}s are stored in the bindings of the
-@r{<variable>}s, and the next iteration begins.
-
-If @r{<test>} evaluates to a true value, then the
-@r{<expression>}s are evaluated from left to right and the value(s) of
-the last @r{<expression>} is(are) returned. If no @r{<expression>}s
-are present, then the value of the @samp{do} expression is unspecified.
-
-The region of the binding of a @r{<variable>}
-@cindex @w{region}
-consists of the entire @samp{do} expression except for the @r{<init>}s.
-It is an error for a @r{<variable>} to appear more than once in the
-list of @samp{do} variables.
-
-A @r{<step>} may be omitted, in which case the effect is the
-same as if @samp{(@r{<variable>} @r{<init>} @r{<variable>})} had
-been written instead of @samp{(@r{<variable>} @r{<init>})}.
-
-
-@format
-@t{(do ((vec (make-vector 5))
- (i 0 (+ i 1)))
- ((= i 5) vec)
- (vector-set! vec i i)) ==> #(0 1 2 3 4)
-
-(let ((x '(1 3 5 7 9)))
- (do ((x x (cdr x))
- (sum 0 (+ sum (car x))))
- ((null? x) sum))) ==> 25
-}
-@end format
-
-
-@c \end{entry}
-@end deffn
-
-
-@deffn {library syntax} let @r{<variable>} @r{<bindings>} @r{<body>}
-
-
-``Named @samp{let}'' is a variant on the syntax of @code{let} which provides
-@vindex @w{let}
-a more general looping construct than @samp{do} and may also be used to express
-recursions.
-It has the same syntax and semantics as ordinary @samp{let}
-except that @r{<variable>} is bound within @r{<body>} to a procedure
-whose formal arguments are the bound variables and whose body is
-@r{<body>}. Thus the execution of @r{<body>} may be repeated by
-invoking the procedure named by @r{<variable>}.
-
-@c | <-- right margin
-
-@format
-@t{(let loop ((numbers '(3 -2 1 6 -5))
- (nonneg '())
- (neg '()))
- (cond ((null? numbers) (list nonneg neg))
- ((>= (car numbers) 0)
- (loop (cdr numbers)
- (cons (car numbers) nonneg)
- neg))
- ((< (car numbers) 0)
- (loop (cdr numbers)
- nonneg
- (cons (car numbers) neg)))))
- ==> ((6 1 3) (-5 -2))
-}
-@end format
-
-
-@end deffn
-
-
-@node Delayed evaluation, Quasiquotation, Iteration, Derived expression types
-@subsection Delayed evaluation
-
-
-
-@deffn {library syntax} delay @r{<expression>}
-
-@ignore todo
-Fix.
-@end ignore
-
-
-The @samp{delay} construct is used together with the procedure @code{force} to
-@vindex @w{force}
-implement @dfn{lazy evaluation} or @dfn{call by need}.
-@cindex @w{call by need}
-@cindex @w{lazy evaluation}
-@t{(delay @r{<expression>})} returns an object called a
-@dfn{promise} which at some point in the future may be asked (by
-@cindex @w{promise}
-the @samp{force} procedure)
-@ignore todo
-Bartley's white lie; OK?
-@end ignore
- to evaluate
-@r{<expression>}, and deliver the resulting value.
-The effect of @r{<expression>} returning multiple values
-is unspecified.
-
-See the description of @samp{force} (section @pxref{Control features}) for a
-more complete description of @samp{delay}.
-
-@end deffn
-
-
-@node Quasiquotation, , Delayed evaluation, Derived expression types
-@subsection Quasiquotation
-
-
-
-
-@deffn {syntax} quasiquote @r{<qq template>}
-
-@deffnx {syntax} @t{`}@r{<qq template>}
-
-
-``Backquote'' or ``quasiquote'' expressions are useful
-@cindex @w{backquote}
-for constructing a list or vector structure when most but not all of the
-desired structure is known in advance. If no
-commas appear within the @r{<qq template>}, the result of
-@cindex @w{comma}
-evaluating
-@t{`}@r{<qq template>} is equivalent to the result of evaluating
-@t{'}@r{<qq template>}. If a comma appears within the
-@cindex @w{,}
-@r{<qq template>}, however, the expression following the comma is
-evaluated (``unquoted'') and its result is inserted into the structure
-instead of the comma and the expression. If a comma appears followed
-immediately by an at-sign (@@), then the following
-@cindex @w{,@@}
-expression must evaluate to a list; the opening and closing parentheses
-of the list are then ``stripped away'' and the elements of the list are
-inserted in place of the comma at-sign expression sequence. A comma
-at-sign should only appear within a list or vector @r{<qq template>}.
-
-@c struck: "(in the sense of {\cf equal?})" after "equivalent"
-
-
-@format
-@t{`(list ,(+ 1 2) 4) ==> (list 3 4)
-(let ((name 'a)) `(list ,name ',name))
- ==> (list a (quote a))
-`(a ,(+ 1 2) ,@@(map abs '(4 -5 6)) b)
- ==> (a 3 4 5 6 b)
-`((@samp{foo} ,(- 10 3)) ,@@(cdr '(c)) . ,(car '(cons)))
- ==> ((foo 7) . cons)
-`#(10 5 ,(sqrt 4) ,@@(map sqrt '(16 9)) 8)
- ==> #(10 5 2 4 3 8)
-}
-@end format
-
-
-Quasiquote forms may be nested. Substitutions are made only for
-unquoted components appearing at the same nesting level
-as the outermost backquote. The nesting level increases by one inside
-each successive quasiquotation, and decreases by one inside each
-unquotation.
-
-
-@format
-@t{`(a `(b ,(+ 1 2) ,(foo ,(+ 1 3) d) e) f)
- ==> (a `(b ,(+ 1 2) ,(foo 4 d) e) f)
-(let ((name1 'x)
- (name2 'y))
- `(a `(b ,,name1 ,',name2 d) e))
- ==> (a `(b ,x ,'y d) e)
-}
-@end format
-
-
-The two notations
- @t{`}@r{<qq template>} and @t{(quasiquote @r{<qq template>})}
- are identical in all respects.
- @samp{,@r{<expression>}} is identical to @samp{(unquote @r{<expression>})},
- and
- @samp{,@@@r{<expression>}} is identical to @samp{(unquote-splicing @r{<expression>})}.
-The external syntax generated by @code{write} for two-element lists whose
-@vindex @w{write}
-car is one of these symbols may vary between implementations.
-
-@cindex @w{`}
-
-
-@format
-@t{(quasiquote (list (unquote (+ 1 2)) 4))
- ==> (list 3 4)
-'(quasiquote (list (unquote (+ 1 2)) 4))
- ==> `(list ,(+ 1 2) 4)
- @emph{}i.e., (quasiquote (list (unquote (+ 1 2)) 4))
-}
-@end format
-
-
-Unpredictable behavior can result if any of the symbols
-@code{quasiquote}, @code{unquote}, or @code{unquote-splicing} appear in
-@vindex @w{unquote-splicing}
-@vindex @w{unquote}
-@vindex @w{quasiquote}
-positions within a @r{<qq template>} otherwise than as described above.
-
-@end deffn
-
-@node Macros, , Derived expression types, Expressions
-@section Macros
-
-@menu
-* Binding constructs for syntactic keywords::
-* Pattern language::
-@end menu
-
-
-
-Scheme programs can define and use new derived expression types,
- called @emph{macros}.
-@cindex @w{macro}
-Program-defined expression types have the syntax
-
-@example
-
-(@r{<keyword>} @r{<datum>} ...)
-
-@end example
-
-where @r{<keyword>} is an identifier that uniquely determines the
-expression type. This identifier is called the @emph{syntactic
-keyword}, or simply @emph{keyword}, of the macro. The
-@cindex @w{macro keyword}
-@cindex @w{keyword}
-@cindex @w{syntactic keyword}
-number of the @r{<datum>}s, and their syntax, depends on the
-expression type.
-
-Each instance of a macro is called a @emph{use}
-@cindex @w{macro use}
-of the macro.
-The set of rules that specifies
-how a use of a macro is transcribed into a more primitive expression
-is called the @emph{transformer}
-@cindex @w{macro transformer}
-of the macro.
-
-The macro definition facility consists of two parts:
-
-
-
-@itemize @bullet
-
-@item
-A set of expressions used to establish that certain identifiers
-are macro keywords, associate them with macro transformers, and control
-the scope within which a macro is defined, and
-
-@item
-a pattern language for specifying macro transformers.
-
-@end itemize
-
-
-The syntactic keyword of a macro may shadow variable bindings, and local
-variable bindings may shadow keyword bindings. All macros
-@cindex @w{keyword}
-defined using the pattern language are ``hygienic'' and ``referentially
-transparent'' and thus preserve Scheme's lexical scoping [Kohlbecker86], [
-hygienic], [Bawden88], [macrosthatwork], [syntacticabstraction]:
-
-@cindex @w{hygienic}
-
-@cindex @w{referentially transparent}
-
-
-
-
-@itemize @bullet
-
-
-@item
-If a macro transformer inserts a binding for an identifier
-(variable or keyword), the identifier will in effect be renamed
-throughout its scope to avoid conflicts with other identifiers.
-Note that a @code{define} at top level may or may not introduce a binding;
-see section @ref{Definitions}.
-
-@item
-If a macro transformer inserts a free reference to an
-identifier, the reference refers to the binding that was visible
-where the transformer was specified, regardless of any local
-bindings that may surround the use of the macro.
-
-
-@end itemize
-
-@vindex @w{define}
-
-@c The low-level facility permits non-hygienic macros to be written,
-@c and may be used to implement the high-level pattern language.
-
-@c The fourth section describes some features that would make the
-@c low-level macro facility easier to use directly.
-
-@node Binding constructs for syntactic keywords, Pattern language, Macros, Macros
-@subsection Binding constructs for syntactic keywords
-
-
-
-@samp{Let-syntax} and @samp{letrec-syntax} are
-analogous to @samp{let} and @samp{letrec}, but they bind
-syntactic keywords to macro transformers instead of binding variables
-to locations that contain values. Syntactic keywords may also be
-bound at top level; see section @ref{Syntax definitions}.
-
-
-@deffn {syntax} let-syntax @r{<bindings>} @r{<body>}
-
-@emph{Syntax:}
-@r{<Bindings>} should have the form
-
-@format
-@t{((@r{<keyword>} @r{<transformer spec>}) @dots{},)
-}
-@end format
-
-Each @r{<keyword>} is an identifier,
-each @r{<transformer spec>} is an instance of @samp{syntax-rules}, and
-@r{<body>} should be a sequence of one or more expressions. It is an error
-for a @r{<keyword>} to appear more than once in the list of keywords
-being bound.
-
-@emph{Semantics:}
-The @r{<body>} is expanded in the syntactic environment
-obtained by extending the syntactic environment of the
-@samp{let-syntax} expression with macros whose keywords are
-the @r{<keyword>}s, bound to the specified transformers.
-Each binding of a @r{<keyword>} has @r{<body>} as its region.
-
-
-@format
-@t{(let-syntax ((when (syntax-rules ()
- ((when test stmt1 stmt2 ...)
- (if test
- (begin stmt1
- stmt2 ...))))))
- (let ((if #t))
- (when if (set! if 'now))
- if)) ==> now
-
-(let ((x 'outer))
- (let-syntax ((m (syntax-rules () ((m) x))))
- (let ((x 'inner))
- (m)))) ==> outer
-}
-@end format
-
-
-@end deffn
-
-
-@deffn {syntax} letrec-syntax @r{<bindings>} @r{<body>}
-
-@emph{Syntax:}
-Same as for @samp{let-syntax}.
-
-@emph{Semantics:}
- The @r{<body>} is expanded in the syntactic environment obtained by
-extending the syntactic environment of the @samp{letrec-syntax}
-expression with macros whose keywords are the
-@r{<keyword>}s, bound to the specified transformers.
-Each binding of a @r{<keyword>} has the @r{<bindings>}
-as well as the @r{<body>} within its region,
-so the transformers can
-transcribe expressions into uses of the macros
-introduced by the @samp{letrec-syntax} expression.
-
-
-@format
-@t{(letrec-syntax
- ((my-or (syntax-rules ()
- ((my-or) #f)
- ((my-or e) e)
- ((my-or e1 e2 ...)
- (let ((temp e1))
- (if temp
- temp
- (my-or e2 ...)))))))
- (let ((x #f)
- (y 7)
- (temp 8)
- (let odd?)
- (if even?))
- (my-or x
- (let temp)
- (if y)
- y))) ==> 7
-}
-@end format
-
-
-@end deffn
-
-@node Pattern language, , Binding constructs for syntactic keywords, Macros
-@subsection Pattern language
-
-
-
-A @r{<transformer spec>} has the following form:
-
-
-@deffn {} syntax-rules @r{<literals>} @r{<syntax rule>} @dots{},
-
-@emph{Syntax:}
-@r{<Literals>} is a list of identifiers and each @r{<syntax rule>}
-should be of the form
-
-@format
-@t{(@r{<pattern>} @r{<template>})
-}
-@end format
-
-The @r{<pattern>} in a @r{<syntax rule>} is a list @r{<pattern>}
-that begins with the keyword for the macro.
-
-A @r{<pattern>} is either an identifier, a constant, or one of the
-following
-
-@format
-@t{(@r{<pattern>} @dots{})
-(@r{<pattern>} @r{<pattern>} @dots{} . @r{<pattern>})
-(@r{<pattern>} @dots{} @r{<pattern>} @r{<ellipsis>})
-#(@r{<pattern>} @dots{})
-#(@r{<pattern>} @dots{} @r{<pattern>} @r{<ellipsis>})
-}
-@end format
-
-and a template is either an identifier, a constant, or one of the following
-
-@format
-@t{(@r{<element>} @dots{})
-(@r{<element>} @r{<element>} @dots{} . @r{<template>})
-#(@r{<element>} @dots{})
-}
-@end format
-
-where an @r{<element>} is a @r{<template>} optionally
-followed by an @r{<ellipsis>} and
-an @r{<ellipsis>} is the identifier ``@samp{...}'' (which cannot be used as
-an identifier in either a template or a pattern).
-@vindex ...
-
-@emph{Semantics:} An instance of @samp{syntax-rules} produces a new macro
-transformer by specifying a sequence of hygienic rewrite rules. A use
-of a macro whose keyword is associated with a transformer specified by
-@samp{syntax-rules} is matched against the patterns contained in the
-@r{<syntax rule>}s, beginning with the leftmost @r{<syntax rule>}.
-When a match is found, the macro use is transcribed hygienically
-according to the template.
-
-An identifier that appears in the pattern of a @r{<syntax rule>} is
-a @emph{pattern variable}, unless it is the keyword that begins the pattern,
-is listed in @r{<literals>}, or is the identifier ``@samp{...}''.
-Pattern variables match arbitrary input elements and
-are used to refer to elements of the input in the template. It is an
-error for the same pattern variable to appear more than once in a
-@r{<pattern>}.
-
-The keyword at the beginning of the pattern in a
-@r{<syntax rule>} is not involved in the matching and
-is not considered a pattern variable or literal identifier.
-
-
-@quotation
-@emph{Rationale:}
-The scope of the keyword is determined by the expression or syntax
-definition that binds it to the associated macro transformer.
-If the keyword were a pattern variable or literal
-identifier, then
-the template that follows the pattern would be within its scope
-regardless of whether the keyword were bound by @samp{let-syntax}
-or by @samp{letrec-syntax}.
-@end quotation
-
-
-Identifiers that appear in @r{<literals>} are interpreted as literal
-identifiers to be matched against corresponding subforms of the input.
-A subform
-in the input matches a literal identifier if and only if it is an
-identifier
-and either both its occurrence in the macro expression and its
-occurrence in the macro definition have the same lexical binding, or
-the two identifiers are equal and both have no lexical binding.
-
-@c [Bill Rozas suggested the term "noise word" for these literal
-@c identifiers, but in their most interesting uses, such as a setf
-@c macro, they aren't noise words at all. -- Will]
-
-A subpattern followed by @samp{...} can match zero or more elements of the
-input. It is an error for @samp{...} to appear in @r{<literals>}.
-Within a pattern the identifier @samp{...} must follow the last element of
-a nonempty sequence of subpatterns.
-
-More formally, an input form F matches a pattern P if and only if:
-
-
-
-@itemize @bullet
-
-@item
-P is a non-literal identifier; or
-
-@item
-P is a literal identifier and F is an identifier with the same
-binding; or
-
-@item
-P is a list @samp{(P_1 @dots{} P_n)} and F is a
-list of n
-forms that match P_1 through P_n, respectively; or
-
-@item
-P is an improper list
-@samp{(P_1 P_2 @dots{} P_n . P_n+1)}
-and F is a list or
-improper list of n or more forms that match P_1 through P_n,
-respectively, and whose nth ``cdr'' matches P_n+1; or
-
-@item
-P is of the form
-@samp{(P_1 @dots{} P_n P_n+1 <ellipsis>)}
-where <ellipsis> is the identifier @samp{...}
-and F is
-a proper list of at least n forms, the first n of which match
-P_1 through P_n, respectively, and each remaining element of F
-matches P_n+1; or
-
-@item
-P is a vector of the form @samp{#(P_1 @dots{} P_n)}
-and F is a vector
-of n forms that match P_1 through P_n; or
-
-@item
-P is of the form
-@samp{#(P_1 @dots{} P_n P_n+1 <ellipsis>)}
-where <ellipsis> is the identifier @samp{...}
-and F is a vector of n
-or more forms the first n of which match
-P_1 through P_n, respectively, and each remaining element of F
-matches P_n+1; or
-
-@item
-P is a datum and F is equal to P in the sense of
-the @samp{equal?} procedure.
-
-@end itemize
-
-
-It is an error to use a macro keyword, within the scope of its
-binding, in an expression that does not match any of the patterns.
-
-When a macro use is transcribed according to the template of the
-matching @r{<syntax rule>}, pattern variables that occur in the
-template are replaced by the subforms they match in the input.
-Pattern variables that occur in subpatterns followed by one or more
-instances of the identifier
-@samp{...} are allowed only in subtemplates that are
-followed by as many instances of @samp{...}.
-They are replaced in the
-output by all of the subforms they match in the input, distributed as
-indicated. It is an error if the output cannot be built up as
-specified.
-
-@c %% This description of output construction is very vague. It should
-@c %% probably be formalized, but that is not easy...
-
-Identifiers that appear in the template but are not pattern variables
-or the identifier
-@samp{...} are inserted into the output as literal identifiers. If a
-literal identifier is inserted as a free identifier then it refers to the
-binding of that identifier within whose scope the instance of
-@samp{syntax-rules} appears.
-If a literal identifier is inserted as a bound identifier then it is
-in effect renamed to prevent inadvertent captures of free identifiers.
-
-As an example, if @code{let} and @code{cond} are defined as in
-@vindex @w{cond}
-@vindex @w{let}
-section @ref{Derived expression type} then they are hygienic (as required) and
-the following is not an error.
-
-
-@format
-@t{(let ((=> #f))
- (cond (#t => 'ok))) ==> ok
-}
-@end format
-
-
-The macro transformer for @samp{cond} recognizes @samp{=>}
-as a local variable, and hence an expression, and not as the
-top-level identifier @samp{=>}, which the macro transformer treats
-as a syntactic keyword. Thus the example expands into
-
-
-@format
-@t{(let ((=> #f))
- (if #t (begin => 'ok)))
-}
-@end format
-
-
-instead of
-
-
-@format
-@t{(let ((=> #f))
- (let ((temp #t))
- (if temp ('ok temp))))
-}
-@end format
-
-
-which would result in an invalid procedure call.
-
-@end deffn
-
-
-@page
-
-@c @include{prog}
-@node Program structure, Standard procedures, Expressions, top
-@chapter Program structure
-
-@menu
-* Programs::
-* Definitions::
-* Syntax definitions::
-@end menu
-
-
-
-@node Programs, Definitions, Program structure, Program structure
-@section Programs
-
-
-A Scheme program consists of a sequence of expressions, definitions,
-and syntax definitions.
-Expressions are described in chapter @ref{Expressions};
-definitions and syntax definitions are the subject of the rest of the
-present chapter.
-
-Programs are typically stored in files or entered interactively to a
-running Scheme system, although other paradigms are possible;
-questions of user interface lie outside the scope of this report.
-(Indeed, Scheme would still be useful as a notation for expressing
-computational methods even in the absence of a mechanical
-implementation.)
-
-Definitions and syntax definitions occurring at the top level of a program
-can be interpreted
-declaratively.
-They cause bindings to be created in the top level
-environment or modify the value of existing top-level bindings.
-Expressions occurring at the top level of a program are
-interpreted imperatively; they are executed in order when the program is
-invoked or loaded, and typically perform some kind of initialization.
-
-At the top level of a program @t{(begin @r{<form1>} @dots{},)} is
-equivalent to the sequence of expressions, definitions, and syntax definitions
-that form the body of the @code{begin}.
-@vindex @w{begin}
-
-@ignore todo
-Cromarty, etc.: disclaimer about top level?
-@end ignore
-
-
-@node Definitions, Syntax definitions, Programs, Program structure
-@section Definitions
-
-@menu
-* Top level definitions::
-* Internal definitions::
-@end menu
-
-
-
-Definitions are valid in some, but not all, contexts where expressions
-are allowed. They are valid only at the top level of a @r{<program>}
-and at the beginning of a @r{<body>}.
-
-@cindex @w{definition}
-
-A definition should have one of the following forms:
-@cindex @w{define}
-
-
-
-@itemize @bullet
-
-
-@item @t{(define @r{<variable>} @r{<expression>})}
-
-@item @t{(define (@r{<variable>} @r{<formals>}) @r{<body>})}
-
-@r{<Formals>} should be either a
-sequence of zero or more variables, or a sequence of one or more
-variables followed by a space-delimited period and another variable (as
-in a lambda expression). This form is equivalent to
-
-@example
-
-(define @r{<variable>}
- (lambda (@r{<formals>}) @r{<body>}))@r{.}
-
-@end example
-
-
-@item @t{(define (@r{<variable>} .@: @r{<formal>}) @r{<body>})}
-
-@r{<Formal>} should be a single
-variable. This form is equivalent to
-
-@example
-
-(define @r{<variable>}
- (lambda @r{<formal>} @r{<body>}))@r{.}
-
-@end example
-
-
-
-@end itemize
-
-
-@node Top level definitions, Internal definitions, Definitions, Definitions
-@subsection Top level definitions
-
-
-At the top level of a program, a definition
-
-@example
-
-(define @r{<variable>} @r{<expression>})
-
-@end example
-
-has essentially the same effect as the assignment expression
-
-@example
-
-(set! @r{<variable>} @r{<expression>})
-
-@end example
-
-if @r{<variable>} is bound. If @r{<variable>} is not bound,
-however, then the definition will bind @r{<variable>} to a new
-location before performing the assignment, whereas it would be an error
-to perform a @samp{set!} on an unbound variable.
-@cindex @w{unbound}
-
-
-@example
-
-(define add3
- (lambda (x) (+ x 3)))
-(add3 3) ==> 6
-(define first car)
-(first '(1 2)) ==> 1
-
-@end example
-
-
-Some implementations of Scheme use an initial environment in
-which all possible variables are bound to locations, most of
-which contain undefined values. Top level definitions in
-such an implementation are truly equivalent to assignments.
-
-@ignore todo
-Rozas: equal time for opposition semantics?
-@end ignore
-
-
-
-@node Internal definitions, , Top level definitions, Definitions
-@subsection Internal definitions
-
-
-
-Definitions may occur at the
-beginning of a @r{<body>} (that is, the body of a @code{lambda},
-@vindex @w{lambda}
-@code{let}, @code{let*}, @code{letrec}, @code{let-syntax}, or @code{letrec-syntax}
-@vindex @w{letrec-syntax}
-@vindex @w{let-syntax}
-@vindex @w{letrec}
-@vindex @w{let*}
-@vindex @w{let}
-expression or that of a definition of an appropriate form).
-Such definitions are known as @emph{internal definitions} as opposed to the top level definitions described above.
-@cindex @w{internal definition}
-The variable defined by an internal definition is local to the
-@r{<body>}. That is, @r{<variable>} is bound rather than assigned,
-and the region of the binding is the entire @r{<body>}. For example,
-
-
-@example
-
-(let ((x 5))
- (define foo (lambda (y) (bar x y)))
- (define bar (lambda (a b) (+ (* a b) a)))
- (foo (+ x 3))) ==> 45
-
-@end example
-
-
-A @r{<body>} containing internal definitions can always be converted
-into a completely equivalent @samp{letrec} expression. For example, the
-@samp{let} expression in the above example is equivalent to
-
-
-@example
-
-(let ((x 5))
- (letrec ((foo (lambda (y) (bar x y)))
- (bar (lambda (a b) (+ (* a b) a))))
- (foo (+ x 3))))
-
-@end example
-
-
-Just as for the equivalent @samp{letrec} expression, it must be
-possible to evaluate each @r{<expression>} of every internal
-definition in a @r{<body>} without assigning or referring to
-the value of any @r{<variable>} being defined.
-
-Wherever an internal definition may occur
-@t{(begin @r{<definition1>} @dots{},)}
-is equivalent to the sequence of definitions
-that form the body of the @code{begin}.
-@vindex @w{begin}
-
-@node Syntax definitions, , Definitions, Program structure
-@section Syntax definitions
-
-
-Syntax definitions are valid only at the top level of a @r{<program>}.
-
-@cindex @w{syntax definition}
-They have the following form:
-@cindex @w{define-syntax}
-
-@t{(define-syntax @r{<keyword>} @r{<transformer spec>})}
-
-@r{<Keyword>} is an identifier, and
-the @r{<transformer spec>} should be an instance of @code{syntax-rules}.
-@vindex @w{syntax-rules}
-The top-level syntactic environment is extended by binding the
-@r{<keyword>} to the specified transformer.
-
-There is no @samp{define-syntax} analogue of internal definitions.
-
-@c [Rationale flushed because it may or may not be true and isn't the
-@c real rationale anyway. -RK]
-@c \begin{rationale}
-@c As discussed below, the syntax and scope rules for syntax definitions
-@c can give rise to syntactic ambiguities when syntactic keywords are
-@c shadowed.
-@c Further ambiguities would arise if {\cf define-syntax}
-@c were permitted at the beginning of a \meta{body}, with scope
-@c rules analogous to those for internal definitions.
-@c \end{rationale}
-
-@c It is an error for a program to contain more than one top-level
-@c \meta{definition} or \meta{syntax definition} of any identifier.
-
-@c [I flushed this because it isn't an error for a program to
-@c contain more than one top-level definition of an identifier,
-@c and I didn't want to introduce any gratuitous incompatibilities
-@c with the existing Scheme language. -- Will]
-
-Although macros may expand into definitions and syntax definitions in
-any context that permits them, it is an error for a definition or syntax
-definition to shadow a syntactic keyword whose meaning is needed to
-determine whether some form in the group of forms that contains the
-shadowing definition is in fact a definition, or, for internal definitions,
-is needed to determine the boundary between the group and the expressions
-that follow the group. For example, the following are errors:
-
-
-@example
-
-(define define 3)
-
-(begin (define begin list))
-
-(let-syntax
- ((foo (syntax-rules ()
- ((foo (proc args ...) body ...)
- (define proc
- (lambda (args ...)
- body ...))))))
- (let ((x 3))
- (foo (plus x y) (+ x y))
- (define foo x)
- (plus foo x)))
-
-@end example
-
-
-
-
-@c @include{procs}
-
-@c Initial environment
-
-@c \vfill\eject
-@node Standard procedures, Formal syntax and semantics, Program structure, top
-@chapter Standard procedures
-
-@menu
-* Equivalence predicates::
-* Numbers::
-* Other data types::
-* Control features::
-* Eval::
-* Input and output::
-@end menu
-
-
-
-
-
-@cindex @w{initial environment}
-
-@cindex @w{top level environment}
-
-@cindex @w{library procedure}
-
-This chapter describes Scheme's built-in procedures. The initial (or
-``top level'') Scheme environment starts out with a number of variables
-bound to locations containing useful values, most of which are primitive
-procedures that manipulate data. For example, the variable @samp{abs} is
-bound to (a location initially containing) a procedure of one argument
-that computes the absolute value of a number, and the variable @samp{+}
-is bound to a procedure that computes sums. Built-in procedures that
-can easily be written in terms of other built-in procedures are identified as
-``library procedures''.
-
-A program may use a top-level definition to bind any variable. It may
-subsequently alter any such binding by an assignment (see @pxref{Assignments}).
-These operations do not modify the behavior of Scheme's built-in
-procedures. Altering any top-level binding that has not been introduced by a
-definition has an unspecified effect on the behavior of the built-in procedures.
-
-@node Equivalence predicates, Numbers, Standard procedures, Standard procedures
-@section Equivalence predicates
-
-
-
-A @dfn{predicate} is a procedure that always returns a boolean
-@cindex @w{predicate}
-value (@t{#t} or @t{#f}). An @dfn{equivalence predicate} is
-@cindex @w{equivalence predicate}
-the computational analogue of a mathematical equivalence relation (it is
-symmetric, reflexive, and transitive). Of the equivalence predicates
-described in this section, @samp{eq?} is the finest or most
-discriminating, and @samp{equal?} is the coarsest. @samp{Eqv?} is
-slightly less discriminating than @samp{eq?}.
-@ignore todo
-Pitman doesn't like
-this paragraph. Lift the discussion from the Maclisp manual. Explain
-why there's more than one predicate.
-@end ignore
-
-
-
-
-@deffn {procedure} eqv? obj1 obj2
-
-The @samp{eqv?} procedure defines a useful equivalence relation on objects.
-Briefly, it returns @t{#t} if @var{obj1} and @var{obj2} should
-normally be regarded as the same object. This relation is left slightly
-open to interpretation, but the following partial specification of
-@samp{eqv?} holds for all implementations of Scheme.
-
-The @samp{eqv?} procedure returns @t{#t} if:
-
-
-
-@itemize @bullet
-
-@item
-@var{obj1} and @var{obj2} are both @t{#t} or both @t{#f}.
-
-@item
-@var{obj1} and @var{obj2} are both symbols and
-
-
-@format
-@t{(string=? (symbol->string obj1)
- (symbol->string obj2))
- ==> #t
-}
-@end format
-
-
-
-@quotation
-@emph{Note:}
-This assumes that neither @var{obj1} nor @var{obj2} is an ``uninterned
-symbol'' as alluded to in section @ref{Symbols}. This report does
-not presume to specify the behavior of @samp{eqv?} on implementation-dependent
-extensions.
-@end quotation
-
-
-@item
-@var{obj1} and @var{obj2} are both numbers, are numerically
-equal (see @samp{=}, section @pxref{Numbers}), and are either both
-exact or both inexact.
-
-@item
-@var{obj1} and @var{obj2} are both characters and are the same
-character according to the @samp{char=?} procedure
-(section @pxref{Characters}).
-
-@item
-both @var{obj1} and @var{obj2} are the empty list.
-
-@item
-@var{obj1} and @var{obj2} are pairs, vectors, or strings that denote the
-same locations in the store (section @pxref{Storage model}).
-
-@item
-@var{obj1} and @var{obj2} are procedures whose location tags are
-equal (section @pxref{Procedures}).
-
-@end itemize
-
-@cindex @w{inexact}
-@cindex @w{exact}
-
-The @samp{eqv?} procedure returns @t{#f} if:
-
-
-
-@itemize @bullet
-
-@item
-@var{obj1} and @var{obj2} are of different types
-(section @pxref{Disjointness of types}).
-
-@item
-one of @var{obj1} and @var{obj2} is @t{#t} but the other is
-@t{#f}.
-
-@item
-@var{obj1} and @var{obj2} are symbols but
-
-
-@format
-@t{(string=? (symbol->string @var{obj1})
- (symbol->string @var{obj2}))
- ==> #f
-}
-@end format
-
-
-@item
-one of @var{obj1} and @var{obj2} is an exact number but the other
-is an inexact number.
-
-@item
-@var{obj1} and @var{obj2} are numbers for which the @samp{=}
-procedure returns @t{#f}.
-
-@item
-@var{obj1} and @var{obj2} are characters for which the @samp{char=?}
-procedure returns @t{#f}.
-
-@item
-one of @var{obj1} and @var{obj2} is the empty list but the other
-is not.
-
-@item
-@var{obj1} and @var{obj2} are pairs, vectors, or strings that denote
-distinct locations.
-
-@item
-@var{obj1} and @var{obj2} are procedures that would behave differently
-(return different value(s) or have different side effects) for some arguments.
-
-
-@end itemize
-
-
-
-@format
-@t{(eqv? 'a 'a) ==> #t
-(eqv? 'a 'b) ==> #f
-(eqv? 2 2) ==> #t
-(eqv? '() '()) ==> #t
-(eqv? 100000000 100000000) ==> #t
-(eqv? (cons 1 2) (cons 1 2)) ==> #f
-(eqv? (lambda () 1)
- (lambda () 2)) ==> #f
-(eqv? #f 'nil) ==> #f
-(let ((p (lambda (x) x)))
- (eqv? p p)) ==> #t
-}
-@end format
-
-
-The following examples illustrate cases in which the above rules do
-not fully specify the behavior of @samp{eqv?}. All that can be said
-about such cases is that the value returned by @samp{eqv?} must be a
-boolean.
-
-
-@format
-@t{(eqv? "" "") ==> @emph{unspecified}
-(eqv? '#() '#()) ==> @emph{unspecified}
-(eqv? (lambda (x) x)
- (lambda (x) x)) ==> @emph{unspecified}
-(eqv? (lambda (x) x)
- (lambda (y) y)) ==> @emph{unspecified}
-}
-@end format
-
-
-The next set of examples shows the use of @samp{eqv?} with procedures
-that have local state. @samp{Gen-counter} must return a distinct
-procedure every time, since each procedure has its own internal counter.
-@samp{Gen-loser}, however, returns equivalent procedures each time, since
-the local state does not affect the value or side effects of the
-procedures.
-
-
-@format
-@t{(define gen-counter
- (lambda ()
- (let ((n 0))
- (lambda () (set! n (+ n 1)) n))))
-(let ((g (gen-counter)))
- (eqv? g g)) ==> #t
-(eqv? (gen-counter) (gen-counter))
- ==> #f
-(define gen-loser
- (lambda ()
- (let ((n 0))
- (lambda () (set! n (+ n 1)) 27))))
-(let ((g (gen-loser)))
- (eqv? g g)) ==> #t
-(eqv? (gen-loser) (gen-loser))
- ==> @emph{unspecified}
-
-(letrec ((f (lambda () (if (eqv? f g) 'both 'f)))
- (g (lambda () (if (eqv? f g) 'both 'g))))
- (eqv? f g))
- ==> @emph{unspecified}
-
-(letrec ((f (lambda () (if (eqv? f g) 'f 'both)))
- (g (lambda () (if (eqv? f g) 'g 'both))))
- (eqv? f g))
- ==> #f
-}
-@end format
-
-
-@c Objects of distinct types must never be regarded as the same object,
-@c except that \schfalse{} and the empty list\index{empty list} are permitted to
-@c be identical.
-
-@c \begin{scheme}
-@c (eqv? '() \schfalse) \ev \unspecified%
-@c \end{scheme}
-
-Since it is an error to modify constant objects (those returned by
-literal expressions), implementations are permitted, though not
-required, to share structure between constants where appropriate. Thus
-the value of @samp{eqv?} on constants is sometimes
-implementation-dependent.
-
-
-@format
-@t{(eqv? '(a) '(a)) ==> @emph{unspecified}
-(eqv? "a" "a") ==> @emph{unspecified}
-(eqv? '(b) (cdr '(a b))) ==> @emph{unspecified}
-(let ((x '(a)))
- (eqv? x x)) ==> #t
-}
-@end format
-
-
-
-@quotation
-@emph{Rationale:}
-The above definition of @samp{eqv?} allows implementations latitude in
-their treatment of procedures and literals: implementations are free
-either to detect or to fail to detect that two procedures or two literals
-are equivalent to each other, and can decide whether or not to
-merge representations of equivalent objects by using the same pointer or
-bit pattern to represent both.
-@end quotation
-
-
-@end deffn
-
-
-
-@deffn {procedure} eq? obj1 obj2
-
-@samp{Eq?} is similar to @samp{eqv?} except that in some cases it is
-capable of discerning distinctions finer than those detectable by
-@samp{eqv?}.
-
-@samp{Eq?} and @samp{eqv?} are guaranteed to have the same
-behavior on symbols, booleans, the empty list, pairs, procedures,
-and non-empty
-strings and vectors. @samp{Eq?}'s behavior on numbers and characters is
-implementation-dependent, but it will always return either true or
-false, and will return true only when @samp{eqv?} would also return
-true. @samp{Eq?} may also behave differently from @samp{eqv?} on empty
-vectors and empty strings.
-
-
-@format
-@t{(eq? 'a 'a) ==> #t
-(eq? '(a) '(a)) ==> @emph{unspecified}
-(eq? (list 'a) (list 'a)) ==> #f
-(eq? "a" "a") ==> @emph{unspecified}
-(eq? "" "") ==> @emph{unspecified}
-(eq? '() '()) ==> #t
-(eq? 2 2) ==> @emph{unspecified}
-(eq? #\A #\A) ==> @emph{unspecified}
-(eq? car car) ==> #t
-(let ((n (+ 2 3)))
- (eq? n n)) ==> @emph{unspecified}
-(let ((x '(a)))
- (eq? x x)) ==> #t
-(let ((x '#()))
- (eq? x x)) ==> #t
-(let ((p (lambda (x) x)))
- (eq? p p)) ==> #t
-}
-@end format
-
-
-@ignore todo
-Needs to be explained better above. How can this be made to be
-not confusing? A table maybe?
-@end ignore
-
-
-
-@quotation
-@emph{Rationale:} It will usually be possible to implement @samp{eq?} much
-more efficiently than @samp{eqv?}, for example, as a simple pointer
-comparison instead of as some more complicated operation. One reason is
-that it may not be possible to compute @samp{eqv?} of two numbers in
-constant time, whereas @samp{eq?} implemented as pointer comparison will
-always finish in constant time. @samp{Eq?} may be used like @samp{eqv?}
-in applications using procedures to implement objects with state since
-it obeys the same constraints as @samp{eqv?}.
-@end quotation
-
-
-@end deffn
-
-
-
-@deffn {library procedure} equal? obj1 obj2
-
-@samp{Equal?} recursively compares the contents of pairs, vectors, and
-strings, applying @samp{eqv?} on other objects such as numbers and symbols.
-A rule of thumb is that objects are generally @samp{equal?} if they print
-the same. @samp{Equal?} may fail to terminate if its arguments are
-circular data structures.
-
-
-@format
-@t{(equal? 'a 'a) ==> #t
-(equal? '(a) '(a)) ==> #t
-(equal? '(a (b) c)
- '(a (b) c)) ==> #t
-(equal? "abc" "abc") ==> #t
-(equal? 2 2) ==> #t
-(equal? (make-vector 5 'a)
- (make-vector 5 'a)) ==> #t
-(equal? (lambda (x) x)
- (lambda (y) y)) ==> @emph{unspecified}
-}
-@end format
-
-
-@end deffn
-
-
-@node Numbers, Other data types, Equivalence predicates, Standard procedures
-@section Numbers
-
-@menu
-* Numerical types::
-* Exactness::
-* Implementation restrictions::
-* Syntax of numerical constants::
-* Numerical operations::
-* Numerical input and output::
-@end menu
-
-
-
-@cindex @w{number}
-
-@c %R4%% The excessive use of the code font in this section was
-@c confusing, somewhat obnoxious, and inconsistent with the rest
-@c of the report and with parts of the section itself. I added
-@c a \tupe no-op, and changed most old uses of \type to \tupe,
-@c to make it easier to change the fonts back if people object
-@c to the change.
-
-@c \newcommand{\type}[1]{{\it#1}}
-@c \newcommand{\tupe}[1]{{#1}}
-
-Numerical computation has traditionally been neglected by the Lisp
-community. Until Common Lisp there was no carefully thought out
-strategy for organizing numerical computation, and with the exception of
-the MacLisp system [Pitman83] little effort was made to
-execute numerical code efficiently. This report recognizes the excellent work
-of the Common Lisp committee and accepts many of their recommendations.
-In some ways this report simplifies and generalizes their proposals in a manner
-consistent with the purposes of Scheme.
-
-It is important to distinguish between the mathematical numbers, the
-Scheme numbers that attempt to model them, the machine representations
-used to implement the Scheme numbers, and notations used to write numbers.
-This report uses the types @i{number}, @i{complex}, @i{real},
-@i{rational}, and @i{integer} to refer to both mathematical numbers
-and Scheme numbers. Machine representations such as fixed point and
-floating point are referred to by names such as @i{fixnum} and
-@i{flonum}.
-
-@c %R4%% I did some reorganizing here to move the discussion of mathematical
-@c numbers before the discussion of the Scheme numbers, hoping that this
-@c would help to motivate the discussion of representation independence.
-
-@node Numerical types, Exactness, Numbers, Numbers
-@subsection Numerical types
-
-
-
-@cindex @w{numerical types}
-
-@c %R4%% A Scheme system provides data of type \type{number}, which is the most
-@c general numerical type supported by that system.
-@c \type{Number} is
-@c likely to be a complicated union type implemented in terms of
-@c \type{fixnum}s, \type{bignum}s, \type{flonum}s, and so forth, but this
-@c should not be apparent to a naive user. What the user should see is
-@c that the usual operations on numbers produce the mathematically
-@c expected results, within the limits of the implementation.
-
-@c %R4%% I rewrote the following paragraph to make the various levels of
-@c the tower into subsets of each other, instead of relating them by
-@c injections. I think the injections tended to put people in the frame
-@c of mind of thinking about coercions between non-overlapping numeric
-@c types in mainstream programming languages.
-
-Mathematically, numbers may be arranged into a tower of subtypes
-@c %R4%% with injections relating adjacent levels of the tower:
-in which each level is a subset of the level above it:
-
-@format
- @r{number}
- @r{complex}
- @r{real}
- @r{rational}
- @r{integer}
-@end format
-
-
-For example, 3 is an integer. Therefore 3 is also a rational,
-a real, and a complex. The same is true of the Scheme numbers
-that model 3. For Scheme numbers, these types are defined by the
-predicates @code{number?}, @code{complex?}, @code{real?}, @code{rational?},
-@vindex @w{rational?}
-@vindex @w{real?}
-@vindex @w{complex?}
-@vindex @w{number?}
-and @code{integer?}.
-@vindex @w{integer?}
-
-There is no simple relationship between a number's type and its
-representation inside a computer. Although most implementations of
-Scheme will offer at least two different representations of 3, these
-different representations denote the same integer.
-
-@c %R4%% I moved "Implementations of Scheme are not required to implement
-@c the whole tower..." to the subsection on implementation restrictions.
-
-Scheme's numerical operations treat numbers as abstract data, as
-independent of their representation as possible. Although an implementation
-of Scheme may use fixnum, flonum, and perhaps other representations for
-numbers, this should not be apparent to a casual programmer writing
-simple programs.
-
-It is necessary, however, to distinguish between numbers that are
-represented exactly and those that may not be. For example, indexes
-into data structures must be known exactly, as must some polynomial
-coefficients in a symbolic algebra system. On the other hand, the
-results of measurements are inherently inexact, and irrational numbers
-may be approximated by rational and therefore inexact approximations.
-In order to catch uses of inexact numbers where exact numbers are
-required, Scheme explicitly distinguishes exact from inexact numbers.
-This distinction is orthogonal to the dimension of type.
-
-@node Exactness, Implementation restrictions, Numerical types, Numbers
-@subsection Exactness
-
-
-@c %R4%% I tried to direct the following paragraph away from philosophizing
-@c about the exactness of mathematical numbers, and toward philosophizing
-@c about the exactness of Scheme numbers.
-
-
-@cindex @w{exactness}
-Scheme numbers are either @i{exact} or @i{inexact}. A number is
-@r{exact} if it was written as an exact constant or was derived from
-@r{exact} numbers using only @r{exact} operations. A number is
-@r{inexact} if it was written as an inexact constant,
-@c %R4%% models a quantity (e.g., a measurement) known only approximately,
-if it was
-derived using @r{inexact} ingredients, or if it was derived using
-@r{inexact} operations. Thus @r{inexact}ness is a contagious
-property of a number.
-@c %R4%% The rest of this paragraph (from R3RS) has been dropped.
-
-If two implementations produce @r{exact} results for a
-computation that did not involve @r{inexact} intermediate results,
-the two ultimate results will be mathematically equivalent. This is
-generally not true of computations involving @r{inexact} numbers
-since approximate methods such as floating point arithmetic may be used,
-but it is the duty of each implementation to make the result as close as
-practical to the mathematically ideal result.
-
-Rational operations such as @samp{+} should always produce
-@r{exact} results when given @r{exact} arguments.
-@c %R4%%If an implementation is
-@c unable to represent an \tupe{exact} result (for example, if it does not
-@c support infinite precision integers and rationals)
-If the operation is unable to produce an @r{exact} result,
-then it may either report the violation of an implementation restriction
-or it may silently coerce its
-result to an @r{inexact} value.
-@c %R4%%Such a coercion may cause an error later.
-See section @ref{Implementation restrictions}.
-
-With the exception of @code{inexact->exact}, the operations described in
-@vindex @w{inexact->exact}
-this section must generally return inexact results when given any inexact
-arguments. An operation may, however, return an @r{exact} result if it can
-prove that the value of the result is unaffected by the inexactness of its
-arguments. For example, multiplication of any number by an @r{exact} zero
-may produce an @r{exact} zero result, even if the other argument is
-@r{inexact}.
-
-@node Implementation restrictions, Syntax of numerical constants, Exactness, Numbers
-@subsection Implementation restrictions
-
-
-
-@cindex @w{implementation restriction}
-
-Implementations of Scheme are not required to implement the whole
-tower of subtypes given in section @ref{Numerical types},
-but they must implement a coherent subset consistent with both the
-purposes of the implementation and the spirit of the Scheme language.
-For example, an implementation in which all numbers are @r{real}
-may still be quite useful.
-
-Implementations may also support only a limited range of numbers of
-any type, subject to the requirements of this section. The supported
-range for @r{exact} numbers of any type may be different from the
-supported range for @r{inexact} numbers of that type. For example,
-an implementation that uses flonums to represent all its
-@r{inexact} @r{real} numbers may
-support a practically unbounded range of @r{exact} @r{integer}s
-and @r{rational}s
-while limiting the range of @r{inexact} @r{real}s (and therefore
-the range of @r{inexact} @r{integer}s and @r{rational}s)
-to the dynamic range of the flonum format.
-Furthermore
-the gaps between the representable @r{inexact} @r{integer}s and
-@r{rational}s are
-likely to be very large in such an implementation as the limits of this
-range are approached.
-
-An implementation of Scheme must support exact integers
-throughout the range of numbers that may be used for indexes of
-lists, vectors, and strings or that may result from computing the length of a
-list, vector, or string. The @code{length}, @code{vector-length},
-@vindex @w{vector-length}
-@vindex @w{length}
-and @code{string-length} procedures must return an exact
-@vindex @w{string-length}
-integer, and it is an error to use anything but an exact integer as an
-index. Furthermore any integer constant within the index range, if
-expressed by an exact integer syntax, will indeed be read as an exact
-integer, regardless of any implementation restrictions that may apply
-outside this range. Finally, the procedures listed below will always
-return an exact integer result provided all their arguments are exact integers
-and the mathematically expected result is representable as an exact integer
-within the implementation:
-
-
-@example
-
-+ - *
-quotient remainder modulo
-max min abs
-numerator denominator gcd
-lcm floor ceiling
-truncate round rationalize
-expt
-
-@end example
-
-
-Implementations are encouraged, but not required, to support
-@r{exact} @r{integer}s and @r{exact} @r{rational}s of
-practically unlimited size and precision, and to implement the
-above procedures and the @samp{/} procedure in
-such a way that they always return @r{exact} results when given @r{exact}
-arguments. If one of these procedures is unable to deliver an @r{exact}
-result when given @r{exact} arguments, then it may either report a
-violation of an
-implementation restriction or it may silently coerce its result to an
-@r{inexact} number. Such a coercion may cause an error later.
-
-@c %R4%% I moved this stuff here.
-@c It seems to me that the only thing that this requires is that
-@c implementations that support inexact numbers have to have both
-@c exact and inexact representations for the integers 0 through 15.
-@c If that's what it's saying, I'd rather say it that way.
-@c On the other hand, letting the limit be as small as 15 sounds a
-@c tad silly, though I think I understand how that number was arrived at.
-@c (Or is 35 the number?)
-
-@c Implementations are encouraged, but not required, to support \tupe{inexact}
-@c numbers. For any implementation that supports \tupe{inexact} numbers,
-@c there is a subset of the integers for which there are both \tupe{exact} and
-@c \tupe{inexact} representations. This subset must include all non-negative
-@c integers up to some limit specified by the implementation. This limit
-@c must be 16 or greater. The
-@c \ide{exact\coerce{}inexact} and \ide{inexact\coerce{}exact}
-@c procedures implement the natural one-to-one correspondence between
-@c the \tupe{inexact} and \tupe{exact} integers within this range.
-
-An implementation may use floating point and other approximate
-representation strategies for @r{inexact} numbers.
-@c %R4%% The following sentence seemed a bit condescending as well as
-@c awkward. It didn't seem to be very enforceable, so I flushed it.
-
-@c This is not to
-@c say that implementors need not use the best known algorithms for
-@c \tupe{inexact} computations---only that approximate methods of high
-@c quality are allowed.
-
-This report recommends, but does not require, that the IEEE 32-bit
-and 64-bit floating point standards be followed by implementations that use
-flonum representations, and that implementations using
-other representations should match or exceed the precision achievable
-using these floating point standards [IEEE].
-
-In particular, implementations that use flonum representations
-must follow these rules: A @r{flonum} result
-must be represented with at least as much precision as is used to express any of
-the inexact arguments to that operation. It is desirable (but not required) for
-potentially inexact operations such as @samp{sqrt}, when applied to @r{exact}
-arguments, to produce @r{exact} answers whenever possible (for example the
-square root of an @r{exact} 4 ought to be an @r{exact} 2).
-If, however, an
-@r{exact} number is operated upon so as to produce an @r{inexact} result
-(as by @samp{sqrt}), and if the result is represented as a @r{flonum}, then
-the most precise @r{flonum} format available must be used; but if the result
-is represented in some other way then the representation must have at least as
-much precision as the most precise @r{flonum} format available.
-
-Although Scheme allows a variety of written
-@c %R4%% representations of
-notations for
-numbers, any particular implementation may support only some of them.
-@c %R4%%
-For example, an implementation in which all numbers are @r{real}
-need not support the rectangular and polar notations for complex
-numbers. If an implementation encounters an @r{exact} numerical constant that
-it cannot represent as an @r{exact} number, then it may either report a
-violation of an implementation restriction or it may silently represent the
-constant by an @r{inexact} number.
-
-
-@node Syntax of numerical constants, Numerical operations, Implementation restrictions, Numbers
-@subsection Syntax of numerical constants
-
-
-
-@c @@@@LOSE@@@@
-
-@c %R4%% I removed the following paragraph in an attempt to tighten up
-@c this subsection. Except for its first sentence, which I moved to
-@c the subsection on implementation restrictions, I think its content
-@c is implied by the rest of the section.
-
-@c Although Scheme allows a variety of written representations of numbers,
-@c any particular implementation may support only some of them.
-@c These syntaxes are intended to be purely notational; any kind of number
-@c may be written in any form that the user deems convenient. Of course,
-@c writing 1/7 as a limited-precision decimal fraction will not express the
-@c number exactly, but this approximate form of expression may be just what
-@c the user wants to see.
-
-The syntax of the written representations for numbers is described formally in
-section @ref{Lexical structure}. Note that case is not significant in numerical
-constants.
-
-@c %R4%% See section~\ref{numberformats} for many examples.
-
-A number may be written in binary, octal, decimal, or
-hexadecimal by the use of a radix prefix. The radix prefixes are @samp{#b} (binary), @samp{#o} (octal), @samp{#d} (decimal), and @samp{#x} (hexadecimal). With
-@vindex #x
-@vindex #d
-@vindex #o
-@vindex #b
-no radix prefix, a number is assumed to be expressed in decimal.
-
-A
-@c %R4%%
-@c simple
-numerical constant may be specified to be either @r{exact} or
-@r{inexact} by a prefix. The prefixes are @samp{#e}
-@vindex #e
-for @r{exact}, and @samp{#i} for @r{inexact}. An exactness
-@vindex #i
-prefix may appear before or after any radix prefix that is used. If
-the written representation of a number has no exactness prefix, the
-constant may be either @r{inexact} or @r{exact}. It is
-@r{inexact} if it contains a decimal point, an
-exponent, or a ``#'' character in the place of a digit,
-otherwise it is @r{exact}.
-@c %R4%% With our new syntax, the following sentence is redundant:
-
-@c The written representation of a
-@c compound number, such as a ratio or a complex, is exact if and only if
-@c all of its constituents are exact.
-
-In systems with @r{inexact} numbers
-of varying precisions it may be useful to specify
-the precision of a constant. For this purpose, numerical constants
-may be written with an exponent marker that indicates the
-desired precision of the @r{inexact}
-representation. The letters @samp{s}, @samp{f},
-@samp{d}, and @samp{l} specify the use of @var{short}, @var{single},
-@var{double}, and @var{long} precision, respectively. (When fewer
-than four internal
-@c %R4%%\tupe{flonum}
-@r{inexact}
-representations exist, the four size
-specifications are mapped onto those available. For example, an
-implementation with two internal representations may map short and
-single together and long and double together.) In addition, the
-exponent marker @samp{e} specifies the default precision for the
-implementation. The default precision has at least as much precision
-as @var{double}, but
-implementations may wish to allow this default to be set by the user.
-
-
-@example
-
-3.14159265358979F0
- @r{Round to single ---} 3.141593
-0.6L0
- @r{Extend to long ---} .600000000000000
-
-@end example
-
-
-
-@node Numerical operations, Numerical input and output, Syntax of numerical constants, Numbers
-@subsection Numerical operations
-
-
-The reader is referred to section @ref{Entry format} for a summary
-of the naming conventions used to specify restrictions on the types of
-arguments to numerical routines.
-@c %R4%% The following sentence has already been said twice, and the
-@c term "exactness-preserving" is no longer defined by the Report.
-
-@c Remember that
-@c an exactness-preserving operation may coerce its result to inexact if the
-@c implementation is unable to represent it exactly.
-The examples used in this section assume that any numerical constant written
-using an @r{exact} notation is indeed represented as an @r{exact}
-number. Some examples also assume that certain numerical constants written
-using an @r{inexact} notation can be represented without loss of
-accuracy; the @r{inexact} constants were chosen so that this is
-likely to be true in implementations that use flonums to represent
-inexact numbers.
-
-@ignore todo
-Scheme provides the usual set of operations for manipulating
-numbers, etc.
-@end ignore
-
-
-
-@deffn {procedure} number? obj
-@deffnx {procedure} complex? obj
-@deffnx {procedure} real? obj
-@deffnx {procedure} rational? obj
-@deffnx {procedure} integer? obj
-
-These numerical type predicates can be applied to any kind of
-argument, including non-numbers. They return @t{#t} if the object is
-of the named type, and otherwise they return @t{#f}.
-In general, if a type predicate is true of a number then all higher
-type predicates are also true of that number. Consequently, if a type
-predicate is false of a number, then all lower type predicates are
-also false of that number.
-@c %R4%% The new section on implementation restrictions subsumes:
-@c Not every system
-@c supports all of these types; for example, it is entirely possible to have a
-@c Scheme system that has only \tupe{integer}s. Nonetheless every implementation
-@c of Scheme must have all of these predicates.
-
-If @var{z} is an inexact complex number, then @samp{(real? @var{z})} is true if
-and only if @samp{(zero? (imag-part @var{z}))} is true. If @var{x} is an inexact
-real number, then @samp{(integer? @var{x})} is true if and only if
-@samp{(= @var{x} (round @var{x}))}.
-
-
-@format
-@t{(complex? 3+4i) ==> #t
-(complex? 3) ==> #t
-(real? 3) ==> #t
-(real? -2.5+0.0i) ==> #t
-(real? #e1e10) ==> #t
-(rational? 6/10) ==> #t
-(rational? 6/3) ==> #t
-(integer? 3+0i) ==> #t
-(integer? 3.0) ==> #t
-(integer? 8/4) ==> #t
-}
-@end format
-
-
-
-@quotation
-@emph{Note:}
-The behavior of these type predicates on @r{inexact} numbers
-is unreliable, since any inaccuracy may affect the result.
-@end quotation
-
-
-
-@quotation
-@emph{Note:}
-In many implementations the @code{rational?} procedure will be the same
-@vindex @w{rational?}
-as @code{real?}, and the @code{complex?} procedure will be the same as
-@vindex @w{complex?}
-@vindex @w{real?}
-@code{number?}, but unusual implementations may be able to represent
-@vindex @w{number?}
-some irrational numbers exactly or may extend the number system to
-support some kind of non-complex numbers.
-@end quotation
-
-
-@end deffn
-
-
-@deffn {procedure} exact? @var{z}
-@deffnx {procedure} inexact? @var{z}
-
-These numerical predicates provide tests for the exactness of a
-quantity. For any Scheme number, precisely one of these predicates
-is true.
-
-@end deffn
-
-
-
-@deffn {procedure} = z1 z2 z3 @dots{},
-@deffnx {procedure} < x1 x2 x3 @dots{},
-@deffnx {procedure} > x1 x2 x3 @dots{},
-@deffnx {procedure} <= x1 x2 x3 @dots{},
-@deffnx {procedure} >= x1 x2 x3 @dots{},
-
-@c - Some implementations allow these procedures to take many arguments, to
-@c - facilitate range checks.
-These procedures return @t{#t} if their arguments are (respectively):
-equal, monotonically increasing, monotonically decreasing,
-monotonically nondecreasing, or monotonically nonincreasing.
-
-These predicates are required to be transitive.
-
-
-@quotation
-@emph{Note:}
-The traditional implementations of these predicates in Lisp-like
-languages are not transitive.
-@end quotation
-
-
-
-@quotation
-@emph{Note:}
-While it is not an error to compare @r{inexact} numbers using these
-predicates, the results may be unreliable because a small inaccuracy
-may affect the result; this is especially true of @code{=} and @code{zero?}.
-@vindex @w{zero?}
-@vindex @w{=}
-When in doubt, consult a numerical analyst.
-@end quotation
-
-
-@end deffn
-
-
-@deffn {library procedure} zero? @var{z}
-@deffnx {library procedure} positive? @var{x}
-@deffnx {library procedure} negative? @var{x}
-@deffnx {library procedure} odd? @var{n}
-@deffnx {library procedure} even? @var{n}
-
-These numerical predicates test a number for a particular property,
-returning @t{#t} or @t{#f}. See note above.
-
-@end deffn
-
-
-@deffn {library procedure} max x1 x2 @dots{},
-@deffnx {library procedure} min x1 x2 @dots{},
-
-These procedures return the maximum or minimum of their arguments.
-
-
-@format
-@t{(max 3 4) ==> 4 ; exact
-(max 3.9 4) ==> 4.0 ; inexact
-}
-@end format
-
-
-
-@quotation
-@emph{Note:}
-If any argument is inexact, then the result will also be inexact (unless
-the procedure can prove that the inaccuracy is not large enough to affect the
-result, which is possible only in unusual implementations). If @samp{min} or
-@samp{max} is used to compare numbers of mixed exactness, and the numerical
-value of the result cannot be represented as an inexact number without loss of
-accuracy, then the procedure may report a violation of an implementation
-restriction.
-@end quotation
-
-
-@end deffn
-
-
-
-@deffn {procedure} + z1 @dots{},
-@deffnx {procedure} * z1 @dots{},
-
-These procedures return the sum or product of their arguments.
-@c - These procedures are exactness preserving.
-
-
-@format
-@t{(+ 3 4) ==> 7
-(+ 3) ==> 3
-(+) ==> 0
-(* 4) ==> 4
-(*) ==> 1
-}
-@end format
-
-
-@end deffn
-
-
-
-@deffn {procedure} - z1 z2
-@deffnx {procedure} - @var{z}
-@deffnx {optional procedure} - z1 z2 @dots{},
-@deffnx {procedure} / z1 z2
-@deffnx {procedure} / @var{z}
-@deffnx {optional procedure} / z1 z2 @dots{},
-
-With two or more arguments, these procedures return the difference or
-quotient of their arguments, associating to the left. With one argument,
-however, they return the additive or multiplicative inverse of their argument.
-@c - These procedures are exactness preserving, except that division may
-@c - coerce its result to inexact in implementations that do not support
-@c - \tupe{ratnum}s.
-
-
-@format
-@t{(- 3 4) ==> -1
-(- 3 4 5) ==> -6
-(- 3) ==> -3
-(/ 3 4 5) ==> 3/20
-(/ 3) ==> 1/3
-}
-@end format
-
-
-@end deffn
-
-
-
-@deffn {library procedure} abs x
-
-@samp{Abs} returns the absolute value of its argument.
-@c - {\cf Abs} is exactness preserving when its argument is real.
-
-@format
-@t{(abs -7) ==> 7
-}
-@end format
-
-@end deffn
-
-
-
-@deffn {procedure} quotient n1 n2
-@deffnx {procedure} remainder n1 n2
-@deffnx {procedure} modulo n1 n2
-
-These procedures implement number-theoretic (integer)
-division. @var{n2} should be non-zero. All three procedures
-return integers. If @var{n1}/@var{n2} is an integer:
-
-@format
-@t{ (quotient @var{n1} @var{n2}) ==> @var{n1}/@var{n2}
- (remainder @var{n1} @var{n2}) ==> 0
- (modulo @var{n1} @var{n2}) ==> 0
-}
-@end format
-
-If @var{n1}/@var{n2} is not an integer:
-
-@format
-@t{ (quotient @var{n1} @var{n2}) ==> @var{n_q}
- (remainder @var{n1} @var{n2}) ==> @var{n_r}
- (modulo @var{n1} @var{n2}) ==> @var{n_m}
-}
-@end format
-
-where @var{n_q} is @var{n1}/@var{n2} rounded towards zero,
-0 < |@var{n_r}| < |@var{n2}|, 0 < |@var{n_m}| < |@var{n2}|,
-@var{n_r} and @var{n_m} differ from @var{n1} by a multiple of @var{n2},
-@var{n_r} has the same sign as @var{n1}, and
-@var{n_m} has the same sign as @var{n2}.
-
-From this we can conclude that for integers @var{n1} and @var{n2} with
-@var{n2} not equal to 0,
-
-@format
-@t{ (= @var{n1} (+ (* @var{n2} (quotient @var{n1} @var{n2}))
- (remainder @var{n1} @var{n2})))
- ==> #t
-}
-@end format
-
-provided all numbers involved in that computation are exact.
-
-
-@format
-@t{(modulo 13 4) ==> 1
-(remainder 13 4) ==> 1
-
-(modulo -13 4) ==> 3
-(remainder -13 4) ==> -1
-
-(modulo 13 -4) ==> -3
-(remainder 13 -4) ==> 1
-
-(modulo -13 -4) ==> -1
-(remainder -13 -4) ==> -1
-
-(remainder -13 -4.0) ==> -1.0 ; inexact
-}
-@end format
-
-@end deffn
-
-
-@deffn {library procedure} gcd n1 @dots{},
-@deffnx {library procedure} lcm n1 @dots{},
-
-These procedures return the greatest common divisor or least common
-multiple of their arguments. The result is always non-negative.
-@c - These procedures are exactness preserving.
-
-@c %R4%% I added the inexact example.
-
-@format
-@t{(gcd 32 -36) ==> 4
-(gcd) ==> 0
-(lcm 32 -36) ==> 288
-(lcm 32.0 -36) ==> 288.0 ; inexact
-(lcm) ==> 1
-}
-@end format
-
-
-@end deffn
-
-
-
-@deffn {procedure} numerator @var{q}
-@deffnx {procedure} denominator @var{q}
-
-These procedures return the numerator or denominator of their
-argument; the result is computed as if the argument was represented as
-a fraction in lowest terms. The denominator is always positive. The
-denominator of 0 is defined to be 1.
-@c - The remarks about denominators are new.
-@c - Clearly, they are exactness-preserving procedures.
-
-@ignore todo
-More description and examples needed.
-@end ignore
-
-
-@format
-@t{(numerator (/ 6 4)) ==> 3
-(denominator (/ 6 4)) ==> 2
-(denominator
- (exact->inexact (/ 6 4))) ==> 2.0
-}
-@end format
-
-
-@end deffn
-
-
-
-@deffn {procedure} floor x
-@deffnx {procedure} ceiling x
-@deffnx {procedure} truncate x
-@deffnx {procedure} round x
-
-
-These procedures return integers.
-@samp{Floor} returns the largest integer not larger than @var{x}.
-@samp{Ceiling} returns the smallest integer not smaller than @var{x}.
-@samp{Truncate} returns the integer closest to @var{x} whose absolute
-value is not larger than the absolute value of @var{x}. @samp{Round} returns the
-closest integer to @var{x}, rounding to even when @var{x} is halfway between two
-integers.
-
-
-@quotation
-@emph{Rationale:}
-@samp{Round} rounds to even for consistency with the default rounding
-mode specified by the IEEE floating point standard.
-@end quotation
-
-
-
-@quotation
-@emph{Note:}
-If the argument to one of these procedures is inexact, then the result
-will also be inexact. If an exact value is needed, the
-result should be passed to the @samp{inexact->exact} procedure.
-@end quotation
-
-
-
-@format
-@t{(floor -4.3) ==> -5.0
-(ceiling -4.3) ==> -4.0
-(truncate -4.3) ==> -4.0
-(round -4.3) ==> -4.0
-
-(floor 3.5) ==> 3.0
-(ceiling 3.5) ==> 4.0
-(truncate 3.5) ==> 3.0
-(round 3.5) ==> 4.0 ; inexact
-
-(round 7/2) ==> 4 ; exact
-(round 7) ==> 7
-}
-@end format
-
-
-@end deffn
-
-
-@deffn {library procedure} rationalize x y
-@c - \proto{rationalize}{ x}{procedure}
-
-
-@samp{Rationalize} returns the @emph{simplest} rational number
-differing from @var{x} by no more than @var{y}. A rational number r_1 is
-@emph{simpler} than another rational number
-@cindex @w{simplest rational}
-r_2 if r_1 = p_1/q_1 and r_2 = p_2/q_2 (in lowest terms) and |p_1|<= |p_2| and |q_1| <= |q_2|. Thus 3/5 is simpler than 4/7.
-Although not all rationals are comparable in this ordering (consider 2/7
-and 3/5) any interval contains a rational number that is simpler than
-every other rational number in that interval (the simpler 2/5 lies
-between 2/7 and 3/5). Note that 0 = 0/1 is the simplest rational of
-all.
-
-
-@format
-@t{(rationalize
- (inexact->exact .3) 1/10) ==> 1/3 ; exact
-(rationalize .3 1/10) ==> #i1/3 ; inexact
-}
-@end format
-
-
-@end deffn
-
-
-@deffn {procedure} exp @var{z}
-@deffnx {procedure} log @var{z}
-@deffnx {procedure} sin @var{z}
-@deffnx {procedure} cos @var{z}
-@deffnx {procedure} tan @var{z}
-@deffnx {procedure} asin @var{z}
-@deffnx {procedure} acos @var{z}
-@deffnx {procedure} atan @var{z}
-@deffnx {procedure} atan @var{y} @var{x}
-
-These procedures are part of every implementation that supports
-@c %R4%%
-general
-real numbers; they compute the usual transcendental functions. @samp{Log}
-computes the natural logarithm of @var{z} (not the base ten logarithm).
-@samp{Asin}, @samp{acos}, and @samp{atan} compute arcsine (sin^-1),
-arccosine (cos^-1), and arctangent (tan^-1), respectively.
-The two-argument variant of @samp{atan} computes @t{(angle
-(make-rectangular @var{x} @var{y}))} (see below), even in implementations
-that don't support general complex numbers.
-
-In general, the mathematical functions log, arcsine, arccosine, and
-arctangent are multiply defined.
-The value of log z is defined to be the one whose imaginary
-part lies in the range from -pi (exclusive) to pi (inclusive).
-log 0 is undefined.
-With log defined this way, the values of sin^-1 z, cos^-1 z,
-and tan^-1 z are according to the following formulae:
-
-
-@center sin^-1 z = -i log (i z + sqrt1 - z^2)
-
-
-
-@center cos^-1 z = pi / 2 - sin^-1 z
-
-
-
-@center tan^-1 z = (log (1 + i z) - log (1 - i z)) / (2 i)
-
-
-The above specification follows [CLtL], which in turn
-cites [Penfield81]; refer to these sources for more detailed
-discussion of branch cuts, boundary conditions, and implementation of
-these functions. When it is possible these procedures produce a real
-result from a real argument.
-
-@c %R4%%
-
-@ignore todo
-The cited references are likely to change their branch cuts
-soon to allow for the possibility of distinct positive and negative
-zeroes, as in IEEE floating point. We may not want to follow those
-changes, since we may want a complex number with zero imaginary part
-(whether positive or negative zero) to be treated as a real. I don't
-think there are any better standards for complex arithmetic than the
-ones cited, so we're really on our own here.
-@end ignore
-
-
-@end deffn
-
-
-
-@deffn {procedure} sqrt @var{z}
-
-Returns the principal square root of @var{z}. The result will have
-either positive real part, or zero real part and non-negative imaginary
-part.
-@end deffn
-
-
-
-@deffn {procedure} expt z1 z2
-
-Returns @var{z1} raised to the power @var{z2}. For z_1 ~= 0
-
-
-@center z_1^z_2 = e^z_2 log z_1
-
-0^z is 1 if z = 0 and 0 otherwise.
-@end deffn
-
-@c - \begin{entry}{%-
-@c - \proto{approximate}{ z x}{procedure}}
-@c -
-@c - Returns an approximation to \vr{z} in a representation whose precision is
-@c - the same as that
-@c - of the representation of \vr{x}, which must be an inexact number. The
-@c - result is always inexact.
-@c -
-@c - \begin{scheme}
-@c - (approximate 3.1415926535 1F10)
-@c - \ev 3.14159F0
-@c - (approximate 3.1415926535 \#I65535)
-@c - \ev \#I3
-@c - (approximate 3.14F0 1L8)
-@c - \ev 3.14L0
-@c - (approximate 3.1415926535F0 1L8)
-@c - \ev 3.14159L0
-@c - \end{scheme}
-@c - \end{entry}
-
-
-
-
-@deffn {procedure} make-rectangular x1 x2
-@deffnx {procedure} make-polar x3 x4
-@deffnx {procedure} real-part @var{z}
-@deffnx {procedure} imag-part @var{z}
-@deffnx {procedure} magnitude @var{z}
-@deffnx {procedure} angle @var{z}
-
-These procedures are part of every implementation that supports
-@c %R4%%
-general
-complex numbers. Suppose @var{x1}, @var{x2}, @var{x3}, and @var{x4} are
-real numbers and @var{z} is a complex number such that
-
-
-@center @var{z} = @var{x1} + @var{x2}@w{i} = @var{x3} . e^@w{i} @var{x4}
-
-Then
-
-@format
-@t{(make-rectangular @var{x1} @var{x2}) ==> @var{z}
-(make-polar @var{x3} @var{x4}) ==> @var{z}
-(real-part @var{z}) ==> @var{x1}
-(imag-part @var{z}) ==> @var{x2}
-(magnitude @var{z}) ==> |@var{x3}|
-(angle @var{z}) ==> x_angle
-}
-@end format
-
-where -pi < x_angle <= pi with x_angle = @var{x4} + 2pi n
-for some integer n.
-
-
-@quotation
-@emph{Rationale:}
-@samp{Magnitude} is the same as @code{abs} for a real argument,
-@vindex @w{abs}
-but @samp{abs} must be present in all implementations, whereas
-@samp{magnitude} need only be present in implementations that support
-general complex numbers.
-@end quotation
-
-
-@end deffn
-
-
-
-@deffn {procedure} exact->inexact @var{z}
-@deffnx {procedure} inexact->exact @var{z}
-
-@samp{Exact->inexact} returns an @r{inexact} representation of @var{z}.
-The value returned is the
-@r{inexact} number that is numerically closest to the argument.
-@c %R4%%For
-@c \tupe{exact} arguments which have no reasonably close \tupe{inexact} equivalent,
-@c it is permissible to signal an error.
-If an @r{exact} argument has no reasonably close @r{inexact} equivalent,
-then a violation of an implementation restriction may be reported.
-
-@samp{Inexact->exact} returns an @r{exact} representation of
-@var{z}. The value returned is the @r{exact} number that is numerically
-closest to the argument.
-@c %R4%% For \tupe{inexact} arguments which have no
-@c reasonably close \tupe{exact} equivalent, it is permissible to signal
-@c an error.
-If an @r{inexact} argument has no reasonably close @r{exact} equivalent,
-then a violation of an implementation restriction may be reported.
-
-@c %R%% I moved this to the section on implementation restrictions.
-@c For any implementation that supports \tupe{inexact} quantities,
-@c there is a subset of the integers for which there are both \tupe{exact} and
-@c \tupe{inexact} representations. This subset must include the non-negative
-@c integers up to a limit specified by the implementation. The limit
-@c must be big enough to represent all digits in reasonable radices, and
-@c may correspond to some natural word size for the implementation. For
-@c such integers, these procedures implement the natural one-to-one
-@c correspondence between the representations.
-
-These procedures implement the natural one-to-one correspondence between
-@r{exact} and @r{inexact} integers throughout an
-implementation-dependent range. See section @ref{Implementation restrictions}.
-
-@end deffn
-
-@sp 3
-
-@node Numerical input and output, , Numerical operations, Numbers
-@subsection Numerical input and output
-
-
-
-@deffn {procedure} number->string z
-@deffnx {procedure} number->string z radix
-
-@var{Radix} must be an exact integer, either 2, 8, 10, or 16. If omitted,
-@var{radix} defaults to 10.
-The procedure @samp{number->string} takes a
-number and a radix and returns as a string an external representation of
-the given number in the given radix such that
-
-@format
-@t{(let ((number @var{number})
- (radix @var{radix}))
- (eqv? number
- (string->number (number->string number
- radix)
- radix)))
-}
-@end format
-
-is true. It is an error if no possible result makes this expression true.
-
-If @var{z} is inexact, the radix is 10, and the above expression
-can be satisfied by a result that contains a decimal point,
-then the result contains a decimal point and is expressed using the
-minimum number of digits (exclusive of exponent and trailing
-zeroes) needed to make the above expression
-true [howtoprint], [howtoread];
-otherwise the format of the result is unspecified.
-
-The result returned by @samp{number->string}
-never contains an explicit radix prefix.
-
-
-@quotation
-@emph{Note:}
-The error case can occur only when @var{z} is not a complex number
-or is a complex number with a non-rational real or imaginary part.
-@end quotation
-
-
-
-@quotation
-@emph{Rationale:}
-If @var{z} is an inexact number represented using flonums, and
-the radix is 10, then the above expression is normally satisfied by
-a result containing a decimal point. The unspecified case
-allows for infinities, NaNs, and non-flonum representations.
-@end quotation
-
-
-@end deffn
-
-
-
-@deffn {procedure} string->number string
-@deffnx {procedure} string->number string radix
-
-@c %R4%% I didn't include the (string->number string radix exactness)
-@c case, since I haven't heard any resolution of the coding to be used
-@c for the third argument.
-
-Returns a number of the maximally precise representation expressed by the
-given @var{string}. @var{Radix} must be an exact integer, either 2, 8, 10,
-or 16. If supplied, @var{radix} is a default radix that may be overridden
-by an explicit radix prefix in @var{string} (e.g. @t{"#o177"}). If @var{radix}
-is not supplied, then the default radix is 10. If @var{string} is not
-a syntactically valid notation for a number, then @samp{string->number}
-returns @t{#f}.
-
-
-@format
-@t{(string->number "100") ==> 100
-(string->number "100" 16) ==> 256
-(string->number "1e2") ==> 100.0
-(string->number "15##") ==> 1500.0
-}
-@end format
-
-
-
-@quotation
-@emph{Note:}
-The domain of @samp{string->number} may be restricted by implementations
-in the following ways. @samp{String->number} is permitted to return
-@t{#f} whenever @var{string} contains an explicit radix prefix.
-If all numbers supported by an implementation are real, then
-@samp{string->number} is permitted to return @t{#f} whenever
-@var{string} uses the polar or rectangular notations for complex
-numbers. If all numbers are integers, then
-@samp{string->number} may return @t{#f} whenever
-the fractional notation is used. If all numbers are exact, then
-@samp{string->number} may return @t{#f} whenever
-an exponent marker or explicit exactness prefix is used, or if
-a @t{#} appears in place of a digit. If all inexact
-numbers are integers, then
-@samp{string->number} may return @t{#f} whenever
-a decimal point is used.
-@end quotation
-
-
-@end deffn
-
-@node Other data types, Control features, Numbers, Standard procedures
-@section Other data types
-
-@menu
-* Booleans::
-* Pairs and lists::
-* Symbols::
-* Characters::
-* Strings::
-* Vectors::
-@end menu
-
-
-This section describes operations on some of Scheme's non-numeric data types:
-booleans, pairs, lists, symbols, characters, strings and vectors.
-
-@node Booleans, Pairs and lists, Other data types, Other data types
-@subsection Booleans
-
-
-
-The standard boolean objects for true and false are written as
-@t{#t} and @t{#f}. What really
-@vindex #f
-@vindex #t
-matters, though, are the objects that the Scheme conditional expressions
-(@samp{if}, @samp{cond}, @samp{and}, @samp{or}, @samp{do}) treat as
-true or false. The phrase ``a true value''
-@cindex @w{false}
-@cindex @w{true}
-(or sometimes just ``true'') means any object treated as true by the
-conditional expressions, and the phrase ``a false value'' (or
-@cindex @w{false}
-``false'') means any object treated as false by the conditional expressions.
-
-Of all the standard Scheme values, only @t{#f}
-@c is guaranteed to count
-counts as false in conditional expressions.
-@c It is not
-@c specified whether the empty list\index{empty list} counts as false
-@c or as true in conditional expressions.
-Except for @t{#f},
-@c and possibly the empty list,
-all standard Scheme values, including @t{#t},
-pairs, the empty list, symbols, numbers, strings, vectors, and procedures,
-count as true.
-
-@c \begin{note}
-@c In some implementations the empty list counts as false, contrary
-@c to the above.
-@c Nonetheless a few examples in this report assume that the
-@c empty list counts as true, as in \cite{IEEEScheme}.
-@c \end{note}
-
-@c \begin{rationale}
-@c For historical reasons some implementations regard \schfalse{} and the
-@c empty list as the same object. These implementations therefore cannot
-@c make the empty list count as true in conditional expressions.
-@c \end{rationale}
-
-
-@quotation
-@emph{Note:}
-Programmers accustomed to other dialects of Lisp should be aware that
-Scheme distinguishes both @t{#f} and the empty list
-@cindex @w{empty list}
-from the symbol @code{nil}.
-@vindex @w{nil}
-@end quotation
-
-
-Boolean constants evaluate to themselves, so they do not need to be quoted
-in programs.
-
-
-@example
-
-#t ==> #t
-#f ==> #f
-'#f ==> #f
-
-@end example
-
-
-
-
-@deffn {library procedure} not obj
-
-@samp{Not} returns @t{#t} if @var{obj} is false, and returns
-@t{#f} otherwise.
-
-
-@format
-@t{(not #t) ==> #f
-(not 3) ==> #f
-(not (list 3)) ==> #f
-(not #f) ==> #t
-(not '()) ==> #f
-(not (list)) ==> #f
-(not 'nil) ==> #f
-}
-@end format
-
-
-@end deffn
-
-
-
-@deffn {library procedure} boolean? obj
-
-@samp{Boolean?} returns @t{#t} if @var{obj} is either @t{#t} or
-@t{#f} and returns @t{#f} otherwise.
-
-
-@format
-@t{(boolean? #f) ==> #t
-(boolean? 0) ==> #f
-(boolean? '()) ==> #f
-}
-@end format
-
-
-@end deffn
-
-
-@node Pairs and lists, Symbols, Booleans, Other data types
-@subsection Pairs and lists
-
-
-
-A @dfn{pair} (sometimes called a @dfn{dotted pair}) is a
-@cindex @w{dotted pair}
-@cindex @w{pair}
-record structure with two fields called the car and cdr fields (for
-historical reasons). Pairs are created by the procedure @samp{cons}.
-The car and cdr fields are accessed by the procedures @samp{car} and
-@samp{cdr}. The car and cdr fields are assigned by the procedures
-@samp{set-car!} and @samp{set-cdr!}.
-
-Pairs are used primarily to represent lists. A list can
-be defined recursively as either the empty list or a pair whose
-@cindex @w{empty list}
-cdr is a list. More precisely, the set of lists is defined as the smallest
-set @var{X} such that
-
-
-
-@itemize @bullet
-
-@item
-The empty list is in @var{X}.
-@item
-If @var{list} is in @var{X}, then any pair whose cdr field contains
-@var{list} is also in @var{X}.
-
-@end itemize
-
-
-The objects in the car fields of successive pairs of a list are the
-elements of the list. For example, a two-element list is a pair whose car
-is the first element and whose cdr is a pair whose car is the second element
-and whose cdr is the empty list. The length of a list is the number of
-elements, which is the same as the number of pairs.
-
-The empty list is a special object of its own type
-@cindex @w{empty list}
-(it is not a pair); it has no elements and its length is zero.
-
-
-@quotation
-@emph{Note:}
-The above definitions imply that all lists have finite length and are
-terminated by the empty list.
-@end quotation
-
-
-The most general notation (external representation) for Scheme pairs is
-the ``dotted'' notation @w{@samp{(@var{c1} .@: @var{c2})}} where
-@var{c1} is the value of the car field and @var{c2} is the value of the
-cdr field. For example @samp{(4 .@: 5)} is a pair whose car is 4 and whose
-cdr is 5. Note that @samp{(4 .@: 5)} is the external representation of a
-pair, not an expression that evaluates to a pair.
-
-A more streamlined notation can be used for lists: the elements of the
-list are simply enclosed in parentheses and separated by spaces. The
-empty list is written @t{()} . For example,
-@cindex @w{empty list}
-
-
-@example
-
-(a b c d e)
-
-@end example
-
-
-and
-
-
-@example
-
-(a . (b . (c . (d . (e . ())))))
-
-@end example
-
-
-are equivalent notations for a list of symbols.
-
-A chain of pairs not ending in the empty list is called an
-@dfn{improper list}. Note that an improper list is not a list.
-@cindex @w{improper list}
-The list and dotted notations can be combined to represent
-improper lists:
-
-
-@example
-
-(a b c . d)
-
-@end example
-
-
-is equivalent to
-
-
-@example
-
-(a . (b . (c . d)))
-
-@end example
-
-
-Whether a given pair is a list depends upon what is stored in the cdr
-field. When the @code{set-cdr!} procedure is used, an object can be a
-@vindex @w{set-cdr!}
-list one moment and not the next:
-
-
-@example
-
-(define x (list 'a 'b 'c))
-(define y x)
-y ==> (a b c)
-(list? y) ==> #t
-(set-cdr! x 4) ==> @emph{unspecified}
-x ==> (a . 4)
-(eqv? x y) ==> #t
-y ==> (a . 4)
-(list? y) ==> #f
-(set-cdr! x x) ==> @emph{unspecified}
-(list? x) ==> #f
-
-@end example
-
-
-@c It is often convenient to speak of a homogeneous list of objects
-@c of some particular data type, as for example \hbox{\cf (1 2 3)} is a list of
-@c integers. To be more precise, suppose \var{D} is some data type. (Any
-@c predicate defines a data type consisting of those objects of which the
-@c predicate is true.) Then
-
-@c \begin{itemize}
-@c \item The empty list is a list of \var{D}.
-@c \item If \var{list} is a list of \var{D}, then any pair whose cdr is
-@c \var{list} and whose car is an element of the data type \var{D} is also a
-@c list of \var{D}.
-@c \item There are no other lists of \var{D}.
-@c \end{itemize}
-
-Within literal expressions and representations of objects read by the
-@code{read} procedure, the forms @t{'}@r{<datum>},
-@vindex '
-@vindex @w{read}
-@t{`}@r{<datum>}, @t{,}@r{<datum>}, and
-@vindex ,
-@t{,@@}@r{<datum>} denote two-ele@-ment lists whose first elements are
-the symbols @code{quote}, @code{quasiquote}, @w{@code{unquote}}, and
-@vindex @w{unquote}
-@vindex @w{quasiquote}
-@vindex @w{quote}
-@code{unquote-splicing}, respectively. The second element in each case
-@vindex @w{unquote-splicing}
-is @r{<datum>}. This convention is supported so that arbitrary Scheme
-programs may be represented as lists.
-@ignore todo
-Can or need this be stated
-more carefully?
-@end ignore
- That is, according to Scheme's grammar, every
-<expression> is also a <datum> (see section @pxref{External representation}).
-Among other things, this permits the use of the @samp{read} procedure to
-parse Scheme programs. See section @ref{External representations}.
-
-
-
-@deffn {procedure} pair? obj
-
-@samp{Pair?} returns @t{#t} if @var{obj} is a pair, and otherwise
-returns @t{#f}.
-
-
-@format
-@t{(pair? '(a . b)) ==> #t
-(pair? '(a b c)) ==> #t
-(pair? '()) ==> #f
-(pair? '#(a b)) ==> #f
-}
-@end format
-
-@end deffn
-
-
-
-@deffn {procedure} cons obj1 obj2
-
-Returns a newly allocated pair whose car is @var{obj1} and whose cdr is
-@var{obj2}. The pair is guaranteed to be different (in the sense of
-@samp{eqv?}) from every existing object.
-
-
-@format
-@t{(cons 'a '()) ==> (a)
-(cons '(a) '(b c d)) ==> ((a) b c d)
-(cons "a" '(b c)) ==> ("a" b c)
-(cons 'a 3) ==> (a . 3)
-(cons '(a b) 'c) ==> ((a b) . c)
-}
-@end format
-
-@end deffn
-
-
-
-@deffn {procedure} car pair
-
-@ignore nodomain
-@var{Pair} must be a pair.
-@end ignore
-
-Returns the contents of the car field of @var{pair}. Note that it is an
-error to take the car of the empty list.
-@cindex @w{empty list}
-
-
-@format
-@t{(car '(a b c)) ==> a
-(car '((a) b c d)) ==> (a)
-(car '(1 . 2)) ==> 1
-(car '()) ==> @emph{error}
-}
-@end format
-
-
-@end deffn
-
-
-
-@deffn {procedure} cdr pair
-
-@ignore nodomain
-@var{Pair} must be a pair.
-@end ignore
-
-Returns the contents of the cdr field of @var{pair}.
-Note that it is an error to take the cdr of the empty list.
-
-
-@format
-@t{(cdr '((a) b c d)) ==> (b c d)
-(cdr '(1 . 2)) ==> 2
-(cdr '()) ==> @emph{error}
-}
-@end format
-
-
-@end deffn
-
-
-
-@deffn {procedure} set-car! pair obj
-
-@ignore nodomain
-@var{Pair} must be a pair.
-@end ignore
-
-Stores @var{obj} in the car field of @var{pair}.
-The value returned by @samp{set-car!} is unspecified.
-@c <!>
-@c This procedure can be very confusing if used indiscriminately.
-
-
-@format
-@t{(define (f) (list 'not-a-constant-list))
-(define (g) '(constant-list))
-(set-car! (f) 3) ==> @emph{unspecified}
-(set-car! (g) 3) ==> @emph{error}
-}
-@end format
-
-
-@end deffn
-
-
-
-@deffn {procedure} set-cdr! pair obj
-
-@ignore nodomain
-@var{Pair} must be a pair.
-@end ignore
-
-Stores @var{obj} in the cdr field of @var{pair}.
-The value returned by @samp{set-cdr!} is unspecified.
-@c <!>
-@c This procedure can be very confusing if used indiscriminately.
-
-@end deffn
-
-
-
-
-
-
-@deffn {library procedure} caar pair
-@deffnx {library procedure} cadr pair
-
-@deffnx { @w{ @dots{}}} @w{ @dots{}}
-
-@deffnx {library procedure} cdddar pair
-@deffnx {library procedure} cddddr pair
-
-These procedures are compositions of @samp{car} and @samp{cdr}, where
-for example @samp{caddr} could be defined by
-
-
-@format
-@t{(define caddr (lambda (x) (car (cdr (cdr x)))))@r{.}
-}
-@end format
-
-
-Arbitrary compositions, up to four deep, are provided. There are
-twenty-eight of these procedures in all.
-
-@end deffn
-
-
-
-@deffn {library procedure} null? obj
-
-Returns @t{#t} if @var{obj} is the empty list,
-@cindex @w{empty list}
-otherwise returns @t{#f}.
-
-@c \begin{note}
-@c In implementations in which the empty
-@c list is the same as \schfalse{}, {\cf null?} will return \schtrue{}
-@c if \var{obj} is \schfalse{}.
-@c \end{note}
-
-@end deffn
-
-
-@deffn {library procedure} list? obj
-
-Returns @t{#t} if @var{obj} is a list, otherwise returns @t{#f}.
-By definition, all lists have finite length and are terminated by
-the empty list.
-
-
-@format
-@t{ (list? '(a b c)) ==> #t
- (list? '()) ==> #t
- (list? '(a . b)) ==> #f
- (let ((x (list 'a)))
- (set-cdr! x x)
- (list? x)) ==> #f
-}
-@end format
-
-@end deffn
-
-
-
-@deffn {library procedure} list @var{obj} @dots{},
-
-Returns a newly allocated list of its arguments.
-
-
-@format
-@t{(list 'a (+ 3 4) 'c) ==> (a 7 c)
-(list) ==> ()
-}
-@end format
-
-@end deffn
-
-
-
-@deffn {library procedure} length list
-
-@ignore nodomain
-@var{List} must be a list.
-@end ignore
-
-Returns the length of @var{list}.
-
-
-@format
-@t{(length '(a b c)) ==> 3
-(length '(a (b) (c d e))) ==> 3
-(length '()) ==> 0
-}
-@end format
-
-@end deffn
-
-
-
-@deffn {library procedure} append list @dots{},
-
-@ignore nodomain
-All @var{list}s should be lists.
-@end ignore
-
-Returns a list consisting of the elements of the first @var{list}
-followed by the elements of the other @var{list}s.
-
-
-@format
-@t{(append '(x) '(y)) ==> (x y)
-(append '(a) '(b c d)) ==> (a b c d)
-(append '(a (b)) '((c))) ==> (a (b) (c))
-}
-@end format
-
-
-The resulting list is always newly allocated, except that it shares
-structure with the last @var{list} argument. The last argument may
-actually be any object; an improper list results if the last argument is not a
-proper list.
-@ignore todo
-This is pretty awkward. I should get Bartley to fix this.
-@end ignore
-
-
-
-@format
-@t{(append '(a b) '(c . d)) ==> (a b c . d)
-(append '() 'a) ==> a
-}
-@end format
-
-@end deffn
-
-
-
-@deffn {library procedure} reverse list
-
-@ignore nodomain
-@var{List} must be a list.
-@end ignore
-
-Returns a newly allocated list consisting of the elements of @var{list}
-in reverse order.
-
-
-@format
-@t{(reverse '(a b c)) ==> (c b a)
-(reverse '(a (b c) d (e (f))))
- ==> ((e (f)) d (b c) a)
-}
-@end format
-
-@end deffn
-
-
-
-@deffn {library procedure} list-tail list @var{k}
-
-Returns the sublist of @var{list} obtained by omitting the first @var{k}
-elements. It is an error if @var{list} has fewer than @var{k} elements.
-@samp{List-tail} could be defined by
-
-
-@format
-@t{(define list-tail
- (lambda (x k)
- (if (zero? k)
- x
- (list-tail (cdr x) (- k 1)))))
-}
-@end format
-
-@end deffn
-
-
-
-@deffn {library procedure} list-ref list @var{k}
-
-Returns the @var{k}th element of @var{list}. (This is the same
-as the car of @t{(list-tail @var{list} @var{k})}.)
-It is an error if @var{list} has fewer than @var{k} elements.
-
-
-@format
-@t{(list-ref '(a b c d) 2) ==> c
-(list-ref '(a b c d)
- (inexact->exact (round 1.8)))
- ==> c
-}
-@end format
-
-@end deffn
-
-
-@c \begin{entry}{%
-@c \proto{last-pair}{ list}{library procedure}}
-
-@c Returns the last pair in the nonempty, possibly improper, list \var{list}.
-@c {\cf Last-pair} could be defined by
-
-@c \begin{scheme}
-@c (define last-pair
-@c (lambda (x)
-@c (if (pair? (cdr x))
-@c (last-pair (cdr x))
-@c x)))%
-@c \end{scheme}
-
-@c \end{entry}
-
-
-
-@deffn {library procedure} memq obj list
-@deffnx {library procedure} memv obj list
-@deffnx {library procedure} member obj list
-
-These procedures return the first sublist of @var{list} whose car is
-@var{obj}, where the sublists of @var{list} are the non-empty lists
-returned by @t{(list-tail @var{list} @var{k})} for @var{k} less
-than the length of @var{list}. If
-@var{obj} does not occur in @var{list}, then @t{#f} (not the empty list) is
-returned. @samp{Memq} uses @samp{eq?} to compare @var{obj} with the elements of
-@var{list}, while @samp{memv} uses @samp{eqv?} and @samp{member} uses @samp{equal?}.
-
-
-@format
-@t{(memq 'a '(a b c)) ==> (a b c)
-(memq 'b '(a b c)) ==> (b c)
-(memq 'a '(b c d)) ==> #f
-(memq (list 'a) '(b (a) c)) ==> #f
-(member (list 'a)
- '(b (a) c)) ==> ((a) c)
-(memq 101 '(100 101 102)) ==> @emph{unspecified}
-(memv 101 '(100 101 102)) ==> (101 102)
-}
-@end format
-
-
-@end deffn
-
-
-
-@deffn {library procedure} assq obj alist
-@deffnx {library procedure} assv obj alist
-@deffnx {library procedure} assoc obj alist
-
-@var{Alist} (for ``association list'') must be a list of
-pairs. These procedures find the first pair in @var{alist} whose car field is @var{obj},
-and returns that pair. If no pair in @var{alist} has @var{obj} as its
-car, then @t{#f} (not the empty list) is returned. @samp{Assq} uses
-@samp{eq?} to compare @var{obj} with the car fields of the pairs in @var{alist},
-while @samp{assv} uses @samp{eqv?} and @samp{assoc} uses @samp{equal?}.
-
-
-@format
-@t{(define e '((a 1) (b 2) (c 3)))
-(assq 'a e) ==> (a 1)
-(assq 'b e) ==> (b 2)
-(assq 'd e) ==> #f
-(assq (list 'a) '(((a)) ((b)) ((c))))
- ==> #f
-(assoc (list 'a) '(((a)) ((b)) ((c))))
- ==> ((a))
-(assq 5 '((2 3) (5 7) (11 13)))
- ==> @emph{unspecified}
-(assv 5 '((2 3) (5 7) (11 13)))
- ==> (5 7)
-}
-@end format
-
-
-
-
-@quotation
-@emph{Rationale:}
-Although they are ordinarily used as predicates,
-@samp{memq}, @samp{memv}, @samp{member}, @samp{assq}, @samp{assv}, and @samp{assoc} do not
-have question marks in their names because they return useful values rather
-than just @t{#t} or @t{#f}.
-@end quotation
-
-@end deffn
-
-
-@node Symbols, Characters, Pairs and lists, Other data types
-@subsection Symbols
-
-
-
-Symbols are objects whose usefulness rests on the fact that two
-symbols are identical (in the sense of @samp{eqv?}) if and only if their
-names are spelled the same way. This is exactly the property needed to
-represent identifiers in programs, and so most
-@cindex @w{identifier}
-implementations of Scheme use them internally for that purpose. Symbols
-are useful for many other applications; for instance, they may be used
-the way enumerated values are used in Pascal.
-
-The rules for writing a symbol are exactly the same as the rules for
-writing an identifier; see sections @ref{Identifiers}
-and @ref{Lexical structure}.
-
-It is guaranteed that any symbol that has been returned as part of
-a literal expression, or read using the @samp{read} procedure, and
-subsequently written out using the @samp{write} procedure, will read back
-in as the identical symbol (in the sense of @samp{eqv?}). The
-@samp{string->symbol} procedure, however, can create symbols for
-which this write/read invariance may not hold because their names
-contain special characters or letters in the non-standard case.
-
-
-@quotation
-@emph{Note:}
-Some implementations of Scheme have a feature known as ``slashification''
-in order to guarantee write/read invariance for all symbols, but
-historically the most important use of this feature has been to
-compensate for the lack of a string data type.
-
-Some implementations also have ``uninterned symbols'', which
-defeat write/read invariance even in implementations with slashification,
-and also generate exceptions to the rule that two symbols are the same
-if and only if their names are spelled the same.
-@end quotation
-
-
-
-
-@deffn {procedure} symbol? obj
-
-Returns @t{#t} if @var{obj} is a symbol, otherwise returns @t{#f}.
-
-
-@format
-@t{(symbol? 'foo) ==> #t
-(symbol? (car '(a b))) ==> #t
-(symbol? "bar") ==> #f
-(symbol? 'nil) ==> #t
-(symbol? '()) ==> #f
-(symbol? #f) ==> #f
-}
-@end format
-
-@end deffn
-
-
-
-@deffn {procedure} symbol->string symbol
-
-Returns the name of @var{symbol} as a string. If the symbol was part of
-an object returned as the value of a literal expression
-(section @pxref{Literal expressions}) or by a call to the @samp{read} procedure,
-and its name contains alphabetic characters, then the string returned
-will contain characters in the implementation's preferred standard
-case---some implementations will prefer upper case, others lower case.
-If the symbol was returned by @samp{string->symbol}, the case of
-characters in the string returned will be the same as the case in the
-string that was passed to @samp{string->symbol}. It is an error
-to apply mutation procedures like @code{string-set!} to strings returned
-@vindex @w{string-set!}
-by this procedure.
-
-The following examples assume that the implementation's standard case is
-lower case:
-
-
-@format
-@t{(symbol->string 'flying-fish)
- ==> "flying-fish"
-(symbol->string 'Martin) ==> "martin"
-(symbol->string
- (string->symbol "Malvina"))
- ==> "Malvina"
-}
-@end format
-
-@end deffn
-
-
-
-@deffn {procedure} string->symbol string
-
-Returns the symbol whose name is @var{string}. This procedure can
-create symbols with names containing special characters or letters in
-the non-standard case, but it is usually a bad idea to create such
-symbols because in some implementations of Scheme they cannot be read as
-themselves. See @samp{symbol->string}.
-
-The following examples assume that the implementation's standard case is
-lower case:
-
-
-@format
-@t{(eq? 'mISSISSIppi 'mississippi)
- ==> #t
-(string->symbol "mISSISSIppi")
- ==>
- @r{}the symbol with name "mISSISSIppi"
-(eq? 'bitBlt (string->symbol "bitBlt"))
- ==> #f
-(eq? 'JollyWog
- (string->symbol
- (symbol->string 'JollyWog)))
- ==> #t
-(string=? "K. Harper, M.D."
- (symbol->string
- (string->symbol "K. Harper, M.D.")))
- ==> #t
-}
-@end format
-
-
-@end deffn
-
-
-@node Characters, Strings, Symbols, Other data types
-@subsection Characters
-
-
-
-Characters are objects that represent printed characters such as
-letters and digits.
-@c There is no requirement that the data type of
-@c characters be disjoint from other data types; implementations are
-@c encouraged to have a separate character data type, but may choose to
-@c represent characters as integers, strings, or some other type.
-Characters are written using the notation #\@r{<character>}
-or #\@r{<character name>}.
-For example:
-
-
-
-@center @c begin-tabular
-@quotation
-@table @asis
-@item @t{#\a}
-; lower case letter
-@item @t{#\A}
-; upper case letter
-@item @t{#\(}
-; left parenthesis
-@item @t{#\ }
-; the space character
-@item @t{#\space}
-; the preferred way to write a space
-@item @t{#\newline}
-; the newline character
-@item
-@end table
-@end quotation
-
-
-
-
-Case is significant in #\@r{<character>}, but not in
-#\@r{<character name>}.
-@c \hyper doesn't
-
-@c allow a linebreak
-If @r{<character>} in
-#\@r{<character>} is alphabetic, then the character
-following @r{<character>} must be a delimiter character such as a
-space or parenthesis. This rule resolves the ambiguous case where, for
-example, the sequence of characters ``@t{#\ space}''
-could be taken to be either a representation of the space character or a
-representation of the character ``@t{#\ s}'' followed
-by a representation of the symbol ``@t{pace}.''
-
-@ignore todo
-Fix
-@end ignore
-
-Characters written in the #\ notation are self-evaluating.
-That is, they do not have to be quoted in programs.
-@c The \sharpsign\backwhack{}
-@c notation is not an essential part of Scheme, however. Even implementations
-@c that support the \sharpsign\backwhack{} notation for input do not have to
-@c support it for output.
-
-Some of the procedures that operate on characters ignore the
-difference between upper case and lower case. The procedures that
-ignore case have @w{``@t{-ci}''} (for ``case
-insensitive'') embedded in their names.
-
-
-
-@deffn {procedure} char? obj
-
-Returns @t{#t} if @var{obj} is a character, otherwise returns @t{#f}.
-
-@end deffn
-
-
-
-@deffn {procedure} char=? char1 char2
-@deffnx {procedure} char<? char1 char2
-@deffnx {procedure} char>? char1 char2
-@deffnx {procedure} char<=? char1 char2
-@deffnx {procedure} char>=? char1 char2
-
-
-@ignore nodomain
-Both @var{char1} and @var{char2} must be characters.
-@end ignore
-
-These procedures impose a total ordering on the set of characters. It
-is guaranteed that under this ordering:
-
-
-
-@itemize @bullet
-
-@item
-The upper case characters are in order. For example, @samp{(char<? #\A #\B)} returns @t{#t}.
-@item
-The lower case characters are in order. For example, @samp{(char<? #\a #\b)} returns @t{#t}.
-@item
-The digits are in order. For example, @samp{(char<? #\0 #\9)} returns @t{#t}.
-@item
-Either all the digits precede all the upper case letters, or vice versa.
-@item
-Either all the digits precede all the lower case letters, or vice versa.
-
-@end itemize
-
-
-Some implementations may generalize these procedures to take more than
-two arguments, as with the corresponding numerical predicates.
-
-@end deffn
-
-
-
-@deffn {library procedure} char-ci=? char1 char2
-@deffnx {library procedure} char-ci<? char1 char2
-@deffnx {library procedure} char-ci>? char1 char2
-@deffnx {library procedure} char-ci<=? char1 char2
-@deffnx {library procedure} char-ci>=? char1 char2
-
-@ignore nodomain
-Both @var{char1} and @var{char2} must be characters.
-@end ignore
-
-These procedures are similar to @samp{char=?} et cetera, but they treat
-upper case and lower case letters as the same. For example, @samp{(char-ci=? #\A #\a)} returns @t{#t}. Some
-implementations may generalize these procedures to take more than two
-arguments, as with the corresponding numerical predicates.
-
-@end deffn
-
-
-
-@deffn {library procedure} char-alphabetic? char
-@deffnx {library procedure} char-numeric? char
-@deffnx {library procedure} char-whitespace? char
-@deffnx {library procedure} char-upper-case? letter
-@deffnx {library procedure} char-lower-case? letter
-
-These procedures return @t{#t} if their arguments are alphabetic,
-numeric, whitespace, upper case, or lower case characters, respectively,
-otherwise they return @t{#f}. The following remarks, which are specific to
-the ASCII character set, are intended only as a guide: The alphabetic characters
-are the 52 upper and lower case letters. The numeric characters are the
-ten decimal digits. The whitespace characters are space, tab, line
-feed, form feed, and carriage return.
-@end deffn
-
-
-@c %R4%%\begin{entry}{%
-@c \proto{char-upper-case?}{ letter}{procedure}
-@c \proto{char-lower-case?}{ letter}{procedure}}
-
-@c \domain{\var{Letter} must be an alphabetic character.}
-@c These procedures return \schtrue{} if their arguments are upper case or
-@c lower case characters, respectively, otherwise they return \schfalse.
-@c \end{entry}
-
-
-
-@deffn {procedure} char->integer char
-@deffnx {procedure} integer->char @var{n}
-
-Given a character, @samp{char->integer} returns an exact integer
-representation of the character. Given an exact integer that is the image of
-a character under @samp{char->integer}, @samp{integer->char}
-returns that character. These procedures implement order-preserving isomorphisms
-between the set of characters under the @code{char<=?} ordering and some
-@vindex @w{char<=?}
-subset of the integers under the @samp{<=} ordering. That is, if
-
-
-@format
-@t{(char<=? @var{a} @var{b}) @result{} #t @r{}and (<= @var{x} @var{y}) @result{} #t
-}
-@end format
-
-
-
-@noindent
- and @var{x} and @var{y} are in the domain of
-@samp{integer->char}, then
-
-
-@format
-@t{(<= (char->integer @var{a})
- (char->integer @var{b})) ==> #t
-
-(char<=? (integer->char @var{x})
- (integer->char @var{y})) ==> #t
-}
-@end format
-
-
-@end deffn
-
-
-
-@deffn {library procedure} char-upcase char
-@deffnx {library procedure} char-downcase char
-
-@ignore nodomain
-@var{Char} must be a character.
-@end ignore
-
-These procedures return a character @var{char2} such that @samp{(char-ci=? @var{char} @var{char2})}. In addition, if @var{char} is
-alphabetic, then the result of @samp{char-upcase} is upper case and the
-result of @samp{char-downcase} is lower case.
-
-@end deffn
-
-
-@node Strings, Vectors, Characters, Other data types
-@subsection Strings
-
-
-
-Strings are sequences of characters.
-@c In some implementations of Scheme
-@c they are immutable; other implementations provide destructive procedures
-@c such as {\cf string-set!}\ that alter string objects.
-Strings are written as sequences of characters enclosed within doublequotes
-(@samp{"}). A doublequote can be written inside a string only by escaping
-it with a backslash (\), as in
-
-
-@example
-
-"The word \"recursion\" has many meanings."
-
-@end example
-
-
-A backslash can be written inside a string only by escaping it with another
-backslash. Scheme does not specify the effect of a backslash within a
-string that is not followed by a doublequote or backslash.
-
-A string constant may continue from one line to the next, but
-the exact contents of such a string are unspecified.
-@c this is
-@c usually a bad idea because
-@c the exact effect may vary from one computer
-@c system to another.
-
-The @emph{length} of a string is the number of characters that it
-contains. This number is an exact, non-negative integer that is fixed when the
-string is created. The @dfn{valid indexes} of a string are the
-@cindex @w{valid indexes}
-exact non-negative integers less than the length of the string. The first
-character of a string has index 0, the second has index 1, and so on.
-
-In phrases such as ``the characters of @var{string} beginning with
-index @var{start} and ending with index @var{end},'' it is understood
-that the index @var{start} is inclusive and the index @var{end} is
-exclusive. Thus if @var{start} and @var{end} are the same index, a null
-substring is referred to, and if @var{start} is zero and @var{end} is
-the length of @var{string}, then the entire string is referred to.
-
-Some of the procedures that operate on strings ignore the
-difference between upper and lower case. The versions that ignore case
-have @w{``@samp{-ci}''} (for ``case insensitive'') embedded in their
-names.
-
-
-
-@deffn {procedure} string? obj
-
-Returns @t{#t} if @var{obj} is a string, otherwise returns @t{#f}.
-@end deffn
-
-
-
-@deffn {procedure} make-string @var{k}
-@deffnx {procedure} make-string @var{k} char
-
-@c \domain{\vr{k} must be a non-negative integer, and \var{char} must be
-@c a character.}
-@samp{Make-string} returns a newly allocated string of
-length @var{k}. If @var{char} is given, then all elements of the string
-are initialized to @var{char}, otherwise the contents of the
-@var{string} are unspecified.
-
-@end deffn
-
-
-@deffn {library procedure} string char @dots{},
-
-Returns a newly allocated string composed of the arguments.
-
-@end deffn
-
-
-@deffn {procedure} string-length string
-
-Returns the number of characters in the given @var{string}.
-@end deffn
-
-
-
-@deffn {procedure} string-ref string @var{k}
-
-@var{k} must be a valid index of @var{string}.
-@samp{String-ref} returns character @var{k} of @var{string} using zero-origin indexing.
-@end deffn
-
-
-
-@deffn {procedure} string-set! string k char
-
-
-@c \var{String} must be a string,
-@var{k} must be a valid index of @var{string}
-@c , and \var{char} must be a character
-.
-@samp{String-set!} stores @var{char} in element @var{k} of @var{string}
-and returns an unspecified value.
-@c <!>
-
-
-@format
-@t{(define (f) (make-string 3 #\*))
-(define (g) "***")
-(string-set! (f) 0 #\?) ==> @emph{unspecified}
-(string-set! (g) 0 #\?) ==> @emph{error}
-(string-set! (symbol->string 'immutable)
- 0
- #\?) ==> @emph{error}
-}
-@end format
-
-
-@end deffn
-
-
-
-@deffn {library procedure} string=? string1 string2
-@deffnx {library procedure} string-ci=? string1 string2
-
-Returns @t{#t} if the two strings are the same length and contain the same
-characters in the same positions, otherwise returns @t{#f}.
-@samp{String-ci=?} treats
-upper and lower case letters as though they were the same character, but
-@samp{string=?} treats upper and lower case as distinct characters.
-
-@end deffn
-
-
-
-@deffn {library procedure} string<? string1 string2
-@deffnx {library procedure} string>? string1 string2
-@deffnx {library procedure} string<=? string1 string2
-@deffnx {library procedure} string>=? string1 string2
-@deffnx {library procedure} string-ci<? string1 string2
-@deffnx {library procedure} string-ci>? string1 string2
-@deffnx {library procedure} string-ci<=? string1 string2
-@deffnx {library procedure} string-ci>=? string1 string2
-
-These procedures are the lexicographic extensions to strings of the
-corresponding orderings on characters. For example, @samp{string<?} is
-the lexicographic ordering on strings induced by the ordering
-@samp{char<?} on characters. If two strings differ in length but
-are the same up to the length of the shorter string, the shorter string
-is considered to be lexicographically less than the longer string.
-
-Implementations may generalize these and the @samp{string=?} and
-@samp{string-ci=?} procedures to take more than two arguments, as with
-the corresponding numerical predicates.
-
-@end deffn
-
-
-
-@deffn {library procedure} substring string start end
-
-@var{String} must be a string, and @var{start} and @var{end}
-must be exact integers satisfying
-
-
-@center 0 <= @var{start} <= @var{end} <= @w{@t{(string-length @var{string})@r{.}}}
-
-@samp{Substring} returns a newly allocated string formed from the characters of
-@var{string} beginning with index @var{start} (inclusive) and ending with index
-@var{end} (exclusive).
-@end deffn
-
-
-
-@deffn {library procedure} string-append @var{string} @dots{},
-
-Returns a newly allocated string whose characters form the concatenation of the
-given strings.
-
-@end deffn
-
-
-
-@deffn {library procedure} string->list string
-@deffnx {library procedure} list->string list
-
-@samp{String->list} returns a newly allocated list of the
-characters that make up the given string. @samp{List->string}
-returns a newly allocated string formed from the characters in the list
-@var{list}, which must be a list of characters. @samp{String->list}
-and @samp{list->string} are
-inverses so far as @samp{equal?} is concerned.
-@c Implementations that provide
-@c destructive operations on strings should ensure that the result of
-@c {\cf list\coerce{}string} is newly allocated.
-
-@end deffn
-
-
-
-@deffn {library procedure} string-copy string
-
-Returns a newly allocated copy of the given @var{string}.
-
-@end deffn
-
-
-
-@deffn {library procedure} string-fill! string char
-
-Stores @var{char} in every element of the given @var{string} and returns an
-unspecified value.
-@c <!>
-
-@end deffn
-
-
-@node Vectors, , Strings, Other data types
-@subsection Vectors
-
-
-
-Vectors are heterogenous structures whose elements are indexed
-by integers. A vector typically occupies less space than a list
-of the same length, and the average time required to access a randomly
-chosen element is typically less for the vector than for the list.
-
-The @emph{length} of a vector is the number of elements that it
-contains. This number is a non-negative integer that is fixed when the
-vector is created. The @emph{valid indexes} of a
-@cindex @w{valid indexes}
-vector are the exact non-negative integers less than the length of the
-vector. The first element in a vector is indexed by zero, and the last
-element is indexed by one less than the length of the vector.
-
-Vectors are written using the notation @t{#(@var{obj} @dots{},)}.
-For example, a vector of length 3 containing the number zero in element
-0, the list @samp{(2 2 2 2)} in element 1, and the string @samp{"Anna"} in
-element 2 can be written as following:
-
-
-@example
-
-#(0 (2 2 2 2) "Anna")
-
-@end example
-
-
-Note that this is the external representation of a vector, not an
-expression evaluating to a vector. Like list constants, vector
-constants must be quoted:
-
-
-@example
-
-'#(0 (2 2 2 2) "Anna")
- ==> #(0 (2 2 2 2) "Anna")
-
-@end example
-
-
-@ignore todo
-Pitman sez: The visual similarity to lists is bound to be confusing
-to some. Elaborate on the distinction.
-@end ignore
-
-
-
-
-@deffn {procedure} vector? obj
-
-Returns @t{#t} if @var{obj} is a vector, otherwise returns @t{#f}.
-@end deffn
-
-
-
-@deffn {procedure} make-vector k
-@deffnx {procedure} make-vector k fill
-
-Returns a newly allocated vector of @var{k} elements. If a second
-argument is given, then each element is initialized to @var{fill}.
-Otherwise the initial contents of each element is unspecified.
-
-@end deffn
-
-
-
-@deffn {library procedure} vector obj @dots{},
-
-Returns a newly allocated vector whose elements contain the given
-arguments. Analogous to @samp{list}.
-
-
-@format
-@t{(vector 'a 'b 'c) ==> #(a b c)
-}
-@end format
-
-@end deffn
-
-
-
-@deffn {procedure} vector-length vector
-
-Returns the number of elements in @var{vector} as an exact integer.
-@end deffn
-
-
-
-@deffn {procedure} vector-ref vector k
-
-@var{k} must be a valid index of @var{vector}.
-@samp{Vector-ref} returns the contents of element @var{k} of
-@var{vector}.
-
-
-@format
-@t{(vector-ref '#(1 1 2 3 5 8 13 21)
- 5)
- ==> 8
-(vector-ref '#(1 1 2 3 5 8 13 21)
- (let ((i (round (* 2 (acos -1)))))
- (if (inexact? i)
- (inexact->exact i)
- i)))
- ==> 13
-}
-@end format
-
-@end deffn
-
-
-
-@deffn {procedure} vector-set! vector k obj
-
-@var{k} must be a valid index of @var{vector}.
-@samp{Vector-set!} stores @var{obj} in element @var{k} of @var{vector}.
-The value returned by @samp{vector-set!} is unspecified.
-@c <!>
-
-
-@format
-@t{(let ((vec (vector 0 '(2 2 2 2) "Anna")))
- (vector-set! vec 1 '("Sue" "Sue"))
- vec)
- ==> #(0 ("Sue" "Sue") "Anna")
-
-(vector-set! '#(0 1 2) 1 "doe")
- ==> @emph{error} ; constant vector
-}
-@end format
-
-@end deffn
-
-
-
-@deffn {library procedure} vector->list vector
-@deffnx {library procedure} list->vector list
-
-@samp{Vector->list} returns a newly allocated list of the objects contained
-in the elements of @var{vector}. @samp{List->vector} returns a newly
-created vector initialized to the elements of the list @var{list}.
-
-
-@format
-@t{(vector->list '#(dah dah didah))
- ==> (dah dah didah)
-(list->vector '(dididit dah))
- ==> #(dididit dah)
-}
-@end format
-
-@end deffn
-
-
-
-@deffn {library procedure} vector-fill! vector fill
-
-Stores @var{fill} in every element of @var{vector}.
-The value returned by @samp{vector-fill!} is unspecified.
-@c <!>
-
-@end deffn
-
-
-@node Control features, Eval, Other data types, Standard procedures
-@section Control features
-
-
-
-@c Intro flushed; not very a propos any more.
-@c Procedures should be discussed somewhere, however.
-
-This chapter describes various primitive procedures which control the
-flow of program execution in special ways.
-The @samp{procedure?} predicate is also described here.
-
-@ignore todo
-@t{Procedure?} doesn't belong in a section with the name
-``control features.'' What to do?
-@end ignore
-
-
-
-@deffn {procedure} procedure? obj
-
-Returns @t{#t} if @var{obj} is a procedure, otherwise returns @t{#f}.
-
-
-@format
-@t{(procedure? car) ==> #t
-(procedure? 'car) ==> #f
-(procedure? (lambda (x) (* x x)))
- ==> #t
-(procedure? '(lambda (x) (* x x)))
- ==> #f
-(call-with-current-continuation procedure?)
- ==> #t
-}
-@end format
-
-
-@end deffn
-
-
-
-@deffn {procedure} apply proc arg1 @dots{} args
-
-@var{Proc} must be a procedure and @var{args} must be a list.
-Calls @var{proc} with the elements of the list
-@samp{(append (list @var{arg1} @dots{},) @var{args})} as the actual
-arguments.
-
-
-@format
-@t{(apply + (list 3 4)) ==> 7
-
-(define compose
- (lambda (f g)
- (lambda args
- (f (apply g args)))))
-
-((compose sqrt *) 12 75) ==> 30
-}
-@end format
-
-@end deffn
-
-
-
-@deffn {library procedure} map proc list1 list2 @dots{},
-
-The @var{list}s must be lists, and @var{proc} must be a
-procedure taking as many arguments as there are @i{list}s
-and returning a single value. If more
-than one @var{list} is given, then they must all be the same length.
-@samp{Map} applies @var{proc} element-wise to the elements of the
-@var{list}s and returns a list of the results, in order.
-The dynamic order in which @var{proc} is applied to the elements of the
-@var{list}s is unspecified.
-
-
-@format
-@t{(map cadr '((a b) (d e) (g h)))
- ==> (b e h)
-
-(map (lambda (n) (expt n n))
- '(1 2 3 4 5))
- ==> (1 4 27 256 3125)
-
-(map + '(1 2 3) '(4 5 6)) ==> (5 7 9)
-
-(let ((count 0))
- (map (lambda (ignored)
- (set! count (+ count 1))
- count)
- '(a b))) ==> (1 2) @var{or} (2 1)
-}
-@end format
-
-
-@end deffn
-
-
-
-@deffn {library procedure} for-each proc list1 list2 @dots{},
-
-The arguments to @samp{for-each} are like the arguments to @samp{map}, but
-@samp{for-each} calls @var{proc} for its side effects rather than for its
-values. Unlike @samp{map}, @samp{for-each} is guaranteed to call @var{proc} on
-the elements of the @var{list}s in order from the first element(s) to the
-last, and the value returned by @samp{for-each} is unspecified.
-
-
-@format
-@t{(let ((v (make-vector 5)))
- (for-each (lambda (i)
- (vector-set! v i (* i i)))
- '(0 1 2 3 4))
- v) ==> #(0 1 4 9 16)
-}
-@end format
-
-
-@end deffn
-
-
-
-@deffn {library procedure} force promise
-
-Forces the value of @var{promise} (see @code{delay},
-@vindex @w{delay}
-section @pxref{Delayed evaluation}). If no value has been computed for
-@cindex @w{promise}
-the promise, then a value is computed and returned. The value of the
-promise is cached (or ``memoized'') so that if it is forced a second
-time, the previously computed value is returned.
-@c without any recomputation.
-@c [As pointed out by Marc Feeley, the "without any recomputation"
-@c isn't necessarily true. --Will]
-
-
-@format
-@t{(force (delay (+ 1 2))) ==> 3
-(let ((p (delay (+ 1 2))))
- (list (force p) (force p)))
- ==> (3 3)
-
-(define a-stream
- (letrec ((next
- (lambda (n)
- (cons n (delay (next (+ n 1)))))))
- (next 0)))
-(define head car)
-(define tail
- (lambda (stream) (force (cdr stream))))
-
-(head (tail (tail a-stream)))
- ==> 2
-}
-@end format
-
-
-@samp{Force} and @samp{delay} are mainly intended for programs written in
-functional style. The following examples should not be considered to
-illustrate good programming style, but they illustrate the property that
-only one value is computed for a promise, no matter how many times it is
-forced.
-@c the value of a promise is computed at most once.
-@c [As pointed out by Marc Feeley, it may be computed more than once,
-@c but as I observed we can at least insist that only one value be
-@c used! -- Will]
-
-
-@format
-@t{(define count 0)
-(define p
- (delay (begin (set! count (+ count 1))
- (if (> count x)
- count
- (force p)))))
-(define x 5)
-p ==> @i{}a promise
-(force p) ==> 6
-p ==> @i{}a promise, still
-(begin (set! x 10)
- (force p)) ==> 6
-}
-@end format
-
-
-Here is a possible implementation of @samp{delay} and @samp{force}.
-Promises are implemented here as procedures of no arguments,
-and @samp{force} simply calls its argument:
-
-
-@format
-@t{(define force
- (lambda (object)
- (object)))
-}
-@end format
-
-
-We define the expression
-
-
-@format
-@t{(delay @r{<expression>})
-}
-@end format
-
-
-to have the same meaning as the procedure call
-
-
-@format
-@t{(make-promise (lambda () @r{<expression>}))@r{}
-}
-@end format
-
-
-as follows
-
-
-@format
-@t{(define-syntax delay
- (syntax-rules ()
- ((delay expression)
- (make-promise (lambda () expression))))),
-}
-@end format
-
-
-where @samp{make-promise} is defined as follows:
-
-@c \begin{scheme}
-@c (define make-promise
-@c (lambda (proc)
-@c (let ((already-run? \schfalse) (result \schfalse))
-@c (lambda ()
-@c (cond ((not already-run?)
-@c (set! result (proc))
-@c (set! already-run? \schtrue)))
-@c result))))%
-@c \end{scheme}
-
-
-@format
-@t{(define make-promise
- (lambda (proc)
- (let ((result-ready? #f)
- (result #f))
- (lambda ()
- (if result-ready?
- result
- (let ((x (proc)))
- (if result-ready?
- result
- (begin (set! result-ready? #t)
- (set! result x)
- result))))))))
-}
-@end format
-
-
-
-@quotation
-@emph{Rationale:}
-A promise may refer to its own value, as in the last example above.
-Forcing such a promise may cause the promise to be forced a second time
-before the value of the first force has been computed.
-This complicates the definition of @samp{make-promise}.
-@end quotation
-
-
-Various extensions to this semantics of @samp{delay} and @samp{force}
-are supported in some implementations:
-
-
-
-@itemize @bullet
-
-@item
-Calling @samp{force} on an object that is not a promise may simply
-return the object.
-
-@item
-It may be the case that there is no means by which a promise can be
-operationally distinguished from its forced value. That is, expressions
-like the following may evaluate to either @t{#t} or to @t{#f},
-depending on the implementation:
-
-
-@format
-@t{(eqv? (delay 1) 1) ==> @emph{unspecified}
-(pair? (delay (cons 1 2))) ==> @emph{unspecified}
-}
-@end format
-
-
-@item
-Some implementations may implement ``implicit forcing,'' where
-the value of a promise is forced by primitive procedures like @samp{cdr}
-and @samp{+}:
-
-
-@format
-@t{(+ (delay (* 3 7)) 13) ==> 34
-}
-@end format
-
-
-@end itemize
-
-@end deffn
-
-
-@deffn {procedure} call-with-current-continuation proc
-
- @var{Proc} must be a procedure of one
-argument. The procedure @samp{call-with-current-continuation} packages
-up the current continuation (see the rationale below) as an ``escape
-procedure'' and passes it as an argument to
-@cindex @w{escape procedure}
-@var{proc}. The escape procedure is a Scheme procedure that, if it is
-later called, will abandon whatever continuation is in effect at that later
-time and will instead use the continuation that was in effect
-when the escape procedure was created. Calling the escape procedure
-may cause the invocation of @var{before} and @var{after} thunks installed using
-@code{dynamic-wind}.
-@vindex @w{dynamic-wind}
-
-The escape procedure accepts the same number of arguments as the continuation to
-the original call to @t{call-with-current-continuation}.
-Except for continuations created by the @samp{call-with-values}
-procedure, all continuations take exactly one value. The
-effect of passing no value or more than one value to continuations
-that were not created by @t{call-with-values} is unspecified.
-
-The escape procedure that is passed to @var{proc} has
-unlimited extent just like any other procedure in Scheme. It may be stored
-in variables or data structures and may be called as many times as desired.
-
-The following examples show only the most common ways in which
-@samp{call-with-current-continuation} is used. If all real uses were as
-simple as these examples, there would be no need for a procedure with
-the power of @samp{call-with-current-continuation}.
-
-
-@format
-@t{(call-with-current-continuation
- (lambda (exit)
- (for-each (lambda (x)
- (if (negative? x)
- (exit x)))
- '(54 0 37 -3 245 19))
- #t)) ==> -3
-
-(define list-length
- (lambda (obj)
- (call-with-current-continuation
- (lambda (return)
- (letrec ((r
- (lambda (obj)
- (cond ((null? obj) 0)
- ((pair? obj)
- (+ (r (cdr obj)) 1))
- (else (return #f))))))
- (r obj))))))
-
-(list-length '(1 2 3 4)) ==> 4
-
-(list-length '(a b . c)) ==> #f
-}
-@end format
-
-
-
-@quotation
-@emph{Rationale:}
-
-A common use of @samp{call-with-current-continuation} is for
-structured, non-local exits from loops or procedure bodies, but in fact
-@samp{call-with-current-continuation} is extremely useful for implementing a
-wide variety of advanced control structures.
-
-Whenever a Scheme expression is evaluated there is a
-@dfn{continuation} wanting the result of the expression. The continuation
-@cindex @w{continuation}
-represents an entire (default) future for the computation. If the expression is
-evaluated at top level, for example, then the continuation might take the
-result, print it on the screen, prompt for the next input, evaluate it, and
-so on forever. Most of the time the continuation includes actions
-specified by user code, as in a continuation that will take the result,
-multiply it by the value stored in a local variable, add seven, and give
-the answer to the top level continuation to be printed. Normally these
-ubiquitous continuations are hidden behind the scenes and programmers do not
-think much about them. On rare occasions, however, a programmer may
-need to deal with continuations explicitly.
-@samp{Call-with-current-continuation} allows Scheme programmers to do
-that by creating a procedure that acts just like the current
-continuation.
-
-Most programming languages incorporate one or more special-purpose
-escape constructs with names like @t{exit}, @w{@samp{return}}, or
-even @t{goto}. In 1965, however, Peter Landin [Landin65]
-invented a general purpose escape operator called the J-operator. John
-Reynolds [Reynolds72] described a simpler but equally powerful
-construct in 1972. The @samp{catch} special form described by Sussman
-and Steele in the 1975 report on Scheme is exactly the same as
-Reynolds's construct, though its name came from a less general construct
-in MacLisp. Several Scheme implementors noticed that the full power of the
-@code{catch} construct could be provided by a procedure instead of by a
-@vindex @w{catch}
-special syntactic construct, and the name
-@samp{call-with-current-continuation} was coined in 1982. This name is
-descriptive, but opinions differ on the merits of such a long name, and
-some people use the name @code{call/cc} instead.
-@vindex @w{call/cc}
-@end quotation
-
-
-@end deffn
-
-
-@deffn {procedure} values obj @dots{}
-
-Delivers all of its arguments to its continuation.
-Except for continuations created by the @code{call-with-values}
-@vindex @w{call-with-values}
-procedure, all continuations take exactly one value.
-@t{Values} might be defined as follows:
-
-@format
-@t{(define (values . things)
- (call-with-current-continuation
- (lambda (cont) (apply cont things))))
-}
-@end format
-
-
-@end deffn
-
-
-@deffn {procedure} call-with-values producer consumer
-
-Calls its @var{producer} argument with no values and
-a continuation that, when passed some values, calls the
-@var{consumer} procedure with those values as arguments.
-The continuation for the call to @var{consumer} is the
-continuation of the call to @t{call-with-values}.
-
-
-@format
-@t{(call-with-values (lambda () (values 4 5))
- (lambda (a b) b))
- ==> 5
-
-(call-with-values * -) ==> -1
-}
-@end format
-
-
-@end deffn
-
-
-@deffn {procedure} dynamic-wind before thunk after
-
-Calls @var{thunk} without arguments, returning the result(s) of this call.
-@var{Before} and @var{after} are called, also without arguments, as required
-by the following rules (note that in the absence of calls to continuations
-captured using @code{call-with-current-continuation} the three arguments are
-@vindex @w{call-with-current-continuation}
-called once each, in order). @var{Before} is called whenever execution
-enters the dynamic extent of the call to @var{thunk} and @var{after} is called
-whenever it exits that dynamic extent. The dynamic extent of a procedure
-call is the period between when the call is initiated and when it
-returns. In Scheme, because of @samp{call-with-current-continuation}, the
-dynamic extent of a call may not be a single, connected time period.
-It is defined as follows:
-
-
-@itemize @bullet
-
-@item
-The dynamic extent is entered when execution of the body of the
-called procedure begins.
-
-@item
-The dynamic extent is also entered when execution is not within
-the dynamic extent and a continuation is invoked that was captured
-(using @samp{call-with-current-continuation}) during the dynamic extent.
-
-@item
-It is exited when the called procedure returns.
-
-@item
-It is also exited when execution is within the dynamic extent and
-a continuation is invoked that was captured while not within the
-dynamic extent.
-
-@end itemize
-
-
-If a second call to @samp{dynamic-wind} occurs within the dynamic extent of the
-call to @var{thunk} and then a continuation is invoked in such a way that the
-@var{after}s from these two invocations of @samp{dynamic-wind} are both to be
-called, then the @var{after} associated with the second (inner) call to
-@samp{dynamic-wind} is called first.
-
-If a second call to @samp{dynamic-wind} occurs within the dynamic extent of the
-call to @var{thunk} and then a continuation is invoked in such a way that the
-@var{before}s from these two invocations of @samp{dynamic-wind} are both to be
-called, then the @var{before} associated with the first (outer) call to
-@samp{dynamic-wind} is called first.
-
-If invoking a continuation requires calling the @var{before} from one call
-to @samp{dynamic-wind} and the @var{after} from another, then the @var{after}
-is called first.
-
-The effect of using a captured continuation to enter or exit the dynamic
-extent of a call to @var{before} or @var{after} is undefined.
-
-
-@format
-@t{(let ((path '())
- (c #f))
- (let ((add (lambda (s)
- (set! path (cons s path)))))
- (dynamic-wind
- (lambda () (add 'connect))
- (lambda ()
- (add (call-with-current-continuation
- (lambda (c0)
- (set! c c0)
- 'talk1))))
- (lambda () (add 'disconnect)))
- (if (< (length path) 4)
- (c 'talk2)
- (reverse path))))
-
- ==> (connect talk1 disconnect
- connect talk2 disconnect)
-}
-@end format
-
-@end deffn
-
-@node Eval, Input and output, Control features, Standard procedures
-@section Eval
-
-
-
-@deffn {procedure} eval expression environment-specifier
-
-Evaluates @var{expression} in the specified environment and returns its value.
-@var{Expression} must be a valid Scheme expression represented as data,
-and @var{environment-specifier} must be a value returned by one of the
-three procedures described below.
-Implementations may extend @samp{eval} to allow non-expression programs
-(definitions) as the first argument and to allow other
-values as environments, with the restriction that @samp{eval} is not
-allowed to create new bindings in the environments associated with
-@samp{null-environment} or @samp{scheme-report-environment}.
-
-
-@format
-@t{(eval '(* 7 3) (scheme-report-environment 5))
- ==> 21
-
-(let ((f (eval '(lambda (f x) (f x x))
- (null-environment 5))))
- (f + 10))
- ==> 20
-}
-@end format
-
-
-@end deffn
-
-
-@deffn {procedure} scheme-report-environment version
-@deffnx {procedure} null-environment version
-
-@var{Version} must be the exact integer @samp{5},
-corresponding to this revision of the Scheme report (the
-Revised^5 Report on Scheme).
-@samp{Scheme-report-environment} returns a specifier for an
-environment that is empty except for all bindings defined in
-this report that are either required or both optional and
-supported by the implementation. @samp{Null-environment} returns
-a specifier for an environment that is empty except for the
-(syntactic) bindings for all syntactic keywords defined in
-this report that are either required or both optional and
-supported by the implementation.
-
-Other values of @var{version} can be used to specify environments
-matching past revisions of this report, but their support is not
-required. An implementation will signal an error if @var{version}
-is neither @samp{5} nor another value supported by
-the implementation.
-
-The effect of assigning (through the use of @samp{eval}) a variable
-bound in a @samp{scheme-report-environment}
-(for example @samp{car}) is unspecified. Thus the environments specified
-by @samp{scheme-report-environment} may be immutable.
-
-@end deffn
-
-
-@deffn {optional procedure} interaction-environment
-
-This procedure returns a specifier for the environment that
-contains imple@-men@-ta@-tion-defined bindings, typically a superset of
-those listed in the report. The intent is that this procedure
-will return the environment in which the implementation would evaluate
-expressions dynamically typed by the user.
-
-@end deffn
-
-@node Input and output, , Eval, Standard procedures
-@section Input and output
-
-@menu
-* Ports::
-* Input::
-* Output::
-* System interface::
-@end menu
-
-
-@node Ports, Input, Input and output, Input and output
-@subsection Ports
-
-
-
-Ports represent input and output devices. To Scheme, an input port is a
-Scheme object that can deliver characters upon command, while an output port
-is a Scheme object that can accept characters.
-@cindex @w{port}
-
-@ignore todo
-Haase: Mention that there are alternatives to files?
-@end ignore
-
-
-
-@deffn {library procedure} call-with-input-file string proc
-@deffnx {library procedure} call-with-output-file string proc
-
-@var{String} should be a string naming a file, and
-@var{proc} should be a procedure that accepts one argument.
-For @samp{call-with-input-file},
-the file should already exist; for
-@samp{call-with-output-file},
-the effect is unspecified if the file
-already exists. These procedures call @var{proc} with one argument: the
-port obtained by opening the named file for input or output. If the
-file cannot be opened, an error is signalled. If @var{proc} returns,
-then the port is closed automatically and the value(s) yielded by the
-@var{proc} is(are) returned. If @var{proc} does not return, then
-the port will not be closed automatically unless it is possible to
-prove that the port will never again be used for a read or write
-operation.
-@c Scheme
-@c will not close the port unless it can prove that the port will never
-@c again be used for a read or write operation.
-
-
-@quotation
-@emph{Rationale:}
-Because Scheme's escape procedures have unlimited extent, it is
-possible to escape from the current continuation but later to escape back in.
-If implementations were permitted to close the port on any escape from the
-current continuation, then it would be impossible to write portable code using
-both @samp{call-with-current-continuation} and @samp{call-with-input-file} or
-@samp{call-with-output-file}.
-@ignore todo
-Pitman wants more said here; maybe encourage users to call
-@var{close-foo-port}; maybe talk about process switches (?).
-@end ignore
-
-@end quotation
-
-@end deffn
-
-
-
-@deffn {procedure} input-port? obj
-@deffnx {procedure} output-port? obj
-
-Returns @t{#t} if @var{obj} is an input port or output port
-respectively, otherwise returns @t{#f}.
-
-@ignore todo
-Won't necessarily return true after port is closed.
-@end ignore
-
-
-@end deffn
-
-
-
-@deffn {procedure} current-input-port
-@deffnx {procedure} current-output-port
-
-Returns the current default input or output port.
-
-@end deffn
-
-
-
-@deffn {optional procedure} with-input-from-file string thunk
-@deffnx {optional procedure} with-output-to-file string thunk
-
-@var{String} should be a string naming a file, and
-@var{proc} should be a procedure of no arguments.
-For @samp{with-input-from-file},
-the file should already exist; for
-@samp{with-output-to-file},
-the effect is unspecified if the file
-already exists.
-The file is opened for input or output, an input or output port
-connected to it is made the default value returned by
-@samp{current-input-port} or @samp{current-output-port}
-(and is used by @t{(read)}, @t{(write @var{obj})}, and so forth),
-and the
-@var{thunk} is called with no arguments. When the @var{thunk} returns,
-the port is closed and the previous default is restored.
-@samp{With-input-from-file} and @samp{with-output-to-file} return(s) the
-value(s) yielded by @var{thunk}.
-If an escape procedure
-is used to escape from the continuation of these procedures, their
-behavior is implementation dependent.
-
-@ignore todo
-OK this with authors??
-@end ignore
-
-@c current continuation changes in such a way
-@c as to make it doubtful that the \var{thunk} will ever return.
-
-@ignore todo
-Freeman:
-Throughout this section I wanted to see ``the value of @t{(current-input-port)}''
-instead of ``the value returned by @var{current-input-port}''. (Same for
-@var{current-output-port}.)
-@end ignore
-
-
-
-@end deffn
-
-
-
-@deffn {procedure} open-input-file filename
-
-Takes a string naming an existing file and returns an input port capable of
-delivering characters from the file. If the file cannot be opened, an error is
-signalled.
-
-@end deffn
-
-
-
-@deffn {procedure} open-output-file filename
-
-Takes a string naming an output file to be created and returns an output
-port capable of writing characters to a new file by that name. If the file
-cannot be opened, an error is signalled. If a file with the given name
-already exists, the effect is unspecified.
-
-@end deffn
-
-
-
-@deffn {procedure} close-input-port port
-@deffnx {procedure} close-output-port port
-
-Closes the file associated with @var{port}, rendering the @var{port}
-incapable of delivering or accepting characters.
-@ignore todo
-But maybe a no-op
-on some ports, e.g. terminals or editor buffers.
-@end ignore
-
-These routines have no effect if the file has already been closed.
-The value returned is unspecified.
-
-@ignore todo
-Ramsdell: Some note is needed explaining why there are two
-different close procedures.
-@end ignore
-
-
-@ignore todo
-A port isn't necessarily still a port after it has been closed?
-@end ignore
-
-
-@end deffn
-
-
-@node Input, Output, Ports, Input and output
-@subsection Input
-
-
-
-
-@noindent
- @w{ }
-@c ???
-@sp 5
-@ignore todo
-The input routines have some things in common, maybe explain here.
-@end ignore
-
-
-
-@deffn {library procedure} read
-@deffnx {library procedure} read port
-
-@samp{Read} converts external representations of Scheme objects into the
-objects themselves. That is, it is a parser for the nonterminal
-<datum> (see sections @pxref{External representation} and
-@pxref{Pairs and lists}). @samp{Read} returns the next
-object parsable from the given input @var{port}, updating @var{port} to point to
-the first character past the end of the external representation of the object.
-
-If an end of file is encountered in the input before any
-characters are found that can begin an object, then an end of file
-object is returned.
-@ignore todo
-
-@end ignore
- The port remains open, and further attempts
-to read will also return an end of file object. If an end of file is
-encountered after the beginning of an object's external representation,
-but the external representation is incomplete and therefore not parsable,
-an error is signalled.
-
-The @var{port} argument may be omitted, in which case it defaults to the
-value returned by @samp{current-input-port}. It is an error to read from
-a closed port.
-@end deffn
-
-
-@deffn {procedure} read-char
-@deffnx {procedure} read-char port
-
-Returns the next character available from the input @var{port}, updating
-the @var{port} to point to the following character. If no more characters
-are available, an end of file object is returned. @var{Port} may be
-omitted, in which case it defaults to the value returned by @samp{current-input-port}.
-
-@end deffn
-
-
-
-@deffn {procedure} peek-char
-@deffnx {procedure} peek-char port
-
-Returns the next character available from the input @var{port},
-@emph{without} updating
-the @var{port} to point to the following character. If no more characters
-are available, an end of file object is returned. @var{Port} may be
-omitted, in which case it defaults to the value returned by @samp{current-input-port}.
-
-
-@quotation
-@emph{Note:}
-The value returned by a call to @samp{peek-char} is the same as the
-value that would have been returned by a call to @samp{read-char} with the
-same @var{port}. The only difference is that the very next call to
-@samp{read-char} or @samp{peek-char} on that @var{port} will return the
-value returned by the preceding call to @samp{peek-char}. In particular, a call
-to @samp{peek-char} on an interactive port will hang waiting for input
-whenever a call to @samp{read-char} would have hung.
-@end quotation
-
-
-@end deffn
-
-
-
-@deffn {procedure} eof-object? obj
-
-Returns @t{#t} if @var{obj} is an end of file object, otherwise returns
-@t{#f}. The precise set of end of file objects will vary among
-implementations, but in any case no end of file object will ever be an object
-that can be read in using @samp{read}.
-
-@end deffn
-
-
-
-@deffn {procedure} char-ready?
-@deffnx {procedure} char-ready? port
-
-Returns @t{#t} if a character is ready on the input @var{port} and
-returns @t{#f} otherwise. If @samp{char-ready} returns @t{#t} then
-the next @samp{read-char} operation on the given @var{port} is guaranteed
-not to hang. If the @var{port} is at end of file then @samp{char-ready?}
-returns @t{#t}. @var{Port} may be omitted, in which case it defaults to
-the value returned by @samp{current-input-port}.
-
-
-@quotation
-@emph{Rationale:}
-@samp{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 @samp{char-ready?} cannot
-be rubbed out. If @samp{char-ready?} were to return @t{#f} at end of
-file, a port at end of file would be indistinguishable from an interactive
-port that has no ready characters.
-@end quotation
-
-@end deffn
-
-
-@node Output, System interface, Input, Input and output
-@subsection Output
-
-
-
-@c We've got to put something here to fix the indentation!!
-
-@noindent
- @w{}
-@sp 5
-
-
-@deffn {library procedure} write obj
-@deffnx {library procedure} write obj port
-
-Writes a written representation of @var{obj} to the given @var{port}. Strings
-that appear in the written representation are enclosed in doublequotes, and
-within those strings backslash and doublequote characters are
-escaped by backslashes.
-Character objects are written using the @samp{#\} notation.
-@samp{Write} returns an unspecified value. The
-@var{port} argument may be omitted, in which case it defaults to the value
-returned by @samp{current-output-port}.
-
-@end deffn
-
-
-
-@deffn {library procedure} display obj
-@deffnx {library procedure} display obj port
-
-Writes a representation of @var{obj} to the given @var{port}. Strings
-that appear in the written representation are not enclosed in
-doublequotes, and no characters are escaped within those strings. Character
-objects appear in the representation as if written by @samp{write-char}
-instead of by @samp{write}. @samp{Display} returns an unspecified value.
-The @var{port} argument may be omitted, in which case it defaults to the
-value returned by @samp{current-output-port}.
-
-
-@quotation
-@emph{Rationale:}
-@samp{Write} is intended
-for producing mach@-ine-readable output and @samp{display} is for producing
-human-readable output. Implementations that allow ``slashification''
-within symbols will probably want @samp{write} but not @samp{display} to
-slashify funny characters in symbols.
-@end quotation
-
-@end deffn
-
-
-
-@deffn {library procedure} newline
-@deffnx {library procedure} newline port
-
-Writes an end of line to @var{port}. Exactly how this is done differs
-from one operating system to another. Returns an unspecified value.
-The @var{port} argument may be omitted, in which case it defaults to the
-value returned by @samp{current-output-port}.
-
-@end deffn
-
-
-
-@deffn {procedure} write-char char
-@deffnx {procedure} write-char char port
-
-Writes the character @var{char} (not an external representation of the
-character) to the given @var{port} and returns an unspecified value. The
-@var{port} argument may be omitted, in which case it defaults to the value
-returned by @samp{current-output-port}.
-
-@end deffn
-
-
-@node System interface, , Output, Input and output
-@subsection System interface
-
-
-Questions of system interface generally fall outside of the domain of this
-report. However, the following operations are important enough to
-deserve description here.
-
-
-
-@deffn {optional procedure} load filename
-
-@ignore todo
-Fix
-@end ignore
-
-
-@c \domain{\var{Filename} should be a string naming an existing file
-@c containing Scheme source code.} The {\cf load} procedure reads
-@var{Filename} should be a string naming an existing file
-containing Scheme source code. The @samp{load} procedure reads
-expressions and definitions from the file and evaluates them
-sequentially. It is unspecified whether the results of the expressions
-are printed. The @samp{load} procedure does not affect the values
-returned by @samp{current-input-port} and @samp{current-output-port}.
-@samp{Load} returns an unspecified value.
-
-
-@quotation
-@emph{Rationale:}
-For portability, @samp{load} must operate on source files.
-Its operation on other kinds of files necessarily varies among
-implementations.
-@end quotation
-
-@end deffn
-
-
-
-@deffn {optional procedure} transcript-on filename
-@deffnx {optional procedure} transcript-off
-
-@var{Filename} must be a string naming an output file to be
-created. The effect of @samp{transcript-on} is to open the named file
-for output, and to cause a transcript of subsequent interaction between
-the user and the Scheme system to be written to the file. The
-transcript is ended by a call to @samp{transcript-off}, which closes the
-transcript file. Only one transcript may be in progress at any time,
-though some implementations may relax this restriction. The values
-returned by these procedures are unspecified.
-
-@c \begin{note}
-@c These procedures are redundant in some systems, but
-@c systems that need them should provide them.
-@c \end{note}
-@end deffn
-
-@page
-
-@c @include{syn}
-@node Formal syntax and semantics, Notes, Standard procedures, top
-@chapter Formal syntax and semantics
-
-@menu
-* Formal syntax::
-* Formal semantics::
-* Derived expression type::
-@end menu
-
-
-
-This chapter provides formal descriptions of what has already been
-described informally in previous chapters of this report.
-
-@ignore todo
-Allow grammar to say that else clause needn't be last?
-@end ignore
-
-
-
-@node Formal syntax, Formal semantics, Formal syntax and semantics, Formal syntax and semantics
-@section Formal syntax
-
-@menu
-* Lexical structure::
-* External representation::
-* Expression::
-* Quasiquotations::
-* Transformers::
-* Programs and definitions::
-@end menu
-
-
-
-This section provides a formal syntax for Scheme written in an extended
-BNF.
-
-All spaces in the grammar are for legibility. Case is insignificant;
-for example, @samp{#x1A} and @samp{#X1a} are equivalent. <empty>
-stands for the empty string.
-
-The following extensions to BNF are used to make the description more
-concise: <thing>* means zero or more occurrences of
-<thing>; and <thing>+ means at least one
-<thing>.
-
-
-@node Lexical structure, External representation, Formal syntax, Formal syntax
-@subsection Lexical structure
-
-
-This section describes how individual tokens (identifiers,
-@cindex @w{token}
-numbers, etc.) are formed from sequences of characters. The following
-sections describe how expressions and programs are formed from sequences
-of tokens.
-
-<Intertoken space> may occur on either side of any token, but not
-within a token.
-
-Tokens which require implicit termination (identifiers, numbers,
-characters, and dot) may be terminated by any <delimiter>, but not
-necessarily by anything else.
-
-The following five characters are reserved for future extensions to the
-language: @t{[ ] @{ @} |}
-
-
-@format
-@t{<token> --> <identifier> | <boolean> | <number>
-@cindex @w{identifier}
- | <character> | <string>
- | ( | ) | #( | @t{'} | @t{`} | , | ,@@ | @b{.}
-<delimiter> --> <whitespace> | ( | ) | " | ;
-<whitespace> --> <space or newline>
-<comment> --> ; <@r{all subsequent characters up to a}
- @r{line break>}
-@cindex @w{comment}
-<atmosphere> --> <whitespace> | <comment>
-<intertoken space> --> <atmosphere>*}
-
-@end format
-
-
-
-
-
-
-@c This is a kludge, but \multicolumn doesn't work in tabbing environments.
-
-
-
-@format
-@t{<identifier> --> <initial> <subsequent>*
- | <peculiar identifier>
-<initial> --> <letter> | <special initial>
-<letter> --> a | b | c | ... | z
-
-<special initial> --> ! | $ | % | & | * | / | : | < | =
- | > | ? | ^ | _ | ~
-<subsequent> --> <initial> | <digit>
- | <special subsequent>
-<digit> --> 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
-<special subsequent> --> + | - | .@: | @@
-<peculiar identifier> --> + | - | ...
-<syntactic keyword> --> <expression keyword>
-@cindex @w{syntactic keyword}
-@cindex @w{keyword}
- | else | => | define
- | unquote | unquote-splicing
-<expression keyword> --> quote | lambda | if
- | set! | begin | cond | and | or | case
- | let | let* | letrec | do | delay
- | quasiquote
-
-@w{@samp{<variable> @result{} <}}@r{any <identifier> that isn't}
-@cindex @w{variable}
- @w{ @r{also a <syntactic keyword>>}}
-
-<boolean> --> #t | #f
-<character> --> #\ <any character>
- | #\ <character name>
-<character name> --> space | newline
-
-<string> --> " <string element>* "
-<string element> --> <any character other than " or \>
- | \" | \\ }
-
-@end format
-
-
-
-
-
-
-
-@format
-@t{<number> --> <num 2>| <num 8>
- | <num 10>| <num 16>
-}
-
-@end format
-
-
-
-The following rules for <num R>, <complex R>, <real
-R>, <ureal R>, <uinteger R>, and <prefix R>
-should be replicated for @w{R = 2, 8, 10,}
-and 16. There are no rules for <decimal 2>, <decimal
-8>, and <decimal 16>, which means that numbers containing
-decimal points or exponents must be in decimal radix.
-@ignore todo
-Mark Meyer and David Bartley want to fix this. (What? -- Will)
-@end ignore
-
-
-
-@format
-@t{<num R> --> <prefix R> <complex R>
-<complex R> --> <real R> | <real R> @@ <real R>
- | <real R> + <ureal R> i | <real R> - <ureal R> i
- | <real R> + i | <real R> - i
- | + <ureal R> i | - <ureal R> i | + i | - i
-<real R> --> <sign> <ureal R>
-<ureal R> --> <uinteger R>
- | <uinteger R> / <uinteger R>
- | <decimal R>
-<decimal 10> --> <uinteger 10> <suffix>
- | . <digit 10>+ #* <suffix>
- | <digit 10>+ . <digit 10>* #* <suffix>
- | <digit 10>+ #+ . #* <suffix>
-<uinteger R> --> <digit R>+ #*
-<prefix R> --> <radix R> <exactness>
- | <exactness> <radix R>
-}
-
-@end format
-
-
-
-
-@format
-@t{<suffix> --> <empty>
- | <exponent marker> <sign> <digit 10>+
-<exponent marker> --> e | s | f | d | l
-<sign> --> <empty> | + | -
-<exactness> --> <empty> | #i | #e
-@vindex #e
-@vindex #i
-<radix 2> --> #b
-@vindex #b
-<radix 8> --> #o
-@vindex #o
-<radix 10> --> <empty> | #d
-<radix 16> --> #x
-@vindex #x
-<digit 2> --> 0 | 1
-<digit 8> --> 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
-<digit 10> --> <digit>
-<digit 16> --> <digit 10> | a | b | c | d | e | f }
-
-@end format
-
-
-
-@ignore todo
-Mark Meyer of TI sez, shouldn't we allow @t{1e3/2}?
-@end ignore
-
-
-
-@node External representation, Expression, Lexical structure, Formal syntax
-@subsection External representations
-
-
-
-<Datum> is what the @code{read} procedure (section @pxref{Input})
-@vindex @w{read}
-successfully parses. Note that any string that parses as an
-<ex@-pres@-sion> will also parse as a <datum>.
-
-
-@format
-@t{<datum> --> <simple datum> | <compound datum>
-<simple datum> --> <boolean> | <number>
- | <character> | <string> | <symbol>
-<symbol> --> <identifier>
-<compound datum> --> <list> | <vector>
-<list> --> (<datum>*) | (<datum>+ .@: <datum>)
- | <abbreviation>
-<abbreviation> --> <abbrev prefix> <datum>
-<abbrev prefix> --> ' | ` | , | ,@@
-<vector> --> #(<datum>*) }
-
-@end format
-
-
-
-
-@node Expression, Quasiquotations, External representation, Formal syntax
-@subsection Expressions
-
-
-
-@format
-@t{<expression> --> <variable>
- | <literal>
- | <procedure call>
- | <lambda expression>
- | <conditional>
- | <assignment>
- | <derived expression>
- | <macro use>
- | <macro block>
-
-<literal> --> <quotation> | <self-evaluating>
-<self-evaluating> --> <boolean> | <number>
- | <character> | <string>
-<quotation> --> '<datum> | (quote <datum>)
-<procedure call> --> (<operator> <operand>*)
-<operator> --> <expression>
-<operand> --> <expression>
-
-<lambda expression> --> (lambda <formals> <body>)
-<formals> --> (<variable>*) | <variable>
- | (<variable>+ .@: <variable>)
-<body> --> <definition>* <sequence>
-<sequence> --> <command>* <expression>
-<command> --> <expression>
-
-<conditional> --> (if <test> <consequent> <alternate>)
-<test> --> <expression>
-<consequent> --> <expression>
-<alternate> --> <expression> | <empty>
-
-<assignment> --> (set! <variable> <expression>)
-
-<derived expression> -->
- (cond <cond clause>+)
- | (cond <cond clause>* (else <sequence>))
- | (case <expression>
- <case clause>+)
- | (case <expression>
- <case clause>*
- (else <sequence>))
- | (and <test>*)
- | (or <test>*)
- | (let (<binding spec>*) <body>)
- | (let <variable> (<binding spec>*) <body>)
- | (let* (<binding spec>*) <body>)
- | (letrec (<binding spec>*) <body>)
- | (begin <sequence>)
- | (do (<iteration spec>*)
- (<test> <do result>)
- <command>*)
- | (delay <expression>)
- | <quasiquotation>
-
-<cond clause> --> (<test> <sequence>)
- | (<test>)
- | (<test> => <recipient>)
-<recipient> --> <expression>
-<case clause> --> ((<datum>*) <sequence>)
-<binding spec> --> (<variable> <expression>)
-<iteration spec> --> (<variable> <init> <step>)
- | (<variable> <init>)
-<init> --> <expression>
-<step> --> <expression>
-<do result> --> <sequence> | <empty>
-
-<macro use> --> (<keyword> <datum>*)
-<keyword> --> <identifier>
-
-<macro block> -->
- (let-syntax (<syntax spec>*) <body>)
- | (letrec-syntax (<syntax spec>*) <body>)
-<syntax spec> --> (<keyword> <transformer spec>)
-
-}
-
-@end format
-
-
-
-@node Quasiquotations, Transformers, Expression, Formal syntax
-@subsection Quasiquotations
-
-
-The following grammar for quasiquote expressions is not context-free.
-It is presented as a recipe for generating an infinite number of
-production rules. Imagine a copy of the following rules for D = 1, 2,3, @dots{}. D keeps track of the nesting depth.
-
-
-@format
-@t{<quasiquotation> --> <quasiquotation 1>
-<qq template 0> --> <expression>
-<quasiquotation D> --> `<qq template D>
- | (quasiquote <qq template D>)
-<qq template D> --> <simple datum>
- | <list qq template D>
- | <vector qq template D>
- | <unquotation D>
-<list qq template D> --> (<qq template or splice D>*)
- | (<qq template or splice D>+ .@: <qq template D>)
- | '<qq template D>
- | <quasiquotation D+1>
-<vector qq template D> --> #(<qq template or splice D>*)
-<unquotation D> --> ,<qq template D-1>
- | (unquote <qq template D-1>)
-<qq template or splice D> --> <qq template D>
- | <splicing unquotation D>
-<splicing unquotation D> --> ,@@<qq template D-1>
- | (unquote-splicing <qq template D-1>) }
-
-@end format
-
-
-
-In <quasiquotation>s, a <list qq template D> can sometimes
-be confused with either an <un@-quota@-tion D> or a <splicing
-un@-quo@-ta@-tion D>. The interpretation as an
-<un@-quo@-ta@-tion> or <splicing
-un@-quo@-ta@-tion D> takes precedence.
-
-@node Transformers, Programs and definitions, Quasiquotations, Formal syntax
-@subsection Transformers
-
-
-
-@format
-@t{<transformer spec> -->
- (syntax-rules (<identifier>*) <syntax rule>*)
-<syntax rule> --> (<pattern> <template>)
-<pattern> --> <pattern identifier>
- | (<pattern>*)
- | (<pattern>+ . <pattern>)
- | (<pattern>* <pattern> <ellipsis>)
- | #(<pattern>*)
- | #(<pattern>* <pattern> <ellipsis>)
- | <pattern datum>
-<pattern datum> --> <string>
- | <character>
- | <boolean>
- | <number>
-<template> --> <pattern identifier>
- | (<template element>*)
- | (<template element>+ . <template>)
- | #(<template element>*)
- | <template datum>
-<template element> --> <template>
- | <template> <ellipsis>
-<template datum> --> <pattern datum>
-<pattern identifier> --> <any identifier except @samp{...}>
-<ellipsis> --> <the identifier @samp{...}>
-}
-
-@end format
-
-
-
-@node Programs and definitions, , Transformers, Formal syntax
-@subsection Programs and definitions
-
-
-
-@format
-@t{<program> --> <command or definition>*
-<command or definition> --> <command>
- | <definition>
- | <syntax definition>
- | (begin <command or definition>+)
-<definition> --> (define <variable> <expression>)
- | (define (<variable> <def formals>) <body>)
- | (begin <definition>*)
-<def formals> --> <variable>*
- | <variable>* .@: <variable>
-<syntax definition> -->
- (define-syntax <keyword> <transformer spec>)
-}
-
-@end format
-
-
-
-@node Formal semantics, Derived expression type, Formal syntax, Formal syntax and semantics
-@section Formal semantics
-
-
-This section provides a formal denotational semantics for the primitive
-expressions of Scheme and selected built-in procedures. The concepts
-and notation used here are described in @sc{[Stoy77]}.
-
-@quotation
-@emph{Note:} The formal semantics section was written in La@TeX{} which
-is incompatible with @TeX{}info. See the Formal semantics section of
-the original document from which this was derived.
-@end quotation
-
-
-@c @include{derive}
-@node Derived expression type, , Formal semantics, Formal syntax and semantics
-@section Derived expression types
-
-
-
-This section gives macro definitions for the derived expression types in
-terms of the primitive expression types (literal, variable, call, @samp{lambda},
-@samp{if}, @samp{set!}). See section @ref{Control features} for a possible
-definition of @samp{delay}.
-
-
-@example
-
-(define-syntax cond
- (syntax-rules (else =>)
- ((cond (else result1 result2 ...))
- (begin result1 result2 ...))
- ((cond (test => result))
- (let ((temp test))
- (if temp (result temp))))
- ((cond (test => result) clause1 clause2 ...)
- (let ((temp test))
- (if temp
- (result temp)
- (cond clause1 clause2 ...))))
- ((cond (test)) test)
- ((cond (test) clause1 clause2 ...)
- (let ((temp test))
- (if temp
- temp
- (cond clause1 clause2 ...))))
- ((cond (test result1 result2 ...))
- (if test (begin result1 result2 ...)))
- ((cond (test result1 result2 ...)
- clause1 clause2 ...)
- (if test
- (begin result1 result2 ...)
- (cond clause1 clause2 ...)))))
-
-@end example
-
-
-
-@example
-
-(define-syntax case
- (syntax-rules (else)
- ((case (key ...)
- clauses ...)
- (let ((atom-key (key ...)))
- (case atom-key clauses ...)))
- ((case key
- (else result1 result2 ...))
- (begin result1 result2 ...))
- ((case key
- ((atoms ...) result1 result2 ...))
- (if (memv key '(atoms ...))
- (begin result1 result2 ...)))
- ((case key
- ((atoms ...) result1 result2 ...)
- clause clauses ...)
- (if (memv key '(atoms ...))
- (begin result1 result2 ...)
- (case key clause clauses ...)))))
-
-@end example
-
-
-
-@example
-
-(define-syntax and
- (syntax-rules ()
- ((and) #t)
- ((and test) test)
- ((and test1 test2 ...)
- (if test1 (and test2 ...) #f))))
-
-@end example
-
-
-
-@example
-
-(define-syntax or
- (syntax-rules ()
- ((or) #f)
- ((or test) test)
- ((or test1 test2 ...)
- (let ((x test1))
- (if x x (or test2 ...))))))
-
-@end example
-
-
-
-@example
-
-(define-syntax let
- (syntax-rules ()
- ((let ((name val) ...) body1 body2 ...)
- ((lambda (name ...) body1 body2 ...)
- val ...))
- ((let tag ((name val) ...) body1 body2 ...)
- ((letrec ((tag (lambda (name ...)
- body1 body2 ...)))
- tag)
- val ...))))
-
-@end example
-
-
-
-@example
-
-(define-syntax let*
- (syntax-rules ()
- ((let* () body1 body2 ...)
- (let () body1 body2 ...))
- ((let* ((name1 val1) (name2 val2) ...)
- body1 body2 ...)
- (let ((name1 val1))
- (let* ((name2 val2) ...)
- body1 body2 ...)))))
-
-@end example
-
-
-The following @samp{letrec} macro uses the symbol @samp{<undefined>}
-in place of an expression which returns something that when stored in
-a location makes it an error to try to obtain the value stored in the
-location (no such expression is defined in Scheme).
-A trick is used to generate the temporary names needed to avoid
-specifying the order in which the values are evaluated.
-This could also be accomplished by using an auxiliary macro.
-
-
-@example
-
-(define-syntax letrec
- (syntax-rules ()
- ((letrec ((var1 init1) ...) body ...)
- (letrec "generate temp names"
- (var1 ...)
- ()
- ((var1 init1) ...)
- body ...))
- ((letrec "generate temp names"
- ()
- (temp1 ...)
- ((var1 init1) ...)
- body ...)
- (let ((var1 <undefined>) ...)
- (let ((temp1 init1) ...)
- (set! var1 temp1)
- ...
- body ...)))
- ((letrec "generate temp names"
- (x y ...)
- (temp ...)
- ((var1 init1) ...)
- body ...)
- (letrec "generate temp names"
- (y ...)
- (newtemp temp ...)
- ((var1 init1) ...)
- body ...))))
-
-@end example
-
-
-
-@example
-
-(define-syntax begin
- (syntax-rules ()
- ((begin exp ...)
- ((lambda () exp ...)))))
-
-@end example
-
-
-The following alternative expansion for @samp{begin} does not make use of
-the ability to write more than one expression in the body of a lambda
-expression. In any case, note that these rules apply only if the body
-of the @samp{begin} contains no definitions.
-
-
-@example
-
-(define-syntax begin
- (syntax-rules ()
- ((begin exp)
- exp)
- ((begin exp1 exp2 ...)
- (let ((x exp1))
- (begin exp2 ...)))))
-
-@end example
-
-
-The following definition
-of @samp{do} uses a trick to expand the variable clauses.
-As with @samp{letrec} above, an auxiliary macro would also work.
-The expression @samp{(if #f #f)} is used to obtain an unspecific
-value.
-
-
-@example
-
-(define-syntax do
- (syntax-rules ()
- ((do ((var init step ...) ...)
- (test expr ...)
- command ...)
- (letrec
- ((loop
- (lambda (var ...)
- (if test
- (begin
- (if #f #f)
- expr ...)
- (begin
- command
- ...
- (loop (do "step" var step ...)
- ...))))))
- (loop init ...)))
- ((do "step" x)
- x)
- ((do "step" x y)
- y)))
-
-@end example
-
-
-@c `a = Q_1[a]
-@c `(a b c ... . z) = `(a . (b c ...))
-@c `(a . b) = (append Q*_0[a] `b)
-@c `(a) = Q*_0[a]
-@c Q*_0[a] = (list 'a)
-@c Q*_0[,a] = (list a)
-@c Q*_0[,@a] = a
-@c Q*_0[`a] = (list 'quasiquote Q*_1[a])
-@c `#(a b ...) = (list->vector `(a b ...))
-@c ugh.
-
-@page
-
-@c @include{notes}
-@node Notes, Additional material, Formal syntax and semantics, top
-@unnumbered Notes
-
-@menu
-* Language changes::
-@end menu
-
-
-
-@ignore todo
-Perhaps this section should be made to disappear.
-Can these remarks be moved somewhere else?
-@end ignore
-
-
-@node Language changes, , Notes, Notes
-@unnumberedsec Language changes
-
-
-
-This section enumerates the changes that have been made to Scheme since
-the ``Revised^4 report'' [R4RS] was published.
-
-
-
-@itemize @bullet
-
-
-@item
-The report is now a superset of the IEEE standard for Scheme
-[IEEEScheme]: implementations that conform to the report will
-also conform to the standard. This required the following changes:
-
-
-@itemize @bullet
-
-
-@item
-The empty list is now required to count as true.
-
-@item
-The classification of features as essential or inessential has been
-removed. There are now three classes of built-in procedures: primitive,
-library, and optional. The optional procedures are @samp{load},
-@samp{with-input-from-file}, @samp{with-output-to-file},
-@samp{transcript-on}, @samp{transcript-off}, and
-@samp{interaction-environment},
-and @samp{-} and @samp{/} with more than two arguments.
-None of these are in the IEEE standard.
-
-@item
-Programs are allowed to redefine built-in procedures. Doing so
-will not change the behavior of other built-in procedures.
-
-@end itemize
-
-
-@item
-@emph{Port} has been added to the list of disjoint types.
-
-@item
-The macro appendix has been removed. High-level macros are now part
-of the main body of the report. The rewrite rules for derived expressions
-have been replaced with macro definitions. There are no reserved identifiers.
-
-@item
-@samp{Syntax-rules} now allows vector patterns.
-
-@item
-Multiple-value returns, @samp{eval}, and @samp{dynamic-wind} have
-been added.
-
-@item
-The calls that are required to be implemented in a properly tail-recursive
-fashion are defined explicitly.
-
-@item
-`@samp{@@}' can be used within identifiers. `@samp{|}' is reserved
-for possible future extensions.
-
-
-@end itemize
-
-
-@c %R4%%
-@c \subsection*{Keywords as variable names}
-
-@c Some implementations allow arbitrary syntactic
-@c keywords \index{keyword}\index{syntactic keyword}to be used as variable
-@c names, instead of reserving them, as this report would have
-@c it.\index{variable} But this creates ambiguities in the interpretation
-@c of expressions: for example, in the following, it's not clear whether
-@c the expression {\tt (if 1 2 3)} should be treated as a procedure call or
-@c as a conditional.
-
-@c \begin{scheme}
-@c (define if list)
-@c (if 1 2 3) \ev 2 {\em{}or} (1 2 3)%
-@c \end{scheme}
-
-@c These ambiguities are usually resolved in some consistent way within any
-@c given implementation, but no particular treatment stands out as being
-@c clearly superior to any other, so these situations were excluded for the
-@c purposes of this report.
-
-@c %R4%%
-@c \subsection*{Macros}
-
-@c Scheme does not have any standard facility for defining new kinds of
-@c expressions.\index{macros}
-
-@c \vest The ability to alter the syntax of the language creates
-@c numerous problems. All current implementations of Scheme have macro
-@c facilities that solve those problems to one degree or another, but the
-@c solutions are quite different and it isn't clear at this time which
-@c solution is best, or indeed whether any of the solutions are truly
-@c adequate. Rather than standardize, we are encouraging implementations
-@c to continue to experiment with different solutions.
-
-@c \vest The main problems with traditional macros are: They must be
-@c defined to the system before any code using them is loaded; this is a
-@c common source of obscure bugs. They are usually global; macros can be
-@c made to follow lexical scope rules \todo{flushed: ``as in Common
-@c Lisp's {\tt macrolet}''; OK?}, but many people find the resulting scope rules
-@c confusing. Unless they are written very carefully, macros are
-@c vulnerable to inadvertent capture of free variables; to get around this,
-@c for example, macros may have to generate code in which procedure values
-@c appear as quoted constants. There is a similar problem with syntactic
-@c keywords if the keywords of special forms are not reserved. If keywords
-@c are reserved, then either macros introduce new reserved words,
-@c invalidating old code, or else special forms defined by the programmer
-@c do not have the same status as special forms defined by the system.
-
-@c \todo{Refer to Pitman's special forms paper.}
-@c \todo{Pitman sez: Discuss importance of having a small number of special forms
-@c so that programs can inspect each other.}
-
-@ignore todo
-Move cwcc history back here? --- Andy Cromarty is concerned about
-confusion over who the audience is.
-@end ignore
-
-
-@ignore todo
-Cromarty:
-23. NOTES, p.35ff.: This material should stay somehow. We need to
- make it clear that R^3 Scheme is not being touted as Yet Another
- Ultimate Solution To The Programming Language Problem, but rather
- as a snapshot of a *process* of good design, for which not all
- answers have yet been found. We also ought to use the opportunity
- for publicity afforded us by SIGPLAN to advertise some of the thorny
- unsolved problems that need further research, and encourage
- language designers to work on them.
-@end ignore
-
-
-@c @include{repository}
-@node Additional material, Example, Notes, top
-@unnumbered Additional material
-
-
-The Internet Scheme Repository at
-
-@center
-@center @url{http://www.cs.indiana.edu/scheme-repository/}
-@center
-
-contains an extensive Scheme bibliography, as well as papers,
-programs, implementations, and other material related to Scheme.
-
-@page
-
-@c @include{example}
-
-@node Example, Bibliography, Additional material, top
-@unnumbered Example
-
-@c -*- Mode: Lisp; Package: SCHEME; Syntax: Common-lisp -*-
-
-
-@samp{Integrate-system} integrates the system
-
-
-@center y_k^^ = f_k(y_1, y_2, @dots{}, y_n), k = 1, @dots{}, n
-
-of differential equations with the method of Runge-Kutta.
-
-The parameter @t{system-derivative} is a function that takes a system
-state (a vector of values for the state variables y_1, @dots{}, y_n)
-and produces a system derivative (the values y_1^^, @dots{},y_n^^). The parameter @t{initial-state} provides an initial
-system state, and @t{h} is an initial guess for the length of the
-integration step.
-
-The value returned by @samp{integrate-system} is an infinite stream of
-system states.
-
-
-@example
-
-(define integrate-system
- (lambda (system-derivative initial-state h)
- (let ((next (runge-kutta-4 system-derivative h)))
- (letrec ((states
- (cons initial-state
- (delay (map-streams next
- states)))))
- states))))
-
-@end example
-
-
-@samp{Runge-Kutta-4} takes a function, @t{f}, that produces a
-system derivative from a system state. @samp{Runge-Kutta-4}
-produces a function that takes a system state and
-produces a new system state.
-
-
-@example
-
-(define runge-kutta-4
- (lambda (f h)
- (let ((*h (scale-vector h))
- (*2 (scale-vector 2))
- (*1/2 (scale-vector (/ 1 2)))
- (*1/6 (scale-vector (/ 1 6))))
- (lambda (y)
- ;; y @r{}is a system state
- (let* ((k0 (*h (f y)))
- (k1 (*h (f (add-vectors y (*1/2 k0)))))
- (k2 (*h (f (add-vectors y (*1/2 k1)))))
- (k3 (*h (f (add-vectors y k2)))))
- (add-vectors y
- (*1/6 (add-vectors k0
- (*2 k1)
- (*2 k2)
- k3))))))))
-@c |--------------------------------------------------|
-
-(define elementwise
- (lambda (f)
- (lambda vectors
- (generate-vector
- (vector-length (car vectors))
- (lambda (i)
- (apply f
- (map (lambda (v) (vector-ref v i))
- vectors)))))))
-
-@c |--------------------------------------------------|
-(define generate-vector
- (lambda (size proc)
- (let ((ans (make-vector size)))
- (letrec ((loop
- (lambda (i)
- (cond ((= i size) ans)
- (else
- (vector-set! ans i (proc i))
- (loop (+ i 1)))))))
- (loop 0)))))
-
-(define add-vectors (elementwise +))
-
-(define scale-vector
- (lambda (s)
- (elementwise (lambda (x) (* x s)))))
-
-@end example
-
-
-@samp{Map-streams} is analogous to @samp{map}: it applies its first
-argument (a procedure) to all the elements of its second argument (a
-stream).
-
-
-@example
-
-(define map-streams
- (lambda (f s)
- (cons (f (head s))
- (delay (map-streams f (tail s))))))
-
-@end example
-
-
-Infinite streams are implemented as pairs whose car holds the first
-element of the stream and whose cdr holds a promise to deliver the rest
-of the stream.
-
-
-@example
-
-(define head car)
-(define tail
- (lambda (stream) (force (cdr stream))))
-
-@end example
-
-
-@sp 6
-The following illustrates the use of @samp{integrate-system} in
-integrating the system
-
-
-@center C dv_C / dt = -i_L - v_C / R
-
-
-
-@center L di_L / dt = v_C
-
-which models a damped oscillator.
-
-
-@example
-
-(define damped-oscillator
- (lambda (R L C)
- (lambda (state)
- (let ((Vc (vector-ref state 0))
- (Il (vector-ref state 1)))
- (vector (- 0 (+ (/ Vc (* R C)) (/ Il C)))
- (/ Vc L))))))
-
-(define the-states
- (integrate-system
- (damped-oscillator 10000 1000 .001)
- '#(1 0)
- .01))
-
-@end example
-
-
-@ignore todo
-Show some output?
-@end ignore
-
-
-@c (letrec ((loop (lambda (s)
-@c (newline)
-@c (write (head s))
-@c (loop (tail s)))))
-@c (loop the-states))
-
-@c #(1 0)
-@c #(0.99895054 9.994835e-6)
-@c #(0.99780226 1.9978681e-5)
-@c #(0.9965554 2.9950552e-5)
-@c #(0.9952102 3.990946e-5)
-@c #(0.99376684 4.985443e-5)
-@c #(0.99222565 5.9784474e-5)
-@c #(0.9905868 6.969862e-5)
-@c #(0.9888506 7.9595884e-5)
-@c #(0.9870173 8.94753e-5)
-
-@page
-
-@c \newpage % Put bib on it's own page (it's just one)
-@c \twocolumn[\vspace{-.18in}]% Last bib item was on a page by itself.
-@c \renewcommand{\bibname}{References}
-@c @include{bib}
-
-@c My reference for proper reference format is:
-@c Mary-Claire van Leunen.
-@c {\em A Handbook for Scholars.}
-@c Knopf, 1978.
-@c I think the references list would look better in ``open'' format,
-@c i.e. with the three blocks for each entry appearing on separate
-@c lines. I used the compressed format for SIGPLAN in the interest of
-@c space. In open format, when a block runs over one line,
-@c continuation lines should be indented; this could probably be done
-@c using some flavor of latex list environment. Maybe the right thing
-@c to do in the long run would be to convert to Bibtex, which probably
-@c does the right thing, since it was implemented by one of van
-@c Leunen's colleagues at DEC SRC.
-@c -- Jonathan
-
-@c I tried to follow Jonathan's format, insofar as I understood it.
-@c I tried to order entries lexicographically by authors (with singly
-@c authored papers first), then by date.
-@c In some cases I replaced a technical report or conference paper
-@c by a subsequent journal article, but I think there are several
-@c more such replacements that ought to be made.
-@c -- Will, 1991.
-
-@c This is just a personal remark on your question on the RRRS:
-@c The language CUCH (Curry-Church) was implemented by 1964 and
-@c is a practical version of the lambda-calculus (call-by-name).
-@c One reference you may find in Formal Language Description Languages
-@c for Computer Programming T.~B.~Steele, 1965 (or so).
-@c -- Matthias Felleisen
-
-@c Rather than try to keep the bibliography up-to-date, which is hopeless
-@c given the time between updates, I replaced the bulk of the references
-@c with a pointer to the Scheme Repository. Ozan Yigit's bibliography in
-@c the repository is a superset of the R4RS one.
-@c The bibliography now contains only items referenced within the report.
-@c -- Richard, 1996.
-
-@node Bibliography, Index, Example, top
-@unnumbered Bibliography
-
-
-@itemize @bullet
-@c 999
-
-
-@item [SICP]
-@pindex SICP
-Harold Abelson and Gerald Jay Sussman with Julie Sussman.
-@emph{Structure and Interpretation of Computer Programs, second edition.}
-MIT Press, Cambridge, 1996.
-
-@item [Bawden88]
-@c new
-Alan Bawden and Jonathan Rees.
-@pindex Bawden88
-Syntactic closures.
-In @emph{Proceedings of the 1988 ACM Symposium on Lisp and
- Functional Programming}, pages 86--95.
-
-@item [howtoprint]
-@pindex howtoprint
-Robert G. Burger and R. Kent Dybvig.
-Printing floating-point numbers quickly and accurately.
-In @emph{Proceedings of the ACM SIGPLAN '96 Conference
- on Programming Language Design and Implementation}, pages 108--116.
-
-@item [RRRS]
-@pindex RRRS
-William Clinger, editor.
-The revised revised report on Scheme, or an uncommon Lisp.
-MIT Artificial Intelligence Memo 848, August 1985.
-Also published as Computer Science Department Technical Report 174,
- Indiana University, June 1985.
-
-@item [howtoread]
-@c new
-William Clinger.
-@pindex howtoread
-How to read floating point numbers accurately.
-In @emph{Proceedings of the ACM SIGPLAN '90 Conference
- on Programming Language Design and Implementation}, pages 92--101.
-Proceedings published as @emph{SIGPLAN Notices} 25(6), June 1990.
-
-@item [R4RS]
-@pindex R4RS
-William Clinger and Jonathan Rees, editors.
-The revised^4 report on the algorithmic language Scheme.
-In @emph{ACM Lisp Pointers} 4(3), pages 1--55, 1991.
-
-@item [macrosthatwork]
-@c new
-William Clinger and Jonathan Rees.
-@pindex macrosthatwork
-Macros that work.
-In @emph{Proceedings of the 1991 ACM Conference on Principles of
- Programming Languages}, pages 155--162.
-
-@item [propertailrecursion]
-@c new
-William Clinger.
-@pindex propertailrecursion
-Proper Tail Recursion and Space Efficiency.
-To appear in @emph{Proceedings of the 1998 ACM Conference on Programming
- Language Design and Implementation}, June 1998.
-
-@item [syntacticabstraction]
-@pindex syntacticabstraction
-R. Kent Dybvig, Robert Hieb, and Carl Bruggeman.
-Syntactic abstraction in Scheme.
-@emph{Lisp and Symbolic Computation} 5(4):295--326, 1993.
-
-@item [Scheme311]
-@pindex Scheme311
-Carol Fessenden, William Clinger, Daniel P. Friedman, and Christopher Haynes.
-Scheme 311 version 4 reference manual.
-Indiana University Computer Science Technical Report 137, February 1983.
-Superseded by [Scheme84].
-
-@item [Scheme84]
-@pindex Scheme84
-D. Friedman, C. Haynes, E. Kohlbecker, and M. Wand.
-Scheme 84 interim reference manual.
-Indiana University Computer Science Technical Report 153, January 1985.
-
-@item [IEEE]
-@pindex IEEE
-@emph{IEEE Standard 754-1985. IEEE Standard for Binary Floating-Point
-Arithmetic.} IEEE, New York, 1985.
-
-@item [IEEEScheme]
-@pindex IEEEScheme
-@emph{IEEE Standard 1178-1990. IEEE Standard for the Scheme
- Programming Language.} IEEE, New York, 1991.
-
-@item [Kohlbecker86]
-@pindex Kohlbecker86
-Eugene E. Kohlbecker Jr.
-@emph{Syntactic Extensions in the Programming Language Lisp.}
-PhD thesis, Indiana University, August 1986.
-
-@item [hygienic]
-@pindex hygienic
-Eugene E. Kohlbecker Jr., Daniel P. Friedman, Matthias Felleisen, and Bruce Duba.
-Hygienic macro expansion.
-In @emph{Proceedings of the 1986 ACM Conference on Lisp
- and Functional Programming}, pages 151--161.
-
-@item [Landin65]
-@pindex Landin65
-Peter Landin.
-A correspondence between Algol 60 and Church's lambda notation: Part I.
-@emph{Communications of the ACM} 8(2):89--101, February 1965.
-
-@item [MITScheme]
-@pindex MITScheme
-MIT Department of Electrical Engineering and Computer Science.
-Scheme manual, seventh edition.
-September 1984.
-
-@item [Naur63]
-@pindex Naur63
-Peter Naur et al.
-Revised report on the algorithmic language Algol 60.
-@emph{Communications of the ACM} 6(1):1--17, January 1963.
-
-@item [Penfield81]
-@pindex Penfield81
-Paul Penfield, Jr.
-Principal values and branch cuts in complex APL.
-In @emph{APL '81 Conference Proceedings,} pages 248--256.
-ACM SIGAPL, San Francisco, September 1981.
-Proceedings published as @emph{APL Quote Quad} 12(1), ACM, September 1981.
-
-@item [Pitman83]
-@pindex Pitman83
-Kent M. Pitman.
-The revised MacLisp manual (Saturday evening edition).
-MIT Laboratory for Computer Science Technical Report 295, May 1983.
-
-@item [Rees82]
-@pindex Rees82
-Jonathan A. Rees and Norman I. Adams IV.
-T: A dialect of Lisp or, lambda: The ultimate software tool.
-In @emph{Conference Record of the 1982 ACM Symposium on Lisp and
- Functional Programming}, pages 114--122.
-
-@item [Rees84]
-@pindex Rees84
-Jonathan A. Rees, Norman I. Adams IV, and James R. Meehan.
-The T manual, fourth edition.
-Yale University Computer Science Department, January 1984.
-
-@item [R3RS]
-@pindex R3RS
-Jonathan Rees and William Clinger, editors.
-The revised^3 report on the algorithmic language Scheme.
-In @emph{ACM SIGPLAN Notices} 21(12), pages 37--79, December 1986.
-
-@item [Reynolds72]
-@pindex Reynolds72
-John Reynolds.
-Definitional interpreters for higher order programming languages.
-In @emph{ACM Conference Proceedings}, pages 717--740.
-ACM,
-@ignore todo
-month?
-@end ignore
- 1972.
-
-@item [Scheme78]
-@pindex Scheme78
-Guy Lewis Steele Jr. and Gerald Jay Sussman.
-The revised report on Scheme, a dialect of Lisp.
-MIT Artificial Intelligence Memo 452, January 1978.
-
-@item [Rabbit]
-@pindex Rabbit
-Guy Lewis Steele Jr.
-Rabbit: a compiler for Scheme.
-MIT Artificial Intelligence Laboratory Technical Report 474, May 1978.
-
-@item [CLtL]
-@pindex CLtL
-Guy Lewis Steele Jr.
-@emph{Common Lisp: The Language, second edition.}
-Digital Press, Burlington MA, 1990.
-
-@item [Scheme75]
-@pindex Scheme75
-Gerald Jay Sussman and Guy Lewis Steele Jr.
-Scheme: an interpreter for extended lambda calculus.
-MIT Artificial Intelligence Memo 349, December 1975.
-
-@item [Stoy77]
-@pindex Stoy77
-Joseph E. Stoy.
-@emph{Denotational Semantics: The Scott-Strachey Approach to
- Programming Language Theory.}
-MIT Press, Cambridge, 1977.
-
-@item [TImanual85]
-@pindex TImanual85
-Texas Instruments, Inc.
-TI Scheme Language Reference Manual.
-Preliminary version 1.0, November 1985.
-
-@end itemize
-
-
-
-
-@page
-
-
-@c Adjustment to avoid having the last index entry on a page by itself.
-@c \addtolength{\baselineskip}{-0.1pt}
-
-@node Index, , Bibliography, top
-@unnumbered Alphabetic index of definitions of concepts, keywords, and procedures
-
-
-
-The principal entry for each term, procedure, or keyword is listed
-first, separated from the other entries by a semicolon.
-
-@sp 6
-
-@unnumberedsec Concepts
-@printindex cp
-@page
-@unnumberedsec Procedures
-@printindex fn
-
-@ifinfo
-@unnumberedsec References
-@printindex pg
-@end ifinfo
-
-
-@contents
-@bye
diff --git a/doc/recipe-guidelines.txt b/doc/recipe-guidelines.txt
deleted file mode 100644
index adf8d5c7d..000000000
--- a/doc/recipe-guidelines.txt
+++ /dev/null
@@ -1,80 +0,0 @@
- -*-text-*-
-
-Guidelines for contributions to the Guile Recipes manual
---------------------------------------------------------
-
-1. Licensing
-
-Contributions must be licensed under the GNU Free Documentation
-License (GFDL) or the GNU General Public License (GPL).
-
-2. Copyright
-
-Contributors are encouraged, but not required, to assign the copyright
-for their contribution to the FSF. `not required' also covers the
-case where a contributor has every intention of assigning copyright,
-but the process is simply taking a little time. Note that:
-
-- If you assign your copyright, other people (who have also assigned
- copyright) can make non-trivial enhancements to your contribution
- without any difficulties arising. If you don't assign copyright for
- contribution, it complicates the ownership picture if other people
- make non-trivial changes to it; and if the burden of tracking
- copyright ownership becomes too great, it will be easier simply to
- remove that contribution from the manual.
-
-- If it transpires that non-assigned copyrights turn out to be a bad
- thing (for whatever reason), the maintainers reserve the right to
- remove non-assigned contributions from the manual.
-
-3. Manual organization
-
-Each contribution has its own chapter and lives in its own Texinfo
-file. Chapters in related areas may be grouped together, but maybe
-not. Instead, the introduction to the manual will contain references
-to chapters, and the introductory text will group those references
-appropriately.
-
-4. Copyright ownership
-
-Given this organization, ownership for copyright purposes is
-straightforward. Each Texinfo file is either owned by its
-contributor, or assigned to the FSF.
-
-Every contribution's chapter should begin with a statement of who
-contributed it, who owns the copyright, and its license (GFDL or
-GPL). These statements should appear in the printed and online
-documentation -- i.e. they are _not_ comments.
-
-5. Documentation vs. code
-
-Contributed material should be informative and helpful, and should fit
-in with the manual syntax. In general, this means that a
-straightforward lump of code is _not_ good enough -- it also needs the
-statements mentioned above, introduction, explanation or
-documentation, Texinfo markup, etc.
-
-Note that the maintainers may be able to accept a contribution that
-requires substantial extra work if copyright for that contribution has
-been assigned to the FSF. Where copyright has not been assigned, the
-contribution has to be already finished by its author.
-
-6. Good indexing
-
-In practice, the manual index will be a very important tool for
-someone looking for an example that is useful to them. So please give
-some thought to good indexing in your contribution.
-
-7. Submissions
-
-To submit material for inclusion in Guile Recipes, please send your
-contribution to the guile-sources mailing list
-<guile-sources@gnu.org>.
-
-As far as past material is concerned, I do have an archive of material
-that I will ask people about including individually, but it would make
-things easier for me if people resubmitted past material to
-guile-sources anyway.
-
---
-Neil Jerram <neil@ossau.uklinux.net> April 20th 2001
diff --git a/doc/ref/.cvsignore b/doc/ref/.cvsignore
deleted file mode 100644
index dd408965c..000000000
--- a/doc/ref/.cvsignore
+++ /dev/null
@@ -1,26 +0,0 @@
-*.aux
-*.cp
-*.cps
-*.dvi
-*.fn
-*.fns
-*.ge
-*.html
-*.info*
-*.ky
-*.log
-*.pg
-*.ps
-*.rn
-*.rns
-*.toc
-*.tp
-*.tps
-*.vr
-*.vrs
-Makefile
-Makefile.in
-autoconf-macros.texi
-stamp-vti
-stamp-vti.1
-version.texi
diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog
deleted file mode 100644
index 88d4c02d8..000000000
--- a/doc/ref/ChangeLog
+++ /dev/null
@@ -1,610 +0,0 @@
-2002-08-02 Gary Houston <ghouston@arglist.com>
-
- * scheme-modules.texi: split "Scheme and modules" into
- "provide and require" and "Environments". Mention R5RS
- environments.
-
-2002-07-16 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-options.texi (Debugger options): New subsection
- describing stack overflow and what to do about it.
-
-2002-07-10 Gary Houston <ghouston@arglist.com>
-
- * scheme-modules.texi (Compiled Code Modules): Removed description
- of scm_register_module_xxx, which no longer exists. A description
- of current techniques is needed.
-
-2002-05-09 Marius Vollmer <mvo@zagadka.ping.de>
-
- * scheme-data.texi (Numbers): Added description of the new values
- +inf.0, -inf.0 and +nan.0.
-
- * posix.texi (Runtime Environment): Added entries for 'setenv' and
- 'unsetenv'.
-
-2002-04-28 Marius Vollmer <mvo@zagadka.ping.de>
-
- * gh.texi, data-rep.texi: Moved `@deftyp {Data type} SCM' line
- from gh.texi to data-rep.texi. Both files already had similar
- descriptions for SCM. Given that gh.texi is deprecated, looking
- up `SCM' in the index should take one to the primary location
- rather than deprecated section. Hence this change. Added
- `@deftp' for scm_t_bits data type so that a proper index entry is
- added for this. Thanks to Richard Y. Kim!
-
- * data-rep.texi (Subrs): Changed scm_make_gsubr to
- scm_c_define_gsubr. Thanks to Richard Y. Kim!
-
-2002-04-24 Marius Vollmer <mvo@zagadka.ping.de>
-
- * srfi-modules.texi (SRFI-13 Miscellaneous): Updated docs of
- string-tokenize.
-
-2002-04-20 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-intro.texi (Scheme Layout), scm.texi (Reference Layout):
- Node moved from a to b.
-
- * guile.texi (Scheme Intro, Basic Ideas, Guile Scripting, Command
- Line Handling, Debugging Features, Autoconf Support, Miscellaneous
- Tools, Further Reading): Moved to new Part II.
-
- * preface.texi (Manual Layout): Part numbers updated accordingly.
-
- * guile.texi (Top): Move API Overview node to beginning of Guile
- API Reference part.
- (Part II: Writing and Running Guile Scheme): New part; will
- contain content from `Programming with Guile' that pertains to
- writing and using Guile on the Scheme level.
-
- * scm.texi (API Overview): Renamed from `Guile API'.
-
- * guile.texi (Top), scheme-modules.texi (Included Guile Modules):
- Debugger User Interface node renamed Debugging Features.
-
- * debugging.texi (Stacks and Frames): Node deleted; non-duplicated
- material moved to scheme-debug.texi.
- (Debugging Features): Renamed from `Debugger User Interface'.
-
- * scheme-debug.texi (Debugging): Rename chapter `Debugging
- Infrastructure' and reorganize its contents.
-
- * scheme-debug.texi (Debugging), scheme-control.texi (Handling
- Errors): Move display-error to error-focussed section.
-
- * scheme-debug.texi (Debugging), debugging.texi (Backtrace): Move
- backtrace to user-level debugging chapter.
-
- * scheme-debug.texi (Debugging), scheme-procedures.texi (Procedure
- Properties): Move procedure-name, procedure-source and
- procedure-environment to procedures chapter.
-
- * scheme-debug.texi (Debugging), scheme-memory.texi (Memory
- Blocks): Move malloc-stats to memory management chapter.
-
- * scheme-procedures.texi (Syntax Rules): Remove mention of
- use-modules for loading syncase; only use-syntax really works.
- Thanks to Panagiotis Vossos for spotting this.
-
- * program.texi (Scheme vs C): New node, with existing material
- taken from chapter intro.
- (Programming Overview): New intro para to introduce example of
- Guile integration:
- (Extending Dia): New node.
-
-2002-04-17 Marius Vollmer <mvo@zagadka.ping.de>
-
- * Makefile.am (CLEANFILES): Added guile.cps, guile.fns, guile.rns,
- guile.tps, guile.vrs, guile.tmp.
-
-2002-04-01 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-intro.texi (Scheme Layout): Remove reference to defunct
- Guile Extensions index.
-
- * guile.texi: Removed Guile Extensions index.
-
- * scheme-indices.texi (Guile Extensions Index): Removed.
-
- * guile.texi: Remove vgone, vdeprecated, vchanged and vnote
- macros; they're not actually useful after all. Update copyright
- years.
-
- * scheme-compound.texi (Vectors): Make subsections into nodes.
- (Vectors): Review, slightly reorg and clarify docs in this
- section.
-
- * scheme-data.texi (Symbols): Reorganized node substructure and
- added lots of explanatory text around the @deffn's.
-
-2002-03-29 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-modules.texi (Variables): Mention obarrays.
-
- * scheme-data.texi (Symbol Tables, Symbol Props): Remove vgone
- markers for deprecated symbol items.
- (Symbol Props): Remove doc for obsolete 2 arg version of
- symbol-interned?.
- (String Miscellanea): Removed, since it only contained duplicate
- doc for string-ci->symbol.
- (Symbol Tables): Move doc for gensym to Symbol Primitives; rest of
- section removed.
-
- * posix.texi (Ports and File Descriptors), scheme-evaluation.texi
- (Fly Evaluation): Remove vgone markers for close-all-ports-except,
- eval2 and read-and-eval!.
-
- * data-rep.texi (Describing a New Type), scheme-compound.texi
- (Append/Reverse), scheme-procedures.texi (Internal Macros):
- Trivial updates to sync with stable branch.
-
-2002-03-27 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-compound.texi (List Searching): Remove docs for
- `scm_sloppy_mem*', which no longer exist.
-
-2002-03-24 Neil Jerram <neil@ossau.uklinux.net>
-
- * guile.texi (Top), intro.texi (What is Guile?, The Basic Guile
- Package): Use @ifnottex instead of @ifinfo, so that HTML
- generation works correctly.
-
-2002-03-24 Marius Vollmer <mvo@zagadka.ping.de>
-
- * tools.texi: Updated to reflect changes to the guile-snarf tool.
-
-2002-03-16 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-utility.texi (Hooks): Further updates. New material on
- GC hooks.
-
- * scheme-evaluation.texi (Fly Evaluation): Note disappearance of
- eval2 and read-and-eval!.
-
- * deprecated.texi (Deprecated): Remove docs about previously
- deprecated items that have now been removed.
-
-2002-03-15 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * tools.texi (guile-1.4 guile-snarf): Remove this node.
- (How guile-snarf works): Update usage and description to
- no longer mention "--compat=1.4" and instead "-d" and "-D".
- (Macros guile-snarf recognizes): Add list of deprecated macros
- and blurb. Add cindex for deprecated macros.
-
-2002-03-15 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-utility.texi (Hooks): Reviewed and updated.
-
- * scheme-options.texi (Feature Tracking): New section.
-
- * scheme-data.texi (Arithmetic, Primitive Numerics): Add
- description of corresponding C functions.
-
- * scheme-utility.texi (Object Properties): Revamp documentation on
- object properties.
-
- * scheme-memory.texi (Weak References): Update reference to Object
- Properties node.
-
- * guile.texi: Add macros for describing version information.
-
- * scheme-data.texi, scheme-debug.texi, scheme-io.texi,
- scheme-procedures.texi: Automatic updates from snarfed libguile
- docstrings.
-
-2002-03-13 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * Makefile.am (guile_toc.html): Look for guile.texi in $(srcdir).
-
- * tools.texi (How guile-snarf works): Mention "--compat=1.4", and
- new processing steps. Update usage example, makefile frag.
-
- (guile-1.4 guile-snarf): New subsubsection under
- "Init Snarfing with guile-snarf".
-
-2002-03-12 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-compound.texi, scheme-data.texi, new-docstrings.texi:
- Automatic updates from snarfed libguile docstrings.
-
- * data-rep.texi, guile.texi, scheme-evaluation.texi,
- scheme-options.texi, scheme-translation.texi: Various minor
- enhancements ported from the stable CVS branch.
-
-2002-03-08 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * tools.texi (Miscellaneous Tools): New node/chapter.
- (Snarfing, Init Snarfing with guile-snarf, How guile-snarf works,
- Macros guile-snarf recognizes, Doc Snarfing): New nodes/(sub)sections.
- (Executable Modules): Now a section under "Miscellaneous Tools".
-
- * guile.texi (Miscellaneous Tools): Add under "Part II".
- Implement by including tools.texi.
-
- * Makefile.am (guile_TEXINFOS): Add tools.texi.
-
-2002-03-07 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * tools.texi: New file.
-
-2002-03-03 Neil Jerram <neil@ossau.uklinux.net>
-
- * autoconf.texi (Autoconf Background): Insert missing `of'.
-
-2002-03-01 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * api.txt, data-rep.texi: Renamed the struct scm_cell to
- scm_t_cell.
-
- * data-rep.texi: Renamed scm_alloc_cell to scm_cell and
- scm_alloc_double_cell to scm_double_cell.
-
-2002-03-01 Marius Vollmer <mvo@zagadka.ping.de>
-
- * scheme-memory.texi (Upgrading from scm_must_malloc et al): New
- section.
-
-2002-02-28 Marius Vollmer <mvo@zagadka.ping.de>
-
- * data-rep.texi: Use scm_gc_malloc and scm_gc_free instead of
- scm_must_malloc and free in example code. Updated text for the
- new memory management functions.
-
- * scheme-debug.texi (malloc-stats): Refer to scm_gc_malloc instead
- of to scm_must_malloc.
-
-2002-02-27 Stefan Jahn <stefan@lkcc.org>
-
- * gh.texi (scm transition summary): Documented some more
- gh equivalents and removed appropriate FIXME's.
-
-2002-02-26 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * Makefile.am: Update path to pre-inst-guile automake frag.
-
-2002-02-24 Rob Browning <rlb@defaultvalue.org>
-
- * .cvsignore: add autoconf-macros.texi.
-
- * Makefile.am (CLEANFILES): add autoconf-macros.texi.
-
-2002-02-19 Marius Vollmer <mvo@zagadka.ping.de>
-
- * scheme-memory.texi (Memory Blocks): New section.
-
-2002-02-05 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * Makefile.am: Include $(top_srcdir)/pre-inst-guile.am.
-
- (GUILE): Delete var.
- (autoconf-macros.texi): Use $(preinstguiletool).
-
-2002-02-04 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * autoconf.texi (Autofrisk, Using Autofrisk): New sections.
- (Autoconf Support): Add new sections to menu.
-
-2002-02-04 Marius Vollmer <marius.vollmer@uni-dortmund.de>
-
- * scheme-data.texi (Symbol Uninterned): Added node.
-
-2002-01-29 Stefan Jahn <stefan@lkcc.org>
-
- * gh.texi (scm transition summary): Documented gh equivalents
- `scm_c_string2str', `scm_c_substring2str' and `scm_c_symbol2str'
- and removed the appropriate FIXME's.
-
-2002-01-14 Marius Vollmer <marius.vollmer@uni-dortmund.de>
-
- * Makefile.am (autoconf-macros.texi): Also set GUILE_LOAD_PATH
- when invoking the uninstalled guile executable.
-
-2002-01-09 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * Makefile.am (autoconf-macros.texi): Fix build bug:
- Write this file to srcdir. Thanks to I. N. Golubev.
-
-2002-01-08 Gary Houston <ghouston@arglist.com>
-
- * Makefile.am: attempt to use guile from $(top_builddir)/libguile
- when building autoconf-macros.texi. There are still problems with
- modules and running makeinfo when builddir != srcdir.
-
-2002-01-08 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * data-rep.texi, gh.texi, guile.texi, intro.texi,
- misc-modules.texi, new-docstrings.texi, posix.texi, program.texi,
- repl-modules.texi, scheme-binding.texi, scheme-compound.texi,
- scheme-control.texi, scheme-data.texi, scheme-debug.texi,
- scheme-ideas.texi, scheme-io.texi, scheme-memory.texi,
- scheme-modules.texi, scheme-procedures.texi,
- scheme-translation.texi, scheme-utility.texi, scm.texi, slib.texi,
- srfi-modules.texi: Spell check. Thanks to Fabrice Bauzac.
-
-2002-01-07 Neil Jerram <neil@ossau.uklinux.net>
-
- * intro.texi (Linking Programs With Guile): Fix typo (superfluous
- `do'). Thanks to Fabrice Bauzac.
-
-2002-01-05 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * intro.texi: Spell check. Thanks to Fabrice Bauzac.
-
-2002-01-02 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * guile.texi (Part II): Add "Autoconf Support"; include
- autoconf.texi.
-
- * Makefile.am (guile_TEXINFOS): Add autoconf.texi and
- autoconf-macros.texi.
- (autoconf.texi, autoconf-macros.texi): New rules.
-
- * autoconf.texi: New file.
-
-2001-12-22 Marius Vollmer <mvo@zagadka.ping.de>
-
- * scheme-compound.texi (Alist Example): Changed "Bismarck" to
- "Pierre". Thanks to Ron Peterson!
-
-2001-12-22 Neil Jerram <neil@ossau.uklinux.net>
-
- * program.texi (Programming Overview): Chapter renamed from
- `Programming Options'; some new material added.
-
-2001-12-07 Neil Jerram <neil@ossau.uklinux.net>
-
- * scm.texi (Guile API): Renamed from `Scheme Primitives' and
- broadened so that this chapter discusses the Guile API as a whole.
-
- * program.texi (Available Functionality): Revise so that text
- reads better.
-
- * guile.texi (Programming Intro): New introductory text.
-
- * scheme-ideas.texi (Definition): Reorder reference bullets in
- ascending page number order.
-
-2001-12-04 Martin Grabmueller <mg@glug.org>
-
- * scheme-procedures.texi (Optional Arguments): Typo fix: wither ->
- either.
-
-2001-12-01 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-data.texi (Hooks): Moved into scheme-utility.texi.
-
- * Makefile.am (guile_TEXINFOS): Added scheme-compound.texi.
-
- * scheme-data.texi (Variables): Node moved to modules chapter.
- (Symbol Read Syntax): New node, with syntax-related material taken
- from old Symbols node.
- (Symbol Primitives): Renamed from `Symbols'.
- (Symbols and Variables): Renamed to `Symbols'.
- (Symbol Props): Renamed from `Symbol Tables'.
- (Symbols): General review, improvements and additional material
- throughout this section.
- (Other Data Types): New material: links to object types documented
- elsewhere. Also renamed node to `Other Types'.
- (Data Types): Split into two: `Simple Data Types' and `Compound
- Data Types'. Introductory blurbs rewritten accordingly.
-
- * guile.texi: Updated Notes comment.
-
- * scheme-data.texi (Rx Interface): Node moved to Guile Modules
- part, as the Rx interface is not core Guile.
-
-2001-11-30 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-data.texi (String Miscellanea): Removed, moving doc for
- string-ci->symbol into the node on Symbols.
-
- * Makefile.am (ETAGS_ARGS): Added.
-
- * scheme-data.texi (Symbol Tables): Removed doc for gentemp,
- intern-symbol, string->obarray-symbol, symbol-binding,
- symbol-bound?, symbol-set!, unintern-symbol, symbol-interned?; all
- of which no longer exist.
-
-2001-11-25 Thien-Thi Nguyen <ttn@glug.org>
-
- * posix.texi: Fix spelling. Thanks to Chris Cramer.
- Reword `getpass' intro blurb.
-
-2001-11-23 Neil Jerram <neil@ossau.uklinux.net>
-
- * program.texi (Program Control): Remove spurious placeholder
- text.
-
-2001-11-20 Thien-Thi Nguyen <ttn@glug.org>
-
- * scheme-options.texi (Install Config):
- Tweak `%load-path' verb to not imply it's a proc.
- Add documentation for `%guile-build-info'.
-
-2001-11-19 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-data.texi (Symbol Tables), new-docstrings.texi: Removed
- doc for builtin-bindings (no longer exists).
- (Variables): Expanded existing description of variables. Removed
- doc for builtin-variable (no longer exists).
-
- * scheme-binding.texi (Top Level): New docs for define, scm_define
- and scm_c_define. Also clarified point about interchangeability
- of define and set!.
-
-2001-11-18 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-data.texi (Vectors): Autoupdate docs for
- vector-move-left! and vector-move-right!.
-
-2001-11-16 Neil Jerram <neil@ossau.uklinux.net>
-
- * debugging.texi, deprecated.texi, intro.texi, misc-modules.texi,
- new-docstrings.texi, posix.texi, scheme-binding.texi,
- scheme-control.texi, scheme-data.texi, scheme-debug.texi,
- scheme-evaluation.texi, scheme-io.texi, scheme-memory.texi,
- scheme-modules.texi, scheme-options.texi, scheme-procedures.texi,
- scheme-scheduling.texi, scheme-translation.texi,
- scheme-utility.texi, script-getopt.texi, srfi-modules.texi: Change
- category for "primitive" and "procedure" @deffn's to {Scheme
- Procedure}; add @deffnx lines for {C Function}s; automatic updates
- from libguile docstring changes.
-
- * scheme-memory.texi (Garbage Collection): Removed doc for removed
- `unhash-name'.
-
-2001-11-14 Thien-Thi Nguyen <ttn@glug.org>
-
- * scheme-procedures.texi: Spell "library" correctly.
-
-2001-11-13 Neil Jerram <neil@ossau.uklinux.net>
-
- * new-docstrings.texi, scheme-data.texi: Merge recent doc
- improvements from stable branch.
-
- * scheme-options.texi: Automatic updates from docstring changes in
- libguile's C source code.
-
-2001-11-12 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-data.texi (Vtables, Structure Basics): Automatic doc
- updates for struct? and struct-vtable?.
- (String Searching): Add missing "for". Thanks to Scott Lenser.
-
-2001-11-08 Neil Jerram <neil@ossau.uklinux.net>
-
- * guile.texi (Top): Added new chapter `Programming Options'.
-
- * program.texi: New file.
-
- * Makefile.am (guile_TEXINFOS): Added program.texi.
-
-2001-11-07 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-memory.texi, scheme-io.texi, scheme-debug.texi,
- scheme-data.texi, scheme-binding.texi, posix.texi,
- new-docstrings.texi: Automatic updates from improved libguile
- docstrings.
-
-2001-11-04 Neil Jerram <neil@ossau.uklinux.net>
-
- * preface.texi: Use MANUAL_EDITION variable.
- (Manual Layout): Updated to reflect reorg.
-
- * guile.texi (MANUAL_EDITION): New variable, with value
- incremented from 1.0 to 1.1 to reflect the reorg described here.
- (Top): Use MANUAL_EDITION variable.
-
- * scheme-indices.texi (R5RS Index, Guile Extensions Index): Use
- @unnumbered rather than @chapter for these indices.
-
- * guile.texi (Top): A little top-level reshuffling, with the aims
- that: (1) the `Guile Scheme' (reference) part of the manual
- becomes the `Guile API Reference', and covers both Scheme and C
- interfaces; (2) non-API-reference material such as the `Basic
- Ideas in Scheme' chapter is collected together to form a new part
- `Programming with Guile'. This new part will contain general
- documentation on using and programming Guile in both Scheme and C,
- including - for example - awareness of GC when C programming, how
- to use the snarf macros, how to debug ...
- (Top): Move inclusion of scheme-indices.texi so that all indices
- appear together in the printed manual.
-
- * Makefile.am (guile_TEXINFOS): Removed appendices.texi, added
- debugging.texi.
-
- * appendices.texi: Removed.
-
- * debugging.texi (Debugger User Interface): New file, same as the
- material that used to be in appendices.texi, but now a chapter in
- Part II rather than an appendix.
-
- * appendices.texi (Obtaining and Installing Guile): Moved to
- become a chapter in ...
- * intro.texi: ... Part I: Introduction to Guile.
-
- * scm.texi (I/O Extensions): Moved to become a section of ...
- * scheme-io.texi (Input and Output): ... this chapter.
-
- * scm.texi (Handling Errors): Moved to become a section of ...
- * scheme-control.texi (Control Mechanisms): ... this chapter.
-
-2001-11-06 Thien-Thi Nguyen <ttn@glug.org>
-
- * srfi-modules.texi (SRFI-19, SRFI-19 Constants, SRFI-19 Current
- time and clock resolution, SRFI-19 Time object and accessors,
- SRFI-19 Time comparison procedures, SRFI-19 Time arithmetic
- procedures, SRFI-19 Date object and accessors, SRFI-19
- Time/Date/Julian Day/Modified Julian Day converters, SRFI-19 Date
- to string/string to date converters): New nodes.
- (SRFI Support): Add "SRFI-19" to menu.
-
-2001-11-06 Marius Vollmer <mvo@zagadka.ping.de>
-
- * scripts.texi: Document `--debug' and `--no-debug'.
-
-2001-10-27 Gary Houston <ghouston@arglist.com>
-
- * guile.texi, scsh.texi: removed obsolete guile-scsh material
- and updated links (I don't know if it should remain in the
- main menu. It's like slib I think.)
-
- * minor updates to the slib installation notes.
-
-2001-10-05 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-evaluation.texi (Fly Evaluation): Removed documentation
- for `read-and-eval!' and `eval2'. (Thanks to Alex Schroeder for
- noticing that they'd disappeared!)
-
-2001-10-05 Thien-Thi Nguyen <ttn@glug.org>
-
- * scheme-io.texi (Writing): Add entry for `display'.
- Include in R5RS Index. Thanks to Alex Schroeder for suggestion.
-
-2001-09-26 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * srfi-modules.texi (SRFI-13): Tyop fix.
- (SRFI-13): Changed paragraph about bindings both in the code and
- in SRFI-13.
-
- * misc-modules.texi (Formatted Output): Tyop fix.
- (Formatted Output): Document ~g properly.
-
- Thanks to Alex Schroeder for pointing out the typos and sending
- suggestions.
-
-2001-09-25 Thien-Thi Nguyen <ttn@glug.org>
-
- * scheme-procedures.texi (Syntax Rules): Add `cindex' directive.
- Thanks to suggestion by Alex Schroeder.
-
-2001-08-30 Neil Jerram <neil@ossau.uklinux.net>
-
- * guile.texi (Top): Group all index nodes together so that
- `Info-index' works more effectively in Info. Thanks to Eric
- Hanchrow for the report and fix.
-
- * scheme-data.texi (Random, String Syntax, String Modification,
- Regular Expressions), scheme-ideas.texi (Definition),
- scheme-modules.texi (Dynamic Linking and Compiled Code Modules),
- scm.texi (Transforming Scheme name to C name, Port
- Implementation): Various typo fixes and clarifications merged from
- the stable CVS branch.
-
-2001-08-27 Neil Jerram <neil@ossau.uklinux.net>
-
- * intro.texi: Merged wording fixes from stable CVS branch.
-
- * Makefile.am (guile_TEXINFOS): Remove ../AUTHORS.
-
- * guile.texi: Incorporate text previously in separate AUTHORS
- file.
-
-2001-08-27 Neil Jerram <neil@ossau.uklinux.net>
-
- The change log for files in this directory continues backwards
- from 2001-08-27 in ../ChangeLog, as all the Guile documentation
- prior to this date was contained in a single directory.
diff --git a/doc/ref/ChangeLog-guile-doc-ref b/doc/ref/ChangeLog-guile-doc-ref
deleted file mode 100644
index 3d2cc4e09..000000000
--- a/doc/ref/ChangeLog-guile-doc-ref
+++ /dev/null
@@ -1,890 +0,0 @@
-2001-03-09 Neil Jerram <neil@ossau.uklinux.net>
-
- Moving texinfo files from guile-doc/ref into guile-core/doc:
-
- * env.texi, indices.texi, mbapi.texi, mltext.texi, scripts.texi,
- scsh.texi, tcltk.texi, hierarchy.txt, scheme-indices.texi,
- slib.texi, deprecated.texi, scheme-binding.texi, appendices.texi,
- scheme-intro.texi, goops.texi, extend.texi, gh.texi, intro.texi,
- preface.texi, scm.texi, goops-tutorial.texi, hierarchy.eps,
- r4rs.texi, r5rs.texi, texinfo.tex, scheme-reading.texi,
- data-rep.texi, scheme-utility.texi, posix.texi,
- scheme-control.texi, scheme-debug.texi, scheme-evaluation.texi,
- scheme-io.texi, scheme-memory.texi, scheme-modules.texi,
- scheme-options.texi, scheme-procedures.texi,
- scheme-scheduling.texi, scheme-translation.texi, guile.texi,
- scheme-data.texi, scheme-ideas.texi, expect.texi: Removed.
-
-2001-02-28 Gary Houston <ghouston@arglist.com>
-
- * expect.texi (Expect): add missing eof? argument in example code.
-
-2001-02-27 Neil Jerram <neil@ossau.uklinux.net>
-
- * guile.texi, scheme-data.texi, scheme-ideas.texi: Remove the code
- that set paragraph indent to zero, then add @noindent to several
- places that need not to be indented.
-
-2001-02-24 Neil Jerram <neil@ossau.uklinux.net>
-
- * posix.texi (File System, Time), scheme-control.texi
- (Exceptions), scheme-data.texi (Complex, Primitive Numerics,
- Random, String Fun, Symbols and Variables, Lists, Bit Vectors,
- Hooks), scheme-debug.texi (Debugging), scheme-evaluation.texi
- (Reader Extensions, Scheme Read, Fly Evaluation, Loading,
- Evaluator Options), scheme-io.texi (Reading, Writing, Default
- Ports, File Ports), scheme-memory.texi (Garbage Collection,
- Guardians, Objects), scheme-modules.texi (The Guile module
- system), scheme-options.texi (Install Config),
- scheme-procedures.texi (Procedure Properties, Procedures with
- Setters), scheme-scheduling.texi (Arbiters, Asyncs),
- scheme-translation.texi (Emacs Lisp Support): Automatic docstring
- updates.
-
- * scheme-io.texi (Binary IO): New node.
-
- * scheme-control.texi (Multiple Values): New node.
-
-2001-02-23 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-utility.texi (Sorting), scheme-procedures.texi (Procedure
- Properties), scheme-memory.texi (Guardians), scheme-io.texi
- (Line/Delimited), scheme-data.texi (String Fun, Symbols and
- Variables, Vtables), posix.texi (Ports and File Descriptors, File
- System, Network Sockets and Communication): Automatic docstring
- updates.
-
-2001-02-15 Neil Jerram <neil@ossau.uklinux.net>
-
- * data-rep.texi: Preserve, in comments beginning `@c essay',
- material from the standalone version of this essay which is very
- soon to be retired from its current location at
- guile-core/doc/data-rep.texi.
-
- * data-rep.texi: Incorporate recent changes to smob example
- documentation from the standalone version of this essay.
-
-2001-02-02 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-reading.texi (Further Reading): Add reference to online
- version of SICP.
-
-2001-01-27 Neil Jerram <neil@ossau.uklinux.net>
-
- Further changes to get everything to build to dvi with the latest
- texinfo.tex.
-
- * texinfo.tex: Replaced by latest version from ftp.gnu.org.
-
- * r5rs.texi (Binding constructs): Remove @c inside @t{...} at
- lines 2207-2209.
- (Lexical structure): Remove @c inside @t{...} at line 7517.
-
- * r4rs.texi (Example): Remove @c inside @t{...} at lines 6557 and
- 6569.
-
-2001-01-26 Neil Jerram <neil@ossau.uklinux.net>
-
- * scm.texi (Handling Errors): Improved markup.
- (snarfing): Deleted.
-
- * data-rep.texi: File copied here from sources directory and
- integrated into the reference manual structure.
-
- * extend.texi (Libguile Intro): New file, new node, to introduce
- new Part.
-
- * guile.texi: Merged Parts V and VI into a single Part: "Extending
- Applications Using Guile". Improved some top level node names and
- descriptions. Include extend.texi and data-rep.texi.
-
- * preface.texi (Manual Layout): Updated according to merge of
- Parts V and VI.
-
- * gh.texi: Restructured into a single chapter.
-
- * scm.texi (C Port Interface, Port Implementation): Moved here
- from scheme-io.texi.
-
- * scheme-io.texi (Default Ports): Renamed from `Port
- Environment'.
- (Port Internals): Contents moved to scm.texi.
-
- * r5rs.texi: Changes to allow building of r5rs.dvi from r5rs.texi.
- Aubrey Jaffer's view - which I agree with - is that, given that
- people have the option of building r5rs.dvi from the original
- LaTeX distribution for R5RS, it is not worth fixing his master
- copy of r5rs.texi and the tool which autogenerates it. On the
- other hand, it is a marginal convenience for people to be able to
- build hardcopy from r5rs.texi, even if the results are less good
- than with the original LaTeX. Hence the following fixes.
- (lines 714, 725, 728, 1614, 2258): Remove invalid parentheses from
- @deffn statements.
- (line 2316): Change @deffnx to @deffn, and insert `@end deffn' to
- terminate preceding @deffn.
- (line 7320): Insert `@c ' at beginning of lines that are intended
- to be @ignore'd.
-
- * guile.texi, r4rs.texi, r5rs.texi: Align @direntry descriptions
- to start in column 32.
-
-2001-01-24 Neil Jerram <neil@ossau.uklinux.net>
-
- * intro.texi: Licensing and Layout material moved to
- preface.texi.
- (Whirlwind Tour): New chapter as top level for preexisting
- sections.
-
- * guile.texi: Various minor changes to improve the structure at
- the beginning of the reference manual.
-
- * preface.texi: New file, to split out "prefatory material".
- Initially with Licensing and Layout material taken from
- intro.texi.
-
- * Makefile.am (dist_texis): Add preface.texi.
-
-2001-01-19 Neil Jerram <neil@ossau.uklinux.net>
-
- * intro.texi: Change R4RS everywhere to R5RS.
- (What is Guile?): Change "compiling" to "translating".
-
-2001-01-07 Neil Jerram <neil@ossau.uklinux.net>
-
- * appendices.texi (Internals): Content merged into Symbols and
- Variables node of scheme-data.texi.
- (Reporting Bugs): Moved to manual Part I.
-
- * guile.texi: Inserted new Part for `Guile Modules' as distinct
- from core Guile Scheme language/features. Other parts renumbered
- correspondingly. Module chapters moved into new part.
-
- * intro.texi (Reporting Bugs): Node moved here from
- appendices.texi.
-
- * posix.texi (POSIX): Node name changed from `POSIX System Calls
- and Networking'.
-
- * scheme-data.texi (Symbols and Variables): Added texinfo markup
- to docstrings that didn't have it. Expanded snarfed argument
- names like `o' and `s' to `obarray' and `string'.
-
- * scheme-debug.texi (Debugging): Node name changed from `Internal
- Debugging Interface'.
-
- * scheme-evaluation.texi (Fly Evaluation): Moved doc for
- `interaction-environment' here (previously under module doc).
-
- * scheme-memory.texi: Structure reorganization.
-
- * scheme-modules.texi: Structure reorganization. Removed empty
- subsections `First-class Variables' and `First-class Modules'.
-
- * scheme-options.texi (Options and Config): Node name changed from
- `Options'.
- (Install Config) Node name changed from `Configuration Data'.
-
- * scheme-scheduling.texi (Scheduling): Node name changed from
- `Threads and Dynamic Roots'.
-
- * scheme-translation.texi (Translation): New top level node for
- translation documentation.
-
-2001-01-05 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-exceptions.texi: Removed.
-
- * Makefile.am (dist_texis): Removed scheme-exceptions.texi.
-
- * guile.texi (Top): Renamed/redescribed some top level nodes. No
- longer include scheme-exceptions.texi.
-
- * scheme-control.texi: Merge material that was previously in
- scheme-exceptions.texi.
-
- * posix.texi: Updated close-port reference.
-
- * scheme-binding.texi, scheme-control.texi,
- scheme-evaluation.texi, scheme-intro.texi, scheme-io.texi,
- scheme-procedures.texi, scheme-utility.texi: Massaged into desired
- structure.
-
- * scheme-data.texi (Generic Data Types): Changed to "Data Types".
- (Numbers) Introduction streamlined.
- (Complex Numbers) New material.
-
-2001-01-05 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-data.texi, scheme-io.texi, scheme-memory.texi,
- scheme-options.texi: Where a single docstring documents more than
- one primitive, add a docstring comment for each additionally
- documented primitive.
-
- * scheme-modules.texi: Update docstring for dynamic-func.
-
- * scheme-data.texi (Numbers, Numerical Tower, Integers, Reals and
- Rationals, Number Syntax): New material.
-
- * deprecated.texi (Deprecated): Remove obsolete MD5 comment line.
-
-2000-12-12 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-data.texi (Numbers): Documentation added for scientific
- functions.
-
- * Makefile.am (dist_texis): Updated following split of scheme.texi
- into per-chapter files.
-
-2000-12-07 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-data.texi (Booleans): Written.
- (Numbers): Introduction written, primitives organized into
- subsections.
-
-2000-12-06 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-data.texi (Generic Data Types): Added chapter
- introduction.
- (Bitwise Operations, Random): Moved underneath Numbers.
- (Other Data Types): New placeholder section for data types that
- are documented elsewhere.
-
- * scheme-indices.texi, scheme-reading.texi: Added Local Variables
- block.
-
-2000-12-06 Neil Jerram <neil@ossau.uklinux.net>
-
- This change replaces scheme.texi, which is unmanageably large, by
- a set of smaller one-per-chapter files. The set and ordering of
- the new files reflects the intended top level structure of the
- Guile Scheme part of the reference manual. This structure is not
- yet all reflected in the combined Texinfo/Info, though, because I
- haven't yet fixed the @node levels appropriately.
-
- * scheme.texi: Removed, after dividing content into new files.
-
- * scheme-procedures.texi, scheme-utility.texi,
- scheme-binding.texi, scheme-control.texi, scheme-io.texi,
- scheme-evaluation.texi, scheme-exceptions.texi,
- scheme-memory.texi, scheme-modules.texi, scheme-scheduling.texi,
- scheme-options.texi, scheme-translation.texi, scheme-debug.texi,
- slib.texi: New files.
-
- * guile.texi: @include new files instead of scheme.texi. Reorder
- existing top level nodes.
-
-2000-12-01 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-data.texi: Remove @page breaks (following demotion).
-
- * guile.texi (Top), scheme-ideas.texi: Demote everything one level
- so that previous chapters About Data, About Procedures, About
- Expressions and About Closure are now combined into a single
- Scheme Ideas chapter. Add overall chapter introduction. Fix up
- top level nodes accordingly.
-
- * guile.texi (Top), scheme.texi, scheme-data.texi: Gather material
- for Generic Data Types chapter into a new file
- (scheme-data.texi). @include new file in guile.texi. Fix up top
- level nodes accordingly. (This changes demotes all the affected
- material by one level, except for that which was already grouped
- together under the Data Structures node.)
-
- * guile.texi (Top): @include new files.
-
- * scheme-intro.texi, scheme-ideas.texi: New files.
-
- * scheme.texi (Guile and R5RS Scheme): Moved introductory chapter
- to its own file (scheme-intro.texi).
- (About Closure) Chapter completed.
- (About Data, About Procedures, About Expressions, About Closure):
- Ideas chapters moved to their own file (scheme-ideas.texi);
- scheme.texi was just getting too large!
-
-2000-11-09 Gary Houston <ghouston@arglist.com>
-
- * posix.texi (Ports and File Descriptors): updated
- close-all-ports-except.
-
-2000-11-07 Gary Houston <ghouston@arglist.com>
-
- * posix.texi (Ports and File Descriptors): added dup2, close-fdes
- and port-for-each.
- (Pipes): synchronise open-input-pipe, open-output-pipe with
- popen.scm.
-
-2000-11-04 Gary Houston <ghouston@arglist.com>
-
- * scheme.texi (Generic Port Operations): "port?" added.
-
-2000-11-03 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme.texi (About Expressions): New material about evaluation
- and program execution.
-
- * scheme.texi (About Procedures): Minor textual improvements.
-
-2000-10-29 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme.texi (About Expressions, About Closure): Placeholder
- structure for remaining introductory Scheme material.
-
- * guile.texi (Top): Shorten some menu item lines to fit on a
- single console line.
-
-2000-10-28 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme-indices.texi (R5RS Index, Guile Extensions Index): Print
- new indices.
-
- * guile.texi: Define new R5RS and Guile extension indices.
-
-2000-10-27 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme.texi (Guile and R5RS Scheme): Filled in examples of Guile
- extensions.
- (About Procedures): New introductory material.
-
- * scheme-reading.texi: New file.
-
- * scheme-indices.texi: New file.
-
- * intro.texi (Scripting Examples): Added @* to fix TeX overfull
- hboxes (twice).
- (end of file): Added Local Variables block for TeX-master
- variable.
-
- * scheme.texi (R4RS Scheme): Node changed to "Guile and R5RS
- Scheme". Content changed to indicate that we plan to document
- both standard Scheme and Guile extensions.
- (About Data, About Procedures, About Expressions): New Scheme
- introductory material chapters.
- (Options): Moved material on Options into its own chapter.
- (Coding With Keywords): New subsection; extends material on use of
- keywords to include examples of and references to (ice-9 optargs).
- (passim): Change many uses of @example to @lisp, since the
- formatting seems to come out better in TeX.
- (Optional Arguments): New placeholder chapter (empty).
- (end of file): Added Local Variables block for TeX-master
- variable.
-
- * guile.texi (Top): "R4RS Scheme" node changed to "Guile and R5RS
- Scheme". Added Scheme introductory chapters: About Data, About
- Procedures and About Expressions. New Options chapter for options
- material. New Optional Arguments chapter as placeholder for
- (ice-9 optargs) material. New chapter for "Further Reading". New
- chapters for indices showing what is standard Scheme and what is
- Guile extension.
-
-2000-10-25 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * Makefile.am: Added goops.texi and new files to dist_texis.
-
- * goops.texi, goops-tutorial.texi, hierarchy.eps, hierarchy.txt:
- New files.
-
-2000-10-15 Neil Jerram <neil@ossau.uklinux.net>
-
- * gh.texi (Starting and controlling the interpreter): Removed
- obsolete note about boot-9.scm not being loaded by gh_enter.
- (Thanks to Chris Cramer for pointing this out.)
-
-2000-10-06 Neil Jerram <neil@ossau.uklinux.net>
-
- * guile.texi, scheme.texi, posix.texi: Simplified docstring
- comments: (i) they new refer to the Texinfo-format file that is
- generated by snarfing when libguile is built, rather than to
- individual C files in the libguile source; (ii) there is no longer
- a need to keep MD5 digest values for the corresponding source
- docstring, since I'm now using a different mechanism for keeping
- track of source material changes.
-
- * scheme.texi (Lists): Use "@example" in docstring for append.
-
- * guile.texi, scheme.texi (Primitive Properties): New chapter,
- documenting new primitive property primitives.
-
-2000-09-22 Neil Jerram <neil@ossau.uklinux.net>
-
- * scm.texi (I/O internals): Add full stops (periods) after
- standalone uses of @xref.
-
- * scheme.texi (Structure Layout): Doc for make-struct-layout
- changed to remove reference to "read-only" strings, which no
- longer exist.
- (Structure Basics): Use @pxref rather than @xref for parenthetical
- reference.
- (Dynamic Roots): Use @code rather than @var for code, in doc for
- call-with-dynamic-root.
- (Low level thread primitives): Ditto call-with-new-thread.
- (Higher level thread procedures): Ditto call-with-new-thread.
- (Symbols and Variables): Docs for gensym and symbol-hash updated
- according to libguile changes.
-
- * posix.texi (Generic Port Operations): Synchronized docstring
- for unread-string.
-
- * gh.texi (Defining new Scheme procedures in C): Avoid texinfo
- warning by using @code rather than @var for code.
-
- * scheme.texi: Lots more docstring comments added, and docs
- synchronized with libguile source.
- (interaction-environment, make-struct, make-vtable-vtable): Newer,
- better doc taken from source file.
- (cons-source): New docstring written.
- (Vectors): New section added.
- (Random, Symbols and Variables): New chapters.
-
- * posix.texi: Lots more docstring comments added.
- (pipe, tzset) Newer, better documentation taken from source file.
-
- * deprecated.texi: New file, for documenting features that are
- deprecated and so planned to disappear.
-
- * guile.texi (Procedures, Reading and Writing, Random, Sorting,
- Symbols and Variables, Deprecated): New chapters in the Scheme
- part of the reference manual, to hold docstrings that don't
- currently fit anywhere else.
-
-2000-08-28 Neil Jerram <neil@ossau.uklinux.net>
-
- * posix.texi (Pipes): open-pipe and close-pipe are procedures (in
- ice-9/popen.scm), not primitives.
-
- * scheme.texi (Generic Port Operations): Remove doc for
- port-revealed and set-port-revealed!, since these are covered in
- posix.texi.
-
- * posix.texi: Inserted docstring synchronization comments and
- synchronized docstrings for all primitives defined in posix.c,
- simpos.c, scmsigs.c, stime.c.
- (Ports and File Descriptors) Similarly synchronized port-revealed
- and set-port-revealed!.
-
-2000-08-25 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme.texi: Lots more docstrings added.
-
- * guile.texi (Top): More new chapters: Pairs, Objects, Guardians,
- Emacs Lisp Support.
-
- * scheme.texi (Numbers): New chapter containing docs (many still
- empty right now) for numerical primitives.
-
- * guile.texi (Top): Add chapter for numerical primitives.
-
-2000-08-18 Neil Jerram <neil@ossau.uklinux.net>
-
- * posix.texi (Ports and File Descriptors): Docstring for select
- substantially changed by update from libguile source.
-
- * scheme.texi, posix.texi: Lots more primitive docstrings added.
-
- * guile.texi (Top): Removed empty Reflection chapter, added new
- Hooks chapter.
-
- * scheme.texi: Added docstrings for all Guile primitives from
- libguile files from arbiters.c to error.c.
- (Reflection): Empty chapter removed.
-
- * guile.texi (Top): New chapters "Booleans" and "Equality"
- (temporary - until we improve the overall organization).
-
- * scheme.texi (Uniform Arrays): Fix "indentical" typo.
-
-2000-08-12 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme.texi: Removed superfluous "@c docstring end" markers -
- docstring.el now uses "@end deffn" to find the end of the
- docstring.
- Added a lot more docstring comments, and synced up docstrings with
- libguile - all libguile primitives documented in scheme.texi now
- have docstring comments and are up to date.
- (Evaluation): Updated docstring for eval and eval-string (now
- R5RS-compliant).
-
- * intro.texi (Guile Scripts): Added a couple of blank lines.
-
-2000-08-11 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme.texi: Add docstring comments and sync up existing
- docstrings with libguile source - complete as far as Association
- Lists.
- (Keywords): Fill out and improve documentation about
- keywords.
-
- * guile.texi: Set paragraph indent to zero.
-
-2000-08-07 Neil Jerram <neil@ossau.uklinux.net>
-
- * scm.texi (libguile error handling): Add note (text supplied by
- Gary Houston) giving a pointer on how to do C exception handling
- since scm_error_callback was removed.
-
-2000-08-01 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * scm.texi (libguile error handling): Removed reference to
- scm_error_callback, which is not available any more since
- guile-1.3. Thanks to Juli-Manel Merino Vidal and to Gary Houston
- for pointing this out.
-
-2000-07-31 Neil Jerram <neil@ossau.uklinux.net>
-
- * scm.texi (Relationship between Scheme and C functions):
- Expand. (Contributed by Thien-Thi Nguyen <ttn@gnu.org>.)
-
-2000-07-30 Neil Jerram <neil@ossau.uklinux.net>
-
- * scheme.texi (Association Lists): New, more complete
- documentation.
- * guile.texi: New top-level manual file based on guile-ref.texi
- but modified to reflect the better organization suggested in
- sources/jimb-org.texi.
- * expect.texi: New file to separate out Expect doc.
- * indices.texi: New file to separate indices from appendices.
- * intro.texi: Invoking Guile and Meta Switch nodes moved to Guile
- Scripting part (scripts.texi). Manual layout node moved to end of
- introduction.
- * posix.texi: All nodes downgraded one level. Expect, SCSH and
- Tcl/Tk nodes moved to dedicated files.
- * scheme.texi: Stuff moved around in accordance with
- sources/jimb-org.texi reorganization (cvs diff totally confused,
- I'm afraid).
- * scsh.texi: New file to separate out SCSH doc.
- * scripts.texi: New file to separate out Guile scripting doc.
- * tcltk.texi: New file to separate out Tcl/Tk interface doc.
- * Makefile.am: Changed guile-ref to guile; more distribution
- texis.
- * Makefile.in: Changed guile-ref to guile; more distribution
- texis.
-
-
-2000-05-14 Marius Vollmer <mvo@zagadka.ping.de>
-
- * posix.texi (Conventions): Added example on how to retrieve errno
- value from a system-exception. Thanks to Eric Hanchrow!
-
-2000-05-04 Marius Vollmer <mvo@zagadka.ping.de>
-
- * intro.texi: Added chapter about Guile's license.
- * guile-ref.texi: Updated menu.
-
-1999-12-15 Gary Houston <ghouston@freewire.co.uk>
-
- * scheme.texi (SLIB installation): new node.
-
-1999-12-06 Gary Houston <ghouston@freewire.co.uk>
-
- * r4rs.texi: tweaked the dircategory/direntry for compatibility
- with the r5 version.
- guile-ref.texi: tweaked the dircategory.
- * Makefile.am (info_TEXINFOS): add r5rs.texi.
- * r5rs.texi: new file, lifted from Aubrey Jaffer's site.
-
-1999-12-04 Gary Houston <ghouston@freewire.co.uk>
-
- * scheme.texi (Generic Port Operations): add "port-closed?".
-
-1999-11-22 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * mbapi.texi: Don't promise any behavior on ill-formed text.
-
-1999-11-19 Gary Houston <ghouston@freewire.co.uk>
-
- * scheme.texi: rewrote the intros in the array nodes.
-
-1999-11-18 Gary Houston <ghouston@freewire.co.uk>
-
- * posix.texi (Network Sockets and Communication): add htons etc.
- (Ports and File Descriptors, Network Sockets and Communication):
- suggest setvbuf instead of duplicate-port for converting
- unbuffered ports to buffered.
-
- * scheme.texi (Uniform Array): add missing array types to the
- table.
-
-1999-11-17 Gary Houston <ghouston@freewire.co.uk>
-
- * posix.texi (Network Databases): updated.
-
-1999-10-24 Gary Houston <ghouston@freewire.co.uk>
-
- * scheme.texi (String Ports): add with-output-to-string and
- with-input-from-string.
- (Port Implementation): update for ptob seek.
-
-1999-10-18 Gary Houston <ghouston@freewire.co.uk>
-
- * scheme.texi (C Port Interface): update the description of
- the rw_random port flag.
-
-1999-09-22 Gary Houston <ghouston@freewire.co.uk>
-
- * scheme.texi: added a bit of documentation for port internals.
-
-1999-09-12 Gary Houston <ghouston@easynet.co.uk>
-
- * posix.texi (File System): make that "directory-stream?".
-
-1999-09-11 Gary Houston <ghouston@easynet.co.uk>
-
- * posix.texi (File System): added "directory?".
-
-1999-09-06 James Blandy <jimb@mule.m17n.org>
-
- * mbapi.texi, mltext.texi: New files, describing interfaces for
- dealing with multilingual code.
-
-1999-07-25 Gary Houston <ghouston@easynet.co.uk>
-
- * scheme.texi, posix.texi: updated for changes in the I/O system
- and expect macros.
-
-1999-01-25 Mark Galassi <rosalia@cygnus.com>
-
- * scheme.texi (General option interface): applied a typo fix.
- Thanks to Eric Hanchrow (offby1@blarg.net).
-
-1998-11-01 Mark Galassi <rosalia@cygnus.com>
-
- * scheme.texi (Weak References): incorporated David Lutterkort's
- chapter on Weak References, which is based on Mikael's email
- message exchange with with Michael Livshin.
-
-1998-10-29 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * scheme.texi: Corrected shell commands in example. (Thanks to
- Chris Bitmead.)
-
-1998-10-25 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
-
- * gh.texi (C to Scheme, Scheme to C): Completed entries about
- vector conversions.
-
-1998-08-26 Mark Galassi <rosalia@cygnus.com>
-
- * gh.texi (Starting and controlling the interpreter): modified the
- gh_enter() docs in response to some good comments from Dirk
- Herrmann: now they address the issue of loading ice-9/boot-9.scm,
- and include Dirk's hackaround for the problem until we fix it
- properly.
-
-1998-04-29 Mark Galassi <rosalia@cygnus.com>
-
- * scheme.texi (Dynamic Linking from Marius): added Marius's new
- chapter on dynamic linking; there is still a section in dynamic
- linking (written by Tim maybe?), and I have to examine how to
- resolve that.
-
-1998-03-30 Mikael Djurfeldt <mdj@nada.kth.se>
-
- * scheme.texi (Port Operations): Changed entry for port-column and
- port-line. (Thanks to Per Bothner.)
-
-1998-02-02 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * scheme.texi (Exceptions): Adjusted documentation to reflect the
- removal of the (catch #f ...) mechanism.
-
-1998-01-28 Mark Galassi <rosalia@nis.lanl.gov>
-
- * guile-ref.texi: changed @dircategory to "Scheme Programming".
- It seems to be the consensus.
-
-1998-01-20 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * gh.texi (C to Scheme): Added documentation for gh_doubles2scm
- and gh_doubles2dvect.
- (Scheme to C): Added documentation for gh_scm2doubles.
-
-1998-01-15 Mark Galassi <rosalia@nis.lanl.gov>
-
- * gh.texi (Calling Scheme procedures from C): removed
- gh_make_subr() since Mikael pointed out that it is gone from
- Guile. I don't remember its history any more, but I don't think
- anyone is missing it.
-
-1998-01-03 Tim Pierce <twp@skepsis.com>
-
- * scheme.texi (Evaluation): Several corrections supplied by MDJ.
-
-Sat Dec 27 19:02:36 1997 Tim Pierce <twp@skepsis.com>
-
- * appendices.texi (Internals, Symbols): New nodes.
- * scheme.texi (Configuration Data): New node.
-
-1997-12-27 Tim Pierce <twp@skepsis.com>
-
- * guile-ref.texi (Bitwise Operations): New description.
-
-1997-12-24 Tim Pierce <twp@skepsis.com>
-
- * scheme.texi (Port Operations, Evaluation): New nodes.
-
-1997-12-13 Tim Pierce <twp@skepsis.com>
-
- * scheme.texi, posix.texi: Documented each procedure as `procedure',
- `primitive' or `syntax' as appropriate.
- (Records): Change record-type-field-names to record-type-fields.
- (Low level thread primitives): Change with-new-thread to
- call-with-new-thread.
-
-Sun Dec 7 22:47:22 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * posix.texi (Processes): add "system" procedure.
-
-1997-11-23 Mark Galassi <rosalia@cygnus.com>
-
- * gh.texi (Starting and controlling the interpreter): added
- documentation for gh_repl() -- gh_repl() has changed since I saw
- the scm_shell() routine.
-
-1997-11-19 Tim Pierce <twp@twp.tezcat.com>
-
- * scheme.texi (String Fun): New node.
- (Hash Tables): Added `get-handle' and `create-handle!' docs.
-
- * posix.texi (Networking Databases): Add docs for gethost, getnet,
- getserv, getproto. Expanded on miscellaneous docs.
-
-1997-11-18 Tim Pierce <twp@twp.tezcat.com>
-
- * posix.texi: New file; moved docs for POSIX interface here.
- * Makefile.am: Add posix.texi.
- * Makefile.in: Regenerated.
- * guile-ref.texi: Reorganize top-level menu. @include posix.texi.
- * scheme.texi: Moved many nodes around, some restructuring
- (e.g. new "Data Structures" node for records, structures, arrays,
- hash tables, and so on).
-
-1997-10-19 Mark Galassi <rosalia@cygnus.com>
-
- * gh.texi (Calling Scheme procedures from C): added many routines
- as I go through R4RS and try to complete the gh_ interface.
-
-Wed Oct 8 04:51:54 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * scheme.texi (Dynamic Roots): added batch mode procedures.
-
-1997-10-03 Mikael Djurfeldt <mdj@nada.kth.se>
-
- * scheme.texi (Vtables): Changed 0 --> @code{vtable-index-layout};
- Changed @code{struct-vtable-offset} --> @code{vtable-offset-user};
- Added short note about the print call-back initializer. (This
- section is in need of review. However, we shoudn't spend much
- time on it since the structs will be replaced by something
- equivalent, but with a different interface.}
-
-Sun Sep 28 00:02:35 1997 Mark Galassi <rosalia@nis.lanl.gov>
-
- * scheme.texi (Keywords): very small re-organization to take
- advantage of the fact that read-options is now documented in
- another chapter.
-
-Thu Sep 25 23:37:02 1997 Mark Galassi <rosalia@nis.lanl.gov>
-
- * scheme.texi (Guile options interface): renamed the symbol case
- section to "Guile options interface". "Reader options" is now a
- subsection of that. I've finally figured a lot of how options
- work, thanks to discovering Mikael's comments in options.c and an
- old note from Mikael to Jim describing it.
- (Guile options interface): reorganized the individual option
- groups. This section (on options) of the manual is now reasonably
- complete, unless I am completely missing something.
-
-Wed Sep 24 15:25:03 1997 Mark Galassi <rosalia@nis.lanl.gov>
-
- * scheme.texi (The Guile module system): Added a bit more to this
- chapter, mostly the more user-friendly (use-modules (ice-9
- module-name)) approach.
- (Symbol case): tried to write something about this, but it will
- need to be reviewed by someone who understands the big picture of
- read options. I also think the section name should be changed to
- something like "Read options".
-
-Sun Sep 21 18:45:57 1997 Mark Galassi <rosalia@nis.lanl.gov>
-
- * scheme.texi (SLIB): some little details, including splitting off
- what does in the installation chapter. Also added a section on
- Jacal, which has some open issues.
-
- * appendices.texi (Packages not shipped with Guile): added this
- section to describe getting resources on SCSH, SLIB and Jacal (and
- who knows what else in the future).
-
-Sat Aug 30 19:31:22 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * scheme.texi (Uniform Array): mention start and end arguments
- for uniform-array-read! and uniform-array-write.
-
-Sat Aug 23 19:05:08 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * guile-ref.texi (Top): corresponding changes.
- * scheme.texi (Exception Handling): add scm-error, strerror.
- (Exceptions): renamed from Exception Handling.
- (Exceptions): deleted empty section.
-
-Mon Aug 18 16:11:43 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- * texinfo.tex: Installed from texinfo release 3.11.
-
-Fri Aug 15 08:14:32 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * scheme.texi (file system): added truncate-file.
- chown, fcntl, fseek, ftell updated.
- (ports vs file descriptors): added fsync, open, open-fdes.
- (time): added times.
-
-Sun Aug 10 07:39:55 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * scheme.texi (processes): added execle.
-
-Tue Jul 29 02:01:21 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * setvbuf added. primitive-dup[2] removed.
-
-Sat Jul 26 04:25:40 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * various close and dup procedures added, plus setenv.
-
-Sat Jul 19 04:04:50 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * scheme.texi (signals): new section.
- (processes): primitive-exit.
- (ports vs. file descriptors): force-output, flush-all-ports.
- fcntl from NEWS.
-
-Fri Jul 18 07:58:52 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * scheme.texi (SLIB): update initialization details.
- (expect): likewise.
- (The Scheme shell (scsh)): likewise.
-
-Fri Jun 27 00:31:25 1997 Tim Pierce <twp@twp.tezcat.com>
-
- * scheme.texi (Regexp Functions): Add docs for make-regexp flags
- regexp/icase, regexp/newline, regexp/basic, regexp/extended.
-
-Mon Jun 23 12:35:57 1997 Tim Pierce <twpierce@bio-5.bsd.uchicago.edu>
-
- * appendices.texi (debugger user interface): new text.
- (Single-Step, Trace, Backtrace): new nodes.
-
- * scheme.texi: Many revised nodes, some new ones.
-
- (Binary Numeric Operations, Input/Output Ports, File Ports, Soft
- Ports, String Ports): Imported documentation from SCM and SLIB manuals.
-
- (Association Lists and Hash Tables, Dictionary Types, Association
- Lists, Hash Tables): New nodes.
- (Dictionaries in general): Removed.
-
- (Regular Expressions): Replaced.
- (Rx Interface): New node, renamed from old `Regular Expressions'.
- (Regexp Functions, Match Functions, Backslash Escapes): new nodes.
-
- (Property Lists): new node with documentation for both object and
- procedure properties.
- (Object Properties): removed.
- * guile-ref.texi: change `Object Properties' to `Property Lists'.
-
diff --git a/doc/ref/Makefile.am b/doc/ref/Makefile.am
deleted file mode 100644
index 584bd8229..000000000
--- a/doc/ref/Makefile.am
+++ /dev/null
@@ -1,62 +0,0 @@
-## Process this file with Automake to create Makefile.in
-##
-## Copyright (C) 1998 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-AUTOMAKE_OPTIONS = gnu
-
-info_TEXINFOS = guile.texi
-
-guile_TEXINFOS = preface.texi intro.texi program.texi scheme-intro.texi \
- scheme-ideas.texi scheme-data.texi scheme-procedures.texi \
- scheme-utility.texi scheme-binding.texi scheme-control.texi \
- scheme-io.texi scheme-evaluation.texi scheme-memory.texi \
- scheme-modules.texi scheme-scheduling.texi scheme-options.texi \
- scheme-translation.texi scheme-debug.texi deprecated.texi \
- scheme-reading.texi scheme-indices.texi slib.texi posix.texi \
- expect.texi scsh.texi tcltk.texi scripts.texi gh.texi scm.texi \
- debugging.texi indices.texi script-getopt.texi data-rep.texi \
- extend.texi repl-modules.texi srfi-modules.texi misc-modules.texi \
- scheme-compound.texi autoconf.texi autoconf-macros.texi tools.texi
-
-ETAGS_ARGS = $(info_TEXINFOS) $(guile_TEXINFOS)
-
-include $(top_srcdir)/am/pre-inst-guile
-
-# Automated snarfing
-
-autoconf.texi: autoconf-macros.texi
-autoconf-macros.texi: $(top_srcdir)/guile-config/guile.m4
- $(preinstguiletool)/snarf-guile-m4-docs $< > $(srcdir)/$@
-
-# Optionally support building an HTML version of the reference manual.
-
-if HTMLDOC
-
-htmldir = $(prefix)/html/guile-$(VERSION)
-
-html_DATA = guile_toc.html $(shell ls guile_*.html 2>/dev/null)
-
-guile_toc.html: guile.texi $(guile_TEXINFOS)
- $(TEXI2HTML) -split_chapter $(srcdir)/guile.texi
-
-endif
-
-CLEANFILES = autoconf-macros.texi \
- guile.cps guile.fns guile.rns guile.tps guile.vrs guile.tmp
diff --git a/doc/ref/api.txt b/doc/ref/api.txt
deleted file mode 100644
index cc26b839f..000000000
--- a/doc/ref/api.txt
+++ /dev/null
@@ -1,185 +0,0 @@
-Scheme objects
-==============
-
-There are two basic C data types to represent objects in guile:
-
-- SCM: SCM is the user level abstract C type that is used to represent all of
-guile's scheme objects, no matter what the scheme object type is. No C
-operation except assignment is guaranteed to work with variables of type SCM.
-Only use macros and functions to work with SCM values. Values are converted
-between C data types and the SCM type with utility functions and macros.
-
-- scm_bits_t: An integral data type that is guaranteed to be large enough to
-hold all information that is required to represent any scheme object. While
-this data type is used to implement guile internals, the use of this type is
-also necessary to write certain kinds of extensions to guile.
-
-
-Relationship between SCM and scm_bits_t
-=======================================
-
-A variable of type SCM is guaranteed to hold a valid scheme object. A
-variable of type scm_bits_t, however, may either hold a representation of a
-SCM value as a C integral type, but may also hold any C value, even if it does
-not correspond to a valid scheme object.
-
-For a variable x of type SCM, the scheme object's type information is stored
-in a form that is not directly usable. To be able to work on the type
-encoding of the scheme value, the SCM variable has to be transformed into the
-corresponding representation as a scm_bits_t variable y by using the
-SCM_UNPACK macro. After this has been done, the type of the scheme object x
-can be derived from the content of the bits of the scm_bits_t value y, as is
-described in -->data-rep. A valid bit encoding of a scheme value as a
-scm_bits_t variable can be transformed into the corresponding SCM value by
-using the SCM_PACK macro.
-
-- scm_bits_t SCM_UNPACK (SCM x): Transforms the SCM value x into it's
-representation as an integral type. Only after applying SCM_UNPACK it is
-possible to access the bits and contents of the SCM value.
-
-- SCM SCM_PACK (scm_bits_t x): Takes a valid integral representation of a
-scheme object and transforms it into its representation as a SCM value.
-
-
-Immediate objects
-=================
-
-A scheme object may either be an immediate, i. e. carrying all necessary
-information by itself, or it may contain a reference to a 'cell' with
-additional information on the heap. While the fact, whether an object is an
-immediate or not should be irrelevant for user code, within guile's own code
-the distinction is sometimes of importance. Thus, the following low level
-macro is provided:
-
-- int SCM_IMP (SCM x): A scheme object is an immediate if it fullfills the
-SCM_IMP predicate, otherwise it holds an encoded reference to a heap cell.
-The result of the predicate is delivered as a C style boolean value. User
-code and code that extends guile should normally not be required to use this
-macro.
-
-Summary:
-* For a scheme object x of unknown type, check first with SCM_IMP (x) if it is
-an immediate object. If so, all of the type and value information can be
-determined from the scm_bits_t value that is delivered by SCM_UNPACK (x).
-
-
-Non immediate objects
-=====================
-
-- (scm_t_cell *) SCM2PTR (SCM x) (FIXME:: this name should be changed)
-- SCM PTR2SCM (scm_t_cell * x) (FIXME:: this name should be changed)
-
-A scheme object of type SCM that does not fullfill the SCM_IMP predicate holds
-an encoded reference to a heap cell. This reference can be decoded to a C
-pointer to a heap cell using the SCM2PTR macro. The encoding of a pointer to
-a heap cell into a SCM value is done using the PTR2SCM macro.
-
-Note that it is also possible to transform a non immediate SCM value by using
-SCM_UNPACK into a scm_bits_t variable. Hower, the result of SCM_UNPACK may
-not be used as a pointer to a scm_t_cell: Only SCM2PTR is guaranteed to
-transform a SCM object into a valid pointer to a heap cell. Also, it is not
-allowed to apply PTR2SCM to anything that is not a valid pointer to a heap
-cell.
-
-Summary:
-* Only use SCM2PTR for SCM values for which SCM_IMP is false!
-* Don't use '(scm_t_cell*) SCM_UNPACK (x)'! Use 'SCM2PTR (x)' instead!
-* Don't use PTR2SCM for anything but a cell pointer!
-
-
-Heap Cell Type Information
-==========================
-
-Heap cells contain a number of entries, each of which is either a scheme
-object of type SCM or a raw C value of type scm_bits_t. Which of the cell
-entries contain scheme objects and which contain raw C values is determined by
-the first entry of the cell, which holds the cell type information.
-
-- scm_bits_t SCM_CELL_TYPE (SCM x): For a non immediate scheme object x,
-deliver the content of the first entry of the heap cell referenced by x. This
-value holds the information about the cell type as described in -->data-rep.
-
-- void SCM_SET_CELL_TYPE (SCM x, scm_bits_t t): For a non immediate scheme
-object x, write the value t into the first entry of the heap cell referenced
-by x. The value t must hold a valid cell type as described in -->data-rep.
-
-
-Accessing Cell Entries
-======================
-
-For a non immediate scheme object x, the object type can be determined by
-reading the cell type entry using the SCM_CELL_TYPE macro. For the different
-types of cells it is known which cell entry holds scheme objects and which cell
-entry holds raw C data. To access the different cell entries appropriately,
-the following macros are provided:
-
-- scm_bits_t SCM_CELL_WORD (SCM x, unsigned int n): Deliver the cell entry n
-of the heap cell referenced by the non immediate scheme object x as raw data.
-It is illegal, to access cell entries that hold scheme objects by using these
-macros. For convenience, the following macros are also provided:
- SCM_CELL_WORD_0 (x) --> SCM_CELL_WORD (x, 0)
- SCM_CELL_WORD_1 (x) --> SCM_CELL_WORD (x, 1)
- ...
- SCM_CELL_WORD_n (x) --> SCM_CELL_WORD (x, n)
-
-- SCM SCM_CELL_OBJECT (SCM x, unsigned int n): Deliver the cell entry n of
-the heap cell referenced by the non immediate scheme object x as a scheme
-object. It is illegal, to access cell entries that do not hold scheme objects
-by using these macros. For convenience, the following macros are also
-provided:
- SCM_CELL_OBJECT_0 (x) --> SCM_CELL_OBJECT (x, 0)
- SCM_CELL_OBJECT_1 (x) --> SCM_CELL_OBJECT (x, 1)
- ...
- SCM_CELL_OBJECT_n (x) --> SCM_CELL_OBJECT (x, n)
-
-- void SCM_SET_CELL_WORD (SCM x, unsigned int n, scm_bits_t w): Write the raw
-C value w into entry number n of the heap cell referenced by the non immediate
-scheme value x. Values that are written into cells this way may only be read
-from the cells using the SCM_CELL_WORD macros or, in case cell entry 0 is
-written, using the SCM_CELL_TYPE macro. For the special case of cell entry 0
-it has to be made sure that w contains a cell type information (see
--->data-rep) which does not describe a scheme object. For convenience, the
-following macros are also provided:
- SCM_SET_CELL_WORD_0 (x, w) --> SCM_SET_CELL_WORD (x, 0, w)
- SCM_SET_CELL_WORD_1 (x, w) --> SCM_SET_CELL_WORD (x, 1, w)
- ...
- SCM_SET_CELL_WORD_n (x, w) --> SCM_SET_CELL_WORD (x, n, w)
-
-- void SCM_SET_CELL_OBJECT (SCM x, unsigned int n, SCM o): Write the scheme
-object o into entry number n of the heap cell referenced by the non immediate
-scheme value x. Values that are written into cells this way may only be read
-from the cells using the SCM_CELL_OBJECT macros or, in case cell entry 0 is
-written, using the SCM_CELL_TYPE macro. For the special case of cell entry 0
-the writing of a scheme object into this cell is only allowed, if the cell
-forms a scheme pair. For convenience, the following macros are also provided:
- SCM_SET_CELL_OBJECT_0 (x, o) --> SCM_SET_CELL_OBJECT (x, 0, o)
- SCM_SET_CELL_OBJECT_1 (x, o) --> SCM_SET_CELL_OBJECT (x, 1, o)
- ...
- SCM_SET_CELL_OBJECT_n (x, o) --> SCM_SET_CELL_OBJECT (x, n, o)
-
-Summary:
-* For a non immediate scheme object x of unknown type, get the type
- information by using SCM_CELL_TYPE (x).
-* As soon as the cell type information is available, only use the appropriate
- access methods to read and write data to the different cell entries.
-
-
-Basic Rules for Accessing Cell Entries
-======================================
-
-For each cell type it is generally up to the implementation of that type which
-of the corresponding cell entries hold scheme objects and which hold raw C
-values. However, there is one basic rules that has to be followed: Scheme
-pairs consist of exactly two cell entries, which both contain scheme objects.
-Further, a cell which contains a scheme object in it first entry has to be a
-scheme pair. In other words, it is not allowed to store a scheme object in
-the first cell entry and a non scheme object in the second cell entry.
-
-Fixme:shouldn't this rather be SCM_PAIRP / SCM_PAIR_P ?
-- int SCM_CONSP (SCM x): Determine, whether the scheme object x is a scheme
-pair, i. e. whether x references a heap cell consisting of exactly two
-entries, where both entries contain a scheme object. In this case, both
-entries will have to be accessed using the SCM_CELL_OBJECT macros. On the
-contrary, if the SCM_CONSP predicate is not fulfilled, the first entry of the
-scheme cell is guaranteed not to be a scheme value and thus the first cell
-entry must be accessed using the SCM_CELL_WORD_0 macro.
diff --git a/doc/ref/autoconf.texi b/doc/ref/autoconf.texi
deleted file mode 100644
index 8d05b2ecc..000000000
--- a/doc/ref/autoconf.texi
+++ /dev/null
@@ -1,234 +0,0 @@
-@page
-@node Autoconf Support
-@chapter Autoconf Support
-
-When Guile is installed, a set of autoconf macros is also installed as
-PREFIX/share/aclocal/guile.m4. This chapter documents the macros provided in
-that file, as well as the high-level guile-tool Autofrisk. @xref{Top,The GNU
-Autoconf Manual,,autoconf}, for more info.
-
-@menu
-* Autoconf Background:: Why use autoconf?
-* Autoconf Macros:: The GUILE_* macros.
-* Using Autoconf Macros:: How to use them, plus examples.
-* Autofrisk:: AUTOFRISK_CHECKS and AUTOFRISK_SUMMARY.
-* Using Autofrisk:: Example modules.af files.
-@end menu
-
-
-@node Autoconf Background
-@section Autoconf Background
-
-As explained elsewhere (@pxref{Top,The GNU Autoconf Manual,,autoconf}), any
-package needs configuration at build-time. If your package uses Guile (or
-uses a package that in turn uses Guile), you probably need to know what
-specific Guile features are available and details about them.
-
-The way to do this is to write feature tests and arrange for their execution
-by the @file{configure} script, typically by adding the tests to
-@file{configure.ac}, and running @code{autoconf} to create @file{configure}.
-Users of your package then run @file{configure} in the normal way.
-
-Macros are a way to make common feature tests easy to express. Autoconf
-provides a wide range of macros (@pxref{Existing Tests,,,autoconf}), and
-Guile installation provides Guile-specific tests in the areas of:
-program detection, compilation flags reporting, and Scheme module
-checks.
-
-
-@node Autoconf Macros
-@section Autoconf Macros
-
-The macro names all begin with "GUILE_".
-
-@c see Makefile.am
-@include autoconf-macros.texi
-
-
-@node Using Autoconf Macros
-@section Using Autoconf Macros
-
-Using the autoconf macros is straightforward: Add the macro "calls" (actually
-instantiations) to @file{configure.ac}, run @code{aclocal}, and finally,
-run @code{autoconf}. If your system doesn't have guile.m4 installed, place
-the desired macro definitions (@code{AC_DEFUN} forms) in @file{acinclude.m4},
-and @code{aclocal} will do the right thing.
-
-Some of the macros can be used inside normal shell constructs: @code{if foo ;
-then GUILE_BAZ ; fi}, but this is not guaranteed. It's probably a good idea
-to instantiate macros at top-level.
-
-We now include two examples, one simple and one complicated.
-
-The first example is for a package that uses libguile, and thus needs to know
-how to compile and link against it. So we use @code{GUILE_FLAGS} to set the
-vars @code{GUILE_CFLAGS} and @code{GUILE_LDFLAGS}, which are automatically
-substituted in the Makefile.
-
-@example
-In configure.ac:
-
- GUILE_FLAGS
-
-In Makefile.in:
-
- GUILE_CFLAGS = @@GUILE_CFLAGS@@
- GUILE_LDFLAGS = @@GUILE_LDFLAGS@@
-
- myprog.o: myprog.c
- $(CC) -o $@ $(GUILE_CFLAGS) $<
- myprog: myprog.o
- $(CC) -o $@ $< $(GUILE_LDFLAGS)
-@end example
-
-The second example is for a package of Guile Scheme modules that uses an
-external program and other Guile Scheme modules (some might call this a "pure
-scheme" package). So we use the @code{GUILE_SITE_DIR} macro, a regular
-@code{AC_PATH_PROG} macro, and the @code{GUILE_MODULE_AVAILABLE} macro.
-
-@example
-In configure.ac:
-
- GUILE_SITE_DIR
-
- probably_wont_work=""
-
- # pgtype pgtable
- GUILE_MODULE_AVAILABLE(have_guile_pg, (database postgres))
- test $have_guile_pg = no &&
- probably_wont_work="(my pgtype) (my pgtable) $probably_wont_work"
-
- # gpgutils
- AC_PATH_PROG(GNUPG,gpg)
- test x"$GNUPG" = x &&
- probably_wont_work="(my gpgutils) $probably_wont_work"
-
- if test ! "$probably_wont_work" = "" ; then
- p=" ***"
- echo
- echo "$p"
- echo "$p NOTE:"
- echo "$p The following modules probably won't work:"
- echo "$p $probably_wont_work"
- echo "$p They can be installed anyway, and will work if their"
- echo "$p dependencies are installed later. Please see README."
- echo "$p"
- echo
- fi
-
-In Makefile.in:
-
- instdir = @@GUILE_SITE@@/my
-
- install:
- $(INSTALL) my/*.scm $(instdir)
-@end example
-
-
-@node Autofrisk
-@section Autofrisk
-
-The @dfn{guile-tools autofrisk} command looks for the file @file{modules.af}
-in the current directory and writes out @file{modules.af.m4} containing
-autoconf definitions for @code{AUTOFRISK_CHECKS} and @code{AUTOFRISK_SUMMARY}.
-@xref{Autoconf Background}, and @xref{Using Autoconf Macros}, for more info.
-
-The modules.af file consists of a series of configuration forms (Scheme
-lists), which have one of the following formats:
-
-@example
- (files-glob PATTERN ...) ;; required
- (non-critical-external MODULE ...) ;; optional
- (non-critical-internal MODULE ...) ;; optional
- (programs (MODULE PROG ...) ...) ;; optional
- (pww-varname VARNAME) ;; optional
-@end example
-
-@var{pattern} is a string that may contain "*" and "?" characters to be
-expanded into filenames. @var{module} is a list of symbols naming a module,
-such as `(srfi srfi-1)'. @var{varname} is a shell-safe name to use instead of
-@code{probably_wont_work}, the default. This var is passed to `AC_SUBST'.
-@var{prog} is a string that names a program, such as "gpg".
-
-Autofrisk expands the @code{files-glob} pattern(s) into a list of files, scans
-each file's module definition form(s), and constructs a module dependency
-graph wherein modules defined by @code{define-module} are considered
-@dfn{internal} and the remaining, @dfn{external}. For each external module
-that has an internal dependency, Autofrisk emits a
-@code{GUILE_MODULE_REQUIRED} check (@pxref{Autoconf Macros}), which altogether
-form the body of @code{AUTOFRISK_CHECKS}.
-
-@code{GUILE_MODULE_REQUIRED} causes the @file{configure} script to exit with
-an error message if the specified module is not available; it enforces a
-strong dependency. You can temper dependency strength by using the
-@code{non-critical-external} and @code{non-critical-internal} configuration
-forms in modules.af. For graph edges that touch such non-critical modules,
-Autofrisk uses @code{GUILE_MODULE_AVAILABLE}, and arranges for
-@code{AUTOFRISK_SUMMARY} to display a warning if they are not found.
-
-The shell code resulting from the expansion of @code{AUTOFRISK_CHECKS} and
-@code{AUTOFRISK_SUMMARY} uses the shell variable @code{probably_wont_work} to
-collect the names of unfound non-critical modules. If this bothers you, use
-configuration form @code{(pww-name foo)} in modules.af.
-
-Although Autofrisk does not detect when a module uses a program (for example,
-in a @code{system} call), it can generate @code{AC_PATH_PROG} forms anyway if
-you use the @code{programs} configuration form in modules.af. These are
-collected into @code{AUTOCONF_CHECKS}.
-
-@xref{Using Autofrisk}, for some modules.af examples.
-
-
-@node Using Autofrisk
-@section Using Autofrisk
-
-Using Autofrisk (@pxref{Autofrisk}) involves writing @file{modules.af} and
-adding two macro calls to @file{configure.in}. Here is an example of the
-latter:
-
-@example
-AUTOFRISK_CHECKS
-AUTOFRISK_SUMMARY
-@end example
-
-Here is an adaptation of the second "GUILE_*" example (@pxref{Using Autoconf
-Macros}) that does basically the same thing.
-
-@example
-(files-glob "my/*.scm")
-(non-critical-external (database postgres))
-(programs ((my gpgutils) "gpg")) ;; (my gpgutils) uses "gpg"
-@end example
-
-If the SRFI modules (@pxref{SRFI Support}) were a separate package, we could
-use @code{guile-tools frisk} to find out its dependencies:
-
-@example
-$ guile-tools frisk srfi/*.scm
-13 files, 18 modules (13 internal, 5 external), 9 edges
-
-x (ice-9 and-let-star)
- regular (srfi srfi-2)
-x (ice-9 syncase)
- regular (srfi srfi-11)
-x (ice-9 rdelim)
- regular (srfi srfi-10)
-x (ice-9 receive)
- regular (srfi srfi-8)
- regular (srfi srfi-1)
-x (ice-9 session)
- regular (srfi srfi-1)
-@end example
-
-Then, we could use the following modules.af to help configure it:
-
-@example
-(files-glob "srfi/*.scm")
-(non-critical-external ;; relatively recent
- (ice-9 rdelim)
- (ice-9 receive)
- (ice-9 and-let-star))
-(pww-varname not_fully_supported)
-@end example
-
-@c autoconf.texi ends here
diff --git a/doc/ref/data-rep.texi b/doc/ref/data-rep.texi
deleted file mode 100644
index 30fcee6c6..000000000
--- a/doc/ref/data-rep.texi
+++ /dev/null
@@ -1,2047 +0,0 @@
-@c essay \input texinfo
-@c essay @c -*-texinfo-*-
-@c essay @c %**start of header
-@c essay @setfilename data-rep.info
-@c essay @settitle Data Representation in Guile
-@c essay @c %**end of header
-
-@c essay @include version.texi
-
-@c essay @dircategory The Algorithmic Language Scheme
-@c essay @direntry
-@c essay * data-rep: (data-rep). Data Representation in Guile --- how to use
-@c essay Guile objects in your C code.
-@c essay @end direntry
-
-@c essay @setchapternewpage off
-
-@c essay @ifinfo
-@c essay Data Representation in Guile
-
-@c essay Copyright (C) 1998, 1999, 2000 Free Software Foundation
-
-@c essay Permission is granted to make and distribute verbatim copies of
-@c essay this manual provided the copyright notice and this permission notice
-@c essay are preserved on all copies.
-
-@c essay @ignore
-@c essay Permission is granted to process this file through TeX and print the
-@c essay results, provided the printed document carries copying permission
-@c essay notice identical to this one except for the removal of this paragraph
-@c essay (this paragraph not being relevant to the printed manual).
-@c essay @end ignore
-
-@c essay Permission is granted to copy and distribute modified versions of this
-@c essay manual under the conditions for verbatim copying, provided that the entire
-@c essay resulting derived work is distributed under the terms of a permission
-@c essay notice identical to this one.
-
-@c essay Permission is granted to copy and distribute translations of this manual
-@c essay into another language, under the above conditions for modified versions,
-@c essay except that this permission notice may be stated in a translation approved
-@c essay by the Free Software Foundation.
-@c essay @end ifinfo
-
-@c essay @titlepage
-@c essay @sp 10
-@c essay @comment The title is printed in a large font.
-@c essay @title Data Representation in Guile
-@c essay @subtitle $Id: data-rep.texi,v 1.7 2002-03-29 20:25:23 ossau Exp $
-@c essay @subtitle For use with Guile @value{VERSION}
-@c essay @author Jim Blandy
-@c essay @author Free Software Foundation
-@c essay @author @email{jimb@@red-bean.com}
-@c essay @c The following two commands start the copyright page.
-@c essay @page
-@c essay @vskip 0pt plus 1filll
-@c essay @vskip 0pt plus 1filll
-@c essay Copyright @copyright{} 1998 Free Software Foundation
-
-@c essay Permission is granted to make and distribute verbatim copies of
-@c essay this manual provided the copyright notice and this permission notice
-@c essay are preserved on all copies.
-
-@c essay Permission is granted to copy and distribute modified versions of this
-@c essay manual under the conditions for verbatim copying, provided that the entire
-@c essay resulting derived work is distributed under the terms of a permission
-@c essay notice identical to this one.
-
-@c essay Permission is granted to copy and distribute translations of this manual
-@c essay into another language, under the above conditions for modified versions,
-@c essay except that this permission notice may be stated in a translation approved
-@c essay by Free Software Foundation.
-@c essay @end titlepage
-
-@c essay @c @smallbook
-@c essay @c @finalout
-@c essay @headings double
-
-
-@c essay @node Top, Data Representation in Scheme, (dir), (dir)
-@c essay @top Data Representation in Guile
-
-@c essay @ifinfo
-@c essay This essay is meant to provide the background necessary to read and
-@c essay write C code that manipulates Scheme values in a way that conforms to
-@c essay libguile's interface. If you would like to write or maintain a
-@c essay Guile-based application in C or C++, this is the first information you
-@c essay need.
-
-@c essay In order to make sense of Guile's @code{SCM_} functions, or read
-@c essay libguile's source code, it's essential to have a good grasp of how Guile
-@c essay actually represents Scheme values. Otherwise, a lot of the code, and
-@c essay the conventions it follows, won't make very much sense.
-
-@c essay We assume you know both C and Scheme, but we do not assume you are
-@c essay familiar with Guile's C interface.
-@c essay @end ifinfo
-
-
-@page
-@node Data Representation
-@chapter Data Representation in Guile
-
-@strong{by Jim Blandy}
-
-[Due to the rather non-orthogonal and performance-oriented nature of the
-SCM interface, you need to understand SCM internals *before* you can use
-the SCM API. That's why this chapter comes first.]
-
-[NOTE: this is Jim Blandy's essay almost entirely unmodified. It has to
-be adapted to fit this manual smoothly.]
-
-In order to make sense of Guile's SCM_ functions, or read libguile's
-source code, it's essential to have a good grasp of how Guile actually
-represents Scheme values. Otherwise, a lot of the code, and the
-conventions it follows, won't make very much sense. This essay is meant
-to provide the background necessary to read and write C code that
-manipulates Scheme values in a way that is compatible with libguile.
-
-We assume you know both C and Scheme, but we do not assume you are
-familiar with Guile's implementation.
-
-@menu
-* Data Representation in Scheme:: Why things aren't just totally
- straightforward, in general terms.
-* How Guile does it:: How to write C code that manipulates
- Guile values, with an explanation
- of Guile's garbage collector.
-* Defining New Types (Smobs):: How to extend Guile with your own
- application-specific datatypes.
-@end menu
-
-@node Data Representation in Scheme
-@section Data Representation in Scheme
-
-Scheme is a latently-typed language; this means that the system cannot,
-in general, determine the type of a given expression at compile time.
-Types only become apparent at run time. Variables do not have fixed
-types; a variable may hold a pair at one point, an integer at the next,
-and a thousand-element vector later. Instead, values, not variables,
-have fixed types.
-
-In order to implement standard Scheme functions like @code{pair?} and
-@code{string?} and provide garbage collection, the representation of
-every value must contain enough information to accurately determine its
-type at run time. Often, Scheme systems also use this information to
-determine whether a program has attempted to apply an operation to an
-inappropriately typed value (such as taking the @code{car} of a string).
-
-Because variables, pairs, and vectors may hold values of any type,
-Scheme implementations use a uniform representation for values --- a
-single type large enough to hold either a complete value or a pointer
-to a complete value, along with the necessary typing information.
-
-The following sections will present a simple typing system, and then
-make some refinements to correct its major weaknesses. However, this is
-not a description of the system Guile actually uses. It is only an
-illustration of the issues Guile's system must address. We provide all
-the information one needs to work with Guile's data in @ref{How Guile
-does it}.
-
-
-@menu
-* A Simple Representation::
-* Faster Integers::
-* Cheaper Pairs::
-* Guile Is Hairier::
-@end menu
-
-@node A Simple Representation
-@subsection A Simple Representation
-
-The simplest way to meet the above requirements in C would be to
-represent each value as a pointer to a structure containing a type
-indicator, followed by a union carrying the real value. Assuming that
-@code{SCM} is the name of our universal type, we can write:
-
-@example
-enum type @{ integer, pair, string, vector, ... @};
-
-typedef struct value *SCM;
-
-struct value @{
- enum type type;
- union @{
- int integer;
- struct @{ SCM car, cdr; @} pair;
- struct @{ int length; char *elts; @} string;
- struct @{ int length; SCM *elts; @} vector;
- ...
- @} value;
-@};
-@end example
-with the ellipses replaced with code for the remaining Scheme types.
-
-This representation is sufficient to implement all of Scheme's
-semantics. If @var{x} is an @code{SCM} value:
-@itemize @bullet
-@item
- To test if @var{x} is an integer, we can write @code{@var{x}->type == integer}.
-@item
- To find its value, we can write @code{@var{x}->value.integer}.
-@item
- To test if @var{x} is a vector, we can write @code{@var{x}->type == vector}.
-@item
- If we know @var{x} is a vector, we can write
- @code{@var{x}->value.vector.elts[0]} to refer to its first element.
-@item
- If we know @var{x} is a pair, we can write
- @code{@var{x}->value.pair.car} to extract its car.
-@end itemize
-
-
-@node Faster Integers
-@subsection Faster Integers
-
-Unfortunately, the above representation has a serious disadvantage. In
-order to return an integer, an expression must allocate a @code{struct
-value}, initialize it to represent that integer, and return a pointer to
-it. Furthermore, fetching an integer's value requires a memory
-reference, which is much slower than a register reference on most
-processors. Since integers are extremely common, this representation is
-too costly, in both time and space. Integers should be very cheap to
-create and manipulate.
-
-One possible solution comes from the observation that, on many
-architectures, structures must be aligned on a four-byte boundary.
-(Whether or not the machine actually requires it, we can write our own
-allocator for @code{struct value} objects that assures this is true.)
-In this case, the lower two bits of the structure's address are known to
-be zero.
-
-This gives us the room we need to provide an improved representation
-for integers. We make the following rules:
-@itemize @bullet
-@item
-If the lower two bits of an @code{SCM} value are zero, then the SCM
-value is a pointer to a @code{struct value}, and everything proceeds as
-before.
-@item
-Otherwise, the @code{SCM} value represents an integer, whose value
-appears in its upper bits.
-@end itemize
-
-Here is C code implementing this convention:
-@example
-enum type @{ pair, string, vector, ... @};
-
-typedef struct value *SCM;
-
-struct value @{
- enum type type;
- union @{
- struct @{ SCM car, cdr; @} pair;
- struct @{ int length; char *elts; @} string;
- struct @{ int length; SCM *elts; @} vector;
- ...
- @} value;
-@};
-
-#define POINTER_P(x) (((int) (x) & 3) == 0)
-#define INTEGER_P(x) (! POINTER_P (x))
-
-#define GET_INTEGER(x) ((int) (x) >> 2)
-#define MAKE_INTEGER(x) ((SCM) (((x) << 2) | 1))
-@end example
-
-Notice that @code{integer} no longer appears as an element of @code{enum
-type}, and the union has lost its @code{integer} member. Instead, we
-use the @code{POINTER_P} and @code{INTEGER_P} macros to make a coarse
-classification of values into integers and non-integers, and do further
-type testing as before.
-
-Here's how we would answer the questions posed above (again, assume
-@var{x} is an @code{SCM} value):
-@itemize @bullet
-@item
- To test if @var{x} is an integer, we can write @code{INTEGER_P (@var{x})}.
-@item
- To find its value, we can write @code{GET_INTEGER (@var{x})}.
-@item
- To test if @var{x} is a vector, we can write:
-@example
- @code{POINTER_P (@var{x}) && @var{x}->type == vector}
-@end example
- Given the new representation, we must make sure @var{x} is truly a
- pointer before we dereference it to determine its complete type.
-@item
- If we know @var{x} is a vector, we can write
- @code{@var{x}->value.vector.elts[0]} to refer to its first element, as
- before.
-@item
- If we know @var{x} is a pair, we can write
- @code{@var{x}->value.pair.car} to extract its car, just as before.
-@end itemize
-
-This representation allows us to operate more efficiently on integers
-than the first. For example, if @var{x} and @var{y} are known to be
-integers, we can compute their sum as follows:
-@example
-MAKE_INTEGER (GET_INTEGER (@var{x}) + GET_INTEGER (@var{y}))
-@end example
-Now, integer math requires no allocation or memory references. Most
-real Scheme systems actually use an even more efficient representation,
-but this essay isn't about bit-twiddling. (Hint: what if pointers had
-@code{01} in their least significant bits, and integers had @code{00}?)
-
-
-@node Cheaper Pairs
-@subsection Cheaper Pairs
-
-However, there is yet another issue to confront. Most Scheme heaps
-contain more pairs than any other type of object; Jonathan Rees says
-that pairs occupy 45% of the heap in his Scheme implementation, Scheme
-48. However, our representation above spends three @code{SCM}-sized
-words per pair --- one for the type, and two for the @sc{car} and
-@sc{cdr}. Is there any way to represent pairs using only two words?
-
-Let us refine the convention we established earlier. Let us assert
-that:
-@itemize @bullet
-@item
- If the bottom two bits of an @code{SCM} value are @code{#b00}, then
- it is a pointer, as before.
-@item
- If the bottom two bits are @code{#b01}, then the upper bits are an
- integer. This is a bit more restrictive than before.
-@item
- If the bottom two bits are @code{#b10}, then the value, with the bottom
- two bits masked out, is the address of a pair.
-@end itemize
-
-Here is the new C code:
-@example
-enum type @{ string, vector, ... @};
-
-typedef struct value *SCM;
-
-struct value @{
- enum type type;
- union @{
- struct @{ int length; char *elts; @} string;
- struct @{ int length; SCM *elts; @} vector;
- ...
- @} value;
-@};
-
-struct pair @{
- SCM car, cdr;
-@};
-
-#define POINTER_P(x) (((int) (x) & 3) == 0)
-
-#define INTEGER_P(x) (((int) (x) & 3) == 1)
-#define GET_INTEGER(x) ((int) (x) >> 2)
-#define MAKE_INTEGER(x) ((SCM) (((x) << 2) | 1))
-
-#define PAIR_P(x) (((int) (x) & 3) == 2)
-#define GET_PAIR(x) ((struct pair *) ((int) (x) & ~3))
-@end example
-
-Notice that @code{enum type} and @code{struct value} now only contain
-provisions for vectors and strings; both integers and pairs have become
-special cases. The code above also assumes that an @code{int} is large
-enough to hold a pointer, which isn't generally true.
-
-
-Our list of examples is now as follows:
-@itemize @bullet
-@item
- To test if @var{x} is an integer, we can write @code{INTEGER_P
- (@var{x})}; this is as before.
-@item
- To find its value, we can write @code{GET_INTEGER (@var{x})}, as
- before.
-@item
- To test if @var{x} is a vector, we can write:
-@example
- @code{POINTER_P (@var{x}) && @var{x}->type == vector}
-@end example
- We must still make sure that @var{x} is a pointer to a @code{struct
- value} before dereferencing it to find its type.
-@item
- If we know @var{x} is a vector, we can write
- @code{@var{x}->value.vector.elts[0]} to refer to its first element, as
- before.
-@item
- We can write @code{PAIR_P (@var{x})} to determine if @var{x} is a
- pair, and then write @code{GET_PAIR (@var{x})->car} to refer to its
- car.
-@end itemize
-
-This change in representation reduces our heap size by 15%. It also
-makes it cheaper to decide if a value is a pair, because no memory
-references are necessary; it suffices to check the bottom two bits of
-the @code{SCM} value. This may be significant when traversing lists, a
-common activity in a Scheme system.
-
-Again, most real Scheme systems use a slightly different implementation;
-for example, if GET_PAIR subtracts off the low bits of @code{x}, instead
-of masking them off, the optimizer will often be able to combine that
-subtraction with the addition of the offset of the structure member we
-are referencing, making a modified pointer as fast to use as an
-unmodified pointer.
-
-
-@node Guile Is Hairier
-@subsection Guile Is Hairier
-
-We originally started with a very simple typing system --- each object
-has a field that indicates its type. Then, for the sake of efficiency
-in both time and space, we moved some of the typing information directly
-into the @code{SCM} value, and left the rest in the @code{struct value}.
-Guile itself employs a more complex hierarchy, storing finer and finer
-gradations of type information in different places, depending on the
-object's coarser type.
-
-In the author's opinion, Guile could be simplified greatly without
-significant loss of efficiency, but the simplified system would still be
-more complex than what we've presented above.
-
-
-@node How Guile does it
-@section How Guile does it
-
-Here we present the specifics of how Guile represents its data. We
-don't go into complete detail; an exhaustive description of Guile's
-system would be boring, and we do not wish to encourage people to write
-code which depends on its details anyway. We do, however, present
-everything one need know to use Guile's data.
-
-
-@menu
-* General Rules::
-* Conservative GC::
-* Immediates vs Non-immediates::
-* Immediate Datatypes::
-* Non-immediate Datatypes::
-* Signalling Type Errors::
-* Unpacking the SCM type::
-@end menu
-
-@node General Rules
-@subsection General Rules
-
-Any code which operates on Guile datatypes must @code{#include} the
-header file @code{<libguile.h>}. This file contains a definition for
-the @code{SCM} typedef (Guile's universal type, as in the examples
-above), and definitions and declarations for a host of macros and
-functions that operate on @code{SCM} values.
-
-All identifiers declared by @code{<libguile.h>} begin with @code{scm_}
-or @code{SCM_}.
-
-@c [[I wish this were true, but I don't think it is at the moment. -JimB]]
-@c Macros do not evaluate their arguments more than once, unless documented
-@c to do so.
-
-The functions described here generally check the types of their
-@code{SCM} arguments, and signal an error if their arguments are of an
-inappropriate type. Macros generally do not, unless that is their
-specified purpose. You must verify their argument types beforehand, as
-necessary.
-
-Macros and functions that return a boolean value have names ending in
-@code{P} or @code{_p} (for ``predicate''). Those that return a negated
-boolean value have names starting with @code{SCM_N}. For example,
-@code{SCM_IMP (@var{x})} is a predicate which returns non-zero iff
-@var{x} is an immediate value (an @code{IM}). @code{SCM_NCONSP
-(@var{x})} is a predicate which returns non-zero iff @var{x} is
-@emph{not} a pair object (a @code{CONS}).
-
-
-@node Conservative GC
-@subsection Conservative Garbage Collection
-
-Aside from the latent typing, the major source of constraints on a
-Scheme implementation's data representation is the garbage collector.
-The collector must be able to traverse every live object in the heap, to
-determine which objects are not live.
-
-There are many ways to implement this, but Guile uses an algorithm
-called @dfn{mark and sweep}. The collector scans the system's global
-variables and the local variables on the stack to determine which
-objects are immediately accessible by the C code. It then scans those
-objects to find the objects they point to, @i{et cetera}. The collector
-sets a @dfn{mark bit} on each object it finds, so each object is
-traversed only once. This process is called @dfn{tracing}.
-
-When the collector can find no unmarked objects pointed to by marked
-objects, it assumes that any objects that are still unmarked will never
-be used by the program (since there is no path of dereferences from any
-global or local variable that reaches them) and deallocates them.
-
-In the above paragraphs, we did not specify how the garbage collector
-finds the global and local variables; as usual, there are many different
-approaches. Frequently, the programmer must maintain a list of pointers
-to all global variables that refer to the heap, and another list
-(adjusted upon entry to and exit from each function) of local variables,
-for the collector's benefit.
-
-The list of global variables is usually not too difficult to maintain,
-since global variables are relatively rare. However, an explicitly
-maintained list of local variables (in the author's personal experience)
-is a nightmare to maintain. Thus, Guile uses a technique called
-@dfn{conservative garbage collection}, to make the local variable list
-unnecessary.
-
-The trick to conservative collection is to treat the stack as an
-ordinary range of memory, and assume that @emph{every} word on the stack
-is a pointer into the heap. Thus, the collector marks all objects whose
-addresses appear anywhere in the stack, without knowing for sure how
-that word is meant to be interpreted.
-
-Obviously, such a system will occasionally retain objects that are
-actually garbage, and should be freed. In practice, this is not a
-problem. The alternative, an explicitly maintained list of local
-variable addresses, is effectively much less reliable, due to programmer
-error.
-
-To accommodate this technique, data must be represented so that the
-collector can accurately determine whether a given stack word is a
-pointer or not. Guile does this as follows:
-
-@itemize @bullet
-@item
-Every heap object has a two-word header, called a @dfn{cell}. Some
-objects, like pairs, fit entirely in a cell's two words; others may
-store pointers to additional memory in either of the words. For
-example, strings and vectors store their length in the first word, and a
-pointer to their elements in the second.
-
-@item
-Guile allocates whole arrays of cells at a time, called @dfn{heap
-segments}. These segments are always allocated so that the cells they
-contain fall on eight-byte boundaries, or whatever is appropriate for
-the machine's word size. Guile keeps all cells in a heap segment
-initialized, whether or not they are currently in use.
-
-@item
-Guile maintains a sorted table of heap segments.
-@end itemize
-
-Thus, given any random word @var{w} fetched from the stack, Guile's
-garbage collector can consult the table to see if @var{w} falls within a
-known heap segment, and check @var{w}'s alignment. If both tests pass,
-the collector knows that @var{w} is a valid pointer to a cell,
-intentional or not, and proceeds to trace the cell.
-
-Note that heap segments do not contain all the data Guile uses; cells
-for objects like vectors and strings contain pointers to other memory
-areas. However, since those pointers are internal, and not shared among
-many pieces of code, it is enough for the collector to find the cell,
-and then use the cell's type to find more pointers to trace.
-
-
-@node Immediates vs Non-immediates
-@subsection Immediates vs Non-immediates
-
-Guile classifies Scheme objects into two kinds: those that fit entirely
-within an @code{SCM}, and those that require heap storage.
-
-The former class are called @dfn{immediates}. The class of immediates
-includes small integers, characters, boolean values, the empty list, the
-mysterious end-of-file object, and some others.
-
-The remaining types are called, not surprisingly, @dfn{non-immediates}.
-They include pairs, procedures, strings, vectors, and all other data
-types in Guile.
-
-@deftypefn Macro int SCM_IMP (SCM @var{x})
-Return non-zero iff @var{x} is an immediate object.
-@end deftypefn
-
-@deftypefn Macro int SCM_NIMP (SCM @var{x})
-Return non-zero iff @var{x} is a non-immediate object. This is the
-exact complement of @code{SCM_IMP}, above.
-@end deftypefn
-
-Note that for versions of Guile prior to 1.4 it was necessary to use the
-@code{SCM_NIMP} macro before calling a finer-grained predicate to
-determine @var{x}'s type, such as @code{SCM_CONSP} or
-@code{SCM_VECTORP}. This is no longer required: the definitions of all
-Guile type predicates now include a call to @code{SCM_NIMP} where
-necessary.
-
-
-@node Immediate Datatypes
-@subsection Immediate Datatypes
-
-The following datatypes are immediate values; that is, they fit entirely
-within an @code{SCM} value. The @code{SCM_IMP} and @code{SCM_NIMP}
-macros will distinguish these from non-immediates; see @ref{Immediates
-vs Non-immediates} for an explanation of the distinction.
-
-Note that the type predicates for immediate values work correctly on any
-@code{SCM} value; you do not need to call @code{SCM_IMP} first, to
-establish that a value is immediate.
-
-@menu
-* Integer Data::
-* Character Data::
-* Boolean Data::
-* Unique Values::
-@end menu
-
-@node Integer Data
-@subsubsection Integers
-
-Here are functions for operating on small integers, that fit within an
-@code{SCM}. Such integers are called @dfn{immediate numbers}, or
-@dfn{INUMs}. In general, INUMs occupy all but two bits of an
-@code{SCM}.
-
-Bignums and floating-point numbers are non-immediate objects, and have
-their own, separate accessors. The functions here will not work on
-them. This is not as much of a problem as you might think, however,
-because the system never constructs bignums that could fit in an INUM,
-and never uses floating point values for exact integers.
-
-@deftypefn Macro int SCM_INUMP (SCM @var{x})
-Return non-zero iff @var{x} is a small integer value.
-@end deftypefn
-
-@deftypefn Macro int SCM_NINUMP (SCM @var{x})
-The complement of SCM_INUMP.
-@end deftypefn
-
-@deftypefn Macro int SCM_INUM (SCM @var{x})
-Return the value of @var{x} as an ordinary, C integer. If @var{x}
-is not an INUM, the result is undefined.
-@end deftypefn
-
-@deftypefn Macro SCM SCM_MAKINUM (int @var{i})
-Given a C integer @var{i}, return its representation as an @code{SCM}.
-This function does not check for overflow.
-@end deftypefn
-
-
-@node Character Data
-@subsubsection Characters
-
-Here are functions for operating on characters.
-
-@deftypefn Macro int SCM_CHARP (SCM @var{x})
-Return non-zero iff @var{x} is a character value.
-@end deftypefn
-
-@deftypefn Macro {unsigned int} SCM_CHAR (SCM @var{x})
-Return the value of @code{x} as a C character. If @var{x} is not a
-Scheme character, the result is undefined.
-@end deftypefn
-
-@deftypefn Macro SCM SCM_MAKE_CHAR (int @var{c})
-Given a C character @var{c}, return its representation as a Scheme
-character value.
-@end deftypefn
-
-
-@node Boolean Data
-@subsubsection Booleans
-
-Here are functions and macros for operating on booleans.
-
-@deftypefn Macro SCM SCM_BOOL_T
-@deftypefnx Macro SCM SCM_BOOL_F
-The Scheme true and false values.
-@end deftypefn
-
-@deftypefn Macro int SCM_NFALSEP (@var{x})
-Convert the Scheme boolean value to a C boolean. Since every object in
-Scheme except @code{#f} is true, this amounts to comparing @var{x} to
-@code{#f}; hence the name.
-@c Noel feels a chill here.
-@end deftypefn
-
-@deftypefn Macro SCM SCM_BOOL_NOT (@var{x})
-Return the boolean inverse of @var{x}. If @var{x} is not a
-Scheme boolean, the result is undefined.
-@end deftypefn
-
-
-@node Unique Values
-@subsubsection Unique Values
-
-The immediate values that are neither small integers, characters, nor
-booleans are all unique values --- that is, datatypes with only one
-instance.
-
-@deftypefn Macro SCM SCM_EOL
-The Scheme empty list object, or ``End Of List'' object, usually written
-in Scheme as @code{'()}.
-@end deftypefn
-
-@deftypefn Macro SCM SCM_EOF_VAL
-The Scheme end-of-file value. It has no standard written
-representation, for obvious reasons.
-@end deftypefn
-
-@deftypefn Macro SCM SCM_UNSPECIFIED
-The value returned by expressions which the Scheme standard says return
-an ``unspecified'' value.
-
-This is sort of a weirdly literal way to take things, but the standard
-read-eval-print loop prints nothing when the expression returns this
-value, so it's not a bad idea to return this when you can't think of
-anything else helpful.
-@end deftypefn
-
-@deftypefn Macro SCM SCM_UNDEFINED
-The ``undefined'' value. Its most important property is that is not
-equal to any valid Scheme value. This is put to various internal uses
-by C code interacting with Guile.
-
-For example, when you write a C function that is callable from Scheme
-and which takes optional arguments, the interpreter passes
-@code{SCM_UNDEFINED} for any arguments you did not receive.
-
-We also use this to mark unbound variables.
-@end deftypefn
-
-@deftypefn Macro int SCM_UNBNDP (SCM @var{x})
-Return true if @var{x} is @code{SCM_UNDEFINED}. Apply this to a
-symbol's value to see if it has a binding as a global variable.
-@end deftypefn
-
-
-@node Non-immediate Datatypes
-@subsection Non-immediate Datatypes
-
-A non-immediate datatype is one which lives in the heap, either because
-it cannot fit entirely within a @code{SCM} word, or because it denotes a
-specific storage location (in the nomenclature of the Revised^5 Report
-on Scheme).
-
-The @code{SCM_IMP} and @code{SCM_NIMP} macros will distinguish these
-from immediates; see @ref{Immediates vs Non-immediates}.
-
-Given a cell, Guile distinguishes between pairs and other non-immediate
-types by storing special @dfn{tag} values in a non-pair cell's car, that
-cannot appear in normal pairs. A cell with a non-tag value in its car
-is an ordinary pair. The type of a cell with a tag in its car depends
-on the tag; the non-immediate type predicates test this value. If a tag
-value appears elsewhere (in a vector, for example), the heap may become
-corrupted.
-
-Note how the type information for a non-immediate object is split
-between the @code{SCM} word and the cell that the @code{SCM} word points
-to. The @code{SCM} word itself only indicates that the object is
-non-immediate --- in other words stored in a heap cell. The tag stored
-in the first word of the heap cell indicates more precisely the type of
-that object.
-
-The type predicates for non-immediate values work correctly on any
-@code{SCM} value; you do not need to call @code{SCM_NIMP} first, to
-establish that a value is non-immediate.
-
-@menu
-* Pair Data::
-* Vector Data::
-* Procedures::
-* Closures::
-* Subrs::
-* Port Data::
-@end menu
-
-
-@node Pair Data
-@subsubsection Pairs
-
-Pairs are the essential building block of list structure in Scheme. A
-pair object has two fields, called the @dfn{car} and the @dfn{cdr}.
-
-It is conventional for a pair's @sc{car} to contain an element of a
-list, and the @sc{cdr} to point to the next pair in the list, or to
-contain @code{SCM_EOL}, indicating the end of the list. Thus, a set of
-pairs chained through their @sc{cdr}s constitutes a singly-linked list.
-Scheme and libguile define many functions which operate on lists
-constructed in this fashion, so although lists chained through the
-@sc{car}s of pairs will work fine too, they may be less convenient to
-manipulate, and receive less support from the community.
-
-Guile implements pairs by mapping the @sc{car} and @sc{cdr} of a pair
-directly into the two words of the cell.
-
-
-@deftypefn Macro int SCM_CONSP (SCM @var{x})
-Return non-zero iff @var{x} is a Scheme pair object.
-@end deftypefn
-
-@deftypefn Macro int SCM_NCONSP (SCM @var{x})
-The complement of SCM_CONSP.
-@end deftypefn
-
-@deftypefun SCM scm_cons (SCM @var{car}, SCM @var{cdr})
-Allocate (``CONStruct'') a new pair, with @var{car} and @var{cdr} as its
-contents.
-@end deftypefun
-
-The macros below perform no type checking. The results are undefined if
-@var{cell} is an immediate. However, since all non-immediate Guile
-objects are constructed from cells, and these macros simply return the
-first element of a cell, they actually can be useful on datatypes other
-than pairs. (Of course, it is not very modular to use them outside of
-the code which implements that datatype.)
-
-@deftypefn Macro SCM SCM_CAR (SCM @var{cell})
-Return the @sc{car}, or first field, of @var{cell}.
-@end deftypefn
-
-@deftypefn Macro SCM SCM_CDR (SCM @var{cell})
-Return the @sc{cdr}, or second field, of @var{cell}.
-@end deftypefn
-
-@deftypefn Macro void SCM_SETCAR (SCM @var{cell}, SCM @var{x})
-Set the @sc{car} of @var{cell} to @var{x}.
-@end deftypefn
-
-@deftypefn Macro void SCM_SETCDR (SCM @var{cell}, SCM @var{x})
-Set the @sc{cdr} of @var{cell} to @var{x}.
-@end deftypefn
-
-@deftypefn Macro SCM SCM_CAAR (SCM @var{cell})
-@deftypefnx Macro SCM SCM_CADR (SCM @var{cell})
-@deftypefnx Macro SCM SCM_CDAR (SCM @var{cell}) @dots{}
-@deftypefnx Macro SCM SCM_CDDDDR (SCM @var{cell})
-Return the @sc{car} of the @sc{car} of @var{cell}, the @sc{car} of the
-@sc{cdr} of @var{cell}, @i{et cetera}.
-@end deftypefn
-
-
-@node Vector Data
-@subsubsection Vectors, Strings, and Symbols
-
-Vectors, strings, and symbols have some properties in common. They all
-have a length, and they all have an array of elements. In the case of a
-vector, the elements are @code{SCM} values; in the case of a string or
-symbol, the elements are characters.
-
-All these types store their length (along with some tagging bits) in the
-@sc{car} of their header cell, and store a pointer to the elements in
-their @sc{cdr}. Thus, the @code{SCM_CAR} and @code{SCM_CDR} macros
-are (somewhat) meaningful when applied to these datatypes.
-
-@deftypefn Macro int SCM_VECTORP (SCM @var{x})
-Return non-zero iff @var{x} is a vector.
-@end deftypefn
-
-@deftypefn Macro int SCM_STRINGP (SCM @var{x})
-Return non-zero iff @var{x} is a string.
-@end deftypefn
-
-@deftypefn Macro int SCM_SYMBOLP (SCM @var{x})
-Return non-zero iff @var{x} is a symbol.
-@end deftypefn
-
-@deftypefn Macro int SCM_VECTOR_LENGTH (SCM @var{x})
-@deftypefnx Macro int SCM_STRING_LENGTH (SCM @var{x})
-@deftypefnx Macro int SCM_SYMBOL_LENGTH (SCM @var{x})
-Return the length of the object @var{x}. The result is undefined if
-@var{x} is not a vector, string, or symbol, respectively.
-@end deftypefn
-
-@deftypefn Macro {SCM *} SCM_VECTOR_BASE (SCM @var{x})
-Return a pointer to the array of elements of the vector @var{x}.
-The result is undefined if @var{x} is not a vector.
-@end deftypefn
-
-@deftypefn Macro {char *} SCM_STRING_CHARS (SCM @var{x})
-@deftypefnx Macro {char *} SCM_SYMBOL_CHARS (SCM @var{x})
-Return a pointer to the characters of @var{x}. The result is undefined
-if @var{x} is not a symbol or string, respectively.
-@end deftypefn
-
-There are also a few magic values stuffed into memory before a symbol's
-characters, but you don't want to know about those. What cruft!
-
-
-@node Procedures
-@subsubsection Procedures
-
-Guile provides two kinds of procedures: @dfn{closures}, which are the
-result of evaluating a @code{lambda} expression, and @dfn{subrs}, which
-are C functions packaged up as Scheme objects, to make them available to
-Scheme programmers.
-
-(There are actually other sorts of procedures: compiled closures, and
-continuations; see the source code for details about them.)
-
-@deftypefun SCM scm_procedure_p (SCM @var{x})
-Return @code{SCM_BOOL_T} iff @var{x} is a Scheme procedure object, of
-any sort. Otherwise, return @code{SCM_BOOL_F}.
-@end deftypefun
-
-
-@node Closures
-@subsubsection Closures
-
-[FIXME: this needs to be further subbed, but texinfo has no subsubsub]
-
-A closure is a procedure object, generated as the value of a
-@code{lambda} expression in Scheme. The representation of a closure is
-straightforward --- it contains a pointer to the code of the lambda
-expression from which it was created, and a pointer to the environment
-it closes over.
-
-In Guile, each closure also has a property list, allowing the system to
-store information about the closure. I'm not sure what this is used for
-at the moment --- the debugger, maybe?
-
-@deftypefn Macro int SCM_CLOSUREP (SCM @var{x})
-Return non-zero iff @var{x} is a closure.
-@end deftypefn
-
-@deftypefn Macro SCM SCM_PROCPROPS (SCM @var{x})
-Return the property list of the closure @var{x}. The results are
-undefined if @var{x} is not a closure.
-@end deftypefn
-
-@deftypefn Macro void SCM_SETPROCPROPS (SCM @var{x}, SCM @var{p})
-Set the property list of the closure @var{x} to @var{p}. The results
-are undefined if @var{x} is not a closure.
-@end deftypefn
-
-@deftypefn Macro SCM SCM_CODE (SCM @var{x})
-Return the code of the closure @var{x}. The result is undefined if
-@var{x} is not a closure.
-
-This function should probably only be used internally by the
-interpreter, since the representation of the code is intimately
-connected with the interpreter's implementation.
-@end deftypefn
-
-@deftypefn Macro SCM SCM_ENV (SCM @var{x})
-Return the environment enclosed by @var{x}.
-The result is undefined if @var{x} is not a closure.
-
-This function should probably only be used internally by the
-interpreter, since the representation of the environment is intimately
-connected with the interpreter's implementation.
-@end deftypefn
-
-
-@node Subrs
-@subsubsection Subrs
-
-[FIXME: this needs to be further subbed, but texinfo has no subsubsub]
-
-A subr is a pointer to a C function, packaged up as a Scheme object to
-make it callable by Scheme code. In addition to the function pointer,
-the subr also contains a pointer to the name of the function, and
-information about the number of arguments accepted by the C function, for
-the sake of error checking.
-
-There is no single type predicate macro that recognizes subrs, as
-distinct from other kinds of procedures. The closest thing is
-@code{scm_procedure_p}; see @ref{Procedures}.
-
-@deftypefn Macro {char *} SCM_SNAME (@var{x})
-Return the name of the subr @var{x}. The result is undefined if
-@var{x} is not a subr.
-@end deftypefn
-
-@deftypefun SCM scm_make_gsubr (char *@var{name}, int @var{req}, int @var{opt}, int @var{rest}, SCM (*@var{function})())
-Create a new subr object named @var{name}, based on the C function
-@var{function}, make it visible to Scheme the value of as a global
-variable named @var{name}, and return the subr object.
-
-The subr object accepts @var{req} required arguments, @var{opt} optional
-arguments, and a @var{rest} argument iff @var{rest} is non-zero. The C
-function @var{function} should accept @code{@var{req} + @var{opt}}
-arguments, or @code{@var{req} + @var{opt} + 1} arguments if @code{rest}
-is non-zero.
-
-When a subr object is applied, it must be applied to at least @var{req}
-arguments, or else Guile signals an error. @var{function} receives the
-subr's first @var{req} arguments as its first @var{req} arguments. If
-there are fewer than @var{opt} arguments remaining, then @var{function}
-receives the value @code{SCM_UNDEFINED} for any missing optional
-arguments. If @var{rst} is non-zero, then any arguments after the first
-@code{@var{req} + @var{opt}} are packaged up as a list as passed as
-@var{function}'s last argument.
-
-Note that subrs can actually only accept a predefined set of
-combinations of required, optional, and rest arguments. For example, a
-subr can take one required argument, or one required and one optional
-argument, but a subr can't take one required and two optional arguments.
-It's bizarre, but that's the way the interpreter was written. If the
-arguments to @code{scm_make_gsubr} do not fit one of the predefined
-patterns, then @code{scm_make_gsubr} will return a compiled closure
-object instead of a subr object.
-@end deftypefun
-
-
-@node Port Data
-@subsubsection Ports
-
-Haven't written this yet, 'cos I don't understand ports yet.
-
-
-@node Signalling Type Errors
-@subsection Signalling Type Errors
-
-Every function visible at the Scheme level should aggressively check the
-types of its arguments, to avoid misinterpreting a value, and perhaps
-causing a segmentation fault. Guile provides some macros to make this
-easier.
-
-@deftypefn Macro void SCM_ASSERT (int @var{test}, SCM @var{obj}, unsigned int @var{position}, const char *@var{subr})
-If @var{test} is zero, signal a ``wrong type argument'' error,
-attributed to the subroutine named @var{subr}, operating on the value
-@var{obj}, which is the @var{position}'th argument of @var{subr}.
-@end deftypefn
-
-@deftypefn Macro int SCM_ARG1
-@deftypefnx Macro int SCM_ARG2
-@deftypefnx Macro int SCM_ARG3
-@deftypefnx Macro int SCM_ARG4
-@deftypefnx Macro int SCM_ARG5
-@deftypefnx Macro int SCM_ARG6
-@deftypefnx Macro int SCM_ARG7
-One of the above values can be used for @var{position} to indicate the
-number of the argument of @var{subr} which is being checked.
-Alternatively, a positive integer number can be used, which allows to
-check arguments after the seventh. However, for parameter numbers up to
-seven it is preferable to use @code{SCM_ARGN} instead of the
-corresponding raw number, since it will make the code easier to
-understand.
-@end deftypefn
-
-@deftypefn Macro int SCM_ARGn
-Passing a value of zero or @code{SCM_ARGn} for @var{position} allows to
-leave it unspecified which argument's type is incorrect. Again,
-@code{SCM_ARGn} should be preferred over a raw zero constant.
-@end deftypefn
-
-
-@node Unpacking the SCM type
-@subsection Unpacking the SCM Type
-
-The previous sections have explained how @code{SCM} values can refer to
-immediate and non-immediate Scheme objects. For immediate objects, the
-complete object value is stored in the @code{SCM} word itself, while for
-non-immediates, the @code{SCM} word contains a pointer to a heap cell,
-and further information about the object in question is stored in that
-cell. This section describes how the @code{SCM} type is actually
-represented and used at the C level.
-
-In fact, there are two basic C data types to represent objects in Guile:
-
-@itemize @bullet
-@item
-@code{SCM} is the user level abstract C type that is used to represent
-all of Guile's Scheme objects, no matter what the Scheme object type is.
-No C operation except assignment is guaranteed to work with variables of
-type @code{SCM}, so you should only use macros and functions to work
-with @code{SCM} values. Values are converted between C data types and
-the @code{SCM} type with utility functions and macros.
-
-@item
-@code{scm_t_bits} is an integral data type that is guaranteed to be
-large enough to hold all information that is required to represent any
-Scheme object. While this data type is mostly used to implement Guile's
-internals, the use of this type is also necessary to write certain kinds
-of extensions to Guile.
-@end itemize
-
-@menu
-* Relationship between SCM and scm_t_bits::
-* Immediate objects::
-* Non-immediate objects::
-* Allocating Cells::
-* Heap Cell Type Information::
-* Accessing Cell Entries::
-* Basic Rules for Accessing Cell Entries::
-@end menu
-
-
-@node Relationship between SCM and scm_t_bits
-@subsubsection Relationship between @code{SCM} and @code{scm_t_bits}
-
-A variable of type @code{SCM} is guaranteed to hold a valid Scheme
-object. A variable of type @code{scm_t_bits}, on the other hand, may
-hold a representation of a @code{SCM} value as a C integral type, but
-may also hold any C value, even if it does not correspond to a valid
-Scheme object.
-
-For a variable @var{x} of type @code{SCM}, the Scheme object's type
-information is stored in a form that is not directly usable. To be able
-to work on the type encoding of the scheme value, the @code{SCM}
-variable has to be transformed into the corresponding representation as
-a @code{scm_t_bits} variable @var{y} by using the @code{SCM_UNPACK}
-macro. Once this has been done, the type of the scheme object @var{x}
-can be derived from the content of the bits of the @code{scm_t_bits}
-value @var{y}, in the way illustrated by the example earlier in this
-chapter (@pxref{Cheaper Pairs}). Conversely, a valid bit encoding of a
-Scheme value as a @code{scm_t_bits} variable can be transformed into the
-corresponding @code{SCM} value using the @code{SCM_PACK} macro.
-
-@deftypefn Macro scm_t_bits SCM_UNPACK (SCM @var{x})
-Transforms the @code{SCM} value @var{x} into its representation as an
-integral type. Only after applying @code{SCM_UNPACK} it is possible to
-access the bits and contents of the @code{SCM} value.
-@end deftypefn
-
-@deftypefn Macro SCM SCM_PACK (scm_t_bits @var{x})
-Takes a valid integral representation of a Scheme object and transforms
-it into its representation as a @code{SCM} value.
-@end deftypefn
-
-
-@node Immediate objects
-@subsubsection Immediate objects
-
-A Scheme object may either be an immediate, i.e. carrying all necessary
-information by itself, or it may contain a reference to a @dfn{cell}
-with additional information on the heap. Although in general it should
-be irrelevant for user code whether an object is an immediate or not,
-within Guile's own code the distinction is sometimes of importance.
-Thus, the following low level macro is provided:
-
-@deftypefn Macro int SCM_IMP (SCM @var{x})
-A Scheme object is an immediate if it fulfills the @code{SCM_IMP}
-predicate, otherwise it holds an encoded reference to a heap cell. The
-result of the predicate is delivered as a C style boolean value. User
-code and code that extends Guile should normally not be required to use
-this macro.
-@end deftypefn
-
-@noindent
-Summary:
-@itemize @bullet
-@item
-Given a Scheme object @var{x} of unknown type, check first
-with @code{SCM_IMP (@var{x})} if it is an immediate object.
-@item
-If so, all of the type and value information can be determined from the
-@code{scm_t_bits} value that is delivered by @code{SCM_UNPACK
-(@var{x})}.
-@end itemize
-
-
-@node Non-immediate objects
-@subsubsection Non-immediate objects
-
-A Scheme object of type @code{SCM} that does not fulfill the
-@code{SCM_IMP} predicate holds an encoded reference to a heap cell.
-This reference can be decoded to a C pointer to a heap cell using the
-@code{SCM2PTR} macro. The encoding of a pointer to a heap cell into a
-@code{SCM} value is done using the @code{PTR2SCM} macro.
-
-@c (FIXME:: this name should be changed)
-@deftypefn Macro (scm_t_cell *) SCM2PTR (SCM @var{x})
-Extract and return the heap cell pointer from a non-immediate @code{SCM}
-object @var{x}.
-@end deftypefn
-
-@c (FIXME:: this name should be changed)
-@deftypefn Macro SCM PTR2SCM (scm_t_cell * @var{x})
-Return a @code{SCM} value that encodes a reference to the heap cell
-pointer @var{x}.
-@end deftypefn
-
-Note that it is also possible to transform a non-immediate @code{SCM}
-value by using @code{SCM_UNPACK} into a @code{scm_t_bits} variable.
-However, the result of @code{SCM_UNPACK} may not be used as a pointer to
-a @code{scm_t_cell}: only @code{SCM2PTR} is guaranteed to transform a
-@code{SCM} object into a valid pointer to a heap cell. Also, it is not
-allowed to apply @code{PTR2SCM} to anything that is not a valid pointer
-to a heap cell.
-
-@noindent
-Summary:
-@itemize @bullet
-@item
-Only use @code{SCM2PTR} on @code{SCM} values for which @code{SCM_IMP} is
-false!
-@item
-Don't use @code{(scm_t_cell *) SCM_UNPACK (@var{x})}! Use @code{SCM2PTR
-(@var{x})} instead!
-@item
-Don't use @code{PTR2SCM} for anything but a cell pointer!
-@end itemize
-
-@node Allocating Cells
-@subsubsection Allocating Cells
-
-Guile provides both ordinary cells with two slots, and double cells
-with four slots. The following two function are the most primitive
-way to allocate such cells.
-
-If the caller intends to use it as a header for some other type, she
-must pass an appropriate magic value in @var{word_0}, to mark it as a
-member of that type, and pass whatever value as @var{word_1}, etc that
-the type expects. You should generally not need these functions,
-unless you are implementing a new datatype, and thoroughly understand
-the code in @code{<libguile/tags.h>}.
-
-If you just want to allocate pairs, use @code{scm_cons}.
-
-@deftypefn Function SCM scm_cell (scm_t_bits word_0, scm_t_bits word_1)
-Allocate a new cell, initialize the two slots with @var{word_0} and
-@var{word_1}, and return it.
-
-Note that @var{word_0} and @var{word_1} are of type @code{scm_t_bits}.
-If you want to pass a @code{SCM} object, you need to use
-@code{SCM_UNPACK}.
-@end deftypefn
-
-@deftypefn Function SCM scm_double_cell (scm_t_bits word_0, scm_t_bits word_1, scm_t_bits word_2, scm_t_bits word_3)
-Like @code{scm_cell}, but allocates a double cell with four
-slots.
-@end deftypefn
-
-@node Heap Cell Type Information
-@subsubsection Heap Cell Type Information
-
-Heap cells contain a number of entries, each of which is either a scheme
-object of type @code{SCM} or a raw C value of type @code{scm_t_bits}.
-Which of the cell entries contain Scheme objects and which contain raw C
-values is determined by the first entry of the cell, which holds the
-cell type information.
-
-@deftypefn Macro scm_t_bits SCM_CELL_TYPE (SCM @var{x})
-For a non-immediate Scheme object @var{x}, deliver the content of the
-first entry of the heap cell referenced by @var{x}. This value holds
-the information about the cell type.
-@end deftypefn
-
-@deftypefn Macro void SCM_SET_CELL_TYPE (SCM @var{x}, scm_t_bits @var{t})
-For a non-immediate Scheme object @var{x}, write the value @var{t} into
-the first entry of the heap cell referenced by @var{x}. The value
-@var{t} must hold a valid cell type.
-@end deftypefn
-
-
-@node Accessing Cell Entries
-@subsubsection Accessing Cell Entries
-
-For a non-immediate Scheme object @var{x}, the object type can be
-determined by reading the cell type entry using the @code{SCM_CELL_TYPE}
-macro. For each different type of cell it is known which cell entries
-hold Scheme objects and which cell entries hold raw C data. To access
-the different cell entries appropriately, the following macros are
-provided.
-
-@deftypefn Macro scm_t_bits SCM_CELL_WORD (SCM @var{x}, unsigned int @var{n})
-Deliver the cell entry @var{n} of the heap cell referenced by the
-non-immediate Scheme object @var{x} as raw data. It is illegal, to
-access cell entries that hold Scheme objects by using these macros. For
-convenience, the following macros are also provided.
-@itemize @bullet
-@item
-SCM_CELL_WORD_0 (@var{x}) @result{} SCM_CELL_WORD (@var{x}, 0)
-@item
-SCM_CELL_WORD_1 (@var{x}) @result{} SCM_CELL_WORD (@var{x}, 1)
-@item
-@dots{}
-@item
-SCM_CELL_WORD_@var{n} (@var{x}) @result{} SCM_CELL_WORD (@var{x}, @var{n})
-@end itemize
-@end deftypefn
-
-@deftypefn Macro SCM SCM_CELL_OBJECT (SCM @var{x}, unsigned int @var{n})
-Deliver the cell entry @var{n} of the heap cell referenced by the
-non-immediate Scheme object @var{x} as a Scheme object. It is illegal,
-to access cell entries that do not hold Scheme objects by using these
-macros. For convenience, the following macros are also provided.
-@itemize @bullet
-@item
-SCM_CELL_OBJECT_0 (@var{x}) @result{} SCM_CELL_OBJECT (@var{x}, 0)
-@item
-SCM_CELL_OBJECT_1 (@var{x}) @result{} SCM_CELL_OBJECT (@var{x}, 1)
-@item
-@dots{}
-@item
-SCM_CELL_OBJECT_@var{n} (@var{x}) @result{} SCM_CELL_OBJECT (@var{x},
-@var{n})
-@end itemize
-@end deftypefn
-
-@deftypefn Macro void SCM_SET_CELL_WORD (SCM @var{x}, unsigned int @var{n}, scm_t_bits @var{w})
-Write the raw C value @var{w} into entry number @var{n} of the heap cell
-referenced by the non-immediate Scheme value @var{x}. Values that are
-written into cells this way may only be read from the cells using the
-@code{SCM_CELL_WORD} macros or, in case cell entry 0 is written, using
-the @code{SCM_CELL_TYPE} macro. For the special case of cell entry 0 it
-has to be made sure that @var{w} contains a cell type information which
-does not describe a Scheme object. For convenience, the following
-macros are also provided.
-@itemize @bullet
-@item
-SCM_SET_CELL_WORD_0 (@var{x}, @var{w}) @result{} SCM_SET_CELL_WORD
-(@var{x}, 0, @var{w})
-@item
-SCM_SET_CELL_WORD_1 (@var{x}, @var{w}) @result{} SCM_SET_CELL_WORD
-(@var{x}, 1, @var{w})
-@item
-@dots{}
-@item
-SCM_SET_CELL_WORD_@var{n} (@var{x}, @var{w}) @result{} SCM_SET_CELL_WORD
-(@var{x}, @var{n}, @var{w})
-@end itemize
-@end deftypefn
-
-@deftypefn Macro void SCM_SET_CELL_OBJECT (SCM @var{x}, unsigned int @var{n}, SCM @var{o})
-Write the Scheme object @var{o} into entry number @var{n} of the heap
-cell referenced by the non-immediate Scheme value @var{x}. Values that
-are written into cells this way may only be read from the cells using
-the @code{SCM_CELL_OBJECT} macros or, in case cell entry 0 is written,
-using the @code{SCM_CELL_TYPE} macro. For the special case of cell
-entry 0 the writing of a Scheme object into this cell is only allowed
-if the cell forms a Scheme pair. For convenience, the following macros
-are also provided.
-@itemize @bullet
-@item
-SCM_SET_CELL_OBJECT_0 (@var{x}, @var{o}) @result{} SCM_SET_CELL_OBJECT
-(@var{x}, 0, @var{o})
-@item
-SCM_SET_CELL_OBJECT_1 (@var{x}, @var{o}) @result{} SCM_SET_CELL_OBJECT
-(@var{x}, 1, @var{o})
-@item
-@dots{}
-@item
-SCM_SET_CELL_OBJECT_@var{n} (@var{x}, @var{o}) @result{}
-SCM_SET_CELL_OBJECT (@var{x}, @var{n}, @var{o})
-@end itemize
-@end deftypefn
-
-@noindent
-Summary:
-@itemize @bullet
-@item
-For a non-immediate Scheme object @var{x} of unknown type, get the type
-information by using @code{SCM_CELL_TYPE (@var{x})}.
-@item
-As soon as the cell type information is available, only use the
-appropriate access methods to read and write data to the different cell
-entries.
-@end itemize
-
-
-@node Basic Rules for Accessing Cell Entries
-@subsubsection Basic Rules for Accessing Cell Entries
-
-For each cell type it is generally up to the implementation of that type
-which of the corresponding cell entries hold Scheme objects and which
-hold raw C values. However, there is one basic rule that has to be
-followed: Scheme pairs consist of exactly two cell entries, which both
-contain Scheme objects. Further, a cell which contains a Scheme object
-in it first entry has to be a Scheme pair. In other words, it is not
-allowed to store a Scheme object in the first cell entry and a non
-Scheme object in the second cell entry.
-
-@c Fixme:shouldn't this rather be SCM_PAIRP / SCM_PAIR_P ?
-@deftypefn Macro int SCM_CONSP (SCM @var{x})
-Determine, whether the Scheme object @var{x} is a Scheme pair,
-i.e. whether @var{x} references a heap cell consisting of exactly two
-entries, where both entries contain a Scheme object. In this case, both
-entries will have to be accessed using the @code{SCM_CELL_OBJECT}
-macros. On the contrary, if the @code{SCM_CONSP} predicate is not
-fulfilled, the first entry of the Scheme cell is guaranteed not to be a
-Scheme value and thus the first cell entry must be accessed using the
-@code{SCM_CELL_WORD_0} macro.
-@end deftypefn
-
-
-@node Defining New Types (Smobs)
-@section Defining New Types (Smobs)
-
-@dfn{Smobs} are Guile's mechanism for adding new non-immediate types to
-the system.@footnote{The term ``smob'' was coined by Aubrey Jaffer, who
-says it comes from ``small object'', referring to the fact that only the
-@sc{cdr} and part of the @sc{car} of a smob's cell are available for
-use.} To define a new smob type, the programmer provides Guile with
-some essential information about the type --- how to print it, how to
-garbage collect it, and so on --- and Guile returns a fresh type tag for
-use in the first word of new cells. The programmer can then use
-@code{scm_c_define_gsubr} to make a set of C functions that create and
-operate on these objects visible to Scheme code.
-
-(You can find a complete version of the example code used in this
-section in the Guile distribution, in @file{doc/example-smob}. That
-directory includes a makefile and a suitable @code{main} function, so
-you can build a complete interactive Guile shell, extended with the
-datatypes described here.)
-
-@menu
-* Describing a New Type::
-* Creating Instances::
-* Type checking::
-* Garbage Collecting Smobs::
-* A Common Mistake In Allocating Smobs::
-* Garbage Collecting Simple Smobs::
-* A Complete Example::
-@end menu
-
-@node Describing a New Type
-@subsection Describing a New Type
-
-To define a new type, the programmer must write four functions to
-manage instances of the type:
-
-@table @code
-@item mark
-Guile will apply this function to each instance of the new type it
-encounters during garbage collection. This function is responsible for
-telling the collector about any other non-immediate objects the object
-refers to. The default smob mark function is to not mark any data.
-@xref{Garbage Collecting Smobs}, for more details.
-
-@item free
-Guile will apply this function to each instance of the new type it could
-not find any live pointers to. The function should release all
-resources held by the object and return the number of bytes released.
-This is analogous to the Java finalization method-- it is invoked at
-an unspecified time (when garbage collection occurs) after the object
-is dead. The default free function frees the smob data (if the size
-of the struct passed to @code{scm_make_smob_type} is non-zero) using
-@code{scm_gc_free}. @xref{Garbage Collecting Smobs}, for more
-details.
-
-@item print
-@c GJB:FIXME:: @var{exp} and @var{port} need to refer to a prototype of
-@c the print function.... where is that, or where should it go?
-Guile will apply this function to each instance of the new type to print
-the value, as for @code{display} or @code{write}. The function should
-write a printed representation of @var{exp} on @var{port}, in accordance
-with the parameters in @var{pstate}. (For more information on print
-states, see @ref{Port Data}.) The default print function prints
-@code{#<NAME ADDRESS>} where @code{NAME} is the first argument passed to
-@code{scm_make_smob_type}.
-
-@item equalp
-If Scheme code asks the @code{equal?} function to compare two instances
-of the same smob type, Guile calls this function. It should return
-@code{SCM_BOOL_T} if @var{a} and @var{b} should be considered
-@code{equal?}, or @code{SCM_BOOL_F} otherwise. If @code{equalp} is
-@code{NULL}, @code{equal?} will assume that two instances of this type are
-never @code{equal?} unless they are @code{eq?}.
-
-@end table
-
-To actually register the new smob type, call @code{scm_make_smob_type}:
-
-@deftypefun scm_t_bits scm_make_smob_type (const char *name, size_t size)
-This function implements the standard way of adding a new smob type,
-named @var{name}, with instance size @var{size}, to the system. The
-return value is a tag that is used in creating instances of the type.
-If @var{size} is 0, then no memory will be allocated when instances of
-the smob are created, and nothing will be freed by the default free
-function. Default values are provided for mark, free, print, and,
-equalp, as described above. If you want to customize any of these
-functions, the call to @code{scm_make_smob_type} should be immediately
-followed by calls to one or several of @code{scm_set_smob_mark},
-@code{scm_set_smob_free}, @code{scm_set_smob_print}, and/or
-@code{scm_set_smob_equalp}.
-@end deftypefun
-
-Each of the below @code{scm_set_smob_XXX} functions registers a smob
-special function for a given type. Each function is intended to be used
-only zero or one time per type, and the call should be placed
-immediately following the call to @code{scm_make_smob_type}.
-
-@deftypefun void scm_set_smob_mark (scm_t_bits tc, SCM (*mark) (SCM))
-This function sets the smob marking procedure for the smob type specified by
-the tag @var{tc}. @var{tc} is the tag returned by @code{scm_make_smob_type}.
-@end deftypefun
-
-@deftypefun void scm_set_smob_free (scm_t_bits tc, size_t (*free) (SCM))
-This function sets the smob freeing procedure for the smob type specified by
-the tag @var{tc}. @var{tc} is the tag returned by @code{scm_make_smob_type}.
-@end deftypefun
-
-@deftypefun void scm_set_smob_print (scm_t_bits tc, int (*print) (SCM, SCM, scm_print_state*))
-This function sets the smob printing procedure for the smob type specified by
-the tag @var{tc}. @var{tc} is the tag returned by @code{scm_make_smob_type}.
-@end deftypefun
-
-@deftypefun void scm_set_smob_equalp (scm_t_bits tc, SCM (*equalp) (SCM, SCM))
-This function sets the smob equality-testing predicate for the smob type specified by
-the tag @var{tc}. @var{tc} is the tag returned by @code{scm_make_smob_type}.
-@end deftypefun
-
-In versions 1.4 and earlier, there was another way of creating smob
-types, using @code{scm_make_smob_type_mfpe}. This function is now
-deprecated and will be removed in a future version of Guile. You should
-use the mechanism described above for new code, and change old code not
-to use deprecated features.
-
-Instead of using @code{scm_make_smob_type} and calling each of the
-individual @code{scm_set_smob_XXX} functions to register each special
-function independently, you could use @code{scm_make_smob_type_mfpe} to
-register all of the special functions at once as you create the smob
-type
-
-@deftypefun long scm_make_smob_type_mfpe(const char *name, size_t size, SCM (*mark) (SCM), size_t (*free) (SCM), int (*print) (SCM, SCM, scm_print_state*), SCM (*equalp) (SCM, SCM))
-This function invokes @code{scm_make_smob_type} on its first two arguments
-to add a new smob type named @var{name}, with instance size @var{size} to the system.
-It also registers the @var{mark}, @var{free}, @var{print}, @var{equalp} smob
-special functions for that new type. Any of these parameters can be @code{NULL}
-to have that special function use the default behavior for guile.
-The return value is a tag that is used in creating instances of the type. If @var{size}
-is 0, then no memory will be allocated when instances of the smob are created, and
-nothing will be freed by the default free function.
-@end deftypefun
-
-For example, here is how one might declare and register a new type
-representing eight-bit gray-scale images:
-
-@example
-#include <libguile.h>
-
-static scm_t_bits image_tag;
-
-void
-init_image_type (void)
-@{
- image_tag = scm_make_smob_type ("image", sizeof (struct image));
- scm_set_smob_mark (image_tag, mark_image);
- scm_set_smob_free (image_tag, free_image);
- scm_set_smob_print (image_tag, print_image);
-@}
-@end example
-
-
-@node Creating Instances
-@subsection Creating Instances
-
-Like other non-immediate types, smobs start with a cell whose first word
-contains typing information, and whose remaining words are free for any
-use.
-
-After the header word containing the type code, smobs can have either
-one, two or three additional words of data. These words store either a
-pointer to the internal C structure holding the smob-specific data, or
-the smob data itself. To create an instance of a smob type following
-these standards, you should use @code{SCM_NEWSMOB}, @code{SCM_NEWSMOB2}
-or @code{SCM_NEWSMOB3}:@footnote{The @code{SCM_NEWSMOB2} and
-@code{SCM_NEWSMOB3} variants will allocate double cells and thus use
-twice as much memory as smobs created by @code{SCM_NEWSMOB}.}
-
-@deftypefn Macro void SCM_NEWSMOB(SCM value, scm_t_bits tag, void *data)
-@deftypefnx Macro void SCM_NEWSMOB2(SCM value, scm_t_bits tag, void *data1, void *data2)
-@deftypefnx Macro void SCM_NEWSMOB3(SCM value, scm_t_bits tag, void *data1, void *data2, void *data3)
-Make @var{value} contain a smob instance of the type with tag @var{tag}
-and smob data @var{data} (or @var{data1}, @var{data2}, and @var{data3}).
-@var{value} must be previously declared as C type @code{SCM}.
-@end deftypefn
-
-Since it is often the case (e.g., in smob constructors) that you will
-create a smob instance and return it, there is also a slightly specialized
-macro for this situation:
-
-@deftypefn Macro fn_returns SCM_RETURN_NEWSMOB(scm_t_bits tag, void *data)
-@deftypefnx Macro fn_returns SCM_RETURN_NEWSMOB2(scm_t_bits tag, void *data1, void *data2)
-@deftypefnx Macro fn_returns SCM_RETURN_NEWSMOB3(scm_t_bits tag, void *data1, void *data2, void *data3)
-This macro expands to a block of code that creates a smob instance of
-the type with tag @var{tag} and smob data @var{data} (or @var{data1},
-@var{data2}, and @var{data3}), and causes the surrounding function to
-return that @code{SCM} value. It should be the last piece of code in
-a block.
-@end deftypefn
-
-Guile provides some functions for managing memory, which are often
-helpful when implementing smobs. @xref{Memory Blocks}.
-
-
-Continuing the above example, if the global variable @code{image_tag}
-contains a tag returned by @code{scm_make_smob_type}, here is how we
-could construct a smob whose @sc{cdr} contains a pointer to a freshly
-allocated @code{struct image}:
-
-@example
-struct image @{
- int width, height;
- char *pixels;
-
- /* The name of this image */
- SCM name;
-
- /* A function to call when this image is
- modified, e.g., to update the screen,
- or SCM_BOOL_F if no action necessary */
- SCM update_func;
-@};
-
-SCM
-make_image (SCM name, SCM s_width, SCM s_height)
-@{
- struct image *image;
- int width, height;
-
- SCM_ASSERT (SCM_STRINGP (name), name, SCM_ARG1, "make-image");
- SCM_ASSERT (SCM_INUMP (s_width), s_width, SCM_ARG2, "make-image");
- SCM_ASSERT (SCM_INUMP (s_height), s_height, SCM_ARG3, "make-image");
-
- width = SCM_INUM (s_width);
- height = SCM_INUM (s_height);
-
- image = (struct image *) scm_gc_malloc (sizeof (struct image), "image");
- image->width = width;
- image->height = height;
- image->pixels = scm_gc_malloc (width * height, "image pixels");
- image->name = name;
- image->update_func = SCM_BOOL_F;
-
- SCM_RETURN_NEWSMOB (image_tag, image);
-@}
-@end example
-
-
-@node Type checking
-@subsection Type checking
-
-Functions that operate on smobs should aggressively check the types of
-their arguments, to avoid misinterpreting some other datatype as a smob,
-and perhaps causing a segmentation fault. Fortunately, this is pretty
-simple to do. The function need only verify that its argument is a
-non-immediate, whose first word is the type tag returned by
-@code{scm_make_smob_type}.
-
-For example, here is a simple function that operates on an image smob,
-and checks the type of its argument. We also present an expanded
-version of the @code{init_image_type} function, to make
-@code{clear_image} and the image constructor function @code{make_image}
-visible to Scheme code.
-
-@example
-SCM
-clear_image (SCM image_smob)
-@{
- int area;
- struct image *image;
-
- SCM_ASSERT (SCM_SMOB_PREDICATE (image_tag, image_smob),
- image_smob, SCM_ARG1, "clear-image");
-
- image = (struct image *) SCM_SMOB_DATA (image_smob);
- area = image->width * image->height;
- memset (image->pixels, 0, area);
-
- /* Invoke the image's update function. */
- if (image->update_func != SCM_BOOL_F)
- scm_apply (image->update_func, SCM_EOL, SCM_EOL);
-
- return SCM_UNSPECIFIED;
-@}
-
-
-void
-init_image_type (void)
-@{
- image_tag = scm_make_smob_type ("image", sizeof (struct image));
- scm_set_smob_mark (image_tag, mark_image);
- scm_set_smob_free (image_tag, free_image);
- scm_set_smob_print (image_tag, print_image);
-
- scm_c_define_gsubr ("clear-image", 1, 0, 0, clear_image);
- scm_c_define_gsubr ("make-image", 3, 0, 0, make_image);
-@}
-@end example
-
-@c GJB:FIXME:: should talk about guile-snarf somewhere!
-
-
-@node Garbage Collecting Smobs
-@subsection Garbage Collecting Smobs
-
-Once a smob has been released to the tender mercies of the Scheme
-system, it must be prepared to survive garbage collection. Guile calls
-the @code{mark} and @code{free} functions of the @code{scm_smobfuns}
-structure to manage this.
-
-As described before (@pxref{Conservative GC}), every object in the
-Scheme system has a @dfn{mark bit}, which the garbage collector uses to
-tell live objects from dead ones. When collection starts, every
-object's mark bit is clear. The collector traces pointers through the
-heap, starting from objects known to be live, and sets the mark bit on
-each object it encounters. When it can find no more unmarked objects,
-the collector walks all objects, live and dead, frees those whose mark
-bits are still clear, and clears the mark bit on the others.
-
-The two main portions of the collection are called the @dfn{mark phase},
-during which the collector marks live objects, and the @dfn{sweep
-phase}, during which the collector frees all unmarked objects.
-
-The mark bit of a smob lives in a special memory region. When the
-collector encounters a smob, it sets the smob's mark bit, and uses the
-smob's type tag to find the appropriate @code{mark} function for that
-smob: the one listed in that smob's @code{scm_smobfuns} structure. It
-then calls the @code{mark} function, passing it the smob as its only
-argument.
-
-The @code{mark} function is responsible for marking any other Scheme
-objects the smob refers to. If it does not do so, the objects' mark
-bits will still be clear when the collector begins to sweep, and the
-collector will free them. If this occurs, it will probably break, or at
-least confuse, any code operating on the smob; the smob's @code{SCM}
-values will have become dangling references.
-
-To mark an arbitrary Scheme object, the @code{mark} function may call
-this function:
-
-@deftypefun void scm_gc_mark (SCM @var{x})
-Mark the object @var{x}, and recurse on any objects @var{x} refers to.
-If @var{x}'s mark bit is already set, return immediately.
-@end deftypefun
-
-Thus, here is how we might write the @code{mark} function for the image
-smob type discussed above:
-
-@example
-@group
-SCM
-mark_image (SCM image_smob)
-@{
- /* Mark the image's name and update function. */
- struct image *image = (struct image *) SCM_SMOB_DATA (image_smob);
-
- scm_gc_mark (image->name);
- scm_gc_mark (image->update_func);
-
- return SCM_BOOL_F;
-@}
-@end group
-@end example
-
-Note that, even though the image's @code{update_func} could be an
-arbitrarily complex structure (representing a procedure and any values
-enclosed in its environment), @code{scm_gc_mark} will recurse as
-necessary to mark all its components. Because @code{scm_gc_mark} sets
-an object's mark bit before it recurses, it is not confused by
-circular structures.
-
-As an optimization, the collector will mark whatever value is returned
-by the @code{mark} function; this helps limit depth of recursion during
-the mark phase. Thus, the code above could also be written as:
-@example
-@group
-SCM
-mark_image (SCM image_smob)
-@{
- /* Mark the image's name and update function. */
- struct image *image = (struct image *) SCM_SMOB_DATA (image_smob);
-
- scm_gc_mark (image->name);
- return image->update_func;
-@}
-@end group
-@end example
-
-
-Finally, when the collector encounters an unmarked smob during the sweep
-phase, it uses the smob's tag to find the appropriate @code{free}
-function for the smob. It then calls the function, passing it the smob
-as its only argument.
-
-The @code{free} function must release any resources used by the smob.
-However, it need not free objects managed by the collector; the
-collector will take care of them. For historical reasons, the return
-type of the @code{free} function should be @code{size_t}, an unsigned
-integral type; the @code{free} function should always return zero.
-
-Here is how we might write the @code{free} function for the image smob
-type:
-@example
-size_t
-free_image (SCM image_smob)
-@{
- struct image *image = (struct image *) SCM_SMOB_DATA (image_smob);
-
- scm_gc_free (image->pixels, image->width * image->height, "image pixels");
- scm_gc_free (image, sizeof (struct image), "image");
-
- return 0;
-@}
-@end example
-
-During the sweep phase, the garbage collector will clear the mark bits
-on all live objects. The code which implements a smob need not do this
-itself.
-
-There is no way for smob code to be notified when collection is
-complete.
-
-It is usually a good idea to minimize the amount of processing done
-during garbage collection; keep @code{mark} and @code{free} functions
-very simple. Since collections occur at unpredictable times, it is easy
-for any unusual activity to interfere with normal code.
-
-
-@node A Common Mistake In Allocating Smobs, Garbage Collecting Simple Smobs, Garbage Collecting Smobs, Defining New Types (Smobs)
-@subsection A Common Mistake In Allocating Smobs
-
-When constructing new objects, you must be careful that the garbage
-collector can always find any new objects you allocate. For example,
-suppose we wrote the @code{make_image} function this way:
-
-@example
-SCM
-make_image (SCM name, SCM s_width, SCM s_height)
-@{
- struct image *image;
- SCM image_smob;
- int width, height;
-
- SCM_ASSERT (SCM_STRINGP (name), name, SCM_ARG1, "make-image");
- SCM_ASSERT (SCM_INUMP (s_width), s_width, SCM_ARG2, "make-image");
- SCM_ASSERT (SCM_INUMP (s_height), s_height, SCM_ARG3, "make-image");
-
- width = SCM_INUM (s_width);
- height = SCM_INUM (s_height);
-
- image = (struct image *) scm_gc_malloc (sizeof (struct image), "image");
- image->width = width;
- image->height = height;
- image->pixels = scm_gc_malloc (width * height, "image pixels");
-
- /* THESE TWO LINES HAVE CHANGED: */
- image->name = scm_string_copy (name);
- image->update_func = scm_c_define_gsubr (@dots{});
-
- SCM_NEWCELL (image_smob);
- SCM_SET_CELL_WORD_1 (image_smob, image);
- SCM_SET_CELL_TYPE (image_smob, image_tag);
-
- return image_smob;
-@}
-@end example
-
-This code is incorrect. The calls to @code{scm_string_copy} and
-@code{scm_c_define_gsubr} allocate fresh objects. Allocating any new object
-may cause the garbage collector to run. If @code{scm_c_define_gsubr}
-invokes a collection, the garbage collector has no way to discover that
-@code{image->name} points to the new string object; the @code{image}
-structure is not yet part of any Scheme object, so the garbage collector
-will not traverse it. Since the garbage collector cannot find any
-references to the new string object, it will free it, leaving
-@code{image} pointing to a dead object.
-
-A correct implementation might say, instead:
-
-@example
- image->name = SCM_BOOL_F;
- image->update_func = SCM_BOOL_F;
-
- SCM_NEWCELL (image_smob);
- SCM_SET_CELL_WORD_1 (image_smob, image);
- SCM_SET_CELL_TYPE (image_smob, image_tag);
-
- image->name = scm_string_copy (name);
- image->update_func = scm_c_define_gsubr (@dots{});
-
- return image_smob;
-@end example
-
-Now, by the time we allocate the new string and function objects,
-@code{image_smob} points to @code{image}. If the garbage collector
-scans the stack, it will find a reference to @code{image_smob} and
-traverse @code{image}, so any objects @code{image} points to will be
-preserved.
-
-
-@node Garbage Collecting Simple Smobs, A Complete Example, A Common Mistake In Allocating Smobs, Defining New Types (Smobs)
-@subsection Garbage Collecting Simple Smobs
-
-It is often useful to define very simple smob types --- smobs which have
-no data to mark, other than the cell itself, or smobs whose first data
-word is simply an ordinary Scheme object, to be marked recursively.
-Guile provides some functions to handle these common cases; you can use
-this function as your smob type's @code{mark} function, if your smob's
-structure is simple enough.
-
-If the smob refers to no other Scheme objects, then no action is
-necessary; the garbage collector has already marked the smob cell
-itself. In that case, you can use zero as your mark function.
-
-@deftypefun SCM scm_markcdr (SCM @var{x})
-Mark the references in the smob @var{x}, assuming that @var{x}'s first
-data word contains an ordinary Scheme object, and @var{x} refers to no
-other objects. This function simply returns @var{x}'s first data word.
-
-This is only useful for simple smobs created by @code{SCM_NEWSMOB} or
-@code{SCM_RETURN_NEWSMOB}, not for smobs allocated as double cells.
-@end deftypefun
-
-@deftypefun size_t scm_free0 (SCM @var{x})
-Do nothing; return zero. This function is appropriate for smobs that
-use either zero or @code{scm_markcdr} as their marking functions, and
-refer to no heap storage, including memory managed by @code{malloc},
-other than the smob's header cell.
-
-This function should not be needed anymore, because simply passing
-@code{NULL} as the free function does the same.
-@end deftypefun
-
-
-@node A Complete Example
-@subsection A Complete Example
-
-Here is the complete text of the implementation of the image datatype,
-as presented in the sections above. We also provide a definition for
-the smob's @code{print} function, and make some objects and functions
-static, to clarify exactly what the surrounding code is using.
-
-As mentioned above, you can find this code in the Guile distribution, in
-@file{doc/example-smob}. That directory includes a makefile and a
-suitable @code{main} function, so you can build a complete interactive
-Guile shell, extended with the datatypes described here.)
-
-@example
-/* file "image-type.c" */
-
-#include <stdlib.h>
-#include <libguile.h>
-
-static scm_t_bits image_tag;
-
-struct image @{
- int width, height;
- char *pixels;
-
- /* The name of this image */
- SCM name;
-
- /* A function to call when this image is
- modified, e.g., to update the screen,
- or SCM_BOOL_F if no action necessary */
- SCM update_func;
-@};
-
-static SCM
-make_image (SCM name, SCM s_width, SCM s_height)
-@{
- struct image *image;
- int width, height;
-
- SCM_ASSERT (SCM_STRINGP (name), name, SCM_ARG1, "make-image");
- SCM_ASSERT (SCM_INUMP (s_width), s_width, SCM_ARG2, "make-image");
- SCM_ASSERT (SCM_INUMP (s_height), s_height, SCM_ARG3, "make-image");
-
- width = SCM_INUM (s_width);
- height = SCM_INUM (s_height);
-
- image = (struct image *) scm_gc_malloc (sizeof (struct image), "image");
- image->width = width;
- image->height = height;
- image->pixels = scm_gc_malloc (width * height, "image pixels");
- image->name = name;
- image->update_func = SCM_BOOL_F;
-
- SCM_RETURN_NEWSMOB (image_tag, image);
-@}
-
-static SCM
-clear_image (SCM image_smob)
-@{
- int area;
- struct image *image;
-
- SCM_ASSERT (SCM_SMOB_PREDICATE (image_tag, image_smob),
- image_smob, SCM_ARG1, "clear-image");
-
- image = (struct image *) SCM_SMOB_DATA (image_smob);
- area = image->width * image->height;
- memset (image->pixels, 0, area);
-
- /* Invoke the image's update function. */
- if (image->update_func != SCM_BOOL_F)
- scm_apply (image->update_func, SCM_EOL, SCM_EOL);
-
- return SCM_UNSPECIFIED;
-@}
-
-static SCM
-mark_image (SCM image_smob)
-@{
- /* Mark the image's name and update function. */
- struct image *image = (struct image *) SCM_SMOB_DATA (image_smob);
-
- scm_gc_mark (image->name);
- return image->update_func;
-@}
-
-static size_t
-free_image (SCM image_smob)
-@{
- struct image *image = (struct image *) SCM_SMOB_DATA (image_smob);
-
- scm_gc_free (image->pixels, image->width * image->height, "image pixels");
- scm_gc_free (image, sizeof (struct image), "image");
-
- return 0;
-@}
-
-static int
-print_image (SCM image_smob, SCM port, scm_print_state *pstate)
-@{
- struct image *image = (struct image *) SCM_SMOB_DATA (image_smob);
-
- scm_puts ("#<image ", port);
- scm_display (image->name, port);
- scm_puts (">", port);
-
- /* non-zero means success */
- return 1;
-@}
-
-void
-init_image_type (void)
-@{
- image_tag = scm_make_smob_type ("image", sizeof (struct image));
- scm_set_smob_mark (image_tag, mark_image);
- scm_set_smob_free (image_tag, free_image);
- scm_set_smob_print (image_tag, print_image);
-
- scm_c_define_gsubr ("clear-image", 1, 0, 0, clear_image);
- scm_c_define_gsubr ("make-image", 3, 0, 0, make_image);
-@}
-@end example
-
-Here is a sample build and interaction with the code from the
-@file{example-smob} directory, on the author's machine:
-
-@example
-zwingli:example-smob$ make CC=gcc
-gcc `guile-config compile` -c image-type.c -o image-type.o
-gcc `guile-config compile` -c myguile.c -o myguile.o
-gcc image-type.o myguile.o `guile-config link` -o myguile
-zwingli:example-smob$ ./myguile
-guile> make-image
-#<primitive-procedure make-image>
-guile> (define i (make-image "Whistler's Mother" 100 100))
-guile> i
-#<image Whistler's Mother>
-guile> (clear-image i)
-guile> (clear-image 4)
-ERROR: In procedure clear-image in expression (clear-image 4):
-ERROR: Wrong type argument in position 1: 4
-ABORT: (wrong-type-arg)
-
-Type "(backtrace)" to get more information.
-guile>
-@end example
-
-@c essay @bye
diff --git a/doc/ref/debugging.texi b/doc/ref/debugging.texi
deleted file mode 100644
index 06a61473d..000000000
--- a/doc/ref/debugging.texi
+++ /dev/null
@@ -1,115 +0,0 @@
-@page
-@node Debugging Features
-@chapter Debugging Features
-
-@c --- The title and introduction of this appendix need to
-@c distinguish this clearly from the chapter on the internal
-@c debugging interface.
-
-When debugging a program, programmers often find it helpful to examine
-the program's internal status while it runs: the values of internal
-variables, the choices made in @code{if} and @code{cond} statements, and
-so forth. Guile Scheme provides a debugging interface that programmers
-can use to single-step through Scheme functions and examine symbol
-bindings. This is different from the @ref{Debugging}, which permits
-programmers to debug the Guile interpreter itself. Most programmers
-will be more interested in debugging their own Scheme programs than the
-interpreter which evaluates them.
-
-[FIXME: should we include examples of traditional debuggers
-and explain why they can't be used to debug interpreted Scheme or Lisp?]
-
-@menu
-* Single-Step:: Execute a program or function one step at a time.
-* Trace:: Print a report each time a given function is called.
-* Backtrace:: See a list of the statements that caused an error.
-@end menu
-
-
-@node Single-Step
-@section Single-Step
-
-
-@node Trace
-@section Trace
-
-When a function is @dfn{traced}, it means that every call to that
-function is reported to the user during a program run. This can help a
-programmer determine whether a function is being called at the wrong
-time or with the wrong set of arguments.
-
-@defun trace function
-Enable debug tracing on @code{function}. While a program is being run, Guile
-will print a brief report at each call to a traced function,
-advising the user which function was called and the arguments that were
-passed to it.
-@end defun
-
-@defun untrace function
-Disable debug tracing for @code{function}.
-@end defun
-
-Example:
-
-@lisp
-(define (rev ls)
- (if (null? ls)
- '()
- (append (rev (cdr ls))
- (cons (car ls) '())))) @result{} rev
-
-(trace rev) @result{} (rev)
-
-(rev '(a b c d e))
-@result{} [rev (a b c d e)]
- | [rev (b c d e)]
- | | [rev (c d e)]
- | | | [rev (d e)]
- | | | | [rev (e)]
- | | | | | [rev ()]
- | | | | | ()
- | | | | (e)
- | | | (e d)
- | | (e d c)
- | (e d c b)
- (e d c b a)
- (e d c b a)
-@end lisp
-
-Note the way Guile indents the output, illustrating the depth of
-execution at each function call. This can be used to demonstrate, for
-example, that Guile implements self-tail-recursion properly:
-
-@lisp
-(define (rev ls sl)
- (if (null? ls)
- sl
- (rev (cdr ls)
- (cons (car ls) sl)))) @result{} rev
-
-(trace rev) @result{} (rev)
-
-(rev '(a b c d e) '())
-@result{} [rev (a b c d e) ()]
- [rev (b c d e) (a)]
- [rev (c d e) (b a)]
- [rev (d e) (c b a)]
- [rev (e) (d c b a)]
- [rev () (e d c b a)]
- (e d c b a)
- (e d c b a)
-@end lisp
-
-Since the tail call is effectively optimized to a @code{goto} statement,
-there is no need for Guile to create a new stack frame for each
-iteration. Using @code{trace} here helps us see why this is so.
-
-
-@node Backtrace
-@section Backtrace
-
-@deffn {Scheme Procedure} backtrace
-@deffnx {C Function} scm_backtrace ()
-Display a backtrace of the stack saved by the last error
-to the current output port.
-@end deffn
diff --git a/doc/ref/deprecated.texi b/doc/ref/deprecated.texi
deleted file mode 100644
index 8d335a936..000000000
--- a/doc/ref/deprecated.texi
+++ /dev/null
@@ -1,3 +0,0 @@
-@page
-@node Deprecated
-@chapter Deprecated
diff --git a/doc/ref/expect.texi b/doc/ref/expect.texi
deleted file mode 100644
index 7e169e428..000000000
--- a/doc/ref/expect.texi
+++ /dev/null
@@ -1,142 +0,0 @@
-@page
-@node Expect
-@chapter Expect
-
-The macros in this section are made available with:
-
-@smalllisp
-(use-modules (ice-9 expect))
-@end smalllisp
-
-@code{expect} is a macro for selecting actions based on the output from
-a port. The name comes from a tool of similar functionality by Don Libes.
-Actions can be taken when a particular string is matched, when a timeout
-occurs, or when end-of-file is seen on the port. The @code{expect} macro
-is described below; @code{expect-strings} is a front-end to @code{expect}
-based on regexec (see the regular expression documentation).
-
-@defmac expect-strings clause @dots{}
-By default, @code{expect-strings} will read from the current input port.
-The first term in each clause consists of an expression evaluating to
-a string pattern (regular expression). As characters
-are read one-by-one from the port, they are accumulated in a buffer string
-which is matched against each of the patterns. When a
-pattern matches, the remaining expression(s) in
-the clause are evaluated and the value of the last is returned. For example:
-
-@smalllisp
-(with-input-from-file "/etc/passwd"
- (lambda ()
- (expect-strings
- ("^nobody" (display "Got a nobody user.\n")
- (display "That's no problem.\n"))
- ("^daemon" (display "Got a daemon user.\n")))))
-@end smalllisp
-
-The regular expression is compiled with the @code{REG_NEWLINE} flag, so
-that the ^ and $ anchors will match at any newline, not just at the start
-and end of the string.
-
-There are two other ways to write a clause:
-
-The expression(s) to evaluate
-can be omitted, in which case the result of the regular expression match
-(converted to strings, as obtained from regexec with match-pick set to "")
-will be returned if the pattern matches.
-
-The symbol @code{=>} can be used to indicate that the expression is a
-procedure which will accept the result of a successful regular expression
-match. E.g.,
-
-@smalllisp
-("^daemon" => write)
-("^d\\(aemon\\)" => (lambda args (for-each write args)))
-("^da\\(em\\)on" => (lambda (all sub)
- (write all) (newline)
- (write sub) (newline)))
-@end smalllisp
-
-The order of the substrings corresponds to the order in which the
-opening brackets occur.
-
-A number of variables can be used to control the behaviour
-of @code{expect} (and @code{expect-strings}).
-Most have default top-level bindings to the value @code{#f},
-which produces the default behaviour.
-They can be redefined at the
-top level or locally bound in a form enclosing the expect expression.
-
-@table @code
-@item expect-port
-A port to read characters from, instead of the current input port.
-@item expect-timeout
-@code{expect} will terminate after this number of
-seconds, returning @code{#f} or the value returned by expect-timeout-proc.
-@item expect-timeout-proc
-A procedure called if timeout occurs. The procedure takes a single argument:
-the accumulated string.
-@item expect-eof-proc
-A procedure called if end-of-file is detected on the input port. The
-procedure takes a single argument: the accumulated string.
-@item expect-char-proc
-A procedure to be called every time a character is read from the
-port. The procedure takes a single argument: the character which was read.
-@item expect-strings-compile-flags
-Flags to be used when compiling a regular expression, which are passed
-to @code{make-regexp} @xref{Regexp Functions}. The default value
-is @code{regexp/newline}.
-@item expect-strings-exec-flags
-Flags to be used when executing a regular expression, which are
-passed to regexp-exec @xref{Regexp Functions}.
-The default value is @code{regexp/noteol}, which prevents @code{$}
-from matching the end of the string while it is still accumulating,
-but still allows it to match after a line break or at the end of file.
-@end table
-
-Here's an example using all of the variables:
-
-@smalllisp
-(let ((expect-port (open-input-file "/etc/passwd"))
- (expect-timeout 1)
- (expect-timeout-proc
- (lambda (s) (display "Times up!\n")))
- (expect-eof-proc
- (lambda (s) (display "Reached the end of the file!\n")))
- (expect-char-proc display)
- (expect-strings-compile-flags (logior regexp/newline regexp/icase))
- (expect-strings-exec-flags 0))
- (expect-strings
- ("^nobody" (display "Got a nobody user\n"))))
-@end smalllisp
-@end defmac
-
-@defmac expect clause @dots{}
-@code{expect} is used in the same way as @code{expect-strings},
-but tests are specified not as patterns, but as procedures. The
-procedures are called in turn after each character is read from the
-port, with two arguments: the value of the accumulated string and
-a flag to indicate whether end-of-file has been reached. The flag
-will usually be @code{#f}, but if end-of-file is reached, the procedures
-are called an additional time with the final accumulated string and
-@code{#t}.
-
-The test is successful if the procedure returns a non-false value.
-
-If the @code{=>} syntax is used, then if the test succeeds it must return
-a list containing the arguments to be provided to the corresponding
-expression.
-
-In the following example, a string will only be matched at the beginning
-of the file:
-
-@smalllisp
-(let ((expect-port (open-input-file "/etc/passwd")))
- (expect
- ((lambda (s eof?) (string=? s "fnord!"))
- (display "Got a nobody user!\n"))))
-@end smalllisp
-
-The control variables described for @code{expect-strings} also
-influence the behaviour of @code{expect}, with the exception of
-variables whose names begin with @code{expect-strings-}.
-@end defmac
diff --git a/doc/ref/extend.texi b/doc/ref/extend.texi
deleted file mode 100644
index 5c72bef33..000000000
--- a/doc/ref/extend.texi
+++ /dev/null
@@ -1,44 +0,0 @@
-@page
-@node Libguile Intro
-@chapter Using Guile as an Extension Language
-
-The chapters in this part of the manual explain how to use Guile as a
-powerful application extension language.
-
-An important change for the 1.6.x series of Guile releases is that the
-GH interface is now deprecated. For the reasoning behind this decision,
-see @xref{GH deprecation}. The GH interface will continue to be
-supported for the 1.6.x and 1.8.x release series, but will be dropped
-thereafter, so developers are encouraged to switch progressively to the
-scm interface. The last chapter in this part of the manual (@pxref{GH})
-documents both how to use GH and how to switch from GH to scm.
-
-The Guile developers believe that clarification of the GH vs. scm
-debate, and the consequent deprecation of the GH interface, are in the
-long term interests of the project. However it does create an
-unfortunate situation for developers who want to start a project using
-Guile and so read the manual to find out how to proceed. They will
-discover that the GH interface, although quite well documented, is
-deprecated, but that there is almost no adequate documentation for its
-theoretical replacement, the scm interface. Moreover, the scm interface
-still has the odd few rough edges which need smoothing down.
-
-Therefore, although deprecated, it is quite OK to continue to use the GH
-interface if you feel uncomfortable with the `scm_' interface as it
-stands today. By the time that support for GH is dropped, we plan to
-have thoroughly documented the `scm_' interface, and to have enhanced it
-such that conversion from GH to the `scm_' interface will be very
-straightforward, and probably mostly automated.
-
-As far as documentation of the scm interface is concerned, the current
-position is that it is a bit confused, but that the situation should
-improve rapidly once the 1.6.0 release is out. The plan is to refocus
-the bulk of Part II, currently ``Guile Scheme'', as the ``Guile API
-Reference'' so that it covers both Scheme and C interfaces. (This makes
-sense because almost all of Guile's primitive procedures on the Scheme
-level --- e.g. @code{memq} --- are also available as C level primitives
-in the scm interface --- e.g. @code{scm_memq}.) There will then remain
-a certain amount of Scheme-specific (such as the ``Basic Ideas''
-chapter) and C-specific documentation (such as SMOB usage and
-interaction with the garbage collector) to collect into corresponding
-chapters.
diff --git a/doc/ref/gh.texi b/doc/ref/gh.texi
deleted file mode 100644
index 1cadc168a..000000000
--- a/doc/ref/gh.texi
+++ /dev/null
@@ -1,1170 +0,0 @@
-@page
-@node GH
-@chapter GH: A Portable C to Scheme Interface
-@cindex libguile - gh
-@cindex gh
-@cindex gh - reference manual
-
-This chapter shows how to use the GH interface to call Guile from your
-application's C code, and to add new Scheme level procedures to Guile
-whose behaviour is specified by application specific code written in C.
-
-Note, however, that the GH interface is now deprecated, and developers
-are encouraged to switch to using the scm interface instead. Therefore,
-for each GH feature, this chapter should also document how to achieve
-the same result using the scm interface.
-
-@menu
-* GH deprecation:: Why the GH interface is now deprecated.
-* gh preliminaries::
-* Data types and constants defined by gh::
-* Starting and controlling the interpreter::
-* Error messages::
-* Executing Scheme code::
-* Defining new Scheme procedures in C::
-* Converting data between C and Scheme::
-* Type predicates::
-* Equality predicates::
-* Memory allocation and garbage collection::
-* Calling Scheme procedures from C::
-* Mixing gh and scm APIs::
-* scm transition summary::
-@end menu
-
-
-@node GH deprecation
-@section Why the GH Interface is Now Deprecated
-
-Historically, the GH interface was the product of a practical problem
-and a neat idea. The practical problem was that the interface of the
-@code{scm_} functions with which Guile itself was written (inherited
-from Aubrey Jaffer's SCM) was so closely tied to the (rather arcane)
-details of the internal data representation that it was extremely
-difficult to write a Guile extension using these functions. The neat
-idea was to define a high level language extension interface in such a
-way that other extension language projects, not just Guile, would be
-able to provide an implementation of that interface; then applications
-using this interface could be compiled with whichever of the various
-available implementations they chose. So the GH interface was created,
-and advertised both as the recommended interface for application
-developers wishing to use Guile, and as a portable high level interface
-that could theoretically be implemented by other extension language
-projects.
-
-Time passed, and various things changed. Crucially, an enormous number
-of improvements were made to the @code{scm_} interface that Guile itself
-uses in its implementation, with the result that it is now both easy and
-comfortable to write a Guile extension with this interface. At the same
-time, the contents of the GH interface were somewhat neglected by the
-core Guile developers, such that some key operations --- such as smob
-creation and management --- are simply not possible using GH alone.
-Finally, the idea of multiple implementations of the GH interface did
-not really crystallize (apart, I believe, from a short lived
-implementation by the MzScheme project).
-
-For all these reasons, the Guile developers have decided to deprecate
-the GH interface --- which means that support for GH will be completely
-removed after the next few releases --- and to focus only on the
-@code{scm_} interface, with additions to ensure that it is as easy to
-use in all respects as GH was.
-
-It remains an open question whether a deep kind of interface portability
-would be useful for extension language-based applications, and it may
-still be an interesting project to attempt to define a corresponding
-GH-like interface, but the Guile developers no longer plan to try to do
-this as part of the core Guile project.
-
-
-@node gh preliminaries
-@section gh preliminaries
-
-To use gh, you must have the following toward the beginning of your C
-source:
-@smallexample
-#include <guile/gh.h>
-@end smallexample
-@cindex gh - headers
-
-When you link, you will have to add at least @code{-lguile} to the list
-of libraries. If you are using more of Guile than the basic Scheme
-interpreter, you will have to add more libraries.
-@cindex gh - linking
-
-
-@node Data types and constants defined by gh
-@section Data types and constants defined by gh
-@cindex libguile - data types
-
-The following C constants and data types are defined in gh:
-
-@deftp {Data type} SCM
-This is a C data type used to store all Scheme data, no matter what the
-Scheme type. Values are converted between C data types and the SCM type
-with utility functions described below (@pxref{Converting data between C
-and Scheme}). [FIXME: put in references to Jim's essay and so forth.]
-@end deftp
-@cindex SCM data type
-
-@defvr Constant SCM_BOOL_T
-@defvrx Constant SCM_BOOL_F
-The @emph{Scheme} values returned by many boolean procedures in
-libguile.
-
-This can cause confusion because they are different from 0 and 1. In
-testing a boolean function in libguile programming, you must always make
-sure that you check the spec: @code{gh_} and @code{scm_} functions will
-usually return @code{SCM_BOOL_T} and @code{SCM_BOOL_F}, but other C
-functions usually can be tested against 0 and 1, so programmers' fingers
-tend to just type @code{if (boolean_function()) @{ ... @}}
-@end defvr
-
-@defvr Constant SCM_UNSPECIFIED
-This is a SCM value that is not the same as any legal Scheme value. It
-is the value that a Scheme function returns when its specification says
-that its return value is unspecified.
-@end defvr
-
-@defvr Constant SCM_UNDEFINED
-This is another SCM value that is not the same as any legal Scheme
-value. It is the value used to mark variables that do not yet have a
-value, and it is also used in C to terminate functions with variable
-numbers of arguments, such as @code{gh_list()}.
-@end defvr
-
-
-@node Starting and controlling the interpreter
-@section Starting and controlling the interpreter
-@cindex libguile - start interpreter
-
-In almost every case, your first @code{gh_} call will be:
-
-@deftypefun void gh_enter (int @var{argc}, char *@var{argv}[], void (*@var{main_prog})())
-Starts up a Scheme interpreter with all the builtin Scheme primitives.
-@code{gh_enter()} never exits, and the user's code should all be in the
-@code{@var{main_prog}()} function. @code{argc} and @code{argv} will be
-passed to @var{main_prog}.
-
-@deftypefun void main_prog (int @var{argc}, char *@var{argv}[])
-This is the user's main program. It will be invoked by
-@code{gh_enter()} after Guile has been started up.
-@end deftypefun
-
-Note that you can use @code{gh_repl} inside @code{gh_enter} (in other
-words, inside the code for @code{main-prog}) if you want the program to
-be controlled by a Scheme read-eval-print loop.
-@end deftypefun
-
-@cindex read eval print loop -- from the gh_ interface
-@cindex REPL -- from the gh_ interface
-A convenience routine which enters the Guile interpreter with the
-standard Guile read-eval-print loop (@dfn{REPL}) is:
-
-@deftypefun void gh_repl (int @var{argc}, char *@var{argv}[])
-Enters the Scheme interpreter giving control to the Scheme REPL.
-Arguments are processed as if the Guile program @file{guile} were being
-invoked.
-
-Note that @code{gh_repl} should be used @emph{inside} @code{gh_enter},
-since any Guile interpreter calls are meaningless unless they happen in
-the context of the interpreter.
-
-Also note that when you use @code{gh_repl}, your program will be
-controlled by Guile's REPL (which is written in Scheme and has many
-useful features). Use straight C code inside @code{gh_enter} if you
-want to maintain execution control in your C program.
-@end deftypefun
-
-You will typically use @code{gh_enter} and @code{gh_repl} when you
-want a Guile interpreter enhanced by your own libraries, but otherwise
-quite normal. For example, to build a Guile--derived program that
-includes some random number routines @dfn{GSL} (GNU Scientific Library),
-you would write a C program that looks like this:
-
-@smallexample
-#include <guile/gh.h>
-#include <gsl_ran.h>
-
-/* random number suite */
-SCM gw_ran_seed(SCM s)
-@{
- gsl_ran_seed(gh_scm2int(s));
- return SCM_UNSPECIFIED;
-@}
-
-SCM gw_ran_random()
-@{
- SCM x;
-
- x = gh_ulong2scm(gsl_ran_random());
- return x;
-@}
-
-SCM gw_ran_uniform()
-@{
- SCM x;
-
- x = gh_double2scm(gsl_ran_uniform());
- return x;
-@}
-SCM gw_ran_max()
-@{
- return gh_double2scm(gsl_ran_max());
-@}
-
-void
-init_gsl()
-@{
- /* random number suite */
- gh_new_procedure("gsl-ran-seed", gw_ran_seed, 1, 0, 0);
- gh_new_procedure("gsl-ran-random", gw_ran_random, 0, 0, 0);
- gh_new_procedure("gsl-ran-uniform", gw_ran_uniform, 0, 0, 0);
- gh_new_procedure("gsl-ran-max", gw_ran_max, 0, 0, 0);
-@}
-
-void
-main_prog (int argc, char *argv[])
-@{
- init_gsl();
-
- gh_repl(argc, argv);
-@}
-
-int
-main (int argc, char *argv[])
-@{
- gh_enter (argc, argv, main_prog);
-@}
-@end smallexample
-
-Then, supposing the C program is in @file{guile-gsl.c}, you could
-compile it with @kbd{gcc -o guile-gsl guile-gsl.c -lguile -lgsl}.
-
-The resulting program @file{guile-gsl} would have new primitive
-procedures @code{gsl-ran-random}, @code{gsl-ran-gaussian} and so forth.
-
-
-@node Error messages
-@section Error messages
-@cindex libguile - error messages
-@cindex error messages in libguile
-
-[FIXME: need to fill this based on Jim's new mechanism]
-
-
-@node Executing Scheme code
-@section Executing Scheme code
-@cindex libguile - executing Scheme
-@cindex executing Scheme
-
-Once you have an interpreter running, you can ask it to evaluate Scheme
-code. There are two calls that implement this:
-
-@deftypefun SCM gh_eval_str (char *@var{scheme_code})
-This asks the interpreter to evaluate a single string of Scheme code,
-and returns the result of the last expression evaluated.
-
-Note that the line of code in @var{scheme_code} must be a well formed
-Scheme expression. If you have many lines of code before you balance
-parentheses, you must either concatenate them into one string, or use
-@code{gh_eval_file()}.
-@end deftypefun
-
-@deftypefun SCM gh_eval_file (char *@var{fname})
-@deftypefunx SCM gh_load (char *@var{fname})
-@code{gh_eval_file} is completely analogous to @code{gh_eval_str()},
-except that a whole file is evaluated instead of a string.
-@code{gh_eval_file} returns @code{SCM_UNSPECIFIED}.
-
-@code{gh_load} is identical to @code{gh_eval_file} (it's a macro that
-calls @code{gh_eval_file} on its argument). It is provided to start
-making the @code{gh_} interface match the R5RS Scheme procedures
-closely.
-@end deftypefun
-
-
-@node Defining new Scheme procedures in C
-@section Defining new Scheme procedures in C
-@cindex libguile - new procedures
-@cindex new procedures
-@cindex procedures, new
-@cindex new primitives
-@cindex primitives, new
-
-The real interface between C and Scheme comes when you can write new
-Scheme procedures in C. This is done through the routine
-
-
-@deftypefn {Libguile high} SCM gh_new_procedure (char *@var{proc_name}, SCM (*@var{fn})(), int @var{n_required_args}, int @var{n_optional_args}, int @var{restp})
-@code{gh_new_procedure} defines a new Scheme procedure. Its Scheme name
-will be @var{proc_name}, it will be implemented by the C function
-(*@var{fn})(), it will take at least @var{n_required_args} arguments,
-and at most @var{n_optional_args} extra arguments.
-
-When the @var{restp} parameter is 1, the procedure takes a final
-argument: a list of remaining parameters.
-
-@code{gh_new_procedure} returns an SCM value representing the procedure.
-
-The C function @var{fn} should have the form
-@deftypefn {Libguile high} SCM fn (SCM @var{req1}, SCM @var{req2}, ..., SCM @var{opt1}, SCM @var{opt2}, ..., SCM @var{rest_args})
-The arguments are all passed as SCM values, so the user will have to use
-the conversion functions to convert to standard C types.
-
-Examples of C functions used as new Scheme primitives can be found in
-the sample programs @code{learn0} and @code{learn1}.
-@end deftypefn
-
-@end deftypefn
-
-@strong{Rationale:} this is the correct way to define new Scheme
-procedures in C. The ugly mess of arguments is required because of how
-C handles procedures with variable numbers of arguments.
-
-@strong{Note:} what about documentation strings?
-
-@cartouche
-There are several important considerations to be made when writing the C
-routine @code{(*fn)()}.
-
-First of all the C routine has to return type @code{SCM}.
-
-Second, all arguments passed to the C function will be of type
-@code{SCM}.
-
-Third: the C routine is now subject to Scheme flow control, which means
-that it could be interrupted at any point, and then reentered. This
-means that you have to be very careful with operations such as
-allocating memory, modifying static data @dots{}
-
-Fourth: to get around the latter issue, you can use
-@code{GH_DEFER_INTS} and @code{GH_ALLOW_INTS}.
-@end cartouche
-
-@defmac GH_DEFER_INTS
-@defmacx GH_ALLOW_INTS
-These macros disable and re-enable Scheme's flow control. They
-@end defmac
-
-
-@c [??? have to do this right; maybe using subsections, or maybe creating a
-@c section called Flow control issues...]
-
-@c [??? Go into exhaustive detail with examples of the various possible
-@c combinations of required and optional args...]
-
-
-@node Converting data between C and Scheme
-@section Converting data between C and Scheme
-@cindex libguile - converting data
-@cindex data conversion
-@cindex converting data
-
-Guile provides mechanisms to convert data between C and Scheme. This
-allows new builtin procedures to understand their arguments (which are
-of type @code{SCM}) and return values of type @code{SCM}.
-
-
-@menu
-* C to Scheme::
-* Scheme to C::
-@end menu
-
-@node C to Scheme
-@subsection C to Scheme
-
-@deftypefun SCM gh_bool2scm (int @var{x})
-Returns @code{#f} if @var{x} is zero, @code{#t} otherwise.
-@end deftypefun
-
-@deftypefun SCM gh_ulong2scm (unsigned long @var{x})
-@deftypefunx SCM gh_long2scm (long @var{x})
-@deftypefunx SCM gh_double2scm (double @var{x})
-@deftypefunx SCM gh_char2scm (char @var{x})
-Returns a Scheme object with the value of the C quantity @var{x}.
-@end deftypefun
-
-@deftypefun SCM gh_str2scm (char *@var{s}, int @var{len})
-Returns a new Scheme string with the (not necessarily null-terminated) C
-array @var{s} data.
-@end deftypefun
-
-@deftypefun SCM gh_str02scm (char *@var{s})
-Returns a new Scheme string with the null-terminated C string @var{s}
-data.
-@end deftypefun
-
-@deftypefun SCM gh_set_substr (char *@var{src}, SCM @var{dst}, int @var{start}, int @var{len})
-Copy @var{len} characters at @var{src} into the @emph{existing} Scheme
-string @var{dst}, starting at @var{start}. @var{start} is an index into
-@var{dst}; zero means the beginning of the string.
-
-If @var{start} + @var{len} is off the end of @var{dst}, signal an
-out-of-range error.
-@end deftypefun
-
-@deftypefun SCM gh_symbol2scm (char *@var{name})
-Given a null-terminated string @var{name}, return the symbol with that
-name.
-@end deftypefun
-
-@deftypefun SCM gh_ints2scm (int *@var{dptr}, int @var{n})
-@deftypefunx SCM gh_doubles2scm (double *@var{dptr}, int @var{n})
-Make a scheme vector containing the @var{n} ints or doubles at memory
-location @var{dptr}.
-@end deftypefun
-
-@deftypefun SCM gh_chars2byvect (char *@var{dptr}, int @var{n})
-@deftypefunx SCM gh_shorts2svect (short *@var{dptr}, int @var{n})
-@deftypefunx SCM gh_longs2ivect (long *@var{dptr}, int @var{n})
-@deftypefunx SCM gh_ulongs2uvect (ulong *@var{dptr}, int @var{n})
-@deftypefunx SCM gh_floats2fvect (float *@var{dptr}, int @var{n})
-@deftypefunx SCM gh_doubles2dvect (double *@var{dptr}, int @var{n})
-Make a scheme uniform vector containing the @var{n} chars, shorts,
-longs, unsigned longs, floats or doubles at memory location @var{dptr}.
-@end deftypefun
-
-
-
-@node Scheme to C
-@subsection Scheme to C
-
-@deftypefun int gh_scm2bool (SCM @var{obj})
-@deftypefunx {unsigned long} gh_scm2ulong (SCM @var{obj})
-@deftypefunx long gh_scm2long (SCM @var{obj})
-@deftypefunx double gh_scm2double (SCM @var{obj})
-@deftypefunx int gh_scm2char (SCM @var{obj})
-These routines convert the Scheme object to the given C type.
-@end deftypefun
-
-@deftypefun char *gh_scm2newstr (SCM @var{str}, int *@var{lenp})
-Given a Scheme string @var{str}, return a pointer to a new copy of its
-contents, followed by a null byte. If @var{lenp} is non-null, set
-@code{*@var{lenp}} to the string's length.
-
-This function uses malloc to obtain storage for the copy; the caller is
-responsible for freeing it.
-
-Note that Scheme strings may contain arbitrary data, including null
-characters. This means that null termination is not a reliable way to
-determine the length of the returned value. However, the function
-always copies the complete contents of @var{str}, and sets @var{*lenp}
-to the true length of the string (when @var{lenp} is non-null).
-@end deftypefun
-
-
-@deftypefun void gh_get_substr (SCM str, char *return_str, int *lenp)
-Copy @var{len} characters at @var{start} from the Scheme string
-@var{src} to memory at @var{dst}. @var{start} is an index into
-@var{src}; zero means the beginning of the string. @var{dst} has
-already been allocated by the caller.
-
-If @var{start} + @var{len} is off the end of @var{src}, signal an
-out-of-range error.
-@end deftypefun
-
-@deftypefun char *gh_symbol2newstr (SCM @var{sym}, int *@var{lenp})
-Takes a Scheme symbol and returns a string of the form
-@code{"'symbol-name"}. If @var{lenp} is non-null, the string's length
-is returned in @code{*@var{lenp}}.
-
-This function uses malloc to obtain storage for the returned string; the
-caller is responsible for freeing it.
-@end deftypefun
-
-@deftypefun char *gh_scm2chars (SCM @var{vector}, chars *@var{result})
-@deftypefunx short *gh_scm2shorts (SCM @var{vector}, short *@var{result})
-@deftypefunx long *gh_scm2longs (SCM @var{vector}, long *@var{result})
-@deftypefunx float *gh_scm2floats (SCM @var{vector}, float *@var{result})
-@deftypefunx double *gh_scm2doubles (SCM @var{vector}, double *@var{result})
-Copy the numbers in @var{vector} to the array pointed to by @var{result}
-and return it. If @var{result} is NULL, allocate a double array large
-enough.
-
-@var{vector} can be an ordinary vector, a weak vector, or a signed or
-unsigned uniform vector of the same type as the result array. For
-chars, @var{vector} can be a string or substring. For floats and
-doubles, @var{vector} can contain a mix of inexact and integer values.
-
-If @var{vector} is of unsigned type and contains values too large to fit
-in the signed destination array, those values will be wrapped around,
-that is, data will be copied as if the destination array was unsigned.
-@end deftypefun
-
-
-@node Type predicates
-@section Type predicates
-
-These C functions mirror Scheme's type predicate procedures with one
-important difference. The C routines return C boolean values (0 and 1)
-instead of @code{SCM_BOOL_T} and @code{SCM_BOOL_F}.
-
-The Scheme notational convention of putting a @code{?} at the end of
-predicate procedure names is mirrored in C by placing @code{_p} at the
-end of the procedure. For example, @code{(pair? ...)} maps to
-@code{gh_pair_p(...)}.
-
-@deftypefun int gh_boolean_p (SCM @var{val})
-Returns 1 if @var{val} is a boolean, 0 otherwise.
-@end deftypefun
-
-@deftypefun int gh_symbol_p (SCM @var{val})
-Returns 1 if @var{val} is a symbol, 0 otherwise.
-@end deftypefun
-
-@deftypefun int gh_char_p (SCM @var{val})
-Returns 1 if @var{val} is a char, 0 otherwise.
-@end deftypefun
-
-@deftypefun int gh_vector_p (SCM @var{val})
-Returns 1 if @var{val} is a vector, 0 otherwise.
-@end deftypefun
-
-@deftypefun int gh_pair_p (SCM @var{val})
-Returns 1 if @var{val} is a pair, 0 otherwise.
-@end deftypefun
-
-@deftypefun int gh_procedure_p (SCM @var{val})
-Returns 1 if @var{val} is a procedure, 0 otherwise.
-@end deftypefun
-
-@deftypefun int gh_list_p (SCM @var{val})
-Returns 1 if @var{val} is a list, 0 otherwise.
-@end deftypefun
-
-@deftypefun int gh_inexact_p (SCM @var{val})
-Returns 1 if @var{val} is an inexact number, 0 otherwise.
-@end deftypefun
-
-@deftypefun int gh_exact_p (SCM @var{val})
-Returns 1 if @var{val} is an exact number, 0 otherwise.
-@end deftypefun
-
-
-@node Equality predicates
-@section Equality predicates
-
-These C functions mirror Scheme's equality predicate procedures with one
-important difference. The C routines return C boolean values (0 and 1)
-instead of @code{SCM_BOOL_T} and @code{SCM_BOOL_F}.
-
-The Scheme notational convention of putting a @code{?} at the end of
-predicate procedure names is mirrored in C by placing @code{_p} at the
-end of the procedure. For example, @code{(equal? ...)} maps to
-@code{gh_equal_p(...)}.
-
-@deftypefun int gh_eq_p (SCM x, SCM y)
-Returns 1 if @var{x} and @var{y} are equal in the sense of Scheme's
-@code{eq?} predicate, 0 otherwise.
-@end deftypefun
-
-@deftypefun int gh_eqv_p (SCM x, SCM y)
-Returns 1 if @var{x} and @var{y} are equal in the sense of Scheme's
-@code{eqv?} predicate, 0 otherwise.
-@end deftypefun
-
-@deftypefun int gh_equal_p (SCM x, SCM y)
-Returns 1 if @var{x} and @var{y} are equal in the sense of Scheme's
-@code{equal?} predicate, 0 otherwise.
-@end deftypefun
-
-@deftypefun int gh_string_equal_p (SCM @var{s1}, SCM @var{s2})
-Returns 1 if the strings @var{s1} and @var{s2} are equal, 0 otherwise.
-@end deftypefun
-
-@deftypefun int gh_null_p (SCM @var{l})
-Returns 1 if @var{l} is an empty list or pair; 0 otherwise.
-@end deftypefun
-
-
-@node Memory allocation and garbage collection
-@section Memory allocation and garbage collection
-
-@c [FIXME: flesh this out with some description of garbage collection in
-@c scm/guile]
-
-@c @deftypefun SCM gh_mkarray (int size)
-@c Allocate memory for a Scheme object in a garbage-collector-friendly
-@c manner.
-@c @end deftypefun
-
-
-@node Calling Scheme procedures from C
-@section Calling Scheme procedures from C
-
-Many of the Scheme primitives are available in the @code{gh_}
-interface; they take and return objects of type SCM, and one could
-basically use them to write C code that mimics Scheme code.
-
-I will list these routines here without much explanation, since what
-they do is the same as documented in @ref{Standard procedures, R5RS, ,
-r5rs, R5RS}. But I will point out that when a procedure takes a
-variable number of arguments (such as @code{gh_list}), you should pass
-the constant @var{SCM_UNDEFINED} from C to signify the end of the list.
-
-@deftypefun SCM gh_define (char *@var{name}, SCM @var{val})
-Corresponds to the Scheme @code{(define name val)}: it binds a value to
-the given name (which is a C string). Returns the new object.
-@end deftypefun
-
-@heading Pairs and lists
-
-@deftypefun SCM gh_cons (SCM @var{a}, SCM @var{b})
-@deftypefunx SCM gh_list (SCM l0, SCM l1, ... , SCM_UNDEFINED)
-These correspond to the Scheme @code{(cons a b)} and @code{(list l0 l1
-...)} procedures. Note that @code{gh_list()} is a C macro that invokes
-@code{scm_listify()}.
-@end deftypefun
-
-@deftypefun SCM gh_car (SCM @var{obj})
-@deftypefunx SCM gh_cdr (SCM @var{obj})
-@dots{}
-
-@deftypefunx SCM gh_c[ad][ad][ad][ad]r (SCM @var{obj})
-These correspond to the Scheme @code{(caadar ls)} procedures etc @dots{}
-@end deftypefun
-
-@deftypefun SCM gh_set_car_x(SCM @var{pair}, SCM @var{value})
-Modifies the CAR of @var{pair} to be @var{value}. This is equivalent to
-the Scheme procedure @code{(set-car! ...)}.
-@end deftypefun
-
-@deftypefun SCM gh_set_cdr_x(SCM @var{pair}, SCM @var{value})
-Modifies the CDR of @var{pair} to be @var{value}. This is equivalent to
-the Scheme procedure @code{(set-cdr! ...)}.
-@end deftypefun
-
-@deftypefun {unsigned long} gh_length (SCM @var{ls})
-Returns the length of the list.
-@end deftypefun
-
-@deftypefun SCM gh_append (SCM @var{args})
-@deftypefunx SCM gh_append2 (SCM @var{l1}, SCM @var{l2})
-@deftypefunx SCM gh_append3 (SCM @var{l1}, SCM @var{l2}, @var{l3})
-@deftypefunx SCM gh_append4 (SCM @var{l1}, SCM @var{l2}, @var{l3}, @var{l4})
-@code{gh_append()} takes @var{args}, which is a list of lists
-@code{(list1 list2 ...)}, and returns a list containing all the elements
-of the individual lists.
-
-A typical invocation of @code{gh_append()} to append 5 lists together
-would be
-@smallexample
- gh_append(gh_list(l1, l2, l3, l4, l5, SCM_UNDEFINED));
-@end smallexample
-
-The functions @code{gh_append2()}, @code{gh_append2()},
-@code{gh_append3()} and @code{gh_append4()} are convenience routines to
-make it easier for C programs to form the list of lists that goes as an
-argument to @code{gh_append()}.
-@end deftypefun
-
-@deftypefun SCM gh_reverse (SCM @var{ls})
-Returns a new list that has the same elements as @var{ls} but in the
-reverse order. Note that this is implemented as a macro which calls
-@code{scm_reverse()}.
-@end deftypefun
-
-@deftypefun SCM gh_list_tail (SCM @var{ls}, SCM @var{k})
-Returns the sublist of @var{ls} with the last @var{k} elements.
-@end deftypefun
-
-@deftypefun SCM gh_list_ref (SCM @var{ls}, SCM @var{k})
-Returns the @var{k}th element of the list @var{ls}.
-@end deftypefun
-
-@deftypefun SCM gh_memq (SCM @var{x}, SCM @var{ls})
-@deftypefunx SCM gh_memv (SCM @var{x}, SCM @var{ls})
-@deftypefunx SCM gh_member (SCM @var{x}, SCM @var{ls})
-These functions return the first sublist of @var{ls} whose CAR is
-@var{x}. They correspond to @code{(memq x ls)}, @code{(memv x ls)} and
-@code{(member x ls)}, and hence use (respectively) @code{eq?},
-@code{eqv?} and @code{equal?} to do comparisons.
-
-If @var{x} does not appear in @var{ls}, the value @code{SCM_BOOL_F} (not
-the empty list) is returned.
-
-Note that these functions are implemented as macros which call
-@code{scm_memq()}, @code{scm_memv()} and @code{scm_member()}
-respectively.
-@end deftypefun
-
-@deftypefun SCM gh_assq (SCM @var{x}, SCM @var{alist})
-@deftypefunx SCM gh_assv (SCM @var{x}, SCM @var{alist})
-@deftypefunx SCM gh_assoc (SCM @var{x}, SCM @var{alist})
-These functions search an @dfn{association list} (list of pairs)
-@var{alist} for the first pair whose CAR is @var{x}, and they return
-that pair.
-
-If no pair in @var{alist} has @var{x} as its CAR, the value
-@code{SCM_BOOL_F} (not the empty list) is returned.
-
-Note that these functions are implemented as macros which call
-@code{scm_assq()}, @code{scm_assv()} and @code{scm_assoc()}
-respectively.
-@end deftypefun
-
-
-@heading Symbols
-
-@c @deftypefun SCM gh_symbol (SCM str, SCM len)
-@c @deftypefunx SCM gh_tmp_symbol (SCM str, SCM len)
-@c Takes the given string @var{str} of length @var{len} and returns a
-@c symbol corresponding to that string.
-@c @end deftypefun
-
-
-@heading Vectors
-
-@deftypefun SCM gh_make_vector (SCM @var{n}, SCM @var{fill})
-@deftypefunx SCM gh_vector (SCM @var{ls})
-@deftypefunx SCM gh_vector_ref (SCM @var{v}, SCM @var{i})
-@deftypefunx SCM gh_vector_set (SCM @var{v}, SCM @var{i}, SCM @var{val})
-@deftypefunx {unsigned long} gh_vector_length (SCM @var{v})
-@deftypefunx SCM gh_list_to_vector (SCM @var{ls})
-These correspond to the Scheme @code{(make-vector n fill)},
-@code{(vector a b c ...)} @code{(vector-ref v i)} @code{(vector-set v i
-value)} @code{(vector-length v)} @code{(list->vector ls)} procedures.
-
-The correspondence is not perfect for @code{gh_vector}: this routine
-takes a list @var{ls} instead of the individual list elements, thus
-making it identical to @code{gh_list_to_vector}.
-
-There is also a difference in gh_vector_length: the value returned is a
-C @code{unsigned long} instead of an SCM object.
-@end deftypefun
-
-
-@heading Procedures
-
-@c @deftypefun SCM gh_make_subr (SCM (*@var{fn})(), int @var{req}, int @var{opt}, int @var{restp}, char *@var{sym})
-@c Make the C function @var{fn} available to Scheme programs. The function
-@c will be bound to the symbol @var{sym}. The arguments @var{req},
-@c @var{opt} and @var{restp} describe @var{fn}'s calling conventions. The
-@c function must take @var{req} required arguments and may take @var{opt}
-@c optional arguments. Any optional arguments which are not supplied by
-@c the caller will be bound to @var{SCM_UNSPECIFIED}. If @var{restp} is
-@c non-zero, it means that @var{fn} may be called with an arbitrary number
-@c of arguments, and that any extra arguments supplied by the caller will
-@c be passed to @var{fn} as a list. The @var{restp} argument is exactly
-@c like Scheme's @code{(lambda (arg1 arg2 . arglist))} calling convention.
-@c
-@c For example, the procedure @code{read-line}, which takes optional
-@c @var{port} and @var{handle-delim} arguments, would be declared like so:
-@c
-@c @example
-@c SCM scm_read_line (SCM port, SCM handle_delim);
-@c gh_make_subr (scm_read_line, 0, 2, 0, "read-line");
-@c @end example
-@c
-@c The @var{req} argument to @code{gh_make_subr} is 0 to indicate that
-@c there are no required arguments, so @code{read-line} may be called
-@c without any arguments at all. The @var{opt} argument is 2, to indicate
-@c that both the @var{port} and @var{handle_delim} arguments to
-@c @code{scm_read_line} are optional, and will be bound to
-@c @code{SCM_UNSPECIFIED} if the calling program does not supply them.
-@c Because the @var{restp} argument is 0, this function may not be called
-@c with more than two arguments.
-@c @end deftypefun
-
-@deftypefun SCM gh_apply (SCM proc, SCM args)
-Call the Scheme procedure @var{proc}, with the elements of @var{args} as
-arguments. @var{args} must be a proper list.
-@end deftypefun
-
-@deftypefun SCM gh_call0 (SCM proc)
-@deftypefunx SCM gh_call1 (SCM proc, SCM arg)
-@deftypefunx SCM gh_call2 (SCM proc, SCM arg1, SCM arg2)
-@deftypefunx SCM gh_call3 (SCM proc, SCM arg1, SCM arg2, SCM arg3)
-Call the Scheme procedure @var{proc} with no arguments
-(@code{gh_call0}), one argument (@code{gh_call1}), and so on. You can
-get the same effect by wrapping the arguments up into a list, and
-calling @code{gh_apply}; Guile provides these functions for convenience.
-@end deftypefun
-
-
-@deftypefun SCM gh_catch (SCM key, SCM thunk, SCM handler)
-@deftypefunx SCM gh_throw (SCM key, SCM args)
-Corresponds to the Scheme @code{catch} and @code{throw} procedures,
-which in Guile are provided as primitives.
-@end deftypefun
-
-@c [FIXME: must add the I/O section in gscm.h]
-
-@deftypefun SCM gh_is_eq (SCM a, SCM b)
-@deftypefunx SCM gh_is_eqv (SCM a, SCM b)
-@deftypefunx SCM gh_is_equal (SCM a, SCM b)
-These correspond to the Scheme @code{eq?}, @code{eqv?} and @code{equal?}
-predicates.
-@end deftypefun
-
-@deftypefun int gh_obj_length (SCM @var{obj})
-Returns the raw object length.
-@end deftypefun
-
-@heading Data lookup
-
-For now I just include Tim Pierce's comments from the @file{gh_data.c}
-file; it should be organized into a documentation of the two functions
-here.
-
-@smallexample
-/* Data lookups between C and Scheme
-
- Look up a symbol with a given name, and return the object to which
- it is bound. gh_lookup examines the Guile top level, and
- gh_module_lookup checks the module name space specified by the
- `vec' argument.
-
- The return value is the Scheme object to which SNAME is bound, or
- SCM_UNDEFINED if SNAME is not bound in the given context. [FIXME:
- should this be SCM_UNSPECIFIED? Can a symbol ever legitimately be
- bound to SCM_UNDEFINED or SCM_UNSPECIFIED? What is the difference?
- -twp] */
-@end smallexample
-
-
-@node Mixing gh and scm APIs
-@section Mixing gh and scm APIs
-
-
-@node scm transition summary
-@section Transitioning to the scm Interface
-
-The following table summarizes the available information on how to
-transition from the GH to the scm interface. Where transitioning is not
-completely straightforward, the table includes a reference to more
-detailed documentation in the preceding sections.
-
-@table @asis
-@item Header file
-Use @code{#include <libguile.h>} instead of @code{#include
-<guile/gh.h>}.
-
-@item Compiling and Linking
-Use @code{guile-config} to pick up the flags required to compile C or
-C++ code that uses @code{libguile}, like so
-
-@smallexample
-$(CC) -o prog.o -c prog.c `guile-config compile`
-@end smallexample
-
-If you are using libtool to link your executables, just use
-@code{-lguile} in your link command. Libtool will expand this into
-the needed linker options automatically. If you are not using
-libtool, use the @code{guile-config} program to query the needed
-options explicitly. A linker command like
-
-@smallexample
-$(CC) -o prog prog.o `guile-config link`
-@end smallexample
-
-should be all that is needed. To link shared libraries that will be
-used as Guile Extensions, use libtool to control both the compilation
-and the link stage.
-
-@item The @code{SCM} type
-No change: the scm interface also uses this type to represent an
-arbitrary Scheme value.
-
-@item @code{SCM_BOOL_F} and @code{SCM_BOOL_T}
-No change.
-
-@item @code{SCM_UNSPECIFIED} and @code{SCM_UNDEFINED}
-No change.
-
-@item @code{gh_enter}
-Use @code{scm_boot_guile} instead, but note that @code{scm_boot_guile}
-has a slightly different calling convention from @code{gh_enter}:
-@code{scm_boot_guile}, and the main program function that you specify
-for @code{scm_boot_guile} to call, both take an additional @var{closure}
-parameter. @ref{Guile Initialization Functions} for more details.
-
-@item @code{gh_repl}
-Use @code{scm_shell} instead.
-
-@item @code{gh_init}
-Use @code{scm_init_guile} instead.
-
-@item @code{gh_eval_str}
-Use @code{scm_c_eval_string} instead.
-
-@item @code{gh_eval_file} or @code{gh_load}
-Use @code{scm_c_primitive_load} instead.
-
-@item @code{gh_new_procedure}
-Use @code{scm_c_define_gsubr} instead, but note that the arguments are
-in a different order: for @code{scm_c_define_gsubr} the C function
-pointer is the last argument. @ref{A Sample Guile Extension} for an
-example.
-
-@item @code{gh_defer_ints} and @code{gh_allow_ints}
-Use @code{SCM_DEFER_INTS} and @code{SCM_ALLOW_INTS} instead. Note that
-these macros are used without parentheses, as in @code{SCM_DEFER_INTS;}.
-
-@item @code{gh_bool2scm}
-Use @code{SCM_BOOL} instead.
-
-@item @code{gh_ulong2scm}
-Use @code{scm_ulong2num} instead.
-
-@item @code{gh_long2scm}
-Use @code{scm_long2num} instead.
-
-@item @code{gh_double2scm}
-Use @code{scm_make_real} instead.
-
-@item @code{gh_char2scm}
-Use @code{SCM_MAKE_CHAR} instead.
-
-@item @code{gh_str2scm}
-Use @code{scm_mem2string} instead.
-
-@item @code{gh_str02scm}
-Use @code{scm_makfrom0str} instead.
-
-@item @code{gh_set_substr}
-No direct scm equivalent. [FIXME]
-
-@item @code{gh_symbol2scm}
-Use @code{scm_str2symbol} instead. [FIXME: inconsistent naming,
-should be @code{scm_str02symbol}.]
-
-@item @code{gh_ints2scm} and @code{gh_doubles2scm}
-Use @code{scm_c_ints2scm} and @code{scm_c_doubles2scm} instead.
-
-@item @code{gh_chars2byvect} and @code{gh_shorts2svect}
-Use @code{scm_c_chars2byvect} and @code{scm_c_shorts2svect} instead.
-
-@item @code{gh_longs2ivect} and @code{gh_ulongs2uvect}
-Use @code{scm_c_longs2ivect} and @code{scm_c_ulongs2uvect} instead.
-
-@item @code{gh_floats2fvect} and @code{gh_doubles2dvect}
-Use @code{scm_c_floats2fvect} and @code{scm_c_doubles2dvect} instead.
-
-@item @code{gh_scm2bool}
-Use @code{SCM_NFALSEP} instead.
-
-@item @code{gh_scm2int}
-Replace @code{gh_scm2int (@var{obj})} by
-@example
-scm_num2int (@var{obj}, SCM_ARG1, @var{str})
-@end example
-where @var{str} is a C string that describes the context of the call.
-
-@item @code{gh_scm2ulong}
-Replace @code{gh_scm2ulong (@var{obj})} by
-@example
-scm_num2ulong (@var{obj}, SCM_ARG1, @var{str})
-@end example
-where @var{str} is a C string that describes the context of the call.
-
-@item @code{gh_scm2long}
-Replace @code{gh_scm2long (@var{obj})} by
-@example
-scm_num2long (@var{obj}, SCM_ARG1, @var{str})
-@end example
-where @var{str} is a C string that describes the context of the call.
-
-@item @code{gh_scm2double}
-Replace @code{gh_scm2double (@var{obj})} by
-@example
-scm_num2dbl (@var{obj}, @var{str})
-@end example
-where @var{str} is a C string that describes the context of the call.
-
-@item @code{gh_scm2char}
-Use the @code{SCM_CHAR} macro instead, but note that @code{SCM_CHAR}
-does not check that its argument is actually a character. To check that
-a @code{SCM} value is a character before using @code{SCM_CHAR} to
-extract the character value, use the @code{SCM_VALIDATE_CHAR} macro.
-
-@item @code{gh_scm2newstr}
-Instead of @code{gh_scm2newstr (@var{obj}, @var{lenp})} use
-@code{scm_c_string2str (@var{obj}, @var{str}, @var{lenp})}. With the
-additional @var{str} argument the user can pass a pre-allocated memory
-chunk or leave it passing NULL.
-
-@item @code{gh_get_substr}
-Use the @code{scm_c_substring2str (@var{obj}, @var{str}, @var{start},
-@var{len})} function instead.
-
-@item @code{gh_symbol2newstr}
-Use the @code{scm_c_symbol2str (@var{obj}, @var{str}, @var{lenp})} function
-instead. With the additional @var{str} argument the user can pass a
-pre-allocated memory chunk or leave it passing NULL.
-
-@item @code{gh_scm2chars}
-Use @code{scm_c_scm2chars} instead.
-
-@item @code{gh_scm2shorts} and @code{gh_scm2longs}
-Use @code{scm_c_shorts2scm} and @code{scm_c_longs2scm} instead.
-
-@item @code{gh_scm2floats} and @code{gh_scm2doubles}
-Use @code{scm_c_floats2scm} and @code{scm_c_doubles2scm} instead.
-
-@item @code{gh_boolean_p}
-Use the @code{SCM_BOOLP} macro instead, or replace @code{gh_boolean_p
-(@var{obj})} by
-@example
-SCM_NFALSEP (scm_boolean_p (@var{obj}))
-@end example
-
-@item @code{gh_symbol_p}
-Use the @code{SCM_SYMBOLP} macro instead, or replace @code{gh_symbol_p
-(@var{obj})} by
-@example
-SCM_NFALSEP (scm_symbol_p (@var{obj}))
-@end example
-
-@item @code{gh_char_p}
-Use the @code{SCM_CHARP} macro instead, or replace @code{gh_char_p
-(@var{obj})} by
-@example
-SCM_NFALSEP (scm_char_p (@var{obj}))
-@end example
-
-@item @code{gh_vector_p}
-Use the @code{SCM_VECTORP} macro instead, or replace @code{gh_vector_p
-(@var{obj})} by
-@example
-SCM_NFALSEP (scm_vector_p (@var{obj}))
-@end example
-
-@item @code{gh_pair_p}
-Use the @code{SCM_CONSP} macro instead, or replace @code{gh_pair_p
-(@var{obj})} by
-@example
-SCM_NFALSEP (scm_pair_p (@var{obj}))
-@end example
-
-@item @code{gh_number_p}
-Use the @code{SCM_NUMBERP} macro instead, or replace @code{gh_number_p
-(@var{obj})} by
-@example
-SCM_NFALSEP (scm_number_p (@var{obj}))
-@end example
-
-@item @code{gh_string_p}
-Use the @code{SCM_STRINGP} macro instead, or replace @code{gh_string_p
-(@var{obj})} by
-@example
-SCM_NFALSEP (scm_string_p (@var{obj}))
-@end example
-
-@item @code{gh_procedure_p}
-Replace @code{gh_procedure_p (@var{obj})} by
-@example
-SCM_NFALSEP (scm_procedure_p (@var{obj}))
-@end example
-
-@item @code{gh_list_p}
-Replace @code{gh_list_p (@var{obj})} by
-@example
-SCM_NFALSEP (scm_list_p (@var{obj}))
-@end example
-
-@item @code{gh_inexact_p}
-Use the @code{SCM_INEXACTP} macro instead, or replace @code{gh_inexact_p
-(@var{obj})} by
-@example
-SCM_NFALSEP (scm_inexact_p (@var{obj}))
-@end example
-
-@item @code{gh_exact_p}
-Replace @code{gh_exact_p (@var{obj})} by
-@example
-SCM_NFALSEP (scm_exact_p (@var{obj}))
-@end example
-
-@item @code{gh_eq_p}
-Use the @code{SCM_EQ_P} macro instead, or replace @code{gh_eq_p
-(@var{x}, @var{y})} by
-@example
-SCM_NFALSEP (scm_eq_p (@var{x}, @var{y}))
-@end example
-
-@item @code{gh_eqv_p}
-Replace @code{gh_eqv_p (@var{x}, @var{y})} by
-@example
-SCM_NFALSEP (scm_eqv_p (@var{x}, @var{y}))
-@end example
-
-@item @code{gh_equal_p}
-Replace @code{gh_equal_p (@var{x}, @var{y})} by
-@example
-SCM_NFALSEP (scm_equal_p (@var{x}, @var{y}))
-@end example
-
-@item @code{gh_string_equal_p}
-Replace @code{gh_string_equal_p (@var{x}, @var{y})} by
-@example
-SCM_NFALSEP (scm_string_equal_p (@var{x}, @var{y}))
-@end example
-
-@item @code{gh_null_p}
-Use the @code{SCM_NULLP} macro instead, or replace @code{gh_null_p
-(@var{obj})} by
-@example
-SCM_NFALSEP (scm_null_p (@var{obj}))
-@end example
-
-@item @code{gh_cons}
-Use @code{scm_cons} instead.
-
-@item @code{gh_car} and @code{gh_cdr}
-Use the @code{SCM_CAR} and @code{SCM_CDR} macros instead.
-
-@item @code{gh_cxxr} and @code{gh_cxxxr}
-(Where each x is either @samp{a} or @samp{d}.) Use the corresponding
-@code{SCM_CXXR} or @code{SCM_CXXXR} macro instead.
-
-@item @code{gh_set_car_x} and @code{gh_set_cdr_x}
-Use @code{scm_set_car_x} and @code{scm_set_cdr_x} instead.
-
-@item @code{gh_list}
-Use @code{scm_listify} instead.
-
-@item @code{gh_length}
-Replace @code{gh_length (@var{lst})} by
-@example
-scm_num2ulong (scm_length (@var{lst}), SCM_ARG1, @var{str})
-@end example
-where @var{str} is a C string that describes the context of the call.
-
-@item @code{gh_append}
-Use @code{scm_append} instead.
-
-@item @code{gh_append2}, @code{gh_append3}, @code{gh_append4}
-Replace @code{gh_append@var{N} (@var{l1}, @dots{}, @var{lN})} by
-@example
-scm_append (scm_listify (@var{l1}, @dots{}, @var{lN}, SCM_UNDEFINED))
-@end example
-
-@item @code{gh_reverse}
-Use @code{scm_reverse} instead.
-
-@item @code{gh_list_tail} and @code{gh_list_ref}
-Use @code{scm_list_tail} and @code{scm_list_ref} instead.
-
-@item @code{gh_memq}, @code{gh_memv} and @code{gh_member}
-Use @code{scm_memq}, @code{scm_memv} and @code{scm_member} instead.
-
-@item @code{gh_assq}, @code{gh_assv} and @code{gh_assoc}
-Use @code{scm_assq}, @code{scm_assv} and @code{scm_assoc} instead.
-
-@item @code{gh_make_vector}
-Use @code{scm_make_vector} instead.
-
-@item @code{gh_vector} or @code{gh_list_to_vector}
-Use @code{scm_vector} instead.
-
-@item @code{gh_vector_ref} and @code{gh_vector_set_x}
-Use @code{scm_vector_ref} and @code{scm_vector_set_x} instead.
-
-@item @code{gh_vector_length}
-Use the @code{SCM_VECTOR_LENGTH} macro instead.
-
-@item @code{gh_apply}
-Use @code{scm_apply} instead, but note that @code{scm_apply} takes an
-additional third argument that you should set to @code{SCM_EOL}.
-
-@end table
diff --git a/doc/ref/guile.texi b/doc/ref/guile.texi
deleted file mode 100644
index c819fb53d..000000000
--- a/doc/ref/guile.texi
+++ /dev/null
@@ -1,389 +0,0 @@
-\input texinfo
-@c -*-texinfo-*-
-@c %**start of header
-@setfilename guile.info
-@settitle Guile Reference Manual
-@set guile
-@set MANUAL_EDITION 1.1
-@c %**end of header
-
-@c Notes
-@c
-@c We no longer use the category "primitive" to distinguish C-defined
-@c Scheme procedures from those defined in Scheme. Instead, the
-@c reference manual now includes a C declaration as well as a Scheme
-@c declaration for each procedure that is available in both Scheme and
-@c C.
-@c
-@c When adding a new reference entry to the Guile manual, please
-@c document it with @deffn using one of the following categories:
-@c
-@c {Scheme Procedure}
-@c {Scheme Syntax}
-@c {C Function}
-@c {C Macro}
-@c
-@c If the entry is for a new primitive, it should have both a @deffn
-@c {Scheme Procedure} line and a @deffnx {C Function} line; see the
-@c manual source for plenty of existing examples of this.
-@c
-@c For {C Function} entries where the return type and all parameter
-@c types are SCM, we omit the SCMs. This is easier to read and also
-@c gets round the problem that Texinfo doesn't allow a @deftypefnx
-@c inside a @deffn.
-@c
-@c For a list of Guile primitives that are not yet incorporated into the
-@c reference manual, see the file `new-docstrings.texi', which holds all
-@c the docstrings snarfed from the libguile C sources for primitives
-@c that are not in the reference manual. If you have worked with some
-@c of these concepts, implemented them, or just happen to know what they
-@c do, please write up a little explanation -- it would be a big help.
-@c Alternatively, if you know of any reason why some of these should
-@c *not* go in the manual, please let the mailing list
-@c <guile-devel@gnu.org> know.
-
-@c Define indices that are used in the Guile Scheme part of the
-@c reference manual to group stuff according to whether it is R5RS or a
-@c Guile extension.
-@defcodeindex rn
-
-@include version.texi
-
-@c vnew - For (some) new items, indicates the Guile version in which
-@c item first appeared. In future, this could be made to expand to
-@c something like a "New in Guile 45!" banner.
-@macro vnew{VERSION}
-@end macro
-
-@c @iftex
-@c @cropmarks
-@c @end iftex
-
-@dircategory The Algorithmic Language Scheme
-@direntry
-* Guile Reference: (guile). The Guile reference manual.
-@end direntry
-
-@setchapternewpage off
-
-@ifinfo
-Guile Reference Manual
-Copyright (C) 1996 Free Software Foundation @*
-Copyright (C) 1997 Free Software Foundation @*
-Copyright (C) 2000 Free Software Foundation @*
-Copyright (C) 2001 Free Software Foundation @*
-Copyright (C) 2002 Free Software Foundation
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@ignore
-Permission is granted to process this file through TeX and print the
-results, provided the printed document carries copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-@end ignore
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the entire
-resulting derived work is distributed under the terms of a permission
-notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that this permission notice may be stated in a translation approved
-by the Free Software Foundation.
-@end ifinfo
-
-@titlepage
-@sp 10
-@comment The title is printed in a large font.
-@title Guile Reference Manual
-@subtitle Edition @value{MANUAL_EDITION}, for use with Guile @value{VERSION}
-@subtitle $Id: guile.texi,v 1.18 2002-04-20 19:26:40 ossau Exp $
-
-@c AUTHORS
-
-@c The Guile reference and tutorial manuals were written and edited
-@c largely by Mark Galassi and Jim Blandy. In particular, Jim wrote the
-@c original tutorial on Guile's data representation and the C API for
-@c accessing Guile objects.
-
-@c Significant portions were contributed by Gary Houston (contributions
-@c to POSIX system calls and networking, expect, I/O internals and
-@c extensions, slib installation, error handling) and Tim Pierce
-@c (sections on script interpreter triggers, alists, function tracing).
-
-@c Tom Lord contributed a great deal of material with early Guile
-@c snapshots; although most of this text has been rewritten, all of it
-@c was important, and some of the structure remains.
-
-@c Aubrey Jaffer wrote the SCM Scheme implementation and manual upon
-@c which the Guile program and manual are based. Some portions of the
-@c SCM and SLIB manuals have been included here verbatim.
-
-@c Since Guile 1.4, Neil Jerram has been maintaining and improving the
-@c reference manual. Among other contributions, he wrote the Basic
-@c Ideas chapter, developed the tools for keeping the manual in sync
-@c with snarfed libguile docstrings, and reorganized the structure so as
-@c to accommodate docstrings for all Guile's primitives.
-
-@c Martin Grabmueller has made substantial contributions throughout the
-@c reference manual in preparation for the Guile 1.6 release, including
-@c filling out a lot of the documentation of Scheme data types, control
-@c mechanisms and procedures. In addition, he wrote the documentation
-@c for Guile's SRFI modules and modules associated with the Guile REPL.
-
-@author Mark Galassi
-@author Cygnus Solution and Los Alamos National Laboratory
-@author @email{rosalia@@cygnus.com}
-@author
-@author Jim Blandy
-@author Free Software Foundation and MIT AI Lab
-@author @email{jimb@@red-bean.com}
-@author
-@author Gary Houston
-@author @email{ghouston@@arglist.com}
-@author
-@author Tim Pierce
-@author @email{twp@@skepsis.com}
-@author
-@author Neil Jerram
-@author @email{neil@@ossau.uklinux.net}
-@author
-@author Martin Grabmueller
-@author @email{mgrabmue@@cs.tu-berlin.de}
-
-@c The following two commands start the copyright page.
-@page
-@vskip 0pt plus 1filll
-@vskip 0pt plus 1filll
-Copyright @copyright{} 1996 Free Software Foundation
-
-Copyright @copyright{} 1997 Free Software Foundation
-
-Copyright @copyright{} 2000 Free Software Foundation
-
-Copyright @copyright{} 2001 Free Software Foundation
-
-Copyright @copyright{} 2002 Free Software Foundation
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the entire
-resulting derived work is distributed under the terms of a permission
-notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that this permission notice may be stated in a translation approved
-by Free Software Foundation.
-@end titlepage
-
-@c @smallbook
-@finalout
-@headings double
-
-@c Where to find Guile examples.
-@set example-dir doc/examples
-
-@ifnottex
-@node Top, Guile License, (dir), (dir)
-@top The Guile Reference Manual
-
-This reference manual documents Guile, GNU's Ubiquitous Intelligent
-Language for Extensions. It describes how to use Guile in many useful
-and interesting ways.
-
-This Info file contains edition @value{MANUAL_EDITION} of the reference
-manual, corresponding to Guile version @value{VERSION}.
-@end ifnottex
-
-@menu
-Preface
-
-* Guile License:: Conditions for copying and using Guile.
-* Manual Layout:: How to read the rest of this manual.
-* Manual Conventions:: Conventional terminology.
-
-Part I: Introduction to Guile
-
-* What is Guile?:: And what does it do?
-* Whirlwind Tour:: An introductory whirlwind tour.
-* Obtaining and Installing Guile::
-* Reporting Bugs:: Reporting bugs in Guile or this manual.
-
-Part II: Writing and Running Guile Scheme
-
-* Running Intro:: Introduction to this part.
-* Guile Scheme:: Guile's implementation of Scheme.
-* Guile Scripting:: How to write Guile scripts.
-* Command Line Handling:: Command line options and arguments.
-* Debugging Features:: Features for debugging errors.
-* Autoconf Support:: Guile-specific configure.in macros.
-* Miscellaneous Tools:: Snarfing, linting, etc.
-* Basic Ideas:: Basic ideas in Scheme.
-* Further Reading:: Where to find out more about Scheme.
-
-Part III: Guile as an Extension Language
-
-* Programming Intro:: Introduction to this part.
-* Libguile Intro:: Using Guile as an extension language.
-* Programming Overview:: An overview of Guile programming.
-* Data Representation:: Data representation in Guile.
-* GH:: The deprecated GH interface.
-
-Part IV: Guile API Reference
-
-* Reference Intro:: Introduction to the Guile API reference.
-* API Overview:: Overview of the Guile API.
-* Simple Data Types:: Numbers, strings, booleans and so on.
-* Compound Data Types:: Data types for holding other data.
-* Procedures and Macros:: Procedures and macros.
-* Utility Functions:: General utility functions.
-* Binding Constructs:: Definitions and variable bindings.
-* Control Mechanisms:: Controlling the flow of program execution.
-* Input and Output:: Ports, reading and writing.
-* Read/Load/Eval:: Reading and evaluating Scheme code.
-* Memory Management:: Memory management and garbage collection.
-* Objects:: Low level object orientation support.
-* Modules:: Designing reusable code libraries.
-* Scheduling:: Threads, mutexes, asyncs and dynamic roots.
-* Options and Config:: Runtime options and configuration.
-* Translation:: Support for translating other languages.
-* Debugging:: Internal debugging interface.
-* Deprecated:: Features that are planned to disappear.
-
-Part V: Guile Modules
-
-* SLIB:: Using the SLIB Scheme library.
-* POSIX:: POSIX system calls and networking.
-* SRFI Support:: Support for various SRFIs.
-* Readline Support:: Module for using the readline library.
-* Value History:: Maintaining a value history in the REPL.
-* Pretty Printing:: Nicely formatting Scheme objects for output.
-* Formatted Output:: The @code{format} procedure.
-* Rx Regexps:: The Rx regular expression library.
-* Expect:: Controlling interactive programs with Guile.
-* The Scheme shell (scsh):: Using scsh interfaces in Guile.
-
-Indices
-
-* Concept Index::
-* Procedure Index::
-* Variable Index::
-* Type Index::
-* R5RS Index::
-
-@end menu
-
-@include preface.texi
-
-@iftex
-@page
-@unnumbered{Part I: Introduction to Guile}
-@end iftex
-
-@include intro.texi
-
-@page
-@node Running Intro
-@unnumbered Part II: Writing and Running Guile Scheme
-
-Guile's core language is Scheme, and an awful lot can be achieved simply
-by using Guile to write and run Scheme programs. In this part of the
-manual, we explain how to use Guile in this mode, and describe the tools
-that Guile provides to help you with script writing, debugging and
-packaging your programs for distribution.
-
-For readers who are not yet familiar with the Scheme language, this part
-includes a chapter that presents the basic concepts of the language, and
-gives references to freely available Scheme tutorial material on the
-web.
-
-For detailed reference information on the variables, functions etc. that
-make up Guile's application programming interface (API), please refer to
-Part IV (@pxref{Reference Intro,,Part IV --- Guile API Reference}).
-
-@include scheme-intro.texi
-@include scripts.texi
-@include script-getopt.texi
-@include debugging.texi
-@include autoconf.texi
-@include tools.texi
-@include scheme-ideas.texi
-@include scheme-reading.texi
-
-@page
-@node Programming Intro
-@unnumbered Part III: Guile as an Extension Language
-
-In this part of the manual, we aim to present a wide ranging picture of
-what it means to use Guile as an application extension language, to
-provide guidance, practical guidelines and tips for @emph{how} to
-program in Guile, and to document the tools that are available to help
-you with your programming. For detailed reference information on the
-variables, functions etc. that make up Guile's application programming
-interface (API), please refer to Part IV (@pxref{Reference Intro,,Part
-IV --- Guile API Reference}).
-
-@include extend.texi
-@include program.texi
-@include data-rep.texi
-@include gh.texi
-
-@page
-@node Reference Intro
-@unnumbered Part IV: Guile API Reference
-
-Guile provides an application programming interface (@dfn{API}) to
-developers in two core languages: Scheme and C. This part of the manual
-contains reference documentation for all of the functionality that is
-available through both Scheme and C interfaces.
-
-@include scm.texi
-@include scheme-data.texi
-@include scheme-compound.texi
-@include scheme-procedures.texi
-@include scheme-utility.texi
-@include scheme-binding.texi
-@include scheme-control.texi
-@include scheme-io.texi
-@include scheme-evaluation.texi
-@include scheme-memory.texi
-@include scheme-modules.texi
-@include scheme-scheduling.texi
-@c object orientation support here
-@include scheme-options.texi
-@include scheme-translation.texi
-@include scheme-debug.texi
-@include deprecated.texi
-
-@iftex
-@page
-@unnumbered{Part V: Guile Modules}
-@end iftex
-
-@include slib.texi
-@include posix.texi
-@include srfi-modules.texi
-@include repl-modules.texi
-@include misc-modules.texi
-@include expect.texi
-@include scsh.texi
-
-@iftex
-@page
-@unnumbered{Indices}
-@end iftex
-
-@include indices.texi
-@include scheme-indices.texi
-
-@contents
-
-@bye
diff --git a/doc/ref/indices.texi b/doc/ref/indices.texi
deleted file mode 100644
index 11ab7476b..000000000
--- a/doc/ref/indices.texi
+++ /dev/null
@@ -1,52 +0,0 @@
-@page
-@node Concept Index
-@unnumbered Concept Index
-
-This index contains concepts, keywords and non-Schemey names for several
-features, to make it easier to locate the desired sections.
-
-@printindex cp
-
-
-@page
-@node Procedure Index
-@unnumbered Procedure Index
-
-@c FIXME::martin: Review me!
-
-This is an alphabetical list of all the procedures and macros in Guile.
-
-When looking for a particular procedure, please look under its Scheme
-name as well as under its C name. The C name can be constructed from
-the Scheme names by a simple transformation described in the section
-@xref{Transforming Scheme name to C name}.
-
-@printindex fn
-
-
-@page
-@node Variable Index
-@unnumbered Variable Index
-
-@c FIXME::martin: Review me!
-
-This is an alphabetical list of all the important variables and
-constants in Guile.
-
-When looking for a particular variable or constant, please look under
-its Scheme name as well as under its C name. The C name can be
-constructed from the Scheme names by a simple transformation described
-in the section @xref{Transforming Scheme name to C name}.
-
-@printindex vr
-
-
-@page
-@node Type Index
-@unnumbered Type Index
-
-This is an alphabetical list of all the important data types defined in
-the Guile Programmers Manual.
-
-@printindex tp
-
diff --git a/doc/ref/intro.texi b/doc/ref/intro.texi
deleted file mode 100644
index af1b48d0e..000000000
--- a/doc/ref/intro.texi
+++ /dev/null
@@ -1,1128 +0,0 @@
-@page
-@node What is Guile?
-@chapter What is Guile?
-
-Guile is an interpreter for the Scheme programming language, packaged
-for use in a wide variety of environments. Guile implements Scheme as
-described in the
-@tex
-Revised$^5$
-@end tex
-@ifnottex
-Revised^5
-@end ifnottex
-Report on the Algorithmic Language Scheme (usually known as R5RS),
-providing clean and general data and control structures. Guile goes
-beyond the rather austere language presented in R5RS, extending it with
-a module system, full access to POSIX system calls, networking support,
-multiple threads, dynamic linking, a foreign function call interface,
-powerful string processing, and many other features needed for
-programming in the real world.
-
-Like a shell, Guile can run interactively, reading expressions from the
-user, evaluating them, and displaying the results, or as a script
-interpreter, reading and executing Scheme code from a file. However,
-Guile is also packaged as an object library, allowing other applications
-to easily incorporate a complete Scheme interpreter. An application can
-use Guile as an extension language, a clean and powerful configuration
-language, or as multi-purpose ``glue'', connecting primitives provided
-by the application. It is easy to call Scheme code from C code and vice
-versa, giving the application designer full control of how and when to
-invoke the interpreter. Applications can add new functions, data types,
-control structures, and even syntax to Guile, creating a domain-specific
-language tailored to the task at hand, but based on a robust language
-design.
-
-Guile's module system allows one to break up a large program into
-manageable sections with well-defined interfaces between them. Modules
-may contain a mixture of interpreted and compiled code; Guile can use
-either static or dynamic linking to incorporate compiled code. Modules
-also encourage developers to package up useful collections of routines
-for general distribution; as of this writing, one can find Emacs
-interfaces, database access routines, compilers, GUI toolkit interfaces,
-and HTTP client functions, among others.
-
-In the future, we hope to expand Guile to support other languages like
-Tcl and Perl by translating them to Scheme code. This means that users
-can program applications which use Guile in the language of their
-choice, rather than having the tastes of the application's author
-imposed on them.
-
-
-@page
-@node Whirlwind Tour
-@chapter A Whirlwind Tour
-
-This chapter presents a quick tour of all the ways that Guile can be
-used.
-
-@menu
-* Running Guile Interactively::
-* Guile Scripts::
-* Linking Programs With Guile::
-* Writing Extensions for Guile::
-* Guile Modules::
-@end menu
-
-
-@node Running Guile Interactively
-@section Running Guile Interactively
-
-In its simplest form, Guile acts as an interactive interpreter for the
-Scheme programming language, reading and evaluating Scheme expressions
-the user enters from the terminal. Here is a sample interaction between
-Guile and a user; the user's input appears after the @code{$} and
-@code{guile>} prompts:
-
-@example
-$ guile
-guile> (+ 1 2 3) ; add some numbers
-6
-guile> (define (factorial n) ; define a function
- (if (zero? n) 1 (* n (factorial (- n 1)))))
-guile> (factorial 20)
-2432902008176640000
-guile> (getpwnam "jimb") ; find my entry in /etc/passwd
-#("jimb" ".0krIpK2VqNbU" 4008 10 "Jim Blandy" "/u/jimb"
- "/usr/local/bin/bash")
-guile> @kbd{C-d}
-$
-@end example
-
-@c [[When we get a fancier read-eval-print loop, with features for bouncing
-@c around among modules, referring to the value of the last expression,
-@c etc. then this section will get longer.]]
-
-
-@node Guile Scripts
-@section Guile Scripts
-
-Like AWK, Perl, or any shell, Guile can interpret script files. A Guile
-script is simply a file of Scheme code with some extra information at
-the beginning which tells the operating system how to invoke Guile, and
-then tells Guile how to handle the Scheme code.
-
-Before we present the details, here is a trivial Guile script:
-
-@example
-#!/usr/local/bin/guile -s
-!#
-(display "Hello, world!")
-(newline)
-@end example
-
-@menu
-* The Top of a Script File:: How to start a Guile script.
-* Scripting Examples:: Simple Guile scripts, explained.
-@end menu
-
-
-@node The Top of a Script File
-@subsection The Top of a Script File
-
-The first line of a Guile script must tell the operating system to use
-Guile to evaluate the script, and then tell Guile how to go about doing
-that. Here is the simplest case:
-
-@itemize @bullet
-
-@item
-The first two characters of the file must be @samp{#!}.
-
-The operating system interprets this to mean that the rest of the line
-is the name of an executable that can interpret the script. Guile,
-however, interprets these characters as the beginning of a multi-line
-comment, terminated by the characters @samp{!#} on a line by themselves.
-(This is an extension to the syntax described in R5RS, added to support
-shell scripts.)
-
-@item
-Immediately after those two characters must come the full pathname to
-the Guile interpreter. On most systems, this would be
-@samp{/usr/local/bin/guile}.
-
-@item
-Then must come a space, followed by a command-line argument to pass to
-Guile; this should be @samp{-s}. This switch tells Guile to run a
-script, instead of soliciting the user for input from the terminal.
-There are more elaborate things one can do here; see @ref{The Meta
-Switch}.
-
-@item
-Follow this with a newline.
-
-@item
-The second line of the script should contain only the characters
-@samp{!#} --- just like the top of the file, but reversed. The
-operating system never reads this far, but Guile treats this as the end
-of the comment begun on the first line by the @samp{#!} characters.
-
-@item
-The rest of the file should be a Scheme program.
-
-@end itemize
-
-Guile reads the program, evaluating expressions in the order that they
-appear. Upon reaching the end of the file, Guile exits.
-
-The function @code{command-line} returns the name of the script file and
-any command-line arguments passed by the user, as a list of strings.
-
-For example, consider the following script file:
-@example
-#!/usr/local/bin/guile -s
-!#
-(write (command-line))
-(newline)
-@end example
-
-If you put that text in a file called @file{foo} in the current
-directory, then you could make it executable and try it out like this:
-@example
-$ chmod a+x foo
-$ ./foo
-("./foo")
-$ ./foo bar baz
-("./foo" "bar" "baz")
-$
-@end example
-
-As another example, here is a simple replacement for the POSIX
-@code{echo} command:
-@example
-#!/usr/local/bin/guile -s
-!#
-(for-each (lambda (s) (display s) (display " "))
- (cdr (command-line)))
-(newline)
-@end example
-
-@deffn {Scheme Procedure} command-line
-@deffnx {Scheme Procedure} program-arguments
-Return a list of the command-line arguments passed to the currently
-running program. If the program invoked Guile with the @samp{-s},
-@samp{-c} or @samp{--} switches, these procedures ignore everything up
-to and including those switches.
-@end deffn
-
-
-@node Scripting Examples
-@subsection Scripting Examples
-
-To start with, here are some examples of invoking Guile directly:
-
-@table @code
-
-@item guile -- a b c
-Run Guile interactively; @code{(command-line)} will return @*
-@code{("/usr/local/bin/guile" "a" "b" "c")}.
-
-@item guile -s /u/jimb/ex2 a b c
-Load the file @file{/u/jimb/ex2}; @code{(command-line)} will return @*
-@code{("/u/jimb/ex2" "a" "b" "c")}.
-
-@item guile -c '(write %load-path) (newline)'
-Write the value of the variable @code{%load-path}, print a newline,
-and exit.
-
-@item guile -e main -s /u/jimb/ex4 foo
-Load the file @file{/u/jimb/ex4}, and then call the function
-@code{main}, passing it the list @code{("/u/jimb/ex4" "foo")}.
-
-@item guile -l first -ds -l last -s script
-Load the files @file{first}, @file{script}, and @file{last}, in that
-order. The @code{-ds} switch says when to process the @code{-s}
-switch. For a more motivated example, see the scripts below.
-
-@end table
-
-
-Here is a very simple Guile script:
-@example
-#!/usr/local/bin/guile -s
-!#
-(display "Hello, world!")
-(newline)
-@end example
-The first line marks the file as a Guile script. When the user invokes
-it, the system runs @file{/usr/local/bin/guile} to interpret the script,
-passing @code{-s}, the script's filename, and any arguments given to the
-script as command-line arguments. When Guile sees @code{-s
-@var{script}}, it loads @var{script}. Thus, running this program
-produces the output:
-@example
-Hello, world!
-@end example
-
-Here is a script which prints the factorial of its argument:
-@example
-#!/usr/local/bin/guile -s
-!#
-(define (fact n)
- (if (zero? n) 1
- (* n (fact (- n 1)))))
-
-(display (fact (string->number (cadr (command-line)))))
-(newline)
-@end example
-In action:
-@example
-$ fact 5
-120
-$
-@end example
-
-However, suppose we want to use the definition of @code{fact} in this
-file from another script. We can't simply @code{load} the script file,
-and then use @code{fact}'s definition, because the script will try to
-compute and display a factorial when we load it. To avoid this problem,
-we might write the script this way:
-
-@example
-#!/usr/local/bin/guile \
--e main -s
-!#
-(define (fact n)
- (if (zero? n) 1
- (* n (fact (- n 1)))))
-
-(define (main args)
- (display (fact (string->number (cadr args))))
- (newline))
-@end example
-This version packages the actions the script should perform in a
-function, @code{main}. This allows us to load the file purely for its
-definitions, without any extraneous computation taking place. Then we
-used the meta switch @code{\} and the entry point switch @code{-e} to
-tell Guile to call @code{main} after loading the script.
-@example
-$ fact 50
-30414093201713378043612608166064768844377641568960512000000000000
-@end example
-
-Suppose that we now want to write a script which computes the
-@code{choose} function: given a set of @var{m} distinct objects,
-@code{(choose @var{n} @var{m})} is the number of distinct subsets
-containing @var{n} objects each. It's easy to write @code{choose} given
-@code{fact}, so we might write the script this way:
-@example
-#!/usr/local/bin/guile \
--l fact -e main -s
-!#
-(define (choose n m)
- (/ (fact m) (* (fact (- m n)) (fact n))))
-
-(define (main args)
- (let ((n (string->number (cadr args)))
- (m (string->number (caddr args))))
- (display (choose n m))
- (newline)))
-@end example
-
-The command-line arguments here tell Guile to first load the file
-@file{fact}, and then run the script, with @code{main} as the entry
-point. In other words, the @code{choose} script can use definitions
-made in the @code{fact} script. Here are some sample runs:
-@example
-$ choose 0 4
-1
-$ choose 1 4
-4
-$ choose 2 4
-6
-$ choose 3 4
-4
-$ choose 4 4
-1
-$ choose 50 100
-100891344545564193334812497256
-@end example
-
-
-@node Linking Programs With Guile
-@section Linking Programs With Guile
-
-The Guile interpreter is available as an object library, to be linked
-into applications using Scheme as a configuration or extension
-language. This chapter covers the mechanics of linking your program
-with Guile on a typical POSIX system.
-
-Parts III and IV of this manual describe the C functions Guile provides.
-Furthermore, any Scheme function described in this manual as a
-``Primitive'' is also callable from C; see @ref{Primitives}.
-
-The header file @code{<libguile.h>} provides declarations for all of
-Guile's functions and constants. You should @code{#include} it at the
-head of any C source file that uses identifiers described in this
-manual. Once you've compiled your source files, you need to link them
-against the Guile object code library, @code{libguile}.
-
-On most systems, you should not need to tell the compiler and linker
-explicitly where they can find @file{libguile.h} and @file{libguile}.
-When Guile has been installed in a peculiar way, or when you are on a
-peculiar system, things might not be so easy and you might need to pass
-additional @code{-I} or @code{-L} options to the compiler. Guile
-provides the utility program @code{guile-config} to help you find the
-right values for these options. You would typically run
-@code{guile-config} during the configuration phase of your program and
-use the obtained information in the Makefile.
-
-@menu
-* Guile Initialization Functions:: What to call first.
-* A Sample Guile Main Program:: Sources and makefiles.
-@end menu
-
-
-@node Guile Initialization Functions
-@subsection Guile Initialization Functions
-
-To initialize Guile, you can use one of two functions. The first,
-@code{scm_boot_guile}, is the most portable way to initialize Guile. It
-should be used whenever you have control over the main function of your
-program because it never returns. The second function,
-@code{scm_init_guile}, does return and can thus be used in more
-situations. However, @code{scm_init_guile} is not as widely available
-as @code{scm_boot_guile} because it needs to rely on non-portable code
-to find the stack bounds. When Guile does not know how to find these
-bounds on your system, it will not provide @code{scm_init_guile}.
-
-When you can tolerate the limits of @code{scm_boot_guile}, you should
-use it in favor of @code{scm_init_guile} since that will make your
-program more portable.
-
-@deftypefun void scm_boot_guile (int @var{argc}, char **@var{argv}, void (*@var{main_func}) (), void *@var{closure})
-Initialize the Guile Scheme interpreter. Then call @var{main_func},
-passing it @var{closure}, @var{argc}, and @var{argv}. @var{main_func}
-should do all the work of the program (initializing other packages,
-defining application-specific functions, reading user input, and so on)
-before returning. When @var{main_func} returns, call @code{exit (0)};
-@code{scm_boot_guile} never returns. If you want some other exit value,
-have @var{main_func} call exit itself.
-
-@code{scm_boot_guile} arranges for the Scheme @code{command-line}
-function to return the strings given by @var{argc} and @var{argv}. If
-@var{main_func} modifies @var{argc} or @var{argv}, it should call
-@code{scm_set_program_arguments} with the final list, so Scheme code
-will know which arguments have been processed.
-
-Why must the caller do all the real work from @var{main_func}? Guile's
-garbage collector scans the stack to find all local variables that
-reference Scheme objects. To do this, it needs to know the bounds of
-the stack that might contain such references. Because there is no
-portable way in C to find the base of the stack, @code{scm_boot_guile}
-assumes that all references are above its own stack frame. If you try
-to manipulate Scheme objects after this function returns, it's the luck
-of the draw whether Guile's storage manager will be able to find the
-objects you allocate. So, @code{scm_boot_guile} function exits, rather
-than returning, to discourage you from making that mistake.
-
-See @code{scm_init_guile}, below, for a function that can find the real
-base of the stack, but not in a portable way.
-@end deftypefun
-
-@deftypefun void scm_init_guile ()
-Initialize the Guile Scheme interpreter.
-
-In contrast to @code{scm_boot_guile}, this function knows how to find
-the true base of the stack and thus does not need to usurp the control
-flow of your program. However, since finding the stack base can not be
-done portably, this function might not be available in all installations
-of Guile. If you can, you should use @code{scm_boot_guile} instead.
-
-Note that @code{scm_init_guile} does not inform Guile about the command
-line arguments that should be returned by the Scheme function
-@code{command-line}. You can use @code{scm_set_program_arguments} to do
-this.
-@end deftypefun
-
-One common way to use Guile is to write a set of C functions which
-perform some useful task, make them callable from Scheme, and then link
-the program with Guile. This yields a Scheme interpreter just like
-@code{guile}, but augmented with extra functions for some specific
-application --- a special-purpose scripting language.
-
-In this situation, the application should probably process its
-command-line arguments in the same manner as the stock Guile
-interpreter. To make that straightforward, Guile provides this
-function:
-
-@deftypefun void scm_shell (int @var{argc}, char **@var{argv})
-Process command-line arguments in the manner of the @code{guile}
-executable. This includes loading the normal Guile initialization
-files, interacting with the user or running any scripts or expressions
-specified by @code{-s} or @code{-e} options, and then exiting.
-@xref{Invoking Guile}, for more details.
-
-Since this function does not return, you must do all
-application-specific initialization before calling this function.
-@end deftypefun
-
-
-@node A Sample Guile Main Program
-@subsection A Sample Guile Main Program
-
-Here is @file{simple-guile.c}, source code for a @code{main} and an
-@code{inner_main} function that will produce a complete Guile
-interpreter.
-
-@example
-/* simple-guile.c --- how to start up the Guile
- interpreter from C code. */
-
-/* Get declarations for all the scm_ functions. */
-#include <libguile.h>
-
-static void
-inner_main (void *closure, int argc, char **argv)
-@{
- /* module initializations would go here */
- scm_shell (argc, argv);
-@}
-
-int
-main (int argc, char **argv)
-@{
- scm_boot_guile (argc, argv, inner_main, 0);
- return 0; /* never reached */
-@}
-@end example
-
-The @code{main} function calls @code{scm_boot_guile} to initialize
-Guile, passing it @code{inner_main}. Once @code{scm_boot_guile} is
-ready, it invokes @code{inner_main}, which calls @code{scm_shell} to
-process the command-line arguments in the usual way.
-
-Here is a Makefile which you can use to compile the above program. It
-uses @code{guile-config} to learn about the necessary compiler and
-linker flags.
-@example
-# Use GCC, if you have it installed.
-CC=gcc
-
-# Tell the C compiler where to find <libguile.h>
-CFLAGS=`guile-config compile`
-
-# Tell the linker what libraries to use and where to find them.
-LIBS=`guile-config link`
-
-simple-guile: simple-guile.o
- $@{CC@} simple-guile.o $@{LIBS@} -o simple-guile
-
-simple-guile.o: simple-guile.c
- $@{CC@} -c $@{CFLAGS@} simple-guile.c
-@end example
-
-If you are using the GNU Autoconf package to make your application more
-portable, Autoconf will settle many of the details in the Makefile above
-automatically, making it much simpler and more portable; we recommend
-using Autoconf with Guile. Guile also provides the @code{GUILE_FLAGS}
-macro for autoconf that performs all necessary checks. Here is a
-@file{configure.in} file for @code{simple-guile} that uses this macro.
-Autoconf can use as this file as template to generate a @code{configure}
-script. In order for Autoconf to find the @code{GUILE_FLAGS} macro, you
-will need to run @code{aclocal} first. This is not really Guile
-specific, so you should refer to the Autoconf documentation REFFIXME
-when in doubt.
-@example
-AC_INIT(simple-guile.c)
-
-# Find a C compiler.
-AC_PROG_CC
-
-# Check for Guile
-GUILE_FLAGS
-
-# Generate a Makefile, based on the results.
-AC_OUTPUT(Makefile)
-@end example
-
-Here is a @code{Makefile.in} template, from which the @code{configure}
-script produces a Makefile customized for the host system:
-@example
-# The configure script fills in these values.
-CC=@@CC@@
-CFLAGS=@@GUILE_CFLAGS@@
-LIBS=@@GUILE_LDFLAGS@@
-
-simple-guile: simple-guile.o
- $@{CC@} simple-guile.o $@{LIBS@} -o simple-guile
-simple-guile.o: simple-guile.c
- $@{CC@} -c $@{CFLAGS@} simple-guile.c
-@end example
-
-The developer should use Autoconf to generate the @file{configure}
-script from the @file{configure.in} template, and distribute
-@file{configure} with the application. Here's how a user might go about
-building the application:
-
-@example
-$ ls
-Makefile.in configure* configure.in simple-guile.c
-$ ./configure
-creating cache ./config.cache
-checking for gcc... (cached) gcc
-checking whether the C compiler (gcc ) works... yes
-checking whether the C compiler (gcc ) is a cross-compiler... no
-checking whether we are using GNU C... (cached) yes
-checking whether gcc accepts -g... (cached) yes
-checking for Guile... yes
-creating ./config.status
-creating Makefile
-$ make
-gcc -c -I/usr/local/include simple-guile.c
-gcc simple-guile.o -L/usr/local/lib -lguile -lqthreads -lpthread -lm -o simple-guile
-$ ./simple-guile
-guile> (+ 1 2 3)
-6
-guile> (getpwnam "jimb")
-#("jimb" "83Z7d75W2tyJQ" 4008 10 "Jim Blandy" "/u/jimb"
- "/usr/local/bin/bash")
-guile> (exit)
-$
-@end example
-
-
-@node Writing Extensions for Guile
-@section Writing Extensions for Guile
-
-The previous sections have briefly explained how to write programs that
-make use of an embedded Guile interpreter. But sometimes, all you want
-to do is make new primitive procedures and data types available to the
-Scheme programmer. Writing a new version of @code{guile} is
-inconvenient in this case and it would in fact make the life of the
-users of your new features needlessly hard.
-
-@c [[ the following is probably a bit long-winded ]]
-
-For example, suppose that there is a program @code{guile-db} that is a
-version of Guile with additional features for accessing a database.
-People who want to write Scheme programs that use these features would
-have to use @code{guile-db} instead of the usual @code{guile} program.
-Now suppose that there is also a program @code{guile-gtk} that extends
-Guile with access to the popular Gtk+ toolkit for graphical user
-interfaces. People who want to write GUIs in Scheme would have to use
-@code{guile-gtk}. Now, what happens when you want to write a Scheme
-application that uses a GUI to let the user access a database? You
-would have to write a @emph{third} program that incorporates both the
-database stuff and the GUI stuff. This might not be easy (because
-@code{guile-gtk} might be a quite obscure program, say) and taking this
-example further makes it easy to see that this approach can not work in
-practice.
-
-It would have been much better if both the database features and the GUI
-feature had been provided as libraries that can just be linked with
-@code{guile}. Guile makes it easy to do just this, and we encourage you
-to make your extensions to Guile available as libraries whenever
-possible.
-
-You write the new primitive procedures and data types in the normal
-fashion, and link them into a shared library instead of into a
-stand-alone program. The shared library can then be loaded dynamically
-by Guile.
-
-@menu
-* A Sample Guile Extension::
-@end menu
-
-
-@node A Sample Guile Extension
-@subsection A Sample Guile Extension
-
-This section explains how to make the Bessel functions of the C library
-available to Scheme. First we need to write the appropriate glue code
-to convert the arguments and return values of the functions from Scheme
-to C and back. Additionally, we need a function that will add them to
-the set of Guile primitives. Because this is just an example, we will
-only implement this for the @code{j0} function.
-
-Consider the following file @file{bessel.c}.
-
-@smallexample
-#include <math.h>
-#include <libguile.h>
-
-SCM
-j0_wrapper (SCM x)
-@{
- return scm_make_real (j0 (scm_num2dbl (x, "j0")));
-@}
-
-void
-init_bessel ()
-@{
- scm_c_define_gsubr ("j0", 1, 0, 0, j0_wrapper);
-@}
-@end smallexample
-
-This C source file needs to be compiled into a shared library. Here is
-how to do it on GNU/Linux:
-
-@smallexample
-gcc -shared -o libguile-bessel.so -fPIC bessel.c
-@end smallexample
-
-For creating shared libraries portably, we recommend the use of
-@code{GNU Libtool}.
-
-A shared library can be loaded into a running Guile process with the
-function @code{load-extension}. In addition to the name of the
-library to load, this function also expects the name of function from
-that library that will be called to initialize it. For our example,
-we are going to call the function @code{init_bessel} which will make
-@code{j0_wrapper} available to Scheme programs with the name
-@code{j0}. Note that we do not specify a filename extension such as
-@file{.so} when invoking @code{load-extension}. The right extension for
-the host platform will be provided automatically.
-
-@smalllisp
-(load-extension "libguile-bessel" "init_bessel")
-(j0 2)
-@result{} 0.223890779141236
-@end smalllisp
-
-For this to work, @code{load-extension} must be able to find
-@file{libguile-bessel}, of course. It will look in the places that
-are usual for your operating system, and it will additionally look
-into the directories listed in the @code{LTDL_LIBRARY_PATH}
-environment variable.
-
-To see how these Guile extensions via shared libraries relate to the
-module system, see below @xref{Intro to Modules and Extensions}.
-
-
-@node Guile Modules
-@section Guile Modules
-
-Guile has support for dividing a program into @dfn{modules}. By using
-modules, you can group related code together and manage the
-composition of complete programs from largely independent parts.
-
-(Although the module system implementation is in flux, feel free to use it
-anyway. Guile will provide reasonable backwards compatibility.)
-
-Details on the module system beyond this introductory material can be found in
-@xref{Modules}.
-
-@menu
-* Intro to Using Guile Modules::
-* Intro to Writing New Modules::
-* Intro to Modules and Extensions::
-@end menu
-
-
-@node Intro to Using Guile Modules
-@subsection Intro to Using Existing Modules
-
-Guile comes with a lot of useful modules, for example for string
-processing or command line parsing. Additionally, there exist many
-Guile modules written by other Guile hackers, but which have to be
-installed manually.
-
-Existing modules have to be placed in places where Guile looks for them
-by default or in colon-separated directories in the environment variable
-@code{GUILE_LOAD_PATH}. When this variable is set, those directories
-are searched first, then the the default. The following command
-shows the complete list of directories searched:
-
-@smallexample
-guile -c '(write %load-path) (newline)'
-@end smallexample
-
-Suppose you want to use the procedures and variables exported by the
-module @code{(ice-9 popen)}, which provides the means for communicating
-with other processes over pipes. Add the following line to your
-currently running Guile REPL or the top of your script file.
-
-@lisp
-(use-modules (ice-9 popen))
-@end lisp
-
-This will load the module and make the procedures exported by
-@code{(ice-9 popen)} automatically available. The next step could be to
-open a pipe to @file{ls} and read the contents of the current directory,
-one line at a time.
-
-@lisp
-(define p (open-input-pipe "ls -l"))
-(read-line p)
-@result{}
-"total 30"
-(read-line p)
-@result{}
-"drwxr-sr-x 2 mgrabmue mgrabmue 1024 Mar 29 19:57 CVS"
-@end lisp
-
-
-@node Intro to Writing New Modules
-@subsection Intro to Writing New Modules
-
-Of course it is possible to write modules yourself. Using modules for
-structuring your programs makes them more readable and lets you
-distribute them more easily. Also, explicitly defining the procedures
-and variables which are exported from a module adds documentation to the
-source and specifies the interface a module provides.
-
-In Guile, you can create new modules and switch to existing modules in
-order to add bindings to them using the syntactic form
-@code{define-module}.
-
-@lisp
-(define-module (foo bar))
-
-(define (frob x) x)
-@end lisp
-
-Will create the module @code{(foo bar)}.@footnote{It is only convention
-that the module names in this section have two elements. One or more
-than two elements are perfectly fine, such as @code{(foo)} or @code{(foo
-bar braz)}} All definitions following this statement will add bindings
-to the module @code{(foo bar)}, and these bindings will not be visible
-outside of the module. To make the bindings accessible to other
-modules, you have to export them explicitly using one of the following
-means:
-
-@itemize @bullet
-@item
-Export them with the @code{export} form:
-@lisp
-(export frob)
-@end lisp
-
-@item
-Include them into the @code{define-module} form with the keyword
-@code{export}:
-@lisp
-(define-module (foo bar)
- #:export (frob))
-@end lisp
-
-@item
-Change the definition of @code{frob} to use @code{define-public}, which
-is a combination of @code{define} and @code{export}.
-@lisp
-(define-public (frob x) x)
-@end lisp
-@end itemize
-
-After exporting, other modules can access the exported items simply by
-using @code{use-modules} to load the module @code{(foo bar)}.
-
-
-@node Intro to Modules and Extensions
-@subsection Intro to Modules and Extensions
-
-In addition to Scheme code you can also put things that are defined in
-C into a module.
-
-You do this by writing a small Scheme file that defines the module.
-That Scheme file in turn invokes @code{load-extension} to make the
-features defined in C available. This works since all definitions
-made by @code{scm_c_define_gsubr} etc. go into the @emph{current
-module} and @code{define-module} causes the newly defined module to be
-current while the code that follows it is executed.
-
-Suppose we want to put the Bessel function @code{j0} from the example
-extension into a module called @code{(math bessel)}. We would have to
-write a Scheme file with this contents
-
-@smallexample
-(define-module (math bessel))
-
-(export j0)
-
-(load-extension "libguile-bessel" "init_bessel")
-@end smallexample
-
-This file should of course be saved in the right place for
-autoloading, for example as
-@file{/usr/local/share/guile/math/bessel.scm}.
-
-When @code{init_bessel} is called, the new @code{(math bessel)} module
-is the current one. Thus, the call to @code{scm_c_define_gsubr} will
-put the new definition for @code{j0} into it, just as we want it.
-
-The definitions made in the C code are not automatically exported from
-a module. You need to explicitly list the ones you want to export in
-@code{export} statements or with the @code{:export} option of
-@code{define-module}.
-
-There is also a way to manipulate the module system from C but only
-Scheme files can be autoloaded. Thus, we recommend that you define
-your modules in Scheme.
-
-
-@page
-@node Obtaining and Installing Guile
-@chapter Obtaining and Installing Guile
-
-Here is the information you will need to get and install Guile and extra
-packages and documentation you might need or find interesting.
-
-@menu
-* The Basic Guile Package::
-* Packages not shipped with Guile::
-@end menu
-
-
-@node The Basic Guile Package
-@section The Basic Guile Package
-
-Guile can be obtained from the main GNU archive site
-@url{ftp://prep.ai.mit.edu/pub/gnu} or any of its mirrors. The file
-will be named guile-version.tar.gz. The current version is
-@value{VERSION}, so the file you should grab is:
-
-@url{ftp://prep.ai.mit.edu/pub/gnu/guile-@value{VERSION}.tar.gz}
-
-To unbundle Guile use the instruction
-@example
-zcat guile-@value{VERSION}.tar.gz | tar xvf -
-@end example
-which will create a directory called @file{guile-@value{VERSION}} with
-all the sources. You can look at the file @file{INSTALL} for detailed
-instructions on how to build and install Guile, but you should be able
-to just do
-@example
-cd guile-@value{VERSION}
-./configure
-make install
-@end example
-
-This will install the Guile executable @file{guile}, the Guile library
-@file{libguile.a} and various associated header files and support
-libraries. It will also install the Guile tutorial and reference manual.
-
-@c [[include instructions for getting R5RS]]
-
-Since this manual frequently refers to the Scheme ``standard'', also
-known as R5RS, or the
-@iftex
-``Revised$^5$ Report on the Algorithmic Language Scheme'',
-@end iftex
-@ifnottex
-``Revised^5 Report on the Algorithmic Language Scheme'',
-@end ifnottex
-we have included the report in the Guile distribution;
-@xref{Top, , Introduction, r5rs, Revised(5) Report on the Algorithmic
-Language Scheme}.
-This will also be installed in your info directory.
-
-
-@node Packages not shipped with Guile
-@section Packages not shipped with Guile
-
-We ship the Guile tutorial and reference manual with the Guile
-distribution. Since the Scheme standard (R5RS) is a stable document, we
-ship that too.
-
-Here are references (usually World Wide Web URLs) to some other freely
-redistributable documents and packages which you might find useful if
-you are using Guile.
-
-@table @strong
-@item SCSH
-the Scheme Shell. Gary Houston has ported SCSH to Guile. The relevant
-chapter (@pxref{The Scheme shell (scsh)}) has references to the SCSH web
-page with all its documentation.
-
-@item SLIB
-a portable Scheme library maintained by Aubrey Jaffer. SLIB can be
-obtained by ftp from @url{ftp://prep.ai.mit.edu/pub/gnu/jacal/}.
-
-The SLIB package should be unpacked somewhere in Guile's load path. It
-will typically be unpacked in @file{/usr/local/share/guile/site}, so
-that it will be @file{/usr/local/share/guile/site/slib}.
-
-Guile might have been installed with a different prefix, in which case
-the load path can be checked from inside the interpreter with:
-
-@smalllisp
-guile> %load-path
-("/usr/local/share/guile/site" "/usr/local/share/guile/1.3a" "/usr/local/share/guile" ".")
-@end smalllisp
-
-The relevant chapter (@pxref{SLIB}) has details on how to use SLIB with
-Guile.
-
-@item JACAL
-a symbolic math package by Aubrey Jaffer. The latest version of Jacal
-can be obtained from @url{ftp://prep.ai.mit.edu/pub/gnu/jacal/}, and
-should be unpacked in @file{/usr/local/share/guile/site/slib} so that
-it will be in @file{/usr/local/share/guile/site/slib/jacal}.
-
-The relevant section (@pxref{JACAL}) has details on how to use Jacal.
-@end table
-
-
-@page
-@node Reporting Bugs
-@chapter Reporting Bugs
-
-Any problems with the installation should be reported to
-@email{bug-guile@@gnu.org}.
-
-Whenever you have found a bug in Guile you are encouraged to report it
-to the Guile developers, so they can fix it. They may also be able to
-suggest workarounds when it is not possible for you to apply the bug-fix
-or install a new version of Guile yourself.
-
-Before sending in bug reports, please check with the following list that
-you really have found a bug.
-
-@itemize @bullet
-@item
-Whenever documentation and actual behavior differ, you have certainly
-found a bug, either in the documentation or in the program.
-
-@item
-When Guile crashes, it is a bug.
-
-@item
-When Guile hangs or takes forever to complete a task, it is a bug.
-
-@item
-When calculations produce wrong results, it is a bug.
-
-@item
-When Guile signals an error for valid Scheme programs, it is a bug.
-
-@item
-When Guile does not signal an error for invalid Scheme programs, it may
-be a bug, unless this is explicitly documented.
-
-@item
-When some part of the documentation is not clear and does not make sense
-to you even after re-reading the section, it is a bug.
-@end itemize
-
-When you write a bug report, please make sure to include as much of the
-information described below in the report. If you can't figure out some
-of the items, it is not a problem, but the more information we get, the
-more likely we can diagnose and fix the bug.
-
-@itemize @bullet
-@item
-The version number of Guile. Without this, we won't know whether there
-is any point in looking for the bug in the current version of Guile.
-
-You can get the version number by invoking the command
-
-@example
-$ guile --version
-Guile 1.4.1
-Copyright (c) 1995, 1996, 1997, 2000 Free Software Foundation
-Guile may be distributed under the terms of the GNU General Public License;
-certain other uses are permitted as well. For details, see the file
-`COPYING', which is included in the Guile distribution.
-There is no warranty, to the extent permitted by law.
-@end example
-
-@item
-The type of machine you are using, and the operating system name and
-version number. On GNU systems, you can get it with @file{uname}.
-
-@example
-$ uname -a
-Linux tortoise 2.2.17 #1 Thu Dec 21 17:29:05 CET 2000 i586 unknown
-@end example
-
-@item
-The operands given to the @file{configure} command when Guile was
-installed. It's often useful to augment this with the output of the
-command @code{guile-config info}.
-
-@item
-A complete list of any modifications you have made to the Guile source.
-(We may not have time to investigate the bug unless it happens in an
-unmodified Guile. But if you've made modifications and you don't tell
-us, you are sending us on a wild goose chase.)
-
-Be precise about these changes. A description in English is not
-enough---send a context diff for them.
-
-Adding files of your own, or porting to another machine, is a
-modification of the source.
-
-@item
-Details of any other deviations from the standard procedure for
-installing Guile.
-
-@item
-The complete text of any source files needed to reproduce the bug.
-
-If you can tell us a way to cause the problem without loading any source
-files, please do so. This makes it much easier to debug. If you do
-need files, make sure you arrange for us to see their exact contents.
-
-@item
-The precise Guile invocation command line we need to type to reproduce
-the bug.
-
-@item
-A description of what behavior you observe that you believe is
-incorrect. For example, "The Guile process gets a fatal signal," or,
-"The resulting output is as follows, which I think is wrong."
-
-Of course, if the bug is that Guile gets a fatal signal, then one can't
-miss it. But if the bug is incorrect results, the maintainer might fail
-to notice what is wrong. Why leave it to chance?
-
-If the manifestation of the bug is a Guile error message, it is
-important to report the precise text of the error message, and a
-backtrace showing how the Scheme program arrived at the error.
-
-This can be done using the procedure @code{backtrace} in the REPL.
-
-@item
-Check whether any programs you have loaded into Guile, including your
-@file{.guile} file, set any variables that may affect the functioning of
-Guile. Also, see whether the problem happens in a freshly started Guile
-without loading your @file{.guile} file (start Guile with the @code{-q}
-switch to prevent loading the init file). If the problem does
-@emph{not} occur then, you must report the precise contents of any
-programs that you must load into Guile in order to cause the problem to
-occur.
-
-@item
-If the problem does depend on an init file or other Scheme programs that
-are not part of the standard Guile distribution, then you should make
-sure it is not a bug in those programs by complaining to their
-maintainers first. After they verify that they are using Guile in a way
-that is supposed to work, they should report the bug.
-
-@item
-If you wish to mention something in the Guile source, show the line of
-code with a few lines of context. Don't just give a line number.
-
-The line numbers in the development sources might not match those in your
-sources. It would take extra work for the maintainers to determine what
-code is in your version at a given line number, and we could not be
-certain.
-
-@item
-Additional information from a C debugger such as GDB might enable
-someone to find a problem on a machine which he does not have available.
-If you don't know how to use GDB, please read the GDB manual---it is not
-very long, and using GDB is easy. You can find the GDB distribution,
-including the GDB manual in online form, in most of the same places you
-can find the Guile distribution. To run Guile under GDB, you should
-switch to the @file{libguile} subdirectory in which Guile was compiled, then
-do @code{gdb guile} or @code{gdb .libs/guile} (if using GNU Libtool).
-
-However, you need to think when you collect the additional information
-if you want it to show what causes the bug.
-
-For example, many people send just a backtrace, but that is not very
-useful by itself. A simple backtrace with arguments often conveys
-little about what is happening inside Guile, because most of the
-arguments listed in the backtrace are pointers to Scheme objects. The
-numeric values of these pointers have no significance whatever; all that
-matters is the contents of the objects they point to (and most of the
-contents are themselves pointers).
-@end itemize
-
-
-
-@c Local Variables:
-@c TeX-master: "guile.texi"
-@c End:
diff --git a/doc/ref/misc-modules.texi b/doc/ref/misc-modules.texi
deleted file mode 100644
index 6f262701e..000000000
--- a/doc/ref/misc-modules.texi
+++ /dev/null
@@ -1,426 +0,0 @@
-@page
-@node Pretty Printing
-@chapter Pretty Printing
-
-@c FIXME::martin: Review me!
-
-@cindex pretty printing
-The module @code{(ice-9 pretty-print)} provides the procedure
-@code{pretty-print}, which provides nicely formatted output of Scheme
-objects. This is especially useful for deeply nested or complex data
-structures, such as lists and vectors.
-
-The module is loaded by simply saying.
-
-@lisp
-(use-modules (ice-9 pretty-print))
-@end lisp
-
-This makes the procedure @code{pretty-print} available. As an example
-how @code{pretty-print} will format the output, see the following:
-
-@lisp
-(pretty-print '(define (foo) (lambda (x)
-(cond ((zero? x) #t) ((negative? x) -x) (else (if (= x 1) 2 (* x x x)))))))
-@print{}
-(define (foo)
- (lambda (x)
- (cond ((zero? x) #t)
- ((negative? x) -x)
- (else (if (= x 1) 2 (* x x x))))))
-@end lisp
-
-@deffn {Scheme Procedure} pretty-print obj [port]
-Print the textual representation of the Scheme object @var{obj} to
-@var{port}. @var{port} defaults to the current output port, if not
-given.
-@end deffn
-
-Beware: Since @code{pretty-print} uses it's own write procedure, it's
-output will not be the same as for example the output of @code{write}.
-Consider the following example.
-
-@lisp
-(write (lambda (x) x))
-@print{}
-#<procedure #f (x)>
-
-(pretty-print (lambda (x) x))
-@print{}
-#[procedure]
-@end lisp
-
-The reason is that @code{pretty-print} does not know as much about
-Guile's object types as the builtin procedures. This is particularly
-important for smobs, for which a write procedure can be defined and be
-used by @code{write}, but not by @code{pretty-print}.
-
-
-@page
-@node Formatted Output
-@chapter Formatted Output
-
-@c FIXME::martin: Review me!
-
-@cindex format
-@cindex formatted output
-Outputting messages or other texts which are composed of literal
-strings, variable contents, newlines and other formatting can be
-cumbersome, when only the standard procedures like @code{display},
-@code{write} and @code{newline} are available. Additionally, one
-often wants to collect the output in strings. With the standard
-routines, the user is required to set up a string port, add this port
-as a parameter to the output procedure calls and then retrieve the
-resulting string from the string port.
-
-The @code{format} procedure, to be found in module @code{(ice-9
-format)}, can do all this, and even more. If you are a C programmer,
-you can think of this procedure as Guile's @code{fprintf}.
-
-@deffn {Scheme Procedure} format destination format-string args @dots{}
-The first parameter is the @var{destination}, it determines where the
-output of @code{format} will go.
-
-@table @asis
-@item @code{#t}
-Send the formatted output to the current output port and return
-@code{#t}.
-
-@item @code{#f}
-Return the formatted output as a string.
-
-@item Any number value
-Send the formatted output to the current error port and return
-@code{#t}.
-
-@item A valid output port
-Send the formatted output to the port @var{destination} and return
-@code{#t}.
-@end table
-
-The second parameter is the format string. It has a similar function
-to the format string in calls to @code{printf} or @code{fprintf} in C.
-It is output to the specified destination, but all escape sequences
-are replaced by the results of formatting the corresponding sequence.
-
-Note that escape sequences are marked with the character @code{~}
-(tilde), and not with a @code{%} (percent sign), as in C.
-
-The escape sequences in the following table are supported. When there
-appears ``corresponding @var{arg}', that means any of the additional
-arguments, after dropping all arguments which have been used up by
-escape sequences which have been processed earlier. Some of the
-format characters (the characters following the tilde) can be prefixed
-by @code{:}, @code{@@}, or @code{:@@}, to modify the behaviour of the
-format character. How the modified behaviour differs from the default
-behaviour is described for every character in the table where
-appropriate.
-
-@table @code
-@item ~~
-Output a single @code{~} (tilde) character.
-
-@item ~%
-Output a newline character, thus advancing to the next output line.
-
-@item ~&
-Start a new line, that is, output a newline character if not already
-at the start of a line.
-
-@item ~_
-Output a single space character.
-
-@item ~/
-Output a single tabulator character.
-
-@item ~|
-Output a page separator (formfeed) character.
-
-@item ~t
-Advance to the next tabulator position.
-
-@item ~y
-Pretty-print the corresponding @var{arg}.
-
-@item ~a
-Output the corresponding @var{arg} like @code{display}.
-
-@item ~s
-Output the corresponding @var{arg} like @code{write}.
-
-@item ~d
-Output the corresponding @var{arg} as a decimal number.
-
-@item ~x
-Output the corresponding @var{arg} as a hexadecimal number.
-
-@item ~o
-Output the corresponding @var{arg} as an octal number.
-
-@item ~b
-Output the corresponding @var{arg} as a binary number.
-
-@item ~r
-Output the corresponding @var{arg} as a number word, e.g. 10 prints as
-@code{ten}. If prefixed with @code{:}, @code{tenth} is printed, if
-prefixed with @code{:@@}, Roman numbers are printed.
-
-@item ~f
-Output the corresponding @var{arg} as a fixed format floating point
-number, such as @code{1.34}.
-
-@item ~e
-Output the corresponding @var{arg} in exponential notation, such as
-@code{1.34E+0}.
-
-@item ~g
-This works either like @code{~f} or like @code{~e}, whichever produces
-less characters to be written.
-
-@item ~$
-Like @code{~f}, but only with two digits after the decimal point.
-
-@item ~i
-Output the corresponding @var{arg} as a complex number.
-
-@item ~c
-Output the corresponding @var{arg} as a character. If prefixed with
-@code{@@}, it is printed like with @code{write}. If prefixed with
-@code{:}, control characters are treated specially, for example
-@code{#\newline} will be printed as @code{^J}.
-
-@item ~p
-``Plural''. If the corresponding @var{arg} is 1, nothing is printed
-(or @code{y} if prefixed with @code{@@} or @code{:@@}), otherwise
-@code{s} is printed (or @code{ies} if prefixed with @code{@@} or
-@code{:@@}).
-
-@item ~?, ~k
-Take the corresponding argument as a format string, and the following
-argument as a list of values. Then format the values with respect to
-the format string.
-
-@item ~!
-Flush the output to the output port.
-
-@item ~#\newline (tilde-newline)
-@c FIXME::martin: I don't understand this from the source.
-Continuation lines.
-
-@item ~*
-Argument jumping. Navigate in the argument list as specified by the
-corresponding argument. If prefixed with @code{:}, jump backwards in
-the argument list, if prefixed by @code{:@@}, jump to the parameter
-with the absolute index, otherwise jump forward in the argument list.
-
-@item ~(
-Case conversion begin. If prefixed by @code{:}, the following output
-string will be capitalized, if prefixed by @code{@@}, the first
-character will be capitalized, if prefixed by @code{:@@} it will be
-upcased and otherwise it will be downcased. Conversion stops when the
-``Case conversion end'' @code{~)}sequence is encountered.
-
-@item ~)
-Case conversion end. Stop any case conversion currently in effect.
-
-@item ~[
-@c FIXME::martin: I don't understand this from the source.
-Conditional begin.
-
-@item ~;
-@c FIXME::martin: I don't understand this from the source.
-Conditional separator.
-
-@item ~]
-@c FIXME::martin: I don't understand this from the source.
-Conditional end.
-
-@item ~@{
-@c FIXME::martin: I don't understand this from the source.
-Iteration begin.
-
-@item ~@}
-@c FIXME::martin: I don't understand this from the source.
-Iteration end.
-
-@item ~^
-@c FIXME::martin: I don't understand this from the source.
-Up and out.
-
-@item ~'
-@c FIXME::martin: I don't understand this from the source.
-Character parameter.
-
-@item ~0 @dots{} ~9, ~-, ~+
-@c FIXME::martin: I don't understand this from the source.
-Numeric parameter.
-
-@item ~v
-@c FIXME::martin: I don't understand this from the source.
-Variable parameter from next argument.
-
-@item ~#
-Parameter is number of remaining args. The number of the remaining
-arguments is prepended to the list of unprocessed arguments.
-
-@item ~,
-@c FIXME::martin: I don't understand this from the source.
-Parameter separators.
-
-@item ~q
-Inquiry message. Insert a copyright message into the output.
-@end table
-
-If any type conversions should fail (for example when using an escape
-sequence for number output, but the argument is a string), an error
-will be signalled.
-@end deffn
-
-You may have noticed that Guile contains a @code{format} procedure
-even when the module @code{(ice-9 format)} is not loaded. The default
-@code{format} procedure does not support all escape sequences
-documented in this chapter, and will signal an error if you try to use
-one of them. The reason for providing two versions of @code{format}
-is that the full-featured module is fairly large and requires some
-time to get loaded. So the Guile maintainers decided not to load the
-large version of @code{format} by default, so that the start-up time
-of the interpreter is not unnecessarily increased.
-
-
-@page
-@node Rx Regexps
-@chapter The Rx Regular Expression Library
-
-[FIXME: this is taken from Gary and Mark's quick summaries and should be
-reviewed and expanded. Rx is pretty stable, so could already be done!]
-
-@cindex rx
-@cindex finite automaton
-
-The @file{guile-lang-allover} package provides an interface to Tom
-Lord's Rx library (currently only to POSIX regular expressions). Use of
-the library requires a two step process: compile a regular expression
-into an efficient structure, then use the structure in any number of
-string comparisons.
-
-For example, given the regular expression @samp{abc.} (which matches any
-string containing @samp{abc} followed by any single character):
-
-@smalllisp
-guile> @kbd{(define r (regcomp "abc."))}
-guile> @kbd{r}
-#<rgx abc.>
-guile> @kbd{(regexec r "abc")}
-#f
-guile> @kbd{(regexec r "abcd")}
-#((0 . 4))
-guile>
-@end smalllisp
-
-The definitions of @code{regcomp} and @code{regexec} are as follows:
-
-@deffn {Scheme Procedure} regcomp pattern [flags]
-Compile the regular expression pattern using POSIX rules. Flags is
-optional and should be specified using symbolic names:
-@defvar REG_EXTENDED
-use extended POSIX syntax
-@end defvar
-@defvar REG_ICASE
-use case-insensitive matching
-@end defvar
-@defvar REG_NEWLINE
-allow anchors to match after newline characters in the
-string and prevents @code{.} or @code{[^...]} from matching newlines.
-@end defvar
-
-The @code{logior} procedure can be used to combine multiple flags.
-The default is to use
-POSIX basic syntax, which makes @code{+} and @code{?} literals and @code{\+}
-and @code{\?}
-operators. Backslashes in @var{pattern} must be escaped if specified in a
-literal string e.g., @code{"\\(a\\)\\?"}.
-@end deffn
-
-@deffn {Scheme Procedure} regexec regex string [match-pick] [flags]
-Match @var{string} against the compiled POSIX regular expression
-@var{regex}.
-@var{match-pick} and @var{flags} are optional. Possible flags (which can be
-combined using the logior procedure) are:
-
-@defvar REG_NOTBOL
-The beginning of line operator won't match the beginning of
-@var{string} (presumably because it's not the beginning of a line)
-@end defvar
-
-@defvar REG_NOTEOL
-Similar to REG_NOTBOL, but prevents the end of line operator
-from matching the end of @var{string}.
-@end defvar
-
-If no match is possible, regexec returns #f. Otherwise @var{match-pick}
-determines the return value:
-
-@code{#t} or unspecified: a newly-allocated vector is returned,
-containing pairs with the indices of the matched part of @var{string} and any
-substrings.
-
-@code{""}: a list is returned: the first element contains a nested list
-with the matched part of @var{string} surrounded by the the unmatched parts.
-Remaining elements are matched substrings (if any). All returned
-substrings share memory with @var{string}.
-
-@code{#f}: regexec returns #t if a match is made, otherwise #f.
-
-vector: the supplied vector is returned, with the first element replaced
-by a pair containing the indices of the matched portion of @var{string} and
-further elements replaced by pairs containing the indices of matched
-substrings (if any).
-
-list: a list will be returned, with each member of the list
-specified by a code in the corresponding position of the supplied list:
-
-a number: the numbered matching substring (0 for the entire match).
-
-@code{#\<}: the beginning of @var{string} to the beginning of the part matched
-by regex.
-
-@code{#\>}: the end of the matched part of @var{string} to the end of
-@var{string}.
-
-@code{#\c}: the "final tag", which seems to be associated with the "cut
-operator", which doesn't seem to be available through the posix
-interface.
-
-e.g., @code{(list #\< 0 1 #\>)}. The returned substrings share memory with
-@var{string}.
-@end deffn
-
-Here are some other procedures that might be used when using regular
-expressions:
-
-@deffn {Scheme Procedure} compiled-regexp? obj
-Test whether obj is a compiled regular expression.
-@end deffn
-
-@deffn {Scheme Procedure} regexp->dfa regex [flags]
-@end deffn
-
-@deffn {Scheme Procedure} dfa-fork dfa
-@end deffn
-
-@deffn {Scheme Procedure} reset-dfa! dfa
-@end deffn
-
-@deffn {Scheme Procedure} dfa-final-tag dfa
-@end deffn
-
-@deffn {Scheme Procedure} dfa-continuable? dfa
-@end deffn
-
-@deffn {Scheme Procedure} advance-dfa! dfa string
-@end deffn
-
-
-@c Local Variables:
-@c TeX-master: "guile.texi"
-@c End:
diff --git a/doc/ref/new-docstrings.texi b/doc/ref/new-docstrings.texi
deleted file mode 100644
index 17aa45680..000000000
--- a/doc/ref/new-docstrings.texi
+++ /dev/null
@@ -1,701 +0,0 @@
-
-@c module (guile)
-
-@deffn {Scheme Procedure} environment? obj
-@deffnx {C Function} scm_environment_p (obj)
-Return @code{#t} if @var{obj} is an environment, or @code{#f}
-otherwise.
-@end deffn
-
-@deffn {Scheme Procedure} environment-bound? env sym
-@deffnx {C Function} scm_environment_bound_p (env, sym)
-Return @code{#t} if @var{sym} is bound in @var{env}, or
-@code{#f} otherwise.
-@end deffn
-
-@deffn {Scheme Procedure} environment-ref env sym
-@deffnx {C Function} scm_environment_ref (env, sym)
-Return the value of the location bound to @var{sym} in
-@var{env}. If @var{sym} is unbound in @var{env}, signal an
-@code{environment:unbound} error.
-@end deffn
-
-@deffn {Scheme Procedure} environment-fold env proc init
-@deffnx {C Function} scm_environment_fold (env, proc, init)
-Iterate over all the bindings in @var{env}, accumulating some
-value.
-For each binding in @var{env}, apply @var{proc} to the symbol
-bound, its value, and the result from the previous application
-of @var{proc}.
-Use @var{init} as @var{proc}'s third argument the first time
-@var{proc} is applied.
-If @var{env} contains no bindings, this function simply returns
-@var{init}.
-If @var{env} binds the symbol sym1 to the value val1, sym2 to
-val2, and so on, then this procedure computes:
-@lisp
- (proc sym1 val1
- (proc sym2 val2
- ...
- (proc symn valn
- init)))
-@end lisp
-Each binding in @var{env} will be processed exactly once.
-@code{environment-fold} makes no guarantees about the order in
-which the bindings are processed.
-Here is a function which, given an environment, constructs an
-association list representing that environment's bindings,
-using environment-fold:
-@lisp
- (define (environment->alist env)
- (environment-fold env
- (lambda (sym val tail)
- (cons (cons sym val) tail))
- '()))
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} environment-define env sym val
-@deffnx {C Function} scm_environment_define (env, sym, val)
-Bind @var{sym} to a new location containing @var{val} in
-@var{env}. If @var{sym} is already bound to another location
-in @var{env} and the binding is mutable, that binding is
-replaced. The new binding and location are both mutable. The
-return value is unspecified.
-If @var{sym} is already bound in @var{env}, and the binding is
-immutable, signal an @code{environment:immutable-binding} error.
-@end deffn
-
-@deffn {Scheme Procedure} environment-undefine env sym
-@deffnx {C Function} scm_environment_undefine (env, sym)
-Remove any binding for @var{sym} from @var{env}. If @var{sym}
-is unbound in @var{env}, do nothing. The return value is
-unspecified.
-If @var{sym} is already bound in @var{env}, and the binding is
-immutable, signal an @code{environment:immutable-binding} error.
-@end deffn
-
-@deffn {Scheme Procedure} environment-set! env sym val
-@deffnx {C Function} scm_environment_set_x (env, sym, val)
-If @var{env} binds @var{sym} to some location, change that
-location's value to @var{val}. The return value is
-unspecified.
-If @var{sym} is not bound in @var{env}, signal an
-@code{environment:unbound} error. If @var{env} binds @var{sym}
-to an immutable location, signal an
-@code{environment:immutable-location} error.
-@end deffn
-
-@deffn {Scheme Procedure} environment-cell env sym for_write
-@deffnx {C Function} scm_environment_cell (env, sym, for_write)
-Return the value cell which @var{env} binds to @var{sym}, or
-@code{#f} if the binding does not live in a value cell.
-The argument @var{for-write} indicates whether the caller
-intends to modify the variable's value by mutating the value
-cell. If the variable is immutable, then
-@code{environment-cell} signals an
-@code{environment:immutable-location} error.
-If @var{sym} is unbound in @var{env}, signal an
-@code{environment:unbound} error.
-If you use this function, you should consider using
-@code{environment-observe}, to be notified when @var{sym} gets
-re-bound to a new value cell, or becomes undefined.
-@end deffn
-
-@deffn {Scheme Procedure} environment-observe env proc
-@deffnx {C Function} scm_environment_observe (env, proc)
-Whenever @var{env}'s bindings change, apply @var{proc} to
-@var{env}.
-This function returns an object, token, which you can pass to
-@code{environment-unobserve} to remove @var{proc} from the set
-of procedures observing @var{env}. The type and value of
-token is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} environment-observe-weak env proc
-@deffnx {C Function} scm_environment_observe_weak (env, proc)
-This function is the same as environment-observe, except that
-the reference @var{env} retains to @var{proc} is a weak
-reference. This means that, if there are no other live,
-non-weak references to @var{proc}, it will be
-garbage-collected, and dropped from @var{env}'s
-list of observing procedures.
-@end deffn
-
-@deffn {Scheme Procedure} environment-unobserve token
-@deffnx {C Function} scm_environment_unobserve (token)
-Cancel the observation request which returned the value
-@var{token}. The return value is unspecified.
-If a call @code{(environment-observe env proc)} returns
-@var{token}, then the call @code{(environment-unobserve token)}
-will cause @var{proc} to no longer be called when @var{env}'s
-bindings change.
-@end deffn
-
-@deffn {Scheme Procedure} make-leaf-environment
-@deffnx {C Function} scm_make_leaf_environment ()
-Create a new leaf environment, containing no bindings.
-All bindings and locations created in the new environment
-will be mutable.
-@end deffn
-
-@deffn {Scheme Procedure} leaf-environment? object
-@deffnx {C Function} scm_leaf_environment_p (object)
-Return @code{#t} if object is a leaf environment, or @code{#f}
-otherwise.
-@end deffn
-
-@deffn {Scheme Procedure} make-eval-environment local imported
-@deffnx {C Function} scm_make_eval_environment (local, imported)
-Return a new environment object eval whose bindings are the
-union of the bindings in the environments @var{local} and
-@var{imported}, with bindings from @var{local} taking
-precedence. Definitions made in eval are placed in @var{local}.
-Applying @code{environment-define} or
-@code{environment-undefine} to eval has the same effect as
-applying the procedure to @var{local}.
-Note that eval incorporates @var{local} and @var{imported} by
-reference:
-If, after creating eval, the program changes the bindings of
-@var{local} or @var{imported}, those changes will be visible
-in eval.
-Since most Scheme evaluation takes place in eval environments,
-they transparently cache the bindings received from @var{local}
-and @var{imported}. Thus, the first time the program looks up
-a symbol in eval, eval may make calls to @var{local} or
-@var{imported} to find their bindings, but subsequent
-references to that symbol will be as fast as references to
-bindings in finite environments.
-In typical use, @var{local} will be a finite environment, and
-@var{imported} will be an import environment
-@end deffn
-
-@deffn {Scheme Procedure} eval-environment? object
-@deffnx {C Function} scm_eval_environment_p (object)
-Return @code{#t} if object is an eval environment, or @code{#f}
-otherwise.
-@end deffn
-
-@deffn {Scheme Procedure} eval-environment-local env
-@deffnx {C Function} scm_eval_environment_local (env)
-Return the local environment of eval environment @var{env}.
-@end deffn
-
-@deffn {Scheme Procedure} eval-environment-set-local! env local
-@deffnx {C Function} scm_eval_environment_set_local_x (env, local)
-Change @var{env}'s local environment to @var{local}.
-@end deffn
-
-@deffn {Scheme Procedure} eval-environment-imported env
-@deffnx {C Function} scm_eval_environment_imported (env)
-Return the imported environment of eval environment @var{env}.
-@end deffn
-
-@deffn {Scheme Procedure} eval-environment-set-imported! env imported
-@deffnx {C Function} scm_eval_environment_set_imported_x (env, imported)
-Change @var{env}'s imported environment to @var{imported}.
-@end deffn
-
-@deffn {Scheme Procedure} make-import-environment imports conflict_proc
-@deffnx {C Function} scm_make_import_environment (imports, conflict_proc)
-Return a new environment @var{imp} whose bindings are the union
-of the bindings from the environments in @var{imports};
-@var{imports} must be a list of environments. That is,
-@var{imp} binds a symbol to a location when some element of
-@var{imports} does.
-If two different elements of @var{imports} have a binding for
-the same symbol, the @var{conflict-proc} is called with the
-following parameters: the import environment, the symbol and
-the list of the imported environments that bind the symbol.
-If the @var{conflict-proc} returns an environment @var{env},
-the conflict is considered as resolved and the binding from
-@var{env} is used. If the @var{conflict-proc} returns some
-non-environment object, the conflict is considered unresolved
-and the symbol is treated as unspecified in the import
-environment.
-The checking for conflicts may be performed lazily, i. e. at
-the moment when a value or binding for a certain symbol is
-requested instead of the moment when the environment is
-created or the bindings of the imports change.
-All bindings in @var{imp} are immutable. If you apply
-@code{environment-define} or @code{environment-undefine} to
-@var{imp}, Guile will signal an
- @code{environment:immutable-binding} error. However,
-notice that the set of bindings in @var{imp} may still change,
-if one of its imported environments changes.
-@end deffn
-
-@deffn {Scheme Procedure} import-environment? object
-@deffnx {C Function} scm_import_environment_p (object)
-Return @code{#t} if object is an import environment, or
-@code{#f} otherwise.
-@end deffn
-
-@deffn {Scheme Procedure} import-environment-imports env
-@deffnx {C Function} scm_import_environment_imports (env)
-Return the list of environments imported by the import
-environment @var{env}.
-@end deffn
-
-@deffn {Scheme Procedure} import-environment-set-imports! env imports
-@deffnx {C Function} scm_import_environment_set_imports_x (env, imports)
-Change @var{env}'s list of imported environments to
-@var{imports}, and check for conflicts.
-@end deffn
-
-@deffn {Scheme Procedure} make-export-environment private signature
-@deffnx {C Function} scm_make_export_environment (private, signature)
-Return a new environment @var{exp} containing only those
-bindings in private whose symbols are present in
-@var{signature}. The @var{private} argument must be an
-environment.
-
-The environment @var{exp} binds symbol to location when
-@var{env} does, and symbol is exported by @var{signature}.
-
-@var{signature} is a list specifying which of the bindings in
-@var{private} should be visible in @var{exp}. Each element of
-@var{signature} should be a list of the form:
- (symbol attribute ...)
-where each attribute is one of the following:
-@table @asis
-@item the symbol @code{mutable-location}
- @var{exp} should treat the
- location bound to symbol as mutable. That is, @var{exp}
- will pass calls to @code{environment-set!} or
- @code{environment-cell} directly through to private.
-@item the symbol @code{immutable-location}
- @var{exp} should treat
- the location bound to symbol as immutable. If the program
- applies @code{environment-set!} to @var{exp} and symbol, or
- calls @code{environment-cell} to obtain a writable value
- cell, @code{environment-set!} will signal an
- @code{environment:immutable-location} error. Note that, even
- if an export environment treats a location as immutable, the
- underlying environment may treat it as mutable, so its
- value may change.
-@end table
-It is an error for an element of signature to specify both
-@code{mutable-location} and @code{immutable-location}. If
-neither is specified, @code{immutable-location} is assumed.
-
-As a special case, if an element of signature is a lone
-symbol @var{sym}, it is equivalent to an element of the form
-@code{(sym)}.
-
-All bindings in @var{exp} are immutable. If you apply
-@code{environment-define} or @code{environment-undefine} to
-@var{exp}, Guile will signal an
-@code{environment:immutable-binding} error. However,
-notice that the set of bindings in @var{exp} may still change,
-if the bindings in private change.
-@end deffn
-
-@deffn {Scheme Procedure} export-environment? object
-@deffnx {C Function} scm_export_environment_p (object)
-Return @code{#t} if object is an export environment, or
-@code{#f} otherwise.
-@end deffn
-
-@deffn {Scheme Procedure} export-environment-private env
-@deffnx {C Function} scm_export_environment_private (env)
-Return the private environment of export environment @var{env}.
-@end deffn
-
-@deffn {Scheme Procedure} export-environment-set-private! env private
-@deffnx {C Function} scm_export_environment_set_private_x (env, private)
-Change the private environment of export environment @var{env}.
-@end deffn
-
-@deffn {Scheme Procedure} export-environment-signature env
-@deffnx {C Function} scm_export_environment_signature (env)
-Return the signature of export environment @var{env}.
-@end deffn
-
-@deffn {Scheme Procedure} export-environment-set-signature! env signature
-@deffnx {C Function} scm_export_environment_set_signature_x (env, signature)
-Change the signature of export environment @var{env}.
-@end deffn
-
-@deffn {Scheme Procedure} %compute-slots class
-@deffnx {C Function} scm_sys_compute_slots (class)
-Return a list consisting of the names of all slots belonging to
-class @var{class}, i. e. the slots of @var{class} and of all of
-its superclasses.
-@end deffn
-
-@deffn {Scheme Procedure} get-keyword key l default_value
-@deffnx {C Function} scm_get_keyword (key, l, default_value)
-Determine an associated value for the keyword @var{key} from
-the list @var{l}. The list @var{l} has to consist of an even
-number of elements, where, starting with the first, every
-second element is a keyword, followed by its associated value.
-If @var{l} does not hold a value for @var{key}, the value
-@var{default_value} is returned.
-@end deffn
-
-@deffn {Scheme Procedure} slot-ref-using-class class obj slot_name
-@deffnx {C Function} scm_slot_ref_using_class (class, obj, slot_name)
-
-@end deffn
-
-@deffn {Scheme Procedure} slot-set-using-class! class obj slot_name value
-@deffnx {C Function} scm_slot_set_using_class_x (class, obj, slot_name, value)
-
-@end deffn
-
-@deffn {Scheme Procedure} class-of x
-@deffnx {C Function} scm_class_of (x)
-Return the class of @var{x}.
-@end deffn
-
-@deffn {Scheme Procedure} %goops-loaded
-@deffnx {C Function} scm_sys_goops_loaded ()
-Announce that GOOPS is loaded and perform initialization
-on the C level which depends on the loaded GOOPS modules.
-@end deffn
-
-@deffn {Scheme Procedure} %method-more-specific? m1 m2 targs
-@deffnx {C Function} scm_sys_method_more_specific_p (m1, m2, targs)
-
-@end deffn
-
-@deffn {Scheme Procedure} find-method . l
-@deffnx {C Function} scm_find_method (l)
-
-@end deffn
-
-@deffn {Scheme Procedure} primitive-generic-generic subr
-@deffnx {C Function} scm_primitive_generic_generic (subr)
-
-@end deffn
-
-@deffn {Scheme Procedure} enable-primitive-generic! . subrs
-@deffnx {C Function} scm_enable_primitive_generic_x (subrs)
-
-@end deffn
-
-@deffn {Scheme Procedure} generic-capability? proc
-@deffnx {C Function} scm_generic_capability_p (proc)
-
-@end deffn
-
-@deffn {Scheme Procedure} %invalidate-method-cache! gf
-@deffnx {C Function} scm_sys_invalidate_method_cache_x (gf)
-
-@end deffn
-
-@deffn {Scheme Procedure} %invalidate-class class
-@deffnx {C Function} scm_sys_invalidate_class (class)
-
-@end deffn
-
-@deffn {Scheme Procedure} %modify-class old new
-@deffnx {C Function} scm_sys_modify_class (old, new)
-
-@end deffn
-
-@deffn {Scheme Procedure} %modify-instance old new
-@deffnx {C Function} scm_sys_modify_instance (old, new)
-
-@end deffn
-
-@deffn {Scheme Procedure} %set-object-setter! obj setter
-@deffnx {C Function} scm_sys_set_object_setter_x (obj, setter)
-
-@end deffn
-
-@deffn {Scheme Procedure} %allocate-instance class initargs
-@deffnx {C Function} scm_sys_allocate_instance (class, initargs)
-Create a new instance of class @var{class} and initialize it
-from the arguments @var{initargs}.
-@end deffn
-
-@deffn {Scheme Procedure} slot-exists? obj slot_name
-@deffnx {C Function} scm_slot_exists_p (obj, slot_name)
-Return @code{#t} if @var{obj} has a slot named @var{slot_name}.
-@end deffn
-
-@deffn {Scheme Procedure} slot-bound? obj slot_name
-@deffnx {C Function} scm_slot_bound_p (obj, slot_name)
-Return @code{#t} if the slot named @var{slot_name} of @var{obj}
-is bound.
-@end deffn
-
-@deffn {Scheme Procedure} slot-set! obj slot_name value
-@deffnx {C Function} scm_slot_set_x (obj, slot_name, value)
-Set the slot named @var{slot_name} of @var{obj} to @var{value}.
-@end deffn
-
-@deffn {Scheme Procedure} slot-exists-using-class? class obj slot_name
-@deffnx {C Function} scm_slot_exists_using_class_p (class, obj, slot_name)
-
-@end deffn
-
-@deffn {Scheme Procedure} slot-bound-using-class? class obj slot_name
-@deffnx {C Function} scm_slot_bound_using_class_p (class, obj, slot_name)
-
-@end deffn
-
-@deffn {Scheme Procedure} %fast-slot-set! obj index value
-@deffnx {C Function} scm_sys_fast_slot_set_x (obj, index, value)
-Set the slot with index @var{index} in @var{obj} to
-@var{value}.
-@end deffn
-
-@deffn {Scheme Procedure} %fast-slot-ref obj index
-@deffnx {C Function} scm_sys_fast_slot_ref (obj, index)
-Return the slot value with index @var{index} from @var{obj}.
-@end deffn
-
-@deffn {Scheme Procedure} @@assert-bound-ref obj index
-@deffnx {C Function} scm_at_assert_bound_ref (obj, index)
-Like @code{assert-bound}, but use @var{index} for accessing
-the value from @var{obj}.
-@end deffn
-
-@deffn {Scheme Procedure} assert-bound value obj
-@deffnx {C Function} scm_assert_bound (value, obj)
-Return @var{value} if it is bound, and invoke the
-@var{slot-unbound} method of @var{obj} if it is not.
-@end deffn
-
-@deffn {Scheme Procedure} unbound? obj
-@deffnx {C Function} scm_unbound_p (obj)
-Return @code{#t} if @var{obj} is unbound.
-@end deffn
-
-@deffn {Scheme Procedure} make-unbound
-@deffnx {C Function} scm_make_unbound ()
-Return the unbound value.
-@end deffn
-
-@deffn {Scheme Procedure} accessor-method-slot-definition obj
-@deffnx {C Function} scm_accessor_method_slot_definition (obj)
-Return the slot definition of the accessor @var{obj}.
-@end deffn
-
-@deffn {Scheme Procedure} method-procedure obj
-@deffnx {C Function} scm_method_procedure (obj)
-Return the procedure of the method @var{obj}.
-@end deffn
-
-@deffn {Scheme Procedure} method-specializers obj
-@deffnx {C Function} scm_method_specializers (obj)
-Return specializers of the method @var{obj}.
-@end deffn
-
-@deffn {Scheme Procedure} method-generic-function obj
-@deffnx {C Function} scm_method_generic_function (obj)
-Return the generic function for the method @var{obj}.
-@end deffn
-
-@deffn {Scheme Procedure} generic-function-methods obj
-@deffnx {C Function} scm_generic_function_methods (obj)
-Return the methods of the generic function @var{obj}.
-@end deffn
-
-@deffn {Scheme Procedure} generic-function-name obj
-@deffnx {C Function} scm_generic_function_name (obj)
-Return the name of the generic function @var{obj}.
-@end deffn
-
-@deffn {Scheme Procedure} class-environment obj
-@deffnx {C Function} scm_class_environment (obj)
-Return the environment of the class @var{obj}.
-@end deffn
-
-@deffn {Scheme Procedure} class-slots obj
-@deffnx {C Function} scm_class_slots (obj)
-Return the slot list of the class @var{obj}.
-@end deffn
-
-@deffn {Scheme Procedure} class-precedence-list obj
-@deffnx {C Function} scm_class_precedence_list (obj)
-Return the class precedence list of the class @var{obj}.
-@end deffn
-
-@deffn {Scheme Procedure} class-direct-methods obj
-@deffnx {C Function} scm_class_direct_methods (obj)
-Return the direct methods of the class @var{obj}
-@end deffn
-
-@deffn {Scheme Procedure} class-direct-subclasses obj
-@deffnx {C Function} scm_class_direct_subclasses (obj)
-Return the direct subclasses of the class @var{obj}.
-@end deffn
-
-@deffn {Scheme Procedure} class-direct-slots obj
-@deffnx {C Function} scm_class_direct_slots (obj)
-Return the direct slots of the class @var{obj}.
-@end deffn
-
-@deffn {Scheme Procedure} class-direct-supers obj
-@deffnx {C Function} scm_class_direct_supers (obj)
-Return the direct superclasses of the class @var{obj}.
-@end deffn
-
-@deffn {Scheme Procedure} class-name obj
-@deffnx {C Function} scm_class_name (obj)
-Return the class name of @var{obj}.
-@end deffn
-
-@deffn {Scheme Procedure} instance? obj
-@deffnx {C Function} scm_instance_p (obj)
-Return @code{#t} if @var{obj} is an instance.
-@end deffn
-
-@deffn {Scheme Procedure} %inherit-magic! class dsupers
-@deffnx {C Function} scm_sys_inherit_magic_x (class, dsupers)
-
-@end deffn
-
-@deffn {Scheme Procedure} %prep-layout! class
-@deffnx {C Function} scm_sys_prep_layout_x (class)
-
-@end deffn
-
-@deffn {Scheme Procedure} %initialize-object obj initargs
-@deffnx {C Function} scm_sys_initialize_object (obj, initargs)
-Initialize the object @var{obj} with the given arguments
-@var{initargs}.
-@end deffn
-
-@deffn {Scheme Procedure} make . args
-@deffnx {C Function} scm_make (args)
-Make a new object. @var{args} must contain the class and
-all necessary initialization information.
-@end deffn
-
-@deffn {Scheme Procedure} slot-ref obj slot_name
-@deffnx {C Function} scm_slot_ref (obj, slot_name)
-Return the value from @var{obj}'s slot with the name
-@var{slot_name}.
-@end deffn
-
-@deffn {Scheme Procedure} %tag-body body
-@deffnx {C Function} scm_sys_tag_body (body)
-Internal GOOPS magic---don't use this function!
-@end deffn
-
-@deffn {Scheme Procedure} list*
-implemented by the C function "scm_cons_star"
-@end deffn
-
-@deffn {Scheme Procedure} set-current-module module
-@deffnx {C Function} scm_set_current_module (module)
-Set the current module to @var{module} and return
-the previous current module.
-@end deffn
-
-@deffn {Scheme Procedure} current-module
-@deffnx {C Function} scm_current_module ()
-Return the current module.
-@end deffn
-
-@deffn {Scheme Procedure} c-clear-registered-modules
-Destroy the list of modules registered with the current Guile process.
-The return value is unspecified. @strong{Warning:} this function does
-not actually unlink or deallocate these modules, but only destroys the
-records of which modules have been loaded. It should therefore be used
-only by module bookkeeping operations.
-@end deffn
-
-@deffn {Scheme Procedure} c-registered-modules
-Return a list of the object code modules that have been imported into
-the current Guile process. Each element of the list is a pair whose
-car is the name of the module, and whose cdr is the function handle
-for that module's initializer function. The name is the string that
-has been passed to scm_register_module_xxx.
-@end deffn
-
-@deffn {Scheme Procedure} include-deprecated-features
-Return @code{#t} iff deprecated features should be included
-in public interfaces.
-@end deffn
-
-@deffn {Scheme Procedure} issue-deprecation-warning . msgs
-Output @var{msgs} to @code{(current-error-port)} when this
-is the first call to @code{issue-deprecation-warning} with
-this specific @var{msg}. Do nothing otherwise.
-The argument @var{msgs} should be a list of strings;
-they are printed in turn, each one followed by a newline.
-@end deffn
-
-@deffn {Scheme Procedure} valid-object-procedure? proc
-@deffnx {C Function} scm_valid_object_procedure_p (proc)
-Return @code{#t} iff @var{proc} is a procedure that can be used with @code{set-object-procedure}. It is always valid to use a closure constructed by @code{lambda}.
-@end deffn
-
-@deffn {Scheme Procedure} %get-pre-modules-obarray
-@deffnx {C Function} scm_get_pre_modules_obarray ()
-Return the obarray that is used for all new bindings before the module system is booted. The first call to @code{set-current-module} will boot the module system.
-@end deffn
-
-@deffn {Scheme Procedure} standard-interface-eval-closure module
-@deffnx {C Function} scm_standard_interface_eval_closure (module)
-Return a interface eval closure for the module @var{module}. Such a closure does not allow new bindings to be added.
-@end deffn
-
-@deffn {Scheme Procedure} env-module env
-@deffnx {C Function} scm_env_module (env)
-Return the module of @var{ENV}, a lexical environment.
-@end deffn
-
-@deffn {Scheme Procedure} load-extension lib init
-@deffnx {C Function} scm_load_extension (lib, init)
-Load and initialize the extension designated by LIB and INIT.
-When there is no pre-registered function for LIB/INIT, this is
-equivalent to
-
-@lisp
-(dynamic-call INIT (dynamic-link LIB))
-@end lisp
-
-When there is a pre-registered function, that function is called
-instead.
-
-Normally, there is no pre-registered function. This option exists
-only for situations where dynamic linking is unavailable or unwanted.
-In that case, you would statically link your program with the desired
-library, and register its init function right after Guile has been
-initialized.
-
-LIB should be a string denoting a shared library without any file type
-suffix such as ".so". The suffix is provided automatically. It
-should also not contain any directory components. Libraries that
-implement Guile Extensions should be put into the normal locations for
-shared libraries. We recommend to use the naming convention
-libguile-bla-blum for a extension related to a module `(bla blum)'.
-
-The normal way for a extension to be used is to write a small Scheme
-file that defines a module, and to load the extension into this
-module. When the module is auto-loaded, the extension is loaded as
-well. For example,
-
-@lisp
-(define-module (bla blum))
-
-(load-extension "libguile-bla-blum" "bla_init_blum")
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} single-active-thread?
-implemented by the C function "scm_single_thread_p"
-@end deffn
-
-@deffn {Scheme Procedure} object-address obj
-@deffnx {C Function} scm_object_address (obj)
-Return an integer that for the lifetime of @var{obj} is uniquely
-returned by this function for @var{obj}
-@end deffn
-
-@deffn {Scheme Procedure} nan
-@deffnx {C Function} scm_nan ()
-Return NaN.
-@end deffn
-
-@deffn {Scheme Procedure} inf
-@deffnx {C Function} scm_inf ()
-Return Inf.
-@end deffn
diff --git a/doc/ref/posix.texi b/doc/ref/posix.texi
deleted file mode 100644
index 8a9fc280e..000000000
--- a/doc/ref/posix.texi
+++ /dev/null
@@ -1,2490 +0,0 @@
-@node POSIX
-@chapter POSIX System Calls and Networking
-
-@menu
-* Conventions:: Conventions employed by the POSIX interface.
-* Ports and File Descriptors:: Scheme ``ports'' and Unix file descriptors
- have different representations.
-* File System:: stat, chown, chmod, etc.
-* User Information:: Retrieving a user's GECOS (/etc/passwd) entry.
-* Time:: gettimeofday, localtime, strftime, etc.
-* Runtime Environment:: Accessing and modifying Guile's environment.
-* Processes:: getuid, getpid, etc.
-* Signals:: sigaction, kill, pause, alarm, setitimer, etc.
-* Terminals and Ptys:: ttyname, tcsetpgrp, etc.
-* Pipes:: Communicating data between processes.
-* Networking:: gethostbyaddr, getnetent, socket, bind, listen.
-* System Identification:: Obtaining information about the system.
-* Locales:: setlocale, etc.
-* Encryption::
-@end menu
-
-@node Conventions
-@section POSIX Interface Conventions
-
-These interfaces provide access to operating system facilities.
-They provide a simple wrapping around the underlying C interfaces
-to make usage from Scheme more convenient. They are also used
-to implement the Guile port of @ref{The Scheme shell (scsh)}.
-
-Generally there is a single procedure for each corresponding Unix
-facility. There are some exceptions, such as procedures implemented for
-speed and convenience in Scheme with no primitive Unix equivalent,
-e.g., @code{copy-file}.
-
-The interfaces are intended as far as possible to be portable across
-different versions of Unix. In some cases procedures which can't be
-implemented on particular systems may become no-ops, or perform limited
-actions. In other cases they may throw errors.
-
-General naming conventions are as follows:
-
-@itemize @bullet
-@item
-The Scheme name is often identical to the name of the underlying Unix
-facility.
-@item
-Underscores in Unix procedure names are converted to hyphens.
-@item
-Procedures which destructively modify Scheme data have exclamation
-marks appended, e.g., @code{recv!}.
-@item
-Predicates (returning only @code{#t} or @code{#f}) have question marks
-appended, e.g., @code{access?}.
-@item
-Some names are changed to avoid conflict with dissimilar interfaces
-defined by scsh, e.g., @code{primitive-fork}.
-@item
-Unix preprocessor names such as @code{EPERM} or @code{R_OK} are converted
-to Scheme variables of the same name (underscores are not replaced
-with hyphens).
-@end itemize
-
-Unexpected conditions are generally handled by raising exceptions.
-There are a few procedures which return a special value if they don't
-succeed, e.g., @code{getenv} returns @code{#f} if it the requested
-string is not found in the environment. These cases are noted in
-the documentation.
-
-For ways to deal with exceptions, @ref{Exceptions}.
-
-Errors which the C-library would report by returning a NULL pointer or
-through some other means are reported by raising a @code{system-error}
-exception. The value of the Unix @code{errno} variable is available
-in the data passed by the exception.
-
-It can be extracted with the function @code{system-error-errno}:
-
-@example
-(catch
- 'system-error
- (lambda ()
- (mkdir "/this-ought-to-fail-if-I'm-not-root"))
- (lambda stuff
- (let ((errno (system-error-errno stuff)))
- (cond
- ((= errno EACCES)
- (display "You're not allowed to do that."))
- ((= errno EEXIST)
- (display "Already exists."))
- (#t
- (display (strerror errno))))
- (newline))))
-@end example
-
-@node Ports and File Descriptors
-@section Ports and File Descriptors
-
-Conventions generally follow those of scsh, @ref{The Scheme shell (scsh)}.
-
-File ports are implemented using low-level operating system I/O
-facilities, with optional buffering to improve efficiency
-@pxref{File Ports}
-
-Note that some procedures (e.g., @code{recv!}) will accept ports as
-arguments, but will actually operate directly on the file descriptor
-underlying the port. Any port buffering is ignored, including the
-buffer which implements @code{peek-char} and @code{unread-char}.
-
-The @code{force-output} and @code{drain-input} procedures can be used
-to clear the buffers.
-
-Each open file port has an associated operating system file descriptor.
-File descriptors are generally not useful in Scheme programs; however
-they may be needed when interfacing with foreign code and the Unix
-environment.
-
-A file descriptor can be extracted from a port and a new port can be
-created from a file descriptor. However a file descriptor is just an
-integer and the garbage collector doesn't recognize it as a reference
-to the port. If all other references to the port were dropped, then
-it's likely that the garbage collector would free the port, with the
-side-effect of closing the file descriptor prematurely.
-
-To assist the programmer in avoiding this problem, each port has an
-associated "revealed count" which can be used to keep track of how many
-times the underlying file descriptor has been stored in other places.
-If a port's revealed count is greater than zero, the file descriptor
-will not be closed when the port is garbage collected. A programmer
-can therefore ensure that the revealed count will be greater than
-zero if the file descriptor is needed elsewhere.
-
-For the simple case where a file descriptor is "imported" once to become
-a port, it does not matter if the file descriptor is closed when the
-port is garbage collected. There is no need to maintain a revealed
-count. Likewise when "exporting" a file descriptor to the external
-environment, setting the revealed count is not required provided the
-port is kept open (i.e., is pointed to by a live Scheme binding) while
-the file descriptor is in use.
-
-To correspond with traditional Unix behaviour, the three file
-descriptors (0, 1 and 2) are automatically imported when a program
-starts up and assigned to the initial values of the current input,
-output and error ports. The revealed count for each is initially set to
-one, so that dropping references to one of these ports will not result
-in its garbage collection: it could be retrieved with fdopen or
-fdes->ports.
-
-@deffn {Scheme Procedure} port-revealed port
-@deffnx {C Function} scm_port_revealed (port)
-Return the revealed count for @var{port}.
-@end deffn
-
-@deffn {Scheme Procedure} set-port-revealed! port rcount
-@deffnx {C Function} scm_set_port_revealed_x (port, rcount)
-Sets the revealed count for a port to a given value.
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} fileno port
-@deffnx {C Function} scm_fileno (port)
-Return the integer file descriptor underlying @var{port}. Does
-not change its revealed count.
-@end deffn
-
-@deffn {Scheme Procedure} port->fdes port
-Returns the integer file descriptor underlying @var{port}. As a
-side effect the revealed count of @var{port} is incremented.
-@end deffn
-
-@deffn {Scheme Procedure} fdopen fdes modes
-@deffnx {C Function} scm_fdopen (fdes, modes)
-Return a new port based on the file descriptor @var{fdes}.
-Modes are given by the string @var{modes}. The revealed count
-of the port is initialized to zero. The modes string is the
-same as that accepted by @ref{File Ports, open-file}.
-@end deffn
-
-@deffn {Scheme Procedure} fdes->ports fd
-@deffnx {C Function} scm_fdes_to_ports (fd)
-Return a list of existing ports which have @var{fdes} as an
-underlying file descriptor, without changing their revealed
-counts.
-@end deffn
-
-@deffn {Scheme Procedure} fdes->inport fdes
-Returns an existing input port which has @var{fdes} as its underlying file
-descriptor, if one exists, and increments its revealed count.
-Otherwise, returns a new input port with a revealed count of 1.
-@end deffn
-
-@deffn {Scheme Procedure} fdes->outport fdes
-Returns an existing output port which has @var{fdes} as its underlying file
-descriptor, if one exists, and increments its revealed count.
-Otherwise, returns a new output port with a revealed count of 1.
-@end deffn
-
-@deffn {Scheme Procedure} primitive-move->fdes port fd
-@deffnx {C Function} scm_primitive_move_to_fdes (port, fd)
-Moves the underlying file descriptor for @var{port} to the integer
-value @var{fdes} without changing the revealed count of @var{port}.
-Any other ports already using this descriptor will be automatically
-shifted to new descriptors and their revealed counts reset to zero.
-The return value is @code{#f} if the file descriptor already had the
-required value or @code{#t} if it was moved.
-@end deffn
-
-@deffn {Scheme Procedure} move->fdes port fdes
-Moves the underlying file descriptor for @var{port} to the integer
-value @var{fdes} and sets its revealed count to one. Any other ports
-already using this descriptor will be automatically
-shifted to new descriptors and their revealed counts reset to zero.
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} release-port-handle port
-Decrements the revealed count for a port.
-@end deffn
-
-@deffn {Scheme Procedure} fsync object
-@deffnx {C Function} scm_fsync (object)
-Copies any unwritten data for the specified output file descriptor to disk.
-If @var{port/fd} is a port, its buffer is flushed before the underlying
-file descriptor is fsync'd.
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} open path flags [mode]
-@deffnx {C Function} scm_open (path, flags, mode)
-Open the file named by @var{path} for reading and/or writing.
-@var{flags} is an integer specifying how the file should be opened.
-@var{mode} is an integer specifying the permission bits of the file, if
-it needs to be created, before the umask is applied. The default is 666
-(Unix itself has no default).
-
-@var{flags} can be constructed by combining variables using @code{logior}.
-Basic flags are:
-
-@defvar O_RDONLY
-Open the file read-only.
-@end defvar
-@defvar O_WRONLY
-Open the file write-only.
-@end defvar
-@defvar O_RDWR
-Open the file read/write.
-@end defvar
-@defvar O_APPEND
-Append to the file instead of truncating.
-@end defvar
-@defvar O_CREAT
-Create the file if it does not already exist.
-@end defvar
-
-See the Unix documentation of the @code{open} system call
-for additional flags.
-@end deffn
-
-@deffn {Scheme Procedure} open-fdes path flags [mode]
-@deffnx {C Function} scm_open_fdes (path, flags, mode)
-Similar to @code{open} but return a file descriptor instead of
-a port.
-@end deffn
-
-@deffn {Scheme Procedure} close fd_or_port
-@deffnx {C Function} scm_close (fd_or_port)
-Similar to close-port (@pxref{Closing, close-port}),
-but also works on file descriptors. A side
-effect of closing a file descriptor is that any ports using that file
-descriptor are moved to a different file descriptor and have
-their revealed counts set to zero.
-@end deffn
-
-@deffn {Scheme Procedure} close-fdes fd
-@deffnx {C Function} scm_close_fdes (fd)
-A simple wrapper for the @code{close} system call.
-Close file descriptor @var{fd}, which must be an integer.
-Unlike close (@pxref{Ports and File Descriptors, close}),
-the file descriptor will be closed even if a port is using it.
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} unread-char char [port]
-@deffnx {C Function} scm_unread_char (char, port)
-Place @var{char} in @var{port} so that it will be read by the
-next read operation. If called multiple times, the unread characters
-will be read again in last-in first-out order. If @var{port} is
-not supplied, the current input port is used.
-@end deffn
-
-@deffn {Scheme Procedure} unread-string str port
-Place the string @var{str} in @var{port} so that its characters will be
-read in subsequent read operations. If called multiple times, the
-unread characters will be read again in last-in first-out order. If
-@var{port} is not supplied, the current-input-port is used.
-@end deffn
-
-@deffn {Scheme Procedure} pipe
-@deffnx {C Function} scm_pipe ()
-Return a newly created pipe: a pair of ports which are linked
-together on the local machine. The @emph{car} is the input
-port and the @emph{cdr} is the output port. Data written (and
-flushed) to the output port can be read from the input port.
-Pipes are commonly used for communication with a newly forked
-child process. The need to flush the output port can be
-avoided by making it unbuffered using @code{setvbuf}.
-
-Writes occur atomically provided the size of the data in bytes
-is not greater than the value of @code{PIPE_BUF}. Note that
-the output port is likely to block if too much data (typically
-equal to @code{PIPE_BUF}) has been written but not yet read
-from the input port.
-@end deffn
-
-The next group of procedures perform a @code{dup2}
-system call, if @var{newfd} (an
-integer) is supplied, otherwise a @code{dup}. The file descriptor to be
-duplicated can be supplied as an integer or contained in a port. The
-type of value returned varies depending on which procedure is used.
-
-All procedures also have the side effect when performing @code{dup2} that any
-ports using @var{newfd} are moved to a different file descriptor and have
-their revealed counts set to zero.
-
-@deffn {Scheme Procedure} dup->fdes fd_or_port [fd]
-@deffnx {C Function} scm_dup_to_fdes (fd_or_port, fd)
-Return a new integer file descriptor referring to the open file
-designated by @var{fd_or_port}, which must be either an open
-file port or a file descriptor.
-@end deffn
-
-@deffn {Scheme Procedure} dup->inport port/fd [newfd]
-Returns a new input port using the new file descriptor.
-@end deffn
-
-@deffn {Scheme Procedure} dup->outport port/fd [newfd]
-Returns a new output port using the new file descriptor.
-@end deffn
-
-@deffn {Scheme Procedure} dup port/fd [newfd]
-Returns a new port if @var{port/fd} is a port, with the same mode as the
-supplied port, otherwise returns an integer file descriptor.
-@end deffn
-
-@deffn {Scheme Procedure} dup->port port/fd mode [newfd]
-Returns a new port using the new file descriptor. @var{mode} supplies a
-mode string for the port (@pxref{File Ports, open-file}).
-@end deffn
-
-@deffn {Scheme Procedure} duplicate-port port modes
-Returns a new port which is opened on a duplicate of the file
-descriptor underlying @var{port}, with mode string @var{modes}
-as for @ref{File Ports, open-file}. The two ports
-will share a file position and file status flags.
-
-Unexpected behaviour can result if both ports are subsequently used
-and the original and/or duplicate ports are buffered.
-The mode string can include @code{0} to obtain an unbuffered duplicate
-port.
-
-This procedure is equivalent to @code{(dup->port @var{port} @var{modes})}.
-@end deffn
-
-@deffn {Scheme Procedure} redirect-port old new
-@deffnx {C Function} scm_redirect_port (old, new)
-This procedure takes two ports and duplicates the underlying file
-descriptor from @var{old-port} into @var{new-port}. The
-current file descriptor in @var{new-port} will be closed.
-After the redirection the two ports will share a file position
-and file status flags.
-
-The return value is unspecified.
-
-Unexpected behaviour can result if both ports are subsequently used
-and the original and/or duplicate ports are buffered.
-
-This procedure does not have any side effects on other ports or
-revealed counts.
-@end deffn
-
-@deffn {Scheme Procedure} dup2 oldfd newfd
-@deffnx {C Function} scm_dup2 (oldfd, newfd)
-A simple wrapper for the @code{dup2} system call.
-Copies the file descriptor @var{oldfd} to descriptor
-number @var{newfd}, replacing the previous meaning
-of @var{newfd}. Both @var{oldfd} and @var{newfd} must
-be integers.
-Unlike for dup->fdes or primitive-move->fdes, no attempt
-is made to move away ports which are using @var{newfd}.
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} port-mode port
-Return the port modes associated with the open port @var{port}.
-These will not necessarily be identical to the modes used when
-the port was opened, since modes such as "append" which are
-used only during port creation are not retained.
-@end deffn
-
-@deffn {Scheme Procedure} port-for-each proc
-@deffnx {C Function} scm_port_for_each (proc)
-Apply @var{proc} to each port in the Guile port table
-in turn. The return value is unspecified. More specifically,
-@var{proc} is applied exactly once to every port that exists
-in the system at the time @var{port-for-each} is invoked.
-Changes to the port table while @var{port-for-each} is running
-have no effect as far as @var{port-for-each} is concerned.
-@end deffn
-
-@deffn {Scheme Procedure} setvbuf port mode [size]
-@deffnx {C Function} scm_setvbuf (port, mode, size)
-Set the buffering mode for @var{port}. @var{mode} can be:
-@table @code
-@item _IONBF
-non-buffered
-@item _IOLBF
-line buffered
-@item _IOFBF
-block buffered, using a newly allocated buffer of @var{size} bytes.
-If @var{size} is omitted, a default size will be used.
-@end table
-@end deffn
-
-@deffn {Scheme Procedure} fcntl object cmd [value]
-@deffnx {C Function} scm_fcntl (object, cmd, value)
-Apply @var{command} to the specified file descriptor or the underlying
-file descriptor of the specified port. @var{value} is an optional
-integer argument.
-
-Values for @var{command} are:
-
-@table @code
-@item F_DUPFD
-Duplicate a file descriptor
-@item F_GETFD
-Get flags associated with the file descriptor.
-@item F_SETFD
-Set flags associated with the file descriptor to @var{value}.
-@item F_GETFL
-Get flags associated with the open file.
-@item F_SETFL
-Set flags associated with the open file to @var{value}
-@item F_GETOWN
-Get the process ID of a socket's owner, for @code{SIGIO} signals.
-@item F_SETOWN
-Set the process that owns a socket to @var{value}, for @code{SIGIO} signals.
-@item FD_CLOEXEC
-The value used to indicate the "close on exec" flag with @code{F_GETFL} or
-@code{F_SETFL}.
-@end table
-@end deffn
-
-@deffn {Scheme Procedure} flock file operation
-@deffnx {C Function} scm_flock (file, operation)
-Apply or remove an advisory lock on an open file.
-@var{operation} specifies the action to be done:
-@table @code
-@item LOCK_SH
-Shared lock. More than one process may hold a shared lock
-for a given file at a given time.
-@item LOCK_EX
-Exclusive lock. Only one process may hold an exclusive lock
-for a given file at a given time.
-@item LOCK_UN
-Unlock the file.
-@item LOCK_NB
-Don't block when locking. May be specified by bitwise OR'ing
-it to one of the other operations.
-@end table
-The return value is not specified. @var{file} may be an open
-file descriptor or an open file descriptor port.
-@end deffn
-
-@deffn {Scheme Procedure} select reads writes excepts [secs [usecs]]
-@deffnx {C Function} scm_select (reads, writes, excepts, secs, usecs)
-This procedure has a variety of uses: waiting for the ability
-to provide input, accept output, or the existence of
-exceptional conditions on a collection of ports or file
-descriptors, or waiting for a timeout to occur.
-It also returns if interrupted by a signal.
-
-@var{reads}, @var{writes} and @var{excepts} can be lists or
-vectors, with each member a port or a file descriptor.
-The value returned is a list of three corresponding
-lists or vectors containing only the members which meet the
-specified requirement. The ability of port buffers to
-provide input or accept output is taken into account.
-Ordering of the input lists or vectors is not preserved.
-
-The optional arguments @var{secs} and @var{usecs} specify the
-timeout. Either @var{secs} can be specified alone, as
-either an integer or a real number, or both @var{secs} and
-@var{usecs} can be specified as integers, in which case
-@var{usecs} is an additional timeout expressed in
-microseconds. If @var{secs} is omitted or is @code{#f} then
-select will wait for as long as it takes for one of the other
-conditions to be satisfied.
-
-The scsh version of @code{select} differs as follows:
-Only vectors are accepted for the first three arguments.
-The @var{usecs} argument is not supported.
-Multiple values are returned instead of a list.
-Duplicates in the input vectors appear only once in output.
-An additional @code{select!} interface is provided.
-@end deffn
-
-@node File System
-@section File System
-
-These procedures allow querying and setting file system attributes
-(such as owner,
-permissions, sizes and types of files); deleting, copying, renaming and
-linking files; creating and removing directories and querying their
-contents; syncing the file system and creating special files.
-
-@deffn {Scheme Procedure} access? path how
-@deffnx {C Function} scm_access (path, how)
-Return @code{#t} if @var{path} corresponds to an existing file
-and the current process has the type of access specified by
-@var{how}, otherwise @code{#f}. @var{how} should be specified
-using the values of the variables listed below. Multiple
-values can be combined using a bitwise or, in which case
-@code{#t} will only be returned if all accesses are granted.
-
-Permissions are checked using the real id of the current
-process, not the effective id, although it's the effective id
-which determines whether the access would actually be granted.
-
-@defvar R_OK
-test for read permission.
-@end defvar
-@defvar W_OK
-test for write permission.
-@end defvar
-@defvar X_OK
-test for execute permission.
-@end defvar
-@defvar F_OK
-test for existence of the file.
-@end defvar
-@end deffn
-
-@findex fstat
-@deffn {Scheme Procedure} stat object
-@deffnx {C Function} scm_stat (object)
-Return an object containing various information about the file
-determined by @var{obj}. @var{obj} can be a string containing
-a file name or a port or integer file descriptor which is open
-on a file (in which case @code{fstat} is used as the underlying
-system call).
-
-The object returned by @code{stat} can be passed as a single
-parameter to the following procedures, all of which return
-integers:
-
-@table @code
-@item stat:dev
-The device containing the file.
-@item stat:ino
-The file serial number, which distinguishes this file from all
-other files on the same device.
-@item stat:mode
-The mode of the file. This includes file type information and
-the file permission bits. See @code{stat:type} and
-@code{stat:perms} below.
-@item stat:nlink
-The number of hard links to the file.
-@item stat:uid
-The user ID of the file's owner.
-@item stat:gid
-The group ID of the file.
-@item stat:rdev
-Device ID; this entry is defined only for character or block
-special files.
-@item stat:size
-The size of a regular file in bytes.
-@item stat:atime
-The last access time for the file.
-@item stat:mtime
-The last modification time for the file.
-@item stat:ctime
-The last modification time for the attributes of the file.
-@item stat:blksize
-The optimal block size for reading or writing the file, in
-bytes.
-@item stat:blocks
-The amount of disk space that the file occupies measured in
-units of 512 byte blocks.
-@end table
-
-In addition, the following procedures return the information
-from stat:mode in a more convenient form:
-
-@table @code
-@item stat:type
-A symbol representing the type of file. Possible values are
-regular, directory, symlink, block-special, char-special, fifo,
-socket and unknown
-@item stat:perms
-An integer representing the access permission bits.
-@end table
-@end deffn
-
-@deffn {Scheme Procedure} lstat str
-@deffnx {C Function} scm_lstat (str)
-Similar to @code{stat}, but does not follow symbolic links, i.e.,
-it will return information about a symbolic link itself, not the
-file it points to. @var{path} must be a string.
-@end deffn
-
-@deffn {Scheme Procedure} readlink path
-@deffnx {C Function} scm_readlink (path)
-Return the value of the symbolic link named by @var{path} (a
-string), i.e., the file that the link points to.
-@end deffn
-
-@findex fchown
-@findex lchown
-@deffn {Scheme Procedure} chown object owner group
-@deffnx {C Function} scm_chown (object, owner, group)
-Change the ownership and group of the file referred to by @var{object} to
-the integer values @var{owner} and @var{group}. @var{object} can be
-a string containing a file name or, if the platform
-supports fchown, a port or integer file descriptor
-which is open on the file. The return value
-is unspecified.
-
-If @var{object} is a symbolic link, either the
-ownership of the link or the ownership of the referenced file will be
-changed depending on the operating system (lchown is
-unsupported at present). If @var{owner} or @var{group} is specified
-as @code{-1}, then that ID is not changed.
-@end deffn
-
-@findex fchmod
-@deffn {Scheme Procedure} chmod object mode
-@deffnx {C Function} scm_chmod (object, mode)
-Changes the permissions of the file referred to by @var{obj}.
-@var{obj} can be a string containing a file name or a port or integer file
-descriptor which is open on a file (in which case @code{fchmod} is used
-as the underlying system call).
-@var{mode} specifies
-the new permissions as a decimal number, e.g., @code{(chmod "foo" #o755)}.
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} utime pathname [actime [modtime]]
-@deffnx {C Function} scm_utime (pathname, actime, modtime)
-@code{utime} sets the access and modification times for the
-file named by @var{path}. If @var{actime} or @var{modtime} is
-not supplied, then the current time is used. @var{actime} and
-@var{modtime} must be integer time values as returned by the
-@code{current-time} procedure.
-@lisp
-(utime "foo" (- (current-time) 3600))
-@end lisp
-will set the access time to one hour in the past and the
-modification time to the current time.
-@end deffn
-
-@findex unlink
-@deffn {Scheme Procedure} delete-file str
-@deffnx {C Function} scm_delete_file (str)
-Deletes (or "unlinks") the file specified by @var{path}.
-@end deffn
-
-@deffn {Scheme Procedure} copy-file oldfile newfile
-@deffnx {C Function} scm_copy_file (oldfile, newfile)
-Copy the file specified by @var{path-from} to @var{path-to}.
-The return value is unspecified.
-@end deffn
-
-@findex rename
-@deffn {Scheme Procedure} rename-file oldname newname
-@deffnx {C Function} scm_rename (oldname, newname)
-Renames the file specified by @var{oldname} to @var{newname}.
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} link oldpath newpath
-@deffnx {C Function} scm_link (oldpath, newpath)
-Creates a new name @var{newpath} in the file system for the
-file named by @var{oldpath}. If @var{oldpath} is a symbolic
-link, the link may or may not be followed depending on the
-system.
-@end deffn
-
-@deffn {Scheme Procedure} symlink oldpath newpath
-@deffnx {C Function} scm_symlink (oldpath, newpath)
-Create a symbolic link named @var{path-to} with the value (i.e., pointing to)
-@var{path-from}. The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} mkdir path [mode]
-@deffnx {C Function} scm_mkdir (path, mode)
-Create a new directory named by @var{path}. If @var{mode} is omitted
-then the permissions of the directory file are set using the current
-umask. Otherwise they are set to the decimal value specified with
-@var{mode}. The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} rmdir path
-@deffnx {C Function} scm_rmdir (path)
-Remove the existing directory named by @var{path}. The directory must
-be empty for this to succeed. The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} opendir dirname
-@deffnx {C Function} scm_opendir (dirname)
-Open the directory specified by @var{path} and return a directory
-stream.
-@end deffn
-
-@deffn {Scheme Procedure} directory-stream? obj
-@deffnx {C Function} scm_directory_stream_p (obj)
-Return a boolean indicating whether @var{object} is a directory
-stream as returned by @code{opendir}.
-@end deffn
-
-@deffn {Scheme Procedure} readdir port
-@deffnx {C Function} scm_readdir (port)
-Return (as a string) the next directory entry from the directory stream
-@var{stream}. If there is no remaining entry to be read then the
-end of file object is returned.
-@end deffn
-
-@deffn {Scheme Procedure} rewinddir port
-@deffnx {C Function} scm_rewinddir (port)
-Reset the directory port @var{stream} so that the next call to
-@code{readdir} will return the first directory entry.
-@end deffn
-
-@deffn {Scheme Procedure} closedir port
-@deffnx {C Function} scm_closedir (port)
-Close the directory stream @var{stream}.
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} sync
-@deffnx {C Function} scm_sync ()
-Flush the operating system disk buffers.
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} mknod path type perms dev
-@deffnx {C Function} scm_mknod (path, type, perms, dev)
-Creates a new special file, such as a file corresponding to a device.
-@var{path} specifies the name of the file. @var{type} should
-be one of the following symbols:
-regular, directory, symlink, block-special, char-special,
-fifo, or socket. @var{perms} (an integer) specifies the file permissions.
-@var{dev} (an integer) specifies which device the special file refers
-to. Its exact interpretation depends on the kind of special file
-being created.
-
-E.g.,
-@lisp
-(mknod "/dev/fd0" 'block-special #o660 (+ (* 2 256) 2))
-@end lisp
-
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} tmpnam
-@deffnx {C Function} scm_tmpnam ()
-Return a name in the file system that does not match any
-existing file. However there is no guarantee that another
-process will not create the file after @code{tmpnam} is called.
-Care should be taken if opening the file, e.g., use the
-@code{O_EXCL} open flag or use @code{mkstemp!} instead.
-@end deffn
-
-@deffn {Scheme Procedure} mkstemp! tmpl
-@deffnx {C Function} scm_mkstemp (tmpl)
-Create a new unique file in the file system and returns a new
-buffered port open for reading and writing to the file.
-@var{tmpl} is a string specifying where the file should be
-created: it must end with @code{XXXXXX} and will be changed in
-place to return the name of the temporary file.
-@end deffn
-
-@deffn {Scheme Procedure} dirname filename
-@deffnx {C Function} scm_dirname (filename)
-Return the directory name component of the file name
-@var{filename}. If @var{filename} does not contain a directory
-component, @code{.} is returned.
-@end deffn
-
-@deffn {Scheme Procedure} basename filename [suffix]
-@deffnx {C Function} scm_basename (filename, suffix)
-Return the base name of the file name @var{filename}. The
-base name is the file name without any directory components.
-If @var{suffix} is provided, and is equal to the end of
-@var{basename}, it is removed also.
-@end deffn
-
-
-@node User Information
-@section User Information
-
-The facilities in this section provide an interface to the user and
-group database.
-They should be used with care since they are not reentrant.
-
-The following functions accept an object representing user information
-and return a selected component:
-
-@table @code
-@item passwd:name
-The name of the userid.
-@item passwd:passwd
-The encrypted passwd.
-@item passwd:uid
-The user id number.
-@item passwd:gid
-The group id number.
-@item passwd:gecos
-The full name.
-@item passwd:dir
-The home directory.
-@item passwd:shell
-The login shell.
-@end table
-
-@deffn {Scheme Procedure} getpwuid uid
-Look up an integer userid in the user database.
-@end deffn
-
-@deffn {Scheme Procedure} getpwnam name
-Look up a user name string in the user database.
-@end deffn
-
-@deffn {Scheme Procedure} setpwent
-Initializes a stream used by @code{getpwent} to read from the user database.
-The next use of @code{getpwent} will return the first entry. The
-return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} getpwent
-Return the next entry in the user database, using the stream set by
-@code{setpwent}.
-@end deffn
-
-@deffn {Scheme Procedure} endpwent
-Closes the stream used by @code{getpwent}. The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} setpw [arg]
-@deffnx {C Function} scm_setpwent (arg)
-If called with a true argument, initialize or reset the password data
-stream. Otherwise, close the stream. The @code{setpwent} and
-@code{endpwent} procedures are implemented on top of this.
-@end deffn
-
-@deffn {Scheme Procedure} getpw [user]
-@deffnx {C Function} scm_getpwuid (user)
-Look up an entry in the user database. @var{obj} can be an integer,
-a string, or omitted, giving the behaviour of getpwuid, getpwnam
-or getpwent respectively.
-@end deffn
-
-The following functions accept an object representing group information
-and return a selected component:
-
-@table @code
-@item group:name
-The group name.
-@item group:passwd
-The encrypted group password.
-@item group:gid
-The group id number.
-@item group:mem
-A list of userids which have this group as a supplementary group.
-@end table
-
-@deffn {Scheme Procedure} getgrgid gid
-Look up an integer group id in the group database.
-@end deffn
-
-@deffn {Scheme Procedure} getgrnam name
-Look up a group name in the group database.
-@end deffn
-
-@deffn {Scheme Procedure} setgrent
-Initializes a stream used by @code{getgrent} to read from the group database.
-The next use of @code{getgrent} will return the first entry.
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} getgrent
-Return the next entry in the group database, using the stream set by
-@code{setgrent}.
-@end deffn
-
-@deffn {Scheme Procedure} endgrent
-Closes the stream used by @code{getgrent}.
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} setgr [arg]
-@deffnx {C Function} scm_setgrent (arg)
-If called with a true argument, initialize or reset the group data
-stream. Otherwise, close the stream. The @code{setgrent} and
-@code{endgrent} procedures are implemented on top of this.
-@end deffn
-
-@deffn {Scheme Procedure} getgr [name]
-@deffnx {C Function} scm_getgrgid (name)
-Look up an entry in the group database. @var{obj} can be an integer,
-a string, or omitted, giving the behaviour of getgrgid, getgrnam
-or getgrent respectively.
-@end deffn
-
-In addition to the accessor procedures for the user database, the
-following shortcut procedures are also available.
-
-@deffn {Scheme Procedure} cuserid
-@deffnx {C Function} scm_cuserid ()
-Return a string containing a user name associated with the
-effective user id of the process. Return @code{#f} if this
-information cannot be obtained.
-@end deffn
-
-@deffn {Scheme Procedure} getlogin
-@deffnx {C Function} scm_getlogin ()
-Return a string containing the name of the user logged in on
-the controlling terminal of the process, or @code{#f} if this
-information cannot be obtained.
-@end deffn
-
-
-@node Time
-@section Time
-
-@deffn {Scheme Procedure} current-time
-@deffnx {C Function} scm_current_time ()
-Return the number of seconds since 1970-01-01 00:00:00 UTC,
-excluding leap seconds.
-@end deffn
-
-@deffn {Scheme Procedure} gettimeofday
-@deffnx {C Function} scm_gettimeofday ()
-Return a pair containing the number of seconds and microseconds
-since 1970-01-01 00:00:00 UTC, excluding leap seconds. Note:
-whether true microsecond resolution is available depends on the
-operating system.
-@end deffn
-
-The following procedures either accept an object representing a broken down
-time and return a selected component, or accept an object representing
-a broken down time and a value and set the component to the value.
-The numbers in parentheses give the usual range.
-
-@table @code
-@item tm:sec, set-tm:sec
-Seconds (0-59).
-@item tm:min, set-tm:min
-Minutes (0-59).
-@item tm:hour, set-tm:hour
-Hours (0-23).
-@item tm:mday, set-tm:mday
-Day of the month (1-31).
-@item tm:mon, set-tm:mon
-Month (0-11).
-@item tm:year, set-tm:year
-Year (70-), the year minus 1900.
-@item tm:wday, set-tm:wday
-Day of the week (0-6) with Sunday represented as 0.
-@item tm:yday, set-tm:yday
-Day of the year (0-364, 365 in leap years).
-@item tm:isdst, set-tm:isdst
-Daylight saving indicator (0 for "no", greater than 0 for "yes", less than
-0 for "unknown").
-@item tm:gmtoff, set-tm:gmtoff
-Time zone offset in seconds west of UTC (-46800 to 43200).
-@item tm:zone, set-tm:zone
-Time zone label (a string), not necessarily unique.
-@end table
-
-@deffn {Scheme Procedure} localtime time [zone]
-@deffnx {C Function} scm_localtime (time, zone)
-Return an object representing the broken down components of
-@var{time}, an integer like the one returned by
-@code{current-time}. The time zone for the calculation is
-optionally specified by @var{zone} (a string), otherwise the
-@code{TZ} environment variable or the system default is used.
-@end deffn
-
-@deffn {Scheme Procedure} gmtime time
-@deffnx {C Function} scm_gmtime (time)
-Return an object representing the broken down components of
-@var{time}, an integer like the one returned by
-@code{current-time}. The values are calculated for UTC.
-@end deffn
-
-@deffn {Scheme Procedure} mktime sbd_time [zone]
-@deffnx {C Function} scm_mktime (sbd_time, zone)
-@var{bd-time} is an object representing broken down time and @code{zone}
-is an optional time zone specifier (otherwise the TZ environment variable
-or the system default is used).
-
-Returns a pair: the car is a corresponding
-integer time value like that returned
-by @code{current-time}; the cdr is a broken down time object, similar to
-as @var{bd-time} but with normalized values.
-@end deffn
-
-@deffn {Scheme Procedure} tzset
-@deffnx {C Function} scm_tzset ()
-Initialize the timezone from the TZ environment variable
-or the system default. It's not usually necessary to call this procedure
-since it's done automatically by other procedures that depend on the
-timezone.
-@end deffn
-
-@deffn {Scheme Procedure} strftime format stime
-@deffnx {C Function} scm_strftime (format, stime)
-Formats a time specification @var{time} using @var{template}. @var{time}
-is an object with time components in the form returned by @code{localtime}
-or @code{gmtime}. @var{template} is a string which can include formatting
-specifications introduced by a @code{%} character. The formatting of
-month and day names is dependent on the current locale. The value returned
-is the formatted string.
-@xref{Formatting Date and Time, , , libc, The GNU C Library Reference Manual}.)
-@end deffn
-
-@deffn {Scheme Procedure} strptime format string
-@deffnx {C Function} scm_strptime (format, string)
-Performs the reverse action to @code{strftime}, parsing
-@var{string} according to the specification supplied in
-@var{template}. The interpretation of month and day names is
-dependent on the current locale. The value returned is a pair.
-The car has an object with time components
-in the form returned by @code{localtime} or @code{gmtime},
-but the time zone components
-are not usefully set.
-The cdr reports the number of characters from @var{string}
-which were used for the conversion.
-@end deffn
-
-@defvar internal-time-units-per-second
-The value of this variable is the number of time units per second
-reported by the following procedures.
-@end defvar
-
-@deffn {Scheme Procedure} times
-@deffnx {C Function} scm_times ()
-Return an object with information about real and processor
-time. The following procedures accept such an object as an
-argument and return a selected component:
-
-@table @code
-@item tms:clock
-The current real time, expressed as time units relative to an
-arbitrary base.
-@item tms:utime
-The CPU time units used by the calling process.
-@item tms:stime
-The CPU time units used by the system on behalf of the calling
-process.
-@item tms:cutime
-The CPU time units used by terminated child processes of the
-calling process, whose status has been collected (e.g., using
-@code{waitpid}).
-@item tms:cstime
-Similarly, the CPU times units used by the system on behalf of
-terminated child processes.
-@end table
-@end deffn
-
-@deffn {Scheme Procedure} get-internal-real-time
-@deffnx {C Function} scm_get_internal_real_time ()
-Return the number of time units since the interpreter was
-started.
-@end deffn
-
-@deffn {Scheme Procedure} get-internal-run-time
-@deffnx {C Function} scm_get_internal_run_time ()
-Return the number of time units of processor time used by the
-interpreter. Both @emph{system} and @emph{user} time are
-included but subprocesses are not.
-@end deffn
-
-@node Runtime Environment
-@section Runtime Environment
-
-@deffn {Scheme Procedure} program-arguments
-@deffnx {Scheme Procedure} command-line
-@deffnx {C Function} scm_program_arguments ()
-Return the list of command line arguments passed to Guile, as a list of
-strings. The list includes the invoked program name, which is usually
-@code{"guile"}, but excludes switches and parameters for command line
-options like @code{-e} and @code{-l}.
-@end deffn
-
-@deffn {Scheme Procedure} getenv nam
-@deffnx {C Function} scm_getenv (nam)
-Looks up the string @var{name} in the current environment. The return
-value is @code{#f} unless a string of the form @code{NAME=VALUE} is
-found, in which case the string @code{VALUE} is returned.
-@end deffn
-
-@c begin (scm-doc-string "boot-9.scm" "setenv")
-@deffn {Scheme Procedure} setenv name value
-Modifies the environment of the current process, which is
-also the default environment inherited by child processes.
-
-If @var{value} is @code{#f}, then @var{name} is removed from the
-environment. Otherwise, the string @var{name}=@var{value} is added
-to the environment, replacing any existing string with name matching
-@var{name}.
-
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} environ [env]
-@deffnx {C Function} scm_environ (env)
-If @var{env} is omitted, return the current environment (in the
-Unix sense) as a list of strings. Otherwise set the current
-environment, which is also the default environment for child
-processes, to the supplied list of strings. Each member of
-@var{env} should be of the form @code{NAME=VALUE} and values of
-@code{NAME} should not be duplicated. If @var{env} is supplied
-then the return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} putenv str
-@deffnx {C Function} scm_putenv (str)
-Modifies the environment of the current process, which is
-also the default environment inherited by child processes.
-
-If @var{string} is of the form @code{NAME=VALUE} then it will be written
-directly into the environment, replacing any existing environment string
-with
-name matching @code{NAME}. If @var{string} does not contain an equal
-sign, then any existing string with name matching @var{string} will
-be removed.
-
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} setenv name value
-Give the environment variable @var{name} the value @var{value}. The
-name can not contain a @samp{=} character.
-@end deffn
-
-@deffn {Scheme Procedure} unsetenv name
-Remove variable @var{name} from the environment. The
-name can not contain a @samp{=} character.
-@end deffn
-
-@node Processes
-@section Processes
-
-@findex cd
-@deffn {Scheme Procedure} chdir str
-@deffnx {C Function} scm_chdir (str)
-Change the current working directory to @var{path}.
-The return value is unspecified.
-@end deffn
-
-@findex pwd
-@deffn {Scheme Procedure} getcwd
-@deffnx {C Function} scm_getcwd ()
-Return the name of the current working directory.
-@end deffn
-
-@deffn {Scheme Procedure} umask [mode]
-@deffnx {C Function} scm_umask (mode)
-If @var{mode} is omitted, returns a decimal number representing the current
-file creation mask. Otherwise the file creation mask is set to
-@var{mode} and the previous value is returned.
-
-E.g., @code{(umask #o022)} sets the mask to octal 22, decimal 18.
-@end deffn
-
-@deffn {Scheme Procedure} chroot path
-@deffnx {C Function} scm_chroot (path)
-Change the root directory to that specified in @var{path}.
-This directory will be used for path names beginning with
-@file{/}. The root directory is inherited by all children
-of the current process. Only the superuser may change the
-root directory.
-@end deffn
-
-@deffn {Scheme Procedure} getpid
-@deffnx {C Function} scm_getpid ()
-Return an integer representing the current process ID.
-@end deffn
-
-@deffn {Scheme Procedure} getgroups
-@deffnx {C Function} scm_getgroups ()
-Return a vector of integers representing the current
-supplementary group IDs.
-@end deffn
-
-@deffn {Scheme Procedure} getppid
-@deffnx {C Function} scm_getppid ()
-Return an integer representing the process ID of the parent
-process.
-@end deffn
-
-@deffn {Scheme Procedure} getuid
-@deffnx {C Function} scm_getuid ()
-Return an integer representing the current real user ID.
-@end deffn
-
-@deffn {Scheme Procedure} getgid
-@deffnx {C Function} scm_getgid ()
-Return an integer representing the current real group ID.
-@end deffn
-
-@deffn {Scheme Procedure} geteuid
-@deffnx {C Function} scm_geteuid ()
-Return an integer representing the current effective user ID.
-If the system does not support effective IDs, then the real ID
-is returned. @code{(feature? 'EIDs)} reports whether the
-system supports effective IDs.
-@end deffn
-
-@deffn {Scheme Procedure} getegid
-@deffnx {C Function} scm_getegid ()
-Return an integer representing the current effective group ID.
-If the system does not support effective IDs, then the real ID
-is returned. @code{(feature? 'EIDs)} reports whether the
-system supports effective IDs.
-@end deffn
-
-@deffn {Scheme Procedure} setuid id
-@deffnx {C Function} scm_setuid (id)
-Sets both the real and effective user IDs to the integer @var{id}, provided
-the process has appropriate privileges.
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} setgid id
-@deffnx {C Function} scm_setgid (id)
-Sets both the real and effective group IDs to the integer @var{id}, provided
-the process has appropriate privileges.
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} seteuid id
-@deffnx {C Function} scm_seteuid (id)
-Sets the effective user ID to the integer @var{id}, provided the process
-has appropriate privileges. If effective IDs are not supported, the
-real ID is set instead -- @code{(feature? 'EIDs)} reports whether the
-system supports effective IDs.
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} setegid id
-@deffnx {C Function} scm_setegid (id)
-Sets the effective group ID to the integer @var{id}, provided the process
-has appropriate privileges. If effective IDs are not supported, the
-real ID is set instead -- @code{(feature? 'EIDs)} reports whether the
-system supports effective IDs.
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} getpgrp
-@deffnx {C Function} scm_getpgrp ()
-Return an integer representing the current process group ID.
-This is the POSIX definition, not BSD.
-@end deffn
-
-@deffn {Scheme Procedure} setpgid pid pgid
-@deffnx {C Function} scm_setpgid (pid, pgid)
-Move the process @var{pid} into the process group @var{pgid}. @var{pid} or
-@var{pgid} must be integers: they can be zero to indicate the ID of the
-current process.
-Fails on systems that do not support job control.
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} setsid
-@deffnx {C Function} scm_setsid ()
-Creates a new session. The current process becomes the session leader
-and is put in a new process group. The process will be detached
-from its controlling terminal if it has one.
-The return value is an integer representing the new process group ID.
-@end deffn
-
-@deffn {Scheme Procedure} waitpid pid [options]
-@deffnx {C Function} scm_waitpid (pid, options)
-This procedure collects status information from a child process which
-has terminated or (optionally) stopped. Normally it will
-suspend the calling process until this can be done. If more than one
-child process is eligible then one will be chosen by the operating system.
-
-The value of @var{pid} determines the behaviour:
-
-@table @r
-@item @var{pid} greater than 0
-Request status information from the specified child process.
-@item @var{pid} equal to -1 or WAIT_ANY
-Request status information for any child process.
-@item @var{pid} equal to 0 or WAIT_MYPGRP
-Request status information for any child process in the current process
-group.
-@item @var{pid} less than -1
-Request status information for any child process whose process group ID
-is -@var{PID}.
-@end table
-
-The @var{options} argument, if supplied, should be the bitwise OR of the
-values of zero or more of the following variables:
-
-@defvar WNOHANG
-Return immediately even if there are no child processes to be collected.
-@end defvar
-
-@defvar WUNTRACED
-Report status information for stopped processes as well as terminated
-processes.
-@end defvar
-
-The return value is a pair containing:
-
-@enumerate
-@item
-The process ID of the child process, or 0 if @code{WNOHANG} was
-specified and no process was collected.
-@item
-The integer status value.
-@end enumerate
-@end deffn
-
-The following three
-functions can be used to decode the process status code returned
-by @code{waitpid}.
-
-@deffn {Scheme Procedure} status:exit-val status
-@deffnx {C Function} scm_status_exit_val (status)
-Return the exit status value, as would be set if a process
-ended normally through a call to @code{exit} or @code{_exit},
-if any, otherwise @code{#f}.
-@end deffn
-
-@deffn {Scheme Procedure} status:term-sig status
-@deffnx {C Function} scm_status_term_sig (status)
-Return the signal number which terminated the process, if any,
-otherwise @code{#f}.
-@end deffn
-
-@deffn {Scheme Procedure} status:stop-sig status
-@deffnx {C Function} scm_status_stop_sig (status)
-Return the signal number which stopped the process, if any,
-otherwise @code{#f}.
-@end deffn
-
-@deffn {Scheme Procedure} system [cmd]
-@deffnx {C Function} scm_system (cmd)
-Execute @var{cmd} using the operating system's "command
-processor". Under Unix this is usually the default shell
-@code{sh}. The value returned is @var{cmd}'s exit status as
-returned by @code{waitpid}, which can be interpreted using the
-functions above.
-
-If @code{system} is called without arguments, return a boolean
-indicating whether the command processor is available.
-@end deffn
-
-@deffn {Scheme Procedure} primitive-exit [status]
-@deffnx {C Function} scm_primitive_exit (status)
-Terminate the current process without unwinding the Scheme stack.
-This is would typically be useful after a fork. The exit status
-is @var{status} if supplied, otherwise zero.
-@end deffn
-
-@deffn {Scheme Procedure} execl filename . args
-@deffnx {C Function} scm_execl (filename, args)
-Executes the file named by @var{path} as a new process image.
-The remaining arguments are supplied to the process; from a C program
-they are accessible as the @code{argv} argument to @code{main}.
-Conventionally the first @var{arg} is the same as @var{path}.
-All arguments must be strings.
-
-If @var{arg} is missing, @var{path} is executed with a null
-argument list, which may have system-dependent side-effects.
-
-This procedure is currently implemented using the @code{execv} system
-call, but we call it @code{execl} because of its Scheme calling interface.
-@end deffn
-
-@deffn {Scheme Procedure} execlp filename . args
-@deffnx {C Function} scm_execlp (filename, args)
-Similar to @code{execl}, however if
-@var{filename} does not contain a slash
-then the file to execute will be located by searching the
-directories listed in the @code{PATH} environment variable.
-
-This procedure is currently implemented using the @code{execvp} system
-call, but we call it @code{execlp} because of its Scheme calling interface.
-@end deffn
-
-@deffn {Scheme Procedure} execle filename env . args
-@deffnx {C Function} scm_execle (filename, env, args)
-Similar to @code{execl}, but the environment of the new process is
-specified by @var{env}, which must be a list of strings as returned by the
-@code{environ} procedure.
-
-This procedure is currently implemented using the @code{execve} system
-call, but we call it @code{execle} because of its Scheme calling interface.
-@end deffn
-
-@deffn {Scheme Procedure} primitive-fork
-@deffnx {C Function} scm_fork ()
-Creates a new "child" process by duplicating the current "parent" process.
-In the child the return value is 0. In the parent the return value is
-the integer process ID of the child.
-
-This procedure has been renamed from @code{fork} to avoid a naming conflict
-with the scsh fork.
-@end deffn
-
-@deffn {Scheme Procedure} nice incr
-@deffnx {C Function} scm_nice (incr)
-Increment the priority of the current process by @var{incr}. A higher
-priority value means that the process runs less often.
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} setpriority which who prio
-@deffnx {C Function} scm_setpriority (which, who, prio)
-Set the scheduling priority of the process, process group
-or user, as indicated by @var{which} and @var{who}. @var{which}
-is one of the variables @code{PRIO_PROCESS}, @code{PRIO_PGRP}
-or @code{PRIO_USER}, and @var{who} is interpreted relative to
-@var{which} (a process identifier for @code{PRIO_PROCESS},
-process group identifier for @code{PRIO_PGRP}, and a user
-identifier for @code{PRIO_USER}. A zero value of @var{who}
-denotes the current process, process group, or user.
-@var{prio} is a value in the range -20 and 20, the default
-priority is 0; lower priorities cause more favorable
-scheduling. Sets the priority of all of the specified
-processes. Only the super-user may lower priorities.
-The return value is not specified.
-@end deffn
-
-@deffn {Scheme Procedure} getpriority which who
-@deffnx {C Function} scm_getpriority (which, who)
-Return the scheduling priority of the process, process group
-or user, as indicated by @var{which} and @var{who}. @var{which}
-is one of the variables @code{PRIO_PROCESS}, @code{PRIO_PGRP}
-or @code{PRIO_USER}, and @var{who} is interpreted relative to
-@var{which} (a process identifier for @code{PRIO_PROCESS},
-process group identifier for @code{PRIO_PGRP}, and a user
-identifier for @code{PRIO_USER}. A zero value of @var{who}
-denotes the current process, process group, or user. Return
-the highest priority (lowest numerical value) of any of the
-specified processes.
-@end deffn
-
-
-@node Signals
-@section Signals
-
-Procedures to raise, handle and wait for signals.
-
-@deffn {Scheme Procedure} kill pid sig
-@deffnx {C Function} scm_kill (pid, sig)
-Sends a signal to the specified process or group of processes.
-
-@var{pid} specifies the processes to which the signal is sent:
-
-@table @r
-@item @var{pid} greater than 0
-The process whose identifier is @var{pid}.
-@item @var{pid} equal to 0
-All processes in the current process group.
-@item @var{pid} less than -1
-The process group whose identifier is -@var{pid}
-@item @var{pid} equal to -1
-If the process is privileged, all processes except for some special
-system processes. Otherwise, all processes with the current effective
-user ID.
-@end table
-
-@var{sig} should be specified using a variable corresponding to
-the Unix symbolic name, e.g.,
-
-@defvar SIGHUP
-Hang-up signal.
-@end defvar
-
-@defvar SIGINT
-Interrupt signal.
-@end defvar
-@end deffn
-
-@deffn {Scheme Procedure} raise sig
-@deffnx {C Function} scm_raise (sig)
-Sends a specified signal @var{sig} to the current process, where
-@var{sig} is as described for the kill procedure.
-@end deffn
-
-@deffn {Scheme Procedure} sigaction signum [handler [flags]]
-@deffnx {C Function} scm_sigaction (signum, handler, flags)
-Install or report the signal handler for a specified signal.
-
-@var{signum} is the signal number, which can be specified using the value
-of variables such as @code{SIGINT}.
-
-If @var{action} is omitted, @code{sigaction} returns a pair: the
-CAR is the current
-signal hander, which will be either an integer with the value @code{SIG_DFL}
-(default action) or @code{SIG_IGN} (ignore), or the Scheme procedure which
-handles the signal, or @code{#f} if a non-Scheme procedure handles the
-signal. The CDR contains the current @code{sigaction} flags for the handler.
-
-If @var{action} is provided, it is installed as the new handler for
-@var{signum}. @var{action} can be a Scheme procedure taking one
-argument, or the value of @code{SIG_DFL} (default action) or
-@code{SIG_IGN} (ignore), or @code{#f} to restore whatever signal handler
-was installed before @code{sigaction} was first used. Flags can
-optionally be specified for the new handler (@code{SA_RESTART} will
-always be added if it's available and the system is using restartable
-system calls.) The return value is a pair with information about the
-old handler as described above.
-
-This interface does not provide access to the "signal blocking"
-facility. Maybe this is not needed, since the thread support may
-provide solutions to the problem of consistent access to data
-structures.
-@end deffn
-
-@deffn {Scheme Procedure} restore-signals
-@deffnx {C Function} scm_restore_signals ()
-Return all signal handlers to the values they had before any call to
-@code{sigaction} was made. The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} alarm i
-@deffnx {C Function} scm_alarm (i)
-Set a timer to raise a @code{SIGALRM} signal after the specified
-number of seconds (an integer). It's advisable to install a signal
-handler for
-@code{SIGALRM} beforehand, since the default action is to terminate
-the process.
-
-The return value indicates the time remaining for the previous alarm,
-if any. The new value replaces the previous alarm. If there was
-no previous alarm, the return value is zero.
-@end deffn
-
-@deffn {Scheme Procedure} pause
-@deffnx {C Function} scm_pause ()
-Pause the current process (thread?) until a signal arrives whose
-action is to either terminate the current process or invoke a
-handler procedure. The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} sleep i
-@deffnx {C Function} scm_sleep (i)
-Wait for the given number of seconds (an integer) or until a signal
-arrives. The return value is zero if the time elapses or the number
-of seconds remaining otherwise.
-@end deffn
-
-@deffn {Scheme Procedure} usleep i
-@deffnx {C Function} scm_usleep (i)
-Sleep for I microseconds. @code{usleep} is not available on
-all platforms.
-@end deffn
-
-@deffn {Scheme Procedure} setitimer which_timer interval_seconds interval_microseconds value_seconds value_microseconds
-@deffnx {C Function} scm_setitimer (which_timer, interval_seconds, interval_microseconds, value_seconds, value_microseconds)
-Set the timer specified by @var{which_timer} according to the given
-@var{interval_seconds}, @var{interval_microseconds},
-@var{value_seconds}, and @var{value_microseconds} values.
-
-Return information about the timer's previous setting.
-Errors are handled as described in the guile info pages under ``POSIX
-Interface Conventions''.
-
-The timers available are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL},
-and @code{ITIMER_PROF}.
-
-The return value will be a list of two cons pairs representing the
-current state of the given timer. The first pair is the seconds and
-microseconds of the timer @code{it_interval}, and the second pair is
-the seconds and microseconds of the timer @code{it_value}.
-@end deffn
-
-@deffn {Scheme Procedure} getitimer which_timer
-@deffnx {C Function} scm_getitimer (which_timer)
-Return information about the timer specified by @var{which_timer}
-Errors are handled as described in the guile info pages under ``POSIX
-Interface Conventions''.
-
-The timers available are: @code{ITIMER_REAL}, @code{ITIMER_VIRTUAL},
-and @code{ITIMER_PROF}.
-
-The return value will be a list of two cons pairs representing the
-current state of the given timer. The first pair is the seconds and
-microseconds of the timer @code{it_interval}, and the second pair is
-the seconds and microseconds of the timer @code{it_value}.
-@end deffn
-
-
-@node Terminals and Ptys
-@section Terminals and Ptys
-
-@deffn {Scheme Procedure} isatty? port
-@deffnx {C Function} scm_isatty_p (port)
-Return @code{#t} if @var{port} is using a serial non--file
-device, otherwise @code{#f}.
-@end deffn
-
-@deffn {Scheme Procedure} ttyname port
-@deffnx {C Function} scm_ttyname (port)
-Return a string with the name of the serial terminal device
-underlying @var{port}.
-@end deffn
-
-@deffn {Scheme Procedure} ctermid
-@deffnx {C Function} scm_ctermid ()
-Return a string containing the file name of the controlling
-terminal for the current process.
-@end deffn
-
-@deffn {Scheme Procedure} tcgetpgrp port
-@deffnx {C Function} scm_tcgetpgrp (port)
-Return the process group ID of the foreground process group
-associated with the terminal open on the file descriptor
-underlying @var{port}.
-
-If there is no foreground process group, the return value is a
-number greater than 1 that does not match the process group ID
-of any existing process group. This can happen if all of the
-processes in the job that was formerly the foreground job have
-terminated, and no other job has yet been moved into the
-foreground.
-@end deffn
-
-@deffn {Scheme Procedure} tcsetpgrp port pgid
-@deffnx {C Function} scm_tcsetpgrp (port, pgid)
-Set the foreground process group ID for the terminal used by the file
-descriptor underlying @var{port} to the integer @var{pgid}.
-The calling process
-must be a member of the same session as @var{pgid} and must have the same
-controlling terminal. The return value is unspecified.
-@end deffn
-
-@node Pipes
-@section Pipes
-
-The following procedures provide an interface to the @code{popen} and
-@code{pclose} system routines. The code is in a separate "popen"
-module:
-
-@smalllisp
-(use-modules (ice-9 popen))
-@end smalllisp
-
-@findex popen
-@deffn {Scheme Procedure} open-pipe command modes
-Executes the shell command @var{command} (a string) in a subprocess.
-A pipe to the process is created and returned. @var{modes} specifies
-whether an input or output pipe to the process is created: it should
-be the value of @code{OPEN_READ} or @code{OPEN_WRITE}.
-@end deffn
-
-@deffn {Scheme Procedure} open-input-pipe command
-Equivalent to @code{open-pipe} with mode @code{OPEN_READ}.
-@end deffn
-
-@deffn {Scheme Procedure} open-output-pipe command
-Equivalent to @code{open-pipe} with mode @code{OPEN_WRITE}.
-@end deffn
-
-@findex pclose
-@deffn {Scheme Procedure} close-pipe port
-Closes the pipe created by @code{open-pipe}, then waits for the process
-to terminate and returns its status value, @xref{Processes, waitpid}, for
-information on how to interpret this value.
-
-@code{close-port} (@pxref{Closing, close-port}) can also be used to
-close a pipe, but doesn't return the status.
-@end deffn
-
-@node Networking
-@section Networking
-
-@menu
-* Network Address Conversion::
-* Network Databases::
-* Network Sockets and Communication::
-@end menu
-
-@node Network Address Conversion
-@subsection Network Address Conversion
-
-This section describes procedures which convert internet addresses
-between numeric and string formats.
-
-@subsubsection IPv4 Address Conversion
-
-@deffn {Scheme Procedure} inet-aton address
-@deffnx {C Function} scm_inet_aton (address)
-Convert an IPv4 Internet address from printable string
-(dotted decimal notation) to an integer. E.g.,
-
-@lisp
-(inet-aton "127.0.0.1") @result{} 2130706433
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} inet-ntoa inetid
-@deffnx {C Function} scm_inet_ntoa (inetid)
-Convert an IPv4 Internet address to a printable
-(dotted decimal notation) string. E.g.,
-
-@lisp
-(inet-ntoa 2130706433) @result{} "127.0.0.1"
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} inet-netof address
-@deffnx {C Function} scm_inet_netof (address)
-Return the network number part of the given IPv4
-Internet address. E.g.,
-
-@lisp
-(inet-netof 2130706433) @result{} 127
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} inet-lnaof address
-@deffnx {C Function} scm_lnaof (address)
-Return the local-address-with-network part of the given
-IPv4 Internet address, using the obsolete class A/B/C system.
-E.g.,
-
-@lisp
-(inet-lnaof 2130706433) @result{} 1
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} inet-makeaddr net lna
-@deffnx {C Function} scm_inet_makeaddr (net, lna)
-Make an IPv4 Internet address by combining the network number
-@var{net} with the local-address-within-network number
-@var{lna}. E.g.,
-
-@lisp
-(inet-makeaddr 127 1) @result{} 2130706433
-@end lisp
-@end deffn
-
-@subsubsection IPv6 Address Conversion
-
-@deffn {Scheme Procedure} inet-ntop family address
-@deffnx {C Function} scm_inet_ntop (family, address)
-Convert a network address into a printable string.
-Note that unlike the C version of this function,
-the input is an integer with normal host byte ordering.
-@var{family} can be @code{AF_INET} or @code{AF_INET6}. E.g.,
-
-@lisp
-(inet-ntop AF_INET 2130706433) @result{} "127.0.0.1"
-(inet-ntop AF_INET6 (- (expt 2 128) 1)) @result{}
-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} inet-pton family address
-@deffnx {C Function} scm_inet_pton (family, address)
-Convert a string containing a printable network address to
-an integer address. Note that unlike the C version of this
-function,
-the result is an integer with normal host byte ordering.
-@var{family} can be @code{AF_INET} or @code{AF_INET6}. E.g.,
-
-@lisp
-(inet-pton AF_INET "127.0.0.1") @result{} 2130706433
-(inet-pton AF_INET6 "::1") @result{} 1
-@end lisp
-@end deffn
-
-
-@node Network Databases
-@subsection Network Databases
-
-This section describes procedures which query various network databases.
-Care should be taken when using the database routines since they are not
-reentrant.
-
-@subsubsection The Host Database
-
-A @dfn{host object} is a structure that represents what is known about a
-network host, and is the usual way of representing a system's network
-identity inside software.
-
-The following functions accept a host object and return a selected
-component:
-
-@deffn {Scheme Procedure} hostent:name host
-The "official" hostname for @var{host}.
-@end deffn
-@deffn {Scheme Procedure} hostent:aliases host
-A list of aliases for @var{host}.
-@end deffn
-@deffn {Scheme Procedure} hostent:addrtype host
-The host address type. For hosts with Internet addresses, this will
-return @code{AF_INET}.
-@end deffn
-@deffn {Scheme Procedure} hostent:length host
-The length of each address for @var{host}, in bytes.
-@end deffn
-@deffn {Scheme Procedure} hostent:addr-list host
-The list of network addresses associated with @var{host}.
-@end deffn
-
-The following procedures are used to search the host database:
-
-@deffn {Scheme Procedure} gethost [host]
-@deffnx {Scheme Procedure} gethostbyname hostname
-@deffnx {Scheme Procedure} gethostbyaddr address
-@deffnx {C Function} scm_gethost (host)
-Look up a host by name or address, returning a host object. The
-@code{gethost} procedure will accept either a string name or an integer
-address; if given no arguments, it behaves like @code{gethostent} (see
-below). If a name or address is supplied but the address can not be
-found, an error will be thrown to one of the keys:
-@code{host-not-found}, @code{try-again}, @code{no-recovery} or
-@code{no-data}, corresponding to the equivalent @code{h_error} values.
-Unusual conditions may result in errors thrown to the
-@code{system-error} or @code{misc_error} keys.
-@end deffn
-
-The following procedures may be used to step through the host
-database from beginning to end.
-
-@deffn {Scheme Procedure} sethostent [stayopen]
-Initialize an internal stream from which host objects may be read. This
-procedure must be called before any calls to @code{gethostent}, and may
-also be called afterward to reset the host entry stream. If
-@var{stayopen} is supplied and is not @code{#f}, the database is not
-closed by subsequent @code{gethostbyname} or @code{gethostbyaddr} calls,
-possibly giving an efficiency gain.
-@end deffn
-
-@deffn {Scheme Procedure} gethostent
-Return the next host object from the host database, or @code{#f} if
-there are no more hosts to be found (or an error has been encountered).
-This procedure may not be used before @code{sethostent} has been called.
-@end deffn
-
-@deffn {Scheme Procedure} endhostent
-Close the stream used by @code{gethostent}. The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} sethost [stayopen]
-@deffnx {C Function} scm_sethost (stayopen)
-If @var{stayopen} is omitted, this is equivalent to @code{endhostent}.
-Otherwise it is equivalent to @code{sethostent stayopen}.
-@end deffn
-@subsubsection The Network Database
-
-The following functions accept an object representing a network
-and return a selected component:
-
-@deffn {Scheme Procedure} netent:name net
-The "official" network name.
-@end deffn
-@deffn {Scheme Procedure} netent:aliases net
-A list of aliases for the network.
-@end deffn
-@deffn {Scheme Procedure} netent:addrtype net
-The type of the network number. Currently, this returns only
-@code{AF_INET}.
-@end deffn
-@deffn {Scheme Procedure} netent:net net
-The network number.
-@end deffn
-
-The following procedures are used to search the network database:
-
-@deffn {Scheme Procedure} getnet [net]
-@deffnx {Scheme Procedure} getnetbyname net-name
-@deffnx {Scheme Procedure} getnetbyaddr net-number
-@deffnx {C Function} scm_getnet (net)
-Look up a network by name or net number in the network database. The
-@var{net-name} argument must be a string, and the @var{net-number}
-argument must be an integer. @code{getnet} will accept either type of
-argument, behaving like @code{getnetent} (see below) if no arguments are
-given.
-@end deffn
-
-The following procedures may be used to step through the network
-database from beginning to end.
-
-@deffn {Scheme Procedure} setnetent [stayopen]
-Initialize an internal stream from which network objects may be read. This
-procedure must be called before any calls to @code{getnetent}, and may
-also be called afterward to reset the net entry stream. If
-@var{stayopen} is supplied and is not @code{#f}, the database is not
-closed by subsequent @code{getnetbyname} or @code{getnetbyaddr} calls,
-possibly giving an efficiency gain.
-@end deffn
-
-@deffn {Scheme Procedure} getnetent
-Return the next entry from the network database.
-@end deffn
-
-@deffn {Scheme Procedure} endnetent
-Close the stream used by @code{getnetent}. The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} setnet [stayopen]
-@deffnx {C Function} scm_setnet (stayopen)
-If @var{stayopen} is omitted, this is equivalent to @code{endnetent}.
-Otherwise it is equivalent to @code{setnetent stayopen}.
-@end deffn
-
-@subsubsection The Protocol Database
-
-The following functions accept an object representing a protocol
-and return a selected component:
-
-@deffn {Scheme Procedure} protoent:name protocol
-The "official" protocol name.
-@end deffn
-@deffn {Scheme Procedure} protoent:aliases protocol
-A list of aliases for the protocol.
-@end deffn
-@deffn {Scheme Procedure} protoent:proto protocol
-The protocol number.
-@end deffn
-
-The following procedures are used to search the protocol database:
-
-@deffn {Scheme Procedure} getproto [protocol]
-@deffnx {Scheme Procedure} getprotobyname name
-@deffnx {Scheme Procedure} getprotobynumber number
-@deffnx {C Function} scm_getproto (protocol)
-Look up a network protocol by name or by number. @code{getprotobyname}
-takes a string argument, and @code{getprotobynumber} takes an integer
-argument. @code{getproto} will accept either type, behaving like
-@code{getprotoent} (see below) if no arguments are supplied.
-@end deffn
-
-The following procedures may be used to step through the protocol
-database from beginning to end.
-
-@deffn {Scheme Procedure} setprotoent [stayopen]
-Initialize an internal stream from which protocol objects may be read. This
-procedure must be called before any calls to @code{getprotoent}, and may
-also be called afterward to reset the protocol entry stream. If
-@var{stayopen} is supplied and is not @code{#f}, the database is not
-closed by subsequent @code{getprotobyname} or @code{getprotobynumber} calls,
-possibly giving an efficiency gain.
-@end deffn
-
-@deffn {Scheme Procedure} getprotoent
-Return the next entry from the protocol database.
-@end deffn
-
-@deffn {Scheme Procedure} endprotoent
-Close the stream used by @code{getprotoent}. The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} setproto [stayopen]
-@deffnx {C Function} scm_setproto (stayopen)
-If @var{stayopen} is omitted, this is equivalent to @code{endprotoent}.
-Otherwise it is equivalent to @code{setprotoent stayopen}.
-@end deffn
-
-@subsubsection The Service Database
-
-The following functions accept an object representing a service
-and return a selected component:
-
-@deffn {Scheme Procedure} servent:name serv
-The "official" name of the network service.
-@end deffn
-@deffn {Scheme Procedure} servent:aliases serv
-A list of aliases for the network service.
-@end deffn
-@deffn {Scheme Procedure} servent:port serv
-The Internet port used by the service.
-@end deffn
-@deffn {Scheme Procedure} servent:proto serv
-The protocol used by the service. A service may be listed many times
-in the database under different protocol names.
-@end deffn
-
-The following procedures are used to search the service database:
-
-@deffn {Scheme Procedure} getserv [name [protocol]]
-@deffnx {Scheme Procedure} getservbyname name protocol
-@deffnx {Scheme Procedure} getservbyport port protocol
-@deffnx {C Function} scm_getserv (name, protocol)
-Look up a network service by name or by service number, and return a
-network service object. The @var{protocol} argument specifies the name
-of the desired protocol; if the protocol found in the network service
-database does not match this name, a system error is signalled.
-
-The @code{getserv} procedure will take either a service name or number
-as its first argument; if given no arguments, it behaves like
-@code{getservent} (see below).
-@end deffn
-
-The following procedures may be used to step through the service
-database from beginning to end.
-
-@deffn {Scheme Procedure} setservent [stayopen]
-Initialize an internal stream from which service objects may be read. This
-procedure must be called before any calls to @code{getservent}, and may
-also be called afterward to reset the service entry stream. If
-@var{stayopen} is supplied and is not @code{#f}, the database is not
-closed by subsequent @code{getservbyname} or @code{getservbyport} calls,
-possibly giving an efficiency gain.
-@end deffn
-
-@deffn {Scheme Procedure} getservent
-Return the next entry from the services database.
-@end deffn
-
-@deffn {Scheme Procedure} endservent
-Close the stream used by @code{getservent}. The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} setserv [stayopen]
-@deffnx {C Function} scm_setserv (stayopen)
-If @var{stayopen} is omitted, this is equivalent to @code{endservent}.
-Otherwise it is equivalent to @code{setservent stayopen}.
-@end deffn
-
-@node Network Sockets and Communication
-@subsection Network Sockets and Communication
-
-Socket ports can be created using @code{socket} and @code{socketpair}.
-The ports are initially unbuffered, to make reading and writing to the
-same port more reliable. A buffer can be added to the port using
-@code{setvbuf}, @xref{Ports and File Descriptors}.
-
-The convention used for "host" vs "network" addresses is that addresses
-are always held in host order at the Scheme level. The procedures in
-this section automatically convert between host and network order when
-required. The arguments and return values are thus in host order.
-
-@deffn {Scheme Procedure} socket family style proto
-@deffnx {C Function} scm_socket (family, style, proto)
-Return a new socket port of the type specified by @var{family},
-@var{style} and @var{proto}. All three parameters are
-integers. Supported values for @var{family} are
-@code{AF_UNIX}, @code{AF_INET} and @code{AF_INET6}.
-Typical values for @var{style} are @code{SOCK_STREAM},
-@code{SOCK_DGRAM} and @code{SOCK_RAW}.
-
-@var{proto} can be obtained from a protocol name using
-@code{getprotobyname}. A value of zero specifies the default
-protocol, which is usually right.
-
-A single socket port cannot by used for communication until it
-has been connected to another socket.
-@end deffn
-
-@deffn {Scheme Procedure} socketpair family style proto
-@deffnx {C Function} scm_socketpair (family, style, proto)
-Return a pair of connected (but unnamed) socket ports of the
-type specified by @var{family}, @var{style} and @var{proto}.
-Many systems support only socket pairs of the @code{AF_UNIX}
-family. Zero is likely to be the only meaningful value for
-@var{proto}.
-@end deffn
-
-@deffn {Scheme Procedure} getsockopt sock level optname
-@deffnx {C Function} scm_getsockopt (sock, level, optname)
-Return the value of a particular socket option for the socket
-port @var{sock}. @var{level} is an integer code for type of
-option being requested, e.g., @code{SOL_SOCKET} for
-socket-level options. @var{optname} is an integer code for the
-option required and should be specified using one of the
-symbols @code{SO_DEBUG}, @code{SO_REUSEADDR} etc.
-
-The returned value is typically an integer but @code{SO_LINGER}
-returns a pair of integers.
-@end deffn
-
-@deffn {Scheme Procedure} setsockopt sock level optname value
-@deffnx {C Function} scm_setsockopt (sock, level, optname, value)
-Set the value of a particular socket option for the socket
-port @var{sock}. @var{level} is an integer code for type of option
-being set, e.g., @code{SOL_SOCKET} for socket-level options.
-@var{optname} is an
-integer code for the option to set and should be specified using one of
-the symbols @code{SO_DEBUG}, @code{SO_REUSEADDR} etc.
-@var{value} is the value to which the option should be set. For
-most options this must be an integer, but for @code{SO_LINGER} it must
-be a pair.
-
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} shutdown sock how
-@deffnx {C Function} scm_shutdown (sock, how)
-Sockets can be closed simply by using @code{close-port}. The
-@code{shutdown} procedure allows reception or transmission on a
-connection to be shut down individually, according to the parameter
-@var{how}:
-
-@table @asis
-@item 0
-Stop receiving data for this socket. If further data arrives, reject it.
-@item 1
-Stop trying to transmit data from this socket. Discard any
-data waiting to be sent. Stop looking for acknowledgement of
-data already sent; don't retransmit it if it is lost.
-@item 2
-Stop both reception and transmission.
-@end table
-
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} connect sock fam address . args
-@deffnx {C Function} scm_connect (sock, fam, address, args)
-Initiate a connection from a socket using a specified address
-family to the address
-specified by @var{address} and possibly @var{args}.
-The format required for @var{address}
-and @var{args} depends on the family of the socket.
-
-For a socket of family @code{AF_UNIX},
-only @var{address} is specified and must be a string with the
-filename where the socket is to be created.
-
-For a socket of family @code{AF_INET},
-@var{address} must be an integer IPv4 host address and
-@var{args} must be a single integer port number.
-
-For a socket of family @code{AF_INET6},
-@var{address} must be an integer IPv6 host address and
-@var{args} may be up to three integers:
-port [flowinfo] [scope_id],
-where flowinfo and scope_id default to zero.
-
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} bind sock fam address . args
-@deffnx {C Function} scm_bind (sock, fam, address, args)
-Assign an address to the socket port @var{sock}.
-Generally this only needs to be done for server sockets,
-so they know where to look for incoming connections. A socket
-without an address will be assigned one automatically when it
-starts communicating.
-
-The format of @var{address} and @var{args} depends
-on the family of the socket.
-
-For a socket of family @code{AF_UNIX}, only @var{address}
-is specified and must be a string with the filename where
-the socket is to be created.
-
-For a socket of family @code{AF_INET}, @var{address}
-must be an integer IPv4 address and @var{args}
-must be a single integer port number.
-
-The values of the following variables can also be used for
-@var{address}:
-
-@defvar INADDR_ANY
-Allow connections from any address.
-@end defvar
-
-@defvar INADDR_LOOPBACK
-The address of the local host using the loopback device.
-@end defvar
-
-@defvar INADDR_BROADCAST
-The broadcast address on the local network.
-@end defvar
-
-@defvar INADDR_NONE
-No address.
-@end defvar
-
-For a socket of family @code{AF_INET6}, @var{address}
-must be an integer IPv6 address and @var{args}
-may be up to three integers:
-port [flowinfo] [scope_id],
-where flowinfo and scope_id default to zero.
-
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} listen sock backlog
-@deffnx {C Function} scm_listen (sock, backlog)
-Enable @var{sock} to accept connection
-requests. @var{backlog} is an integer specifying
-the maximum length of the queue for pending connections.
-If the queue fills, new clients will fail to connect until
-the server calls @code{accept} to accept a connection from
-the queue.
-
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} accept sock
-@deffnx {C Function} scm_accept (sock)
-Accept a connection on a bound, listening socket.
-If there
-are no pending connections in the queue, wait until
-one is available unless the non-blocking option has been
-set on the socket.
-
-The return value is a
-pair in which the @emph{car} is a new socket port for the
-connection and
-the @emph{cdr} is an object with address information about the
-client which initiated the connection.
-
-@var{sock} does not become part of the
-connection and will continue to accept new requests.
-@end deffn
-
-The following functions take a socket address object, as returned
-by @code{accept} and other procedures, and return a selected component.
-
-@table @code
-@item sockaddr:fam
-The socket family, typically equal to the value of @code{AF_UNIX} or
-@code{AF_INET}.
-@item sockaddr:path
-If the socket family is @code{AF_UNIX}, returns the path of the
-filename the socket is based on.
-@item sockaddr:addr
-If the socket family is @code{AF_INET}, returns the Internet host
-address.
-@item sockaddr:port
-If the socket family is @code{AF_INET}, returns the Internet port
-number.
-@end table
-
-@deffn {Scheme Procedure} getsockname sock
-@deffnx {C Function} scm_getsockname (sock)
-Return the address of @var{sock}, in the same form as the
-object returned by @code{accept}. On many systems the address
-of a socket in the @code{AF_FILE} namespace cannot be read.
-@end deffn
-
-@deffn {Scheme Procedure} getpeername sock
-@deffnx {C Function} scm_getpeername (sock)
-Return the address that @var{sock}
-is connected to, in the same form as the object returned by
-@code{accept}. On many systems the address of a socket in the
-@code{AF_FILE} namespace cannot be read.
-@end deffn
-
-@deffn {Scheme Procedure} recv! sock buf [flags]
-@deffnx {C Function} scm_recv (sock, buf, flags)
-Receive data from a socket port.
-@var{sock} must already
-be bound to the address from which data is to be received.
-@var{buf} is a string into which
-the data will be written. The size of @var{buf} limits
-the amount of
-data which can be received: in the case of packet
-protocols, if a packet larger than this limit is encountered
-then some data
-will be irrevocably lost.
-
-The optional @var{flags} argument is a value or
-bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc.
-
-The value returned is the number of bytes read from the
-socket.
-
-Note that the data is read directly from the socket file
-descriptor:
-any unread buffered port data is ignored.
-@end deffn
-
-@deffn {Scheme Procedure} send sock message [flags]
-@deffnx {C Function} scm_send (sock, message, flags)
-Transmit the string @var{message} on a socket port @var{sock}.
-@var{sock} must already be bound to a destination address. The
-value returned is the number of bytes transmitted --
-it's possible for
-this to be less than the length of @var{message}
-if the socket is
-set to be non-blocking. The optional @var{flags} argument
-is a value or
-bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc.
-
-Note that the data is written directly to the socket
-file descriptor:
-any unflushed buffered port data is ignored.
-@end deffn
-
-@deffn {Scheme Procedure} recvfrom! sock str [flags [start [end]]]
-@deffnx {C Function} scm_recvfrom (sock, str, flags, start, end)
-Return data from the socket port @var{sock} and also
-information about where the data was received from.
-@var{sock} must already be bound to the address from which
-data is to be received. @code{str}, is a string into which the
-data will be written. The size of @var{str} limits the amount
-of data which can be received: in the case of packet protocols,
-if a packet larger than this limit is encountered then some
-data will be irrevocably lost.
-
-The optional @var{flags} argument is a value or bitwise OR of
-@code{MSG_OOB}, @code{MSG_PEEK}, @code{MSG_DONTROUTE} etc.
-
-The value returned is a pair: the @emph{car} is the number of
-bytes read from the socket and the @emph{cdr} an address object
-in the same form as returned by @code{accept}. The address
-will given as @code{#f} if not available, as is usually the
-case for stream sockets.
-
-The @var{start} and @var{end} arguments specify a substring of
-@var{str} to which the data should be written.
-
-Note that the data is read directly from the socket file
-descriptor: any unread buffered port data is ignored.
-@end deffn
-
-@deffn {Scheme Procedure} sendto sock message fam address . args_and_flags
-@deffnx {C Function} scm_sendto (sock, message, fam, address, args_and_flags)
-Transmit the string @var{message} on the socket port
-@var{sock}. The
-destination address is specified using the @var{fam},
-@var{address} and
-@var{args_and_flags} arguments, in a similar way to the
-@code{connect} procedure. @var{args_and_flags} contains
-the usual connection arguments optionally followed by
-a flags argument, which is a value or
-bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc.
-
-The value returned is the number of bytes transmitted --
-it's possible for
-this to be less than the length of @var{message} if the
-socket is
-set to be non-blocking.
-Note that the data is written directly to the socket
-file descriptor:
-any unflushed buffered port data is ignored.
-@end deffn
-
-The following functions can be used to convert short and long integers
-between "host" and "network" order. Although the procedures above do
-this automatically for addresses, the conversion will still need to
-be done when sending or receiving encoded integer data from the network.
-
-@deffn {Scheme Procedure} htons value
-@deffnx {C Function} scm_htons (value)
-Convert a 16 bit quantity from host to network byte ordering.
-@var{value} is packed into 2 bytes, which are then converted
-and returned as a new integer.
-@end deffn
-
-@deffn {Scheme Procedure} ntohs value
-@deffnx {C Function} scm_ntohs (value)
-Convert a 16 bit quantity from network to host byte ordering.
-@var{value} is packed into 2 bytes, which are then converted
-and returned as a new integer.
-@end deffn
-
-@deffn {Scheme Procedure} htonl value
-@deffnx {C Function} scm_htonl (value)
-Convert a 32 bit quantity from host to network byte ordering.
-@var{value} is packed into 4 bytes, which are then converted
-and returned as a new integer.
-@end deffn
-
-@deffn {Scheme Procedure} ntohl value
-@deffnx {C Function} scm_ntohl (value)
-Convert a 32 bit quantity from network to host byte ordering.
-@var{value} is packed into 4 bytes, which are then converted
-and returned as a new integer.
-@end deffn
-
-These procedures are inconvenient to use at present, but consider:
-
-@example
-(define write-network-long
- (lambda (value port)
- (let ((v (make-uniform-vector 1 1 0)))
- (uniform-vector-set! v 0 (htonl value))
- (uniform-vector-write v port))))
-
-(define read-network-long
- (lambda (port)
- (let ((v (make-uniform-vector 1 1 0)))
- (uniform-vector-read! v port)
- (ntohl (uniform-vector-ref v 0)))))
-@end example
-
-@node System Identification
-@section System Identification
-
-This section lists the various procedures Guile provides for accessing
-information about the system it runs on.
-
-@deffn {Scheme Procedure} uname
-@deffnx {C Function} scm_uname ()
-Return an object with some information about the computer
-system the program is running on.
-@end deffn
-
-The following procedures accept an object as returned by @code{uname}
-and return a selected component.
-
-@table @code
-@item utsname:sysname
-The name of the operating system.
-@item utsname:nodename
-The network name of the computer.
-@item utsname:release
-The current release level of the operating system implementation.
-@item utsname:version
-The current version level within the release of the operating system.
-@item utsname:machine
-A description of the hardware.
-@end table
-
-@deffn {Scheme Procedure} gethostname
-@deffnx {C Function} scm_gethostname ()
-Return the host name of the current processor.
-@end deffn
-
-@deffn {Scheme Procedure} sethostname name
-@deffnx {C Function} scm_sethostname (name)
-Set the host name of the current processor to @var{name}. May
-only be used by the superuser. The return value is not
-specified.
-@end deffn
-
-@c FIXME::martin: Not in libguile!
-@deffn {Scheme Procedure} software-type
-Return a symbol describing the current platform's operating system.
-This may be one of AIX, VMS, UNIX, COHERENT, WINDOWS, MS-DOS, OS/2,
-THINKC, AMIGA, ATARIST, MACH, or ACORN.
-
-Note that most varieties of Unix are considered to be simply "UNIX".
-That is because when a program depends on features that are not present
-on every operating system, it is usually better to test for the presence
-or absence of that specific feature. The return value of
-@code{software-type} should only be used for this purpose when there is
-no other easy or unambiguous way of detecting such features.
-@end deffn
-
-@node Locales
-@section Locales
-
-@deffn {Scheme Procedure} setlocale category [locale]
-@deffnx {C Function} scm_setlocale (category, locale)
-If @var{locale} is omitted, return the current value of the
-specified locale category as a system-dependent string.
-@var{category} should be specified using the values
-@code{LC_COLLATE}, @code{LC_ALL} etc.
-
-Otherwise the specified locale category is set to the string
-@var{locale} and the new value is returned as a
-system-dependent string. If @var{locale} is an empty string,
-the locale will be set using environment variables.
-@end deffn
-
-@node Encryption
-@section Encryption
-
-Please note that the procedures in this section are not suited for
-strong encryption, they are only interfaces to the well-known and
-common system library functions of the same name. They are just as good
-(or bad) as the underlying functions, so you should refer to your system
-documentation before using them.
-
-@deffn {Scheme Procedure} crypt key salt
-@deffnx {C Function} scm_crypt (key, salt)
-Encrypt @var{key} using @var{salt} as the salt value to the
-crypt(3) library call.
-@end deffn
-
-Although @code{getpass} is not an encryption procedure per se, it
-appears here because it is often used in combination with @code{crypt}:
-
-@deffn {Scheme Procedure} getpass prompt
-@deffnx {C Function} scm_getpass (prompt)
-Display @var{prompt} to the standard error output and read
-a password from @file{/dev/tty}. If this file is not
-accessible, it reads from standard input. The password may be
-up to 127 characters in length. Additional characters and the
-terminating newline character are discarded. While reading
-the password, echoing and the generation of signals by special
-characters is disabled.
-@end deffn
diff --git a/doc/ref/preface.texi b/doc/ref/preface.texi
deleted file mode 100644
index bcabb411a..000000000
--- a/doc/ref/preface.texi
+++ /dev/null
@@ -1,200 +0,0 @@
-@iftex
-@page
-@unnumbered Preface
-
-This reference manual documents Guile, GNU's Ubiquitous Intelligent
-Language for Extensions. It describes how to use Guile in many useful
-and interesting ways.
-
-This is edition @value{MANUAL_EDITION} of the reference manual, and
-corresponds to Guile version @value{VERSION}.
-@end iftex
-
-
-@iftex
-@section The Guile License
-@end iftex
-
-@ifnottex
-@node Guile License
-@chapter The Guile License
-@end ifnottex
-
-The license of Guile 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 GUILE.
-
-The exception is that, if you link the GUILE 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 GUILE
-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 GUILE. If you copy code from other Free
-Software Foundation releases into a copy of GUILE, 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 GUILE, 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
-
-
-@iftex
-@section Layout of this Manual
-@end iftex
-
-@ifnottex
-@node Manual Layout
-@chapter Layout of this Manual
-@end ifnottex
-
-The manual is divided into five parts.
-
-@strong{Part I: Introduction to Guile} provides an overview of what
-Guile is and how you can use it. A whirlwind tour shows how Guile can
-be used interactively and as a script interpreter, how to link Guile
-into your own applications, and how to write modules of interpreted and
-compiled code for use with Guile. Everything introduced here is
-documented again and in full by the later parts of the manual. This
-part also explains how to obtain and install new versions of Guile, and
-how to report bugs effectively.
-
-@strong{Part II: Writing and Running Guile Scheme} and @strong{Part III:
-Programming with Guile} document all aspects of practical programming
-using Guile. This covers both the Scheme level --- where we provide an
-introduction to the key ideas of the Scheme language --- and use of
-Guile's @code{scm} interface to write new primitives and objects in C,
-and to incorporate Guile into a C application. It also covers the use
-of Guile as a POSIX compliant script interpreter, and how to use the
-Guile debugger.
-
-@c @strong{Part V: Extending Applications Using Guile} explains the options
-@c available for using Guile as a application extension language. At the
-@c simpler end of the scale, an application might use Guile to define some
-@c application-specific primitives in C and then load an application Scheme
-@c file. In this case most of the application code is written on the
-@c Scheme level, and uses the application-specific primitives as an
-@c extension to standard Scheme. At the other end of the scale, an
-@c application might be predominantly written in C --- with its main
-@c control loop implemented in C --- but make occasional forays into Scheme
-@c to, say, read configuration data or run user-defined customization code.
-@c This part of the manual covers the complete range of application
-@c extension options.
-
-@strong{Part IV: Guile API Reference} documents Guile's core API. Most
-of the variables and procedures in Guile's core programming interface
-are available in both Scheme and C, and are related systematically such
-that the C interface can be inferred from the Scheme interface and vice
-versa. Therefore this part of the manual documents the Guile API in
-functionality-based groups with the Scheme and C interfaces presented
-side by side. Where the Scheme and C interfaces for a particular
-functional area do differ --- which is sometimes inevitable, given the
-differences in the structure of the two languages --- this is pointed
-out and explained. In all cases the overriding principle is that all
-the reference documentation for a given functional area is grouped
-together.
-
-@c the core Scheme language and features that Guile implements. Although
-@c the basis for this is the Scheme language described in R5RS, this part
-@c of the manual does not assume any prior familiarity with R5RS in
-@c particular, or with Scheme in general. Basic Scheme concepts, standard
-@c aspects of the Scheme language and Guile extensions on top of R5RS are
-@c all documented from scratch, and organized by functionality rather than
-@c by the defining standards.
-
-@strong{Part V: Guile Modules} describes some important modules,
-distributed as part of the Guile distribution, that extend the
-functionality provided by the Guile Scheme core. Two important examples
-are:
-
-@itemize @bullet
-@item
-the POSIX module, which provides Scheme level procedures for system and
-network programming that conform to the POSIX standard
-
-@item
-the SLIB module, which makes Aubrey Jaffer's portable Scheme library
-available for use in Guile.
-@end itemize
-
-
-@iftex
-@section Manual Conventions
-@end iftex
-
-@ifnottex
-@node Manual Conventions
-@chapter Conventions used in this Manual
-@end ifnottex
-
-We use some conventions in this manual.
-
-@itemize @bullet
-
-@item
-For some procedures, notably type predicates, we use @dfn{iff} to
-mean `if and only if'. The construct is usually something like:
-`Return @var{val} iff @var{condition}', where @var{val} is usually
-`@code{#t}' or `non-@code{#f}'. This typically means that @var{val}
-is returned if @var{condition} holds, and that @samp{#f} is returned
-otherwise.
-@cindex iff
-
-@item
-In examples and procedure descriptions and all other places where the
-evaluation of Scheme expression is shown, we use some notation for
-denoting the output and evaluation results of expressions.
-
-The symbol @code{@result{}} is used to tell which value is returned by
-an evaluation:
-
-@lisp
-(+ 1 2)
-@result{}
-3
-@end lisp
-
-Some procedures produce some output besides returning a value. This
-is denoted by the symbol @code{@print{}}.
-
-@lisp
-(begin (display 1) (newline) 'hooray)
-@print{} 1
-@result{}
-hooray
-@end lisp
-
-@c Add other conventions here.
-
-@end itemize
-
-
-@c Local Variables:
-@c TeX-master: "guile.texi"
-@c End:
diff --git a/doc/ref/program.texi b/doc/ref/program.texi
deleted file mode 100644
index eba3fdf83..000000000
--- a/doc/ref/program.texi
+++ /dev/null
@@ -1,776 +0,0 @@
-@page
-@node Programming Overview
-@chapter An Overview of Guile Programming
-
-Guile is designed as an extension language interpreter that is
-straightforward to integrate with applications written in C (and C++).
-The big win here for the application developer is that Guile
-integration, as the Guile web page says, ``lowers your project's
-hacktivation energy.'' Lowering the hacktivation energy means that you,
-as the application developer, @emph{and your users}, reap the benefits
-that flow from being able to extend the application in a high level
-extension language rather than in plain old C.
-
-In abstract terms, it's difficult to explain what this really means and
-what the integration process involves, so instead let's begin by jumping
-straight into an example of how you might integrate Guile into an
-existing program, and what you could expect to gain by so doing. With
-that example under our belts, we'll then return to a more general
-analysis of the arguments involved and the range of programming options
-available.
-
-@menu
-* Extending Dia:: How one might extend Dia using Guile.
-* Scheme vs C:: Why Scheme is more hackable than C.
-* Testbed Example:: Example: using Guile in a testbed.
-* Programming Options:: Options for Guile programming.
-* User Programming:: How about application users?
-@end menu
-
-
-@node Extending Dia
-@section How One Might Extend Dia Using Guile
-
-Dia is a free software program for drawing schematic diagrams like flow
-charts and floor plans (REFFIXME). This section conducts the thought
-experiment of adding Guile to Dia. In so doing, it aims to illustrate
-several of the steps and considerations involved in adding Guile to
-applications in general.
-
-@menu
-* Dia Objective:: Deciding why you want to add Guile.
-* Dia Steps:: Four steps required to add Guile.
-* Dia Smobs:: How to represent Dia data in Scheme.
-* Dia Primitives:: Writing Guile primitives for Dia.
-* Dia Hook:: Providing a hook for Scheme evaluation.
-* Dia Structure:: Overall structure for adding Guile.
-* Dia Advanced:: Going further with Dia and Guile.
-@end menu
-
-
-@node Dia Objective
-@subsection Deciding Why You Want to Add Guile
-
-First off, you should understand why you want to add Guile to Dia at
-all, and that means forming a picture of what Dia does and how it does
-it. So, what are the constituents of the Dia application?
-
-@itemize @bullet
-@item
-Most importantly, the @dfn{application domain objects} --- in other
-words, the concepts that differentiate Dia from another application such
-as a word processor or spreadsheet: shapes, templates, connectors,
-pages, plus the properties of all these things.
-
-@item
-The code that manages the graphical face of the application, including
-the layout and display of the objects above.
-
-@item
-The code that handles input events, which indicate that the application
-user is wanting to do something.
-@end itemize
-
-@noindent
-(In other words, a textbook example of the @dfn{model - view -
-controller} paradigm.)
-
-Next question: how will Dia benefit once the Guile integration is
-complete? Several (positive!) answers are possible here, and the choice
-is obviously up to the application developers. Still, one answer is
-that the main benefit will be the ability to manipulate Dia's
-application domain objects from Scheme.
-
-Suppose that Dia made a set of procedures available in Scheme,
-representing the most basic operations on objects such as shapes,
-connectors, and so on. Using Scheme, the application user could then
-write code that builds upon these basic operations to create more
-complex procedures. For example, given basic procedures to enumerate
-the objects on a page, to determine whether an object is a square, and
-to change the fill pattern of a single shape, the user can write a
-Scheme procedure to change the fill pattern of all squares on the
-current page:
-
-@lisp
-(define (change-squares'-fill-pattern new-pattern)
- (for-each-shape current-page
- (lambda (shape)
- (if (square? shape)
- (change-fill-pattern shape new-pattern)))))
-@end lisp
-
-
-@node Dia Steps
-@subsection Four Steps Required to Add Guile
-
-Assuming this objective, four steps are needed to achieve it.
-
-First, you need a way of representing your application-specific objects
---- such as @code{shape} in the previous example --- when they are
-passed into the Scheme world. Unless your objects are so simple that
-they map naturally into builtin Scheme data types like numbers and
-strings, you will probably want to use Guile's @dfn{SMOB} interface to
-create a new Scheme data type for your objects.
-
-Second, you need to write code for the basic operations like
-@code{for-each-shape} and @code{square?} such that they access and
-manipulate your existing data structures correctly, and then make these
-operations available as @dfn{primitives} on the Scheme level.
-
-Third, you need to provide some mechanism within the Dia application
-that a user can hook into to cause arbitrary Scheme code to be
-evaluated.
-
-Finally, you need to restructure your top-level application C code a
-little so that it initializes the Guile interpreter correctly and
-declares your @dfn{SMOBs} and @dfn{primitives} to the Scheme world.
-
-The following subsections expand on these four points in turn.
-
-
-@node Dia Smobs
-@subsection How to Represent Dia Data in Scheme
-
-For all but the most trivial applications, you will probably want to
-allow some representation of your domain objects to exist on the Scheme
-level. This is where the idea of SMOBs comes in, and with it issues of
-lifetime management and garbage collection.
-
-To get more concrete about this, let's look again at the example we gave
-earlier of how application users can use Guile to build higher-level
-functions from the primitives that Dia itself provides.
-
-@lisp
-(define (change-squares'-fill-pattern new-pattern)
- (for-each-shape current-page
- (lambda (shape)
- (if (square? shape)
- (change-fill-pattern shape new-pattern)))))
-@end lisp
-
-Consider what is stored here in the variable @code{shape}. For each
-shape on the current page, the @code{for-each-shape} primitive calls
-@code{(lambda (shape) @dots{})} with an argument representing that
-shape. Question is: how is that argument represented on the Scheme
-level? The issues are as follows.
-
-@itemize @bullet
-@item
-Whatever the representation, it has to be decodable again by the C code
-for the @code{square?} and @code{change-fill-pattern} primitives. In
-other words, a primitive like @code{square?} has somehow to be able to
-turn the value that it receives back into something that points to the
-underlying C structure describing a shape.
-
-@item
-The representation must also cope with Scheme code holding on to the
-value for later use. What happens if the Scheme code stores
-@code{shape} in a global variable, but then that shape is deleted (in a
-way that the Scheme code is not aware of), and later on some other
-Scheme code uses that global variable again in a call to, say,
-@code{square?}?
-
-@item
-The lifetime and memory allocation of objects that exist @emph{only} in
-the Scheme world is managed automatically by Guile's garbage collector
-using one simple rule: when there are no remaining references to an
-object, the object is considered dead and so its memory is freed. But
-for objects that exist in both C and Scheme, the picture is more
-complicated; in the case of Dia, where the @code{shape} argument passes
-transiently in and out of the Scheme world, it would be quite wrong the
-@strong{delete} the underlying C shape just because the Scheme code has
-finished evaluation. How do we avoid this happening?
-@end itemize
-
-One resolution of these issues is for the Scheme-level representation of
-a shape to be a new, Scheme-specific C structure wrapped up as a SMOB.
-The SMOB is what is passed into and out of Scheme code, and the
-Scheme-specific C structure inside the SMOB points to Dia's underlying C
-structure so that the code for primitives like @code{square?} can get at
-it.
-
-To cope with an underlying shape being deleted while Scheme code is
-still holding onto a Scheme shape value, the underlying C structure
-should have a new field that points to the Scheme-specific SMOB. When a
-shape is deleted, the relevant code chains through to the
-Scheme-specific structure and sets its pointer back to the underlying
-structure to NULL. Thus the SMOB value for the shape continues to
-exist, but any primitive code that tries to use it will detect that the
-underlying shape has been deleted because the underlying structure
-pointer is NULL.
-
-So, to summarize the steps involved in this resolution of the problem
-(and assuming that the underlying C structure for a shape is
-@code{struct dia_shape}):
-
-@itemize @bullet
-@item
-Define a new Scheme-specific structure that @emph{points} to the
-underlying C structure:
-
-@lisp
-struct dia_guile_shape
-@{
- struct dia_shape * c_shape; /* NULL => deleted */
-@}
-@end lisp
-
-@item
-Add a field to @code{struct dia_shape} that points to its @code{struct
-dia_guile_shape} if it has one ---
-
-@lisp
-struct dia_shape
-@{
- @dots{}
- struct dia_guile_shape * guile_shape;
-@}
-@end lisp
-
-@noindent
---- so that C code can set @code{guile_shape->c_shape} to NULL when the
-underlying shape is deleted.
-
-@item
-Wrap @code{struct dia_guile_shape} as a SMOB type.
-
-@item
-Whenever you need to represent a C shape onto the Scheme level, create a
-SMOB instance for it, and pass that.
-
-@item
-In primitive code that receives a shape SMOB instance, check the
-@code{c_shape} field when decoding it, to find out whether the
-underlying C shape is still there.
-@end itemize
-
-As far as memory management is concerned, the SMOB values and their
-Scheme-specific structures are under the control of the garbage
-collector, whereas the underlying C structures are explicitly managed in
-exactly the same way that Dia managed them before we thought of adding
-Guile.
-
-When the garbage collector decides to free a shape SMOB value, it calls
-the @dfn{SMOB free} function that was specified when defining the shape
-SMOB type. To maintain the correctness of the @code{guile_shape} field
-in the underlying C structure, this function should chain through to the
-underlying C structure (if it still exists) and set its
-@code{guile_shape} field to NULL.
-
-For full documentation on defining and using SMOB types, see
-@ref{Defining New Types (Smobs)}.
-
-
-@node Dia Primitives
-@subsection Writing Guile Primitives for Dia
-
-Once the details of object representation are decided, writing the
-primitive function code that you need is usually straightforward.
-
-A primitive is simply a C function whose arguments and return value are
-all of type @code{SCM}, and whose body does whatever you want it to do.
-As an example, here is a possible implementation of the @code{square?}
-primitive:
-
-@lisp
-#define FUNC_NAME "square?"
-static SCM square_p (SCM shape)
-@{
- struct dia_guile_shape * guile_shape;
-
- /* Check that arg is really a shape SMOB. */
- SCM_VALIDATE_SHAPE (SCM_ARG1, shape);
-
- /* Access Scheme-specific shape structure. */
- guile_shape = SCM_SMOB_DATA (shape);
-
- /* Find out if underlying shape exists and is a
- square; return answer as a Scheme boolean. */
- return SCM_BOOL (guile_shape->c_shape &&
- (guile_shape->c_shape->type == DIA_SQUARE));
-@}
-#undef FUNC_NAME
-@end lisp
-
-Notice how easy it is to chain through from the @code{SCM shape}
-parameter that @code{square_p} receives --- which is a SMOB --- to the
-Scheme-specific structure inside the SMOB, and thence to the underlying
-C structure for the shape.
-
-In this code, @code{SCM_SMOB_DATA} and @code{SCM_BOOL} are macros from
-the standard Guile API. @code{SCM_VALIDATE_SHAPE} is a macro that you
-should define as part of your SMOB definition: it checks that the passed
-parameter is of the expected type. This is needed to guard against
-Scheme code using the @code{square?} procedure incorrectly, as in
-@code{(square? "hello")}; Scheme's latent typing means that usage errors
-like this must be caught at run time.
-
-Having written the C code for your primitives, you need to make them
-available as Scheme procedures by calling the @code{scm_c_define_gsubr}
-function. @code{scm_c_define_gsubr} (REFFIXME) takes arguments that
-specify the Scheme-level name for the primitive and how many required,
-optional and rest arguments it can accept. The @code{square?} primitive
-always requires exactly one argument, so the call to make it available
-in Scheme reads like this:
-
-@lisp
-scm_c_define_gsubr ("square?", 1, 0, 0, square_p);
-@end lisp
-
-For where to put this call, see the subsection after next on the
-structure of Guile-enabled code (@pxref{Dia Structure}).
-
-
-@node Dia Hook
-@subsection Providing a Hook for the Evaluation of Scheme Code
-
-To make the Guile integration useful, you have to design some kind of
-hook into your application that application users can use to cause their
-Scheme code to be evaluated.
-
-Technically, this is straightforward; you just have to decide on a
-mechanism that is appropriate for your application. Think of Emacs, for
-example: when you type @kbd{@key{ESC} :}, you get a prompt where you can
-type in any Elisp code, which Emacs will then evaluate. Or, again like
-Emacs, you could provide a mechanism (such as an init file) to allow
-Scheme code to be associated with a particular key sequence, and
-evaluate the code when that key sequence is entered.
-
-In either case, once you have the Scheme code that you want to evaluate,
-as a null terminated string, you can tell Guile to evaluate it by
-calling the @code{scm_c_eval_string} function.
-
-
-@node Dia Structure
-@subsection Top-level Structure of Guile-enabled Dia
-
-Let's assume that the pre-Guile Dia code looks structurally like this:
-
-@itemize @bullet
-@item
-@code{main ()}
-
-@itemize @bullet
-@item
-do lots of initialization and setup stuff
-@item
-enter Gtk main loop
-@end itemize
-@end itemize
-
-When you add Guile to a program, one (rather technical) requirement is
-that Guile's garbage collector needs to know where the bottom of the C
-stack is. The easiest way to ensure this is to use
-@code{scm_boot_guile} like this:
-
-@itemize @bullet
-@item
-@code{main ()}
-
-@itemize @bullet
-@item
-do lots of initialization and setup stuff
-@item
-@code{scm_boot_guile (argc, argv, inner_main, NULL)}
-@end itemize
-
-@item
-@code{inner_main ()}
-
-@itemize @bullet
-@item
-define all SMOB types
-@item
-export primitives to Scheme using @code{scm_c_define_gsubr}
-@item
-enter Gtk main loop
-@end itemize
-@end itemize
-
-In other words, you move the guts of what was previously in your
-@code{main} function into a new function called @code{inner_main}, and
-then add a @code{scm_boot_guile} call, with @code{inner_main} as a
-parameter, to the end of @code{main}.
-
-Assuming that you are using SMOBs and have written primitive code as
-described in the preceding subsections, you also need to insert calls to
-declare your new SMOBs and export the primitives to Scheme. These
-declarations must happen @emph{inside} the dynamic scope of the
-@code{scm_boot_guile} call, but also @emph{before} any code is run that
-could possibly use them --- the beginning of @code{inner_main} is an
-ideal place for this.
-
-
-@node Dia Advanced
-@subsection Going Further with Dia and Guile
-
-The steps described so far implement an initial Guile integration that
-already gives a lot of additional power to Dia application users. But
-there are further steps that you could take, and it's interesting to
-consider a few of these.
-
-In general, you could progressively move more of Dia's source code from
-C into Scheme. This might make the code more maintainable and
-extensible, and it could open the door to new programming paradigms that
-are tricky to effect in C but straightforward in Scheme.
-
-A specific example of this is that you could use the guile-gtk package,
-which provides Scheme-level procedures for most of the Gtk+ library, to
-move the code that lays out and displays Dia objects from C to Scheme.
-
-As you follow this path, it naturally becomes less useful to maintain a
-distinction between Dia's original non-Guile-related source code, and
-its later code implementing SMOBs and primitives for the Scheme world.
-
-For example, suppose that the original source code had a
-@code{dia_change_fill_pattern} function:
-
-@lisp
-void dia_change_fill_pattern (struct dia_shape * shape,
- struct dia_pattern * pattern)
-@{
- /* real pattern change work */
-@}
-@end lisp
-
-During initial Guile integration, you add a @code{change_fill_pattern}
-primitive for Scheme purposes, which accesses the underlying structures
-from its SMOB values and uses @code{dia_change_fill_pattern} to do the
-real work:
-
-@lisp
-SCM change_fill_pattern (SCM shape, SCM pattern)
-@{
- struct dia_shape * d_shape;
- struct dia_pattern * d_pattern;
-
- @dots{}
-
- dia_change_fill_pattern (d_shape, d_pattern);
-
- return SCM_UNSPECIFIED;
-@}
-@end lisp
-
-At this point, it makes sense to keep @code{dia_change_fill_pattern} and
-@code{change_fill_pattern} separate, because
-@code{dia_change_fill_pattern} can also be called without going through
-Scheme at all, say because the user clicks a button which causes a
-C-registered Gtk+ callback to be called.
-
-But, if the code for creating buttons and registering their callbacks is
-moved into Scheme (using guile-gtk), it may become true that
-@code{dia_change_fill_pattern} can no longer be called other than
-through Scheme. In which case, it makes sense to abolish it and move
-its contents directly into @code{change_fill_pattern}, like this:
-
-@lisp
-SCM change_fill_pattern (SCM shape, SCM pattern)
-@{
- struct dia_shape * d_shape;
- struct dia_pattern * d_pattern;
-
- @dots{}
-
- /* real pattern change work */
-
- return SCM_UNSPECIFIED;
-@}
-@end lisp
-
-So further Guile integration progressively @emph{reduces} the amount of
-functional C code that you have to maintain over the long term.
-
-A similar argument applies to data representation. In the discussion of
-SMOBs earlier, issues arose because of the different memory management
-and lifetime models that normally apply to data structures in C and in
-Scheme. However, with further Guile integration, you can resolve this
-issue in a more radical way by allowing all your data structures to be
-under the control of the garbage collector, and kept alive by references
-from the Scheme world. Instead of maintaining an array or linked list
-of shapes in C, you would instead maintain a list in Scheme.
-
-Rather like the coalescing of @code{dia_change_fill_pattern} and
-@code{change_fill_pattern}, the practical upshot of such a change is
-that you would no longer have to keep the @code{dia_shape} and
-@code{dia_guile_shape} structures separate, and so wouldn't need to
-worry about the pointers between them. Instead, you could change the
-SMOB definition to wrap the @code{dia_shape} structure directly, and
-send @code{dia_guile_shape} off to the scrap yard. Cut out the middle
-man!
-
-Finally, we come to the holy grail of Guile's free software / extension
-language approach. Once you have a Scheme representation for
-interesting Dia data types like shapes, and a handy bunch of primitives
-for manipulating them, it suddenly becomes clear that you have a bundle
-of functionality that could have far-ranging use beyond Dia itself. In
-other words, the data types and primitives could now become a library,
-and Dia becomes just one of the many possible applications using that
-library --- albeit, at this early stage, a rather important one!
-
-In this model, Guile becomes just the glue that binds everything
-together. Imagine an application that usefully combined functionality
-from Dia, Gnumeric and GnuCash --- it's tricky right now, because no
-such application yet exists; but it'll happen some day @dots{}
-
-
-@node Scheme vs C
-@section Why Scheme is More Hackable Than C
-
-Underlying Guile's value proposition is the assumption that programming
-in a high level language, specifically Guile's implementation of Scheme,
-is necessarily better in some way than programming in C. What do we
-mean by this claim, and how can we be so sure?
-
-One class of advantages applies not only to Scheme, but more generally
-to any interpretable, high level, scripting language, such as Emacs
-Lisp, Python, Ruby, or @TeX{}'s macro language. Common features of all
-such languages, when compared to C, are that:
-
-@itemize @bullet
-@item
-They lend themselves to rapid and experimental development cycles,
-owing usually to a combination of their interpretability and the
-integrated development environment in which they are used.
-
-@item
-They free developers from some of the low level bookkeeping tasks
-associated with C programming, notably memory management.
-
-@item
-They provide high level features such as container objects and exception
-handling that make common programming tasks easier.
-@end itemize
-
-In the case of Scheme, particular features that make programming easier
---- and more fun! --- are its powerful mechanisms for abstracting parts
-of programs (closures --- @pxref{About Closure}) and for iteration
-(@pxref{while do}).
-
-The evidence in support of this argument is empirical: the huge amount
-of code that has been written in extension languages for applications
-that support this mechanism. Most notable are extensions written in
-Emacs Lisp for GNU Emacs, in @TeX{}'s macro language for @TeX{}, and in
-Script-Fu for the Gimp, but there is increasingly now a significant code
-eco-system for Guile-based applications as well, such as Lilypond and
-GnuCash. It is close to inconceivable that similar amounts of
-functionality could have been added to these applications just by
-writing new code in their base implementation languages.
-
-
-@node Testbed Example
-@section Example: Using Guile for an Application Testbed
-
-As an example of what this means in practice, imagine writing a testbed
-for an application that is tested by submitting various requests (via a
-C interface) and validating the output received. Suppose further that
-the application keeps an idea of its current state, and that the
-``correct'' output for a given request may depend on the current
-application state. A complete ``white box''@footnote{A @dfn{white box}
-test plan is one that incorporates knowledge of the internal design of
-the application under test.} test plan for this application would aim to
-submit all possible requests in each distinguishable state, and validate
-the output for all request/state combinations.
-
-To write all this test code in C would be very tedious. Suppose instead
-that the testbed code adds a single new C function, to submit an
-arbitrary request and return the response, and then uses Guile to export
-this function as a Scheme procedure. The rest of the testbed can then
-be written in Scheme, and so benefits from all the advantages of
-programming in Scheme that were described in the previous section.
-
-(In this particular example, there is an additional benefit of writing
-most of the testbed in Scheme. A common problem for white box testing
-is that mistakes and mistaken assumptions in the application under test
-can easily be reproduced in the testbed code. It is more difficult to
-copy mistakes like this when the testbed is written in a different
-language from the application.)
-
-
-@node Programming Options
-@section A Choice of Programming Options
-
-The preceding arguments and example point to a model of Guile
-programming that is applicable in many cases. According to this model,
-Guile programming involves a balance between C and Scheme programming,
-with the aim being to extract the greatest possible Scheme level benefit
-from the least amount of C level work.
-
-The C level work required in this model usually consists of packaging
-and exporting functions and application objects such that they can be
-seen and manipulated on the Scheme level. To help with this, Guile's C
-language interface includes utility features that aim to make this kind
-of integration very easy for the application developer. These features
-are documented later in this part of the manual: see REFFIXME.
-
-This model, though, is really just one of a range of possible
-programming options. If all of the functionality that you need is
-available from Scheme, you could choose instead to write your whole
-application in Scheme (or one of the other high level languages that
-Guile supports through translation), and simply use Guile as an
-interpreter for Scheme. (In the future, we hope that Guile will also be
-able to compile Scheme code, so lessening the performance gap between C
-and Scheme code.) Or, at the other end of the C--Scheme scale, you
-could write the majority of your application in C, and only call out to
-Guile occasionally for specific actions such as reading a configuration
-file or executing a user-specified extension. The choices boil down to
-two basic questions:
-
-@itemize @bullet
-@item
-Which parts of the application do you write in C, and which in Scheme
-(or another high level translated language)?
-
-@item
-How do you design the interface between the C and Scheme parts of your
-application?
-@end itemize
-
-These are of course design questions, and the right design for any given
-application will always depend upon the particular requirements that you
-are trying to meet. In the context of Guile, however, there are some
-generally applicable considerations that can help you when designing
-your answers.
-
-@menu
-* Available Functionality:: What functionality is already available?
-* Basic Constraints:: Functional and performance constraints.
-* Style Choices:: Your preferred programming style.
-* Program Control:: What controls program execution?
-@end menu
-
-
-@node Available Functionality
-@subsection What Functionality is Already Available?
-
-Suppose, for the sake of argument, that you would prefer to write your
-whole application in Scheme. Then the API available to you consists of:
-
-@itemize @bullet
-@item
-standard Scheme
-
-@item
-plus the extensions to standard Scheme provided by
-Guile in its core distribution
-
-@item
-plus any additional functionality that you or others have packaged so
-that it can be loaded as a Guile Scheme module.
-@end itemize
-
-A module in the last category can either be a pure Scheme module --- in
-other words a collection of utility procedures coded in Scheme --- or a
-module that provides a Scheme interface to an extension library coded in
-C --- in other words a nice package where someone else has done the work
-of wrapping up some useful C code for you. The set of available modules
-is growing quickly and already includes such useful examples as
-@code{(gtk gtk)}, which makes Gtk+ drawing functions available in
-Scheme, and @code{(database postgres)}, which provides SQL access to a
-Postgres database.
-
-Given the growing collection of pre-existing modules, it is quite
-feasible that your application could be implemented by combining a
-selection of these modules together with new application code written in
-Scheme.
-
-If this approach is not enough, because the functionality that your
-application needs is not already available in this form, and it is
-impossible to write the new functionality in Scheme, you will need to
-write some C code. If the required function is already available in C
-(e.g. in a library), all you need is a little glue to connect it to the
-world of Guile. If not, you need both to write the basic code and to
-plumb it into Guile.
-
-In either case, two general considerations are important. Firstly, what
-is the interface by which the functionality is presented to the Scheme
-world? Does the interface consist only of function calls (for example,
-a simple drawing interface), or does it need to include @dfn{objects} of
-some kind that can be passed between C and Scheme and manipulated by
-both worlds. Secondly, how does the lifetime and memory management of
-objects in the C code relate to the garbage collection governed approach
-of Scheme objects? In the case where the basic C code is not already
-written, most of the difficulties of memory management can be avoided by
-using Guile's C interface features from the start.
-
-For the full documentation on writing C code for Guile and connecting
-existing C code to the Guile world, see REFFIXME.
-
-
-@node Basic Constraints
-@subsection Functional and Performance Constraints
-
-
-@node Style Choices
-@subsection Your Preferred Programming Style
-
-
-@node Program Control
-@subsection What Controls Program Execution?
-
-
-@node User Programming
-@section How About Application Users?
-
-So far we have considered what Guile programming means for an
-application developer. But what if you are instead @emph{using} an
-existing Guile-based application, and want to know what your
-options are for programming and extending this application?
-
-The answer to this question varies from one application to another,
-because the options available depend inevitably on whether the
-application developer has provided any hooks for you to hang your own
-code on and, if there are such hooks, what they allow you to
-do.@footnote{Of course, in the world of free software, you always have
-the freedom to modify the application's source code to your own
-requirements. Here we are concerned with the extension options that the
-application has provided for without your needing to modify its source
-code.} For example@dots{}
-
-@itemize @bullet
-@item
-If the application permits you to load and execute any Guile code, the
-world is your oyster. You can extend the application in any way that
-you choose.
-
-@item
-A more cautious application might allow you to load and execute Guile
-code, but only in a @dfn{safe} environment, where the interface
-available is restricted by the application from the standard Guile API.
-
-@item
-Or a really fearful application might not provide a hook to really
-execute user code at all, but just use Scheme syntax as a convenient way
-for users to specify application data or configuration options.
-@end itemize
-
-In the last two cases, what you can do is, by definition, restricted by
-the application, and you should refer to the application's own manual to
-find out your options.
-
-The most well known example of the first case is Emacs, with its
-extension language Emacs Lisp: as well as being a text editor, Emacs
-supports the loading and execution of arbitrary Emacs Lisp code. The
-result of such openness has been dramatic: Emacs now benefits from
-user-contributed Emacs Lisp libraries that extend the basic editing
-function to do everything from reading news to psychoanalysis and
-playing adventure games. The only limitation is that extensions are
-restricted to the functionality provided by Emacs's built-in set of
-primitive operations. For example, you can interact and display data by
-manipulating the contents of an Emacs buffer, but you can't pop-up and
-draw a window with a layout that is totally different to the Emacs
-standard.
-
-This situation with a Guile application that supports the loading of
-arbitrary user code is similar, except perhaps even more so, because
-Guile also supports the loading of extension libraries written in C.
-This last point enables user code to add new primitive operations to
-Guile, and so to bypass the limitation present in Emacs Lisp.
-
-At this point, the distinction between an application developer and an
-application user becomes rather blurred. Instead of seeing yourself as
-a user extending an application, you could equally well say that you are
-developing a new application of your own using some of the primitive
-functionality provided by the original application. As such, all the
-discussions of the preceding sections of this chapter are relevant to
-how you can proceed with developing your extension.
diff --git a/doc/ref/repl-modules.texi b/doc/ref/repl-modules.texi
deleted file mode 100644
index b136bd865..000000000
--- a/doc/ref/repl-modules.texi
+++ /dev/null
@@ -1,131 +0,0 @@
-@page
-@node Readline Support
-@chapter Readline Support
-
-@c FIXME::martin: Review me!
-
-@cindex readline
-@cindex command line history
-Guile comes with an interface module to the readline library. This
-makes interactive use much more convenient, because of the command-line
-editing features of readline. Using @code{(ice-9 readline)}, you can
-navigate through the current input line with the cursor keys, retrieve
-older command lines from the input history and even search through the
-history entries.
-
-@menu
-* Loading Readline Support:: How to load readline support into Guile.
-* Readline Options:: How to modify readline's behaviour.
-@end menu
-
-
-@node Loading Readline Support
-@section Loading Readline Support
-
-The module is not loaded by default and so has to be loaded and
-activated explicitly. This is done with two simple lines of code:
-
-@lisp
-(use-modules (ice-9 readline))
-(activate-readline)
-@end lisp
-
-@c FIXME::martin: Review me!
-
-The first line will load the necessary code, and the second will
-activate readline's features for the REPL. If you plan to use this
-module often, you should save these to lines to your @file{.guile}
-personal startup file.
-
-You will notice that the REPL's behaviour changes a bit when you have
-loaded the readline module. For example, when you press Enter before
-typing in the closing parentheses of a list, you will see the
-@dfn{continuation} prompt, three dots: @code{...} This gives you a nice
-visual feedback when trying to match parentheses. To make this even
-easier, @dfn{bouncing parentheses} are implemented. That means that
-when you type in a closing parentheses, the cursor will jump to the
-corresponding opening parenthesis for a short time, making it trivial to make
-them match.
-
-Once the readline module is activated, all lines entered interactively
-will be stored in a history and can be recalled later using the
-cursor-up and -down keys. Readline also understands the Emacs keys for
-navigating through the command line and history.
-
-When you quit your Guile session by evaluating @code{(quit)} or pressing
-Ctrl-D, the history will be saved to the file @file{.guile_history} and
-read in when you start Guile for the next time. Thus you can start a
-new Guile session and still have the (probably long-winded) definition
-expressions available.
-
-
-@node Readline Options
-@section Readline Options
-
-@c FIXME::martin: Review me!
-
-@cindex readline options
-The readline interface module can be configured in several ways to
-better suit the user's needs. Configuration is done via the readline
-module's options interface, in a similar way to the evaluator and
-debugging options (@pxref{General option interface}.)
-
-Here is the list of readline options generated by typing
-@code{(readline-options 'full)} in Guile. You can also see the
-default values.
-
-@smalllisp
-bounce-parens 500 Time (ms) to show matching opening parenthesis (0 = off).
-history-length 200 History length.
-history-file yes Use history file.
-@end smalllisp
-
-The history length specifies how many input lines will be remembered.
-If the history contains that many lines and additional lines are
-entered, the oldest lines will be lost. You can switch on/off the
-usage of the history file using the following call.
-
-@lisp
-(readline-disable 'history)
-@end lisp
-
-The readline options interface can only be used @emph{after} loading
-the readline module, because it is defined in that module.
-
-
-@page
-@node Value History
-@chapter Value History
-
-@c FIXME::martin: Review me!
-
-@cindex value history
-Another module which makes command line usage more convenient is
-@code{(ice-9 history)}. This module will change the REPL so that each
-value which is evaluated and printed will be remembered under a name
-constructed from the dollar character (@code{$}) and the number of the
-evaluated expression.
-
-Consider an example session.
-
-@example
-guile> (use-modules (ice-9 history))
-guile> 1
-$1 = 1
-guile> (+ $1 $1)
-$2 = 2
-guile> (* $2 $2)
-$3 = 4
-@end example
-
-After loading the value history module @code{(ice-9 history)}, one
-(trivial) expression is evaluated. The result is stored into the
-variable @code{$1}. This fact is indicated by the output @code{$1 = },
-which is also caused by @code{(ice-9 history)}. In the next line, this
-variable is used two times, to produce the value @code{$2}, which in
-turn is used in the calculation for @code{$3}.
-
-
-@c Local Variables:
-@c TeX-master: "guile.texi"
-@c End:
diff --git a/doc/ref/scheme-binding.texi b/doc/ref/scheme-binding.texi
deleted file mode 100644
index 23786b3bf..000000000
--- a/doc/ref/scheme-binding.texi
+++ /dev/null
@@ -1,279 +0,0 @@
-@page
-@node Binding Constructs
-@chapter Definitions and Variable Bindings
-
-@c FIXME::martin: Review me!
-
-Scheme supports the definition of variables in different contexts.
-Variables can be defined at the top level, so that they are visible in
-the entire program, and variables can be defined locally to procedures
-and expressions. This is important for modularity and data abstraction.
-
-@menu
-* Top Level:: Top level variable definitions.
-* Local Bindings:: Local variable bindings.
-* Internal Definitions:: Internal definitions.
-* Binding Reflection:: Querying variable bindings.
-@end menu
-
-
-@node Top Level
-@section Top Level Variable Definitions
-
-@cindex variable definition
-
-On the top level of a program (i.e. when not inside the body of a
-procedure definition or a @code{let}, @code{let*} or @code{letrec}
-expression), a definition of the form
-
-@lisp
-(define a @var{value})
-@end lisp
-
-@noindent
-defines a variable called @code{a} and sets it to the value @var{value}.
-
-If the variable already exists, because it has already been created by a
-previous @code{define} expression with the same name, its value is
-simply changed to the new @var{value}. In this case, then, the above
-form is completely equivalent to
-
-@lisp
-(set! a @var{value})
-@end lisp
-
-@noindent
-This equivalence means that @code{define} can be used interchangeably
-with @code{set!} to change the value of variables at the top level of
-the REPL or a Scheme source file. It is useful during interactive
-development when reloading a Scheme file that you have modified, because
-it allows the @code{define} expressions in that file to work as expected
-both the first time that the file is loaded and on subsequent occasions.
-
-Note, though, that @code{define} and @code{set!} are not always
-equivalent. For example, a @code{set!} is not allowed if the named
-variable does not already exist, and the two expressions can behave
-differently in the case where there are imported variables visible from
-another module.
-
-@deffn {Scheme Syntax} define name value
-Create a top level variable named @var{name} with value @var{value}.
-If the named variable already exists, just change its value. The return
-value of a @code{define} expression is unspecified.
-@end deffn
-
-The C API equivalents of @code{define} are @code{scm_define} and
-@code{scm_c_define}, which differ from each other in whether the
-variable name is specified as a @code{SCM} symbol or as a
-null-terminated C string.
-
-@deffn {C Function} scm_define (sym, value)
-@deffnx {C Function} scm_c_define (const char *name, value)
-C equivalents of @code{define}, with variable name specified either by
-@var{sym}, a symbol, or by @var{name}, a null-terminated C string. Both
-variants return the new or preexisting variable object.
-@end deffn
-
-@code{define} (when it occurs at top level), @code{scm_define} and
-@code{scm_c_define} all create or set the value of a variable in the top
-level environment of the current module. If there was not already a
-variable with the specified name belonging to the current module, but a
-similarly named variable from another module was visible through having
-been imported, the newly created variable in the current module will
-shadow the imported variable, such that the imported variable is no
-longer visible.
-
-Attention: Scheme definitions inside local binding constructs
-(@pxref{Local Bindings}) act differently (@pxref{Internal Definitions}).
-
-
-@node Local Bindings
-@section Local Variable Bindings
-
-@c FIXME::martin: Review me!
-
-@cindex local bindings
-@cindex local variables
-
-As opposed to definitions at the top level, which are visible in the
-whole program (or current module, when Guile modules are used), it is
-also possible to define variables which are only visible in a
-well-defined part of the program. Normally, this part of a program
-will be a procedure or a subexpression of a procedure.
-
-With the constructs for local binding (@code{let}, @code{let*} and
-@code{letrec}), the Scheme language has a block structure like most
-other programming languages since the days of @sc{Algol 60}. Readers
-familiar to languages like C or Java should already be used to this
-concept, but the family of @code{let} expressions has a few properties
-which are well worth knowing.
-
-The first local binding construct is @code{let}. The other constructs
-@code{let*} and @code{letrec} are specialized versions for usage where
-using plain @code{let} is a bit inconvenient.
-
-@deffn syntax let bindings body
-@var{bindings} has the form
-
-@lisp
-((@var{variable1} @var{init1}) @dots{})
-@end lisp
-
-that is zero or more two-element lists of a variable and an arbitrary
-expression each. All @var{variable} names must be distinct.
-
-A @code{let} expression is evaluated as follows.
-
-@itemize @bullet
-@item
-All @var{init} expressions are evaluated.
-
-@item
-New storage is allocated for the @var{variables}.
-
-@item
-The values of the @var{init} expressions are stored into the variables.
-
-@item
-The expressions in @var{body} are evaluated in order, and the value of
-the last expression is returned as the value of the @code{let}
-expression.
-
-@item
-The storage for the @var{variables} is freed.
-@end itemize
-
-The @var{init} expressions are not allowed to refer to any of the
-@var{variables}.
-@end deffn
-
-@deffn syntax let* bindings body
-Similar to @code{let}, but the variable bindings are performed
-sequentially, that means that all @var{init} expression are allowed to
-use the variables defined on their left in the binding list.
-
-A @code{let*} expression can always be expressed with nested @code{let}
-expressions.
-
-@lisp
-(let* ((a 1) (b a))
- b)
-@equiv{}
-(let ((a 1))
- (let ((b a))
- b))
-@end lisp
-@end deffn
-
-@deffn syntax letrec bindings body
-Similar to @code{let}, but it is possible to refer to the @var{variable}
-from lambda expression created in any of the @var{inits}. That is,
-procedures created in the @var{init} expression can recursively refer to
-the defined variables.
-
-@lisp
-(letrec ((even?
- (lambda (n)
- (if (zero? n)
- #t
- (odd? (- n 1)))))
- (odd?
- (lambda (n)
- (if (zero? n)
- #f
- (even? (- n 1))))))
- (even? 88))
-@result{}
-#t
-@end lisp
-@end deffn
-
-There is also an alternative form of the @code{let} form, which is used
-for expressing iteration. Because of the use as a looping construct,
-this form (the @dfn{named let}) is documented in the section about
-iteration (@pxref{while do, Iteration})
-
-@node Internal Definitions
-@section Internal definitions
-
-@c FIXME::martin: Review me!
-
-A @code{define} form which appears inside the body of a @code{lambda},
-@code{let}, @code{let*}, @code{letrec} or equivalent expression is
-called an @dfn{internal definition}. An internal definition differs
-from a top level definition (@pxref{Top Level}), because the definition
-is only visible inside the complete body of the enclosing form. Let us
-examine the following example.
-
-@lisp
-(let ((frumble "froz"))
- (define banana (lambda () (apple 'peach)))
- (define apple (lambda (x) x))
- (banana))
-@result{}
-peach
-@end lisp
-
-Here the enclosing form is a @code{let}, so the @code{define}s in the
-@code{let}-body are internal definitions. Because the scope of the
-internal definitions is the @strong{complete} body of the
-@code{let}-expression, the @code{lambda}-expression which gets bound
-to the variable @code{banana} may refer to the variable @code{apple},
-even though it's definition appears lexically @emph{after} the definition
-of @code{banana}. This is because a sequence of internal definition
-acts as if it were a @code{letrec} expression.
-
-@lisp
-(let ()
- (define a 1)
- (define b 2)
- (+ a b))
-@end lisp
-
-@noindent
-is equivalent to
-
-@lisp
-(let ()
- (letrec ((a 1) (b 2))
- (+ a b)))
-@end lisp
-
-Another noteworthy difference to top level definitions is that within
-one group of internal definitions all variable names must be distinct.
-That means where on the top level a second define for a given variable
-acts like a @code{set!}, an exception is thrown for internal definitions
-with duplicate bindings.
-
-@c FIXME::martin: The following is required by R5RS, but Guile does not
-@c signal an error. Document it anyway, saying that Guile is sloppy?
-
-@c Internal definitions are only allowed at the beginning of the body of an
-@c enclosing expression. They may not be mixed with other expressions.
-
-@c @lisp
-@c (let ()
-@c (define a 1)
-@c a
-@c (define b 2)
-@c b)
-@c @end lisp
-
-@node Binding Reflection
-@section Querying variable bindings
-
-Guile provides a procedure for checking whether a symbol is bound in the
-top level environment. If you want to test whether a symbol is locally
-bound in expression, you can use the @code{bound?} macro from the module
-@code{(ice-9 optargs)}, documented in @ref{Optional Arguments}.
-
-@c NJFIXME explain [env]
-@deffn {Scheme Procedure} defined? sym [env]
-@deffnx {C Function} scm_definedp (sym, env)
-Return @code{#t} if @var{sym} is defined in the lexical environment @var{env}. When @var{env} is not specified, look in the top-level environment as defined by the current module.
-@end deffn
-
-
-@c Local Variables:
-@c TeX-master: "guile.texi"
-@c End:
diff --git a/doc/ref/scheme-compound.texi b/doc/ref/scheme-compound.texi
deleted file mode 100644
index b39ea76ca..000000000
--- a/doc/ref/scheme-compound.texi
+++ /dev/null
@@ -1,2431 +0,0 @@
-@page
-@node Compound Data Types
-@chapter Compound Data Types
-
-This chapter describes Guile's compound data types. By @dfn{compound}
-we mean that the primary purpose of these data types is to act as
-containers for other kinds of data (including other compound objects).
-For instance, a (non-uniform) vector with length 5 is a container that
-can hold five arbitrary Scheme objects.
-
-The various kinds of container object differ from each other in how
-their memory is allocated, how they are indexed, and how particular
-values can be looked up within them.
-
-@menu
-* Pairs:: Scheme's basic building block.
-* Lists:: Special list functions supported by Guile.
-* Vectors:: One-dimensional arrays of Scheme objects.
-* Records::
-* Structures::
-* Arrays:: Arrays of values.
-* Association Lists and Hash Tables:: Dictionary data types.
-@end menu
-
-
-@node Pairs
-@section Pairs
-@tpindex Pairs
-
-Pairs are used to combine two Scheme objects into one compound object.
-Hence the name: A pair stores a pair of objects.
-
-The data type @dfn{pair} is extremely important in Scheme, just like in
-any other Lisp dialect. The reason is that pairs are not only used to
-make two values available as one object, but that pairs are used for
-constructing lists of values. Because lists are so important in Scheme,
-they are described in a section of their own (@pxref{Lists}).
-
-Pairs can literally get entered in source code or at the REPL, in the
-so-called @dfn{dotted list} syntax. This syntax consists of an opening
-parentheses, the first element of the pair, a dot, the second element
-and a closing parentheses. The following example shows how a pair
-consisting of the two numbers 1 and 2, and a pair containing the symbols
-@code{foo} and @code{bar} can be entered. It is very important to write
-the whitespace before and after the dot, because otherwise the Scheme
-parser would not be able to figure out where to split the tokens.
-
-@lisp
-(1 . 2)
-(foo . bar)
-@end lisp
-
-But beware, if you want to try out these examples, you have to
-@dfn{quote} the expressions. More information about quotation is
-available in the section (REFFIXME). The correct way to try these
-examples is as follows.
-
-@lisp
-'(1 . 2)
-@result{}
-(1 . 2)
-'(foo . bar)
-@result{}
-(foo . bar)
-@end lisp
-
-A new pair is made by calling the procedure @code{cons} with two
-arguments. Then the argument values are stored into a newly allocated
-pair, and the pair is returned. The name @code{cons} stands for
-"construct". Use the procedure @code{pair?} to test whether a
-given Scheme object is a pair or not.
-
-@rnindex cons
-@deffn {Scheme Procedure} cons x y
-@deffnx {C Function} scm_cons (x, y)
-Return a newly allocated pair whose car is @var{x} and whose
-cdr is @var{y}. The pair is guaranteed to be different (in the
-sense of @code{eq?}) from every previously existing object.
-@end deffn
-
-@rnindex pair?
-@deffn {Scheme Procedure} pair? x
-@deffnx {C Function} scm_pair_p (x)
-Return @code{#t} if @var{x} is a pair; otherwise return
-@code{#f}.
-@end deffn
-
-The two parts of a pair are traditionally called @dfn{car} and
-@dfn{cdr}. They can be retrieved with procedures of the same name
-(@code{car} and @code{cdr}), and can be modified with the procedures
-@code{set-car!} and @code{set-cdr!}. Since a very common operation in
-Scheme programs is to access the car of a pair, or the car of the cdr of
-a pair, etc., the procedures called @code{caar}, @code{cadr} and so on
-are also predefined.
-
-@rnindex car
-@rnindex cdr
-@deffn {Scheme Procedure} car pair
-@deffnx {Scheme Procedure} cdr pair
-Return the car or the cdr of @var{pair}, respectively.
-@end deffn
-
-@deffn {Scheme Procedure} caar pair
-@deffnx {Scheme Procedure} cadr pair @dots{}
-@deffnx {Scheme Procedure} cdddar pair
-@deffnx {Scheme Procedure} cddddr pair
-These procedures are compositions of @code{car} and @code{cdr}, where
-for example @code{caddr} could be defined by
-
-@lisp
-(define caddr (lambda (x) (car (cdr (cdr x)))))
-@end lisp
-@end deffn
-
-@rnindex set-car!
-@deffn {Scheme Procedure} set-car! pair value
-@deffnx {C Function} scm_set_car_x (pair, value)
-Stores @var{value} in the car field of @var{pair}. The value returned
-by @code{set-car!} is unspecified.
-@end deffn
-
-@rnindex set-cdr!
-@deffn {Scheme Procedure} set-cdr! pair value
-@deffnx {C Function} scm_set_cdr_x (pair, value)
-Stores @var{value} in the cdr field of @var{pair}. The value returned
-by @code{set-cdr!} is unspecified.
-@end deffn
-
-
-@node Lists
-@section Lists
-@tpindex Lists
-
-A very important data type in Scheme---as well as in all other Lisp
-dialects---is the data type @dfn{list}.@footnote{Strictly speaking,
-Scheme does not have a real datatype @dfn{list}. Lists are made up of
-@dfn{chained pairs}, and only exist by definition---a list is a chain
-of pairs which looks like a list.}
-
-This is the short definition of what a list is:
-
-@itemize @bullet
-@item
-Either the empty list @code{()},
-
-@item
-or a pair which has a list in its cdr.
-@end itemize
-
-@c FIXME::martin: Describe the pair chaining in more detail.
-
-@c FIXME::martin: What is a proper, what an improper list?
-@c What is a circular list?
-
-@c FIXME::martin: Maybe steal some graphics from the Elisp reference
-@c manual?
-
-@menu
-* List Syntax:: Writing literal lists.
-* List Predicates:: Testing lists.
-* List Constructors:: Creating new lists.
-* List Selection:: Selecting from lists, getting their length.
-* Append/Reverse:: Appending and reversing lists.
-* List Modification:: Modifying existing lists.
-* List Searching:: Searching for list elements
-* List Mapping:: Applying procedures to lists.
-@end menu
-
-@node List Syntax
-@subsection List Read Syntax
-
-The syntax for lists is an opening parentheses, then all the elements of
-the list (separated by whitespace) and finally a closing
-parentheses.@footnote{Note that there is no separation character between
-the list elements, like a comma or a semicolon.}.
-
-@lisp
-(1 2 3) ; @r{a list of the numbers 1, 2 and 3}
-("foo" bar 3.1415) ; @r{a string, a symbol and a real number}
-() ; @r{the empty list}
-@end lisp
-
-The last example needs a bit more explanation. A list with no elements,
-called the @dfn{empty list}, is special in some ways. It is used for
-terminating lists by storing it into the cdr of the last pair that makes
-up a list. An example will clear that up:
-
-@lisp
-(car '(1))
-@result{}
-1
-(cdr '(1))
-@result{}
-()
-@end lisp
-
-This example also shows that lists have to be quoted (REFFIXME) when
-written, because they would otherwise be mistakingly taken as procedure
-applications (@pxref{Simple Invocation}).
-
-
-@node List Predicates
-@subsection List Predicates
-
-Often it is useful to test whether a given Scheme object is a list or
-not. List-processing procedures could use this information to test
-whether their input is valid, or they could do different things
-depending on the datatype of their arguments.
-
-@rnindex list?
-@deffn {Scheme Procedure} list? x
-@deffnx {C Function} scm_list_p (x)
-Return @code{#t} iff @var{x} is a proper list, else @code{#f}.
-@end deffn
-
-The predicate @code{null?} is often used in list-processing code to
-tell whether a given list has run out of elements. That is, a loop
-somehow deals with the elements of a list until the list satisfies
-@code{null?}. Then, the algorithm terminates.
-
-@rnindex null?
-@deffn {Scheme Procedure} null? x
-@deffnx {C Function} scm_null_p (x)
-Return @code{#t} iff @var{x} is the empty list, else @code{#f}.
-@end deffn
-
-@node List Constructors
-@subsection List Constructors
-
-This section describes the procedures for constructing new lists.
-@code{list} simply returns a list where the elements are the arguments,
-@code{cons*} is similar, but the last argument is stored in the cdr of
-the last pair of the list.
-
-@rnindex list
-@deffn {Scheme Procedure} list . objs
-@deffnx {C Function} scm_list (objs)
-Return a list containing @var{objs}, the arguments to
-@code{list}.
-@end deffn
-
-@deffn {Scheme Procedure} cons* arg1 arg2 @dots{}
-@deffnx {C Function} scm_cons_star (arg1, rest)
-Like @code{list}, but the last arg provides the tail of the
-constructed list, returning @code{(cons @var{arg1} (cons
-@var{arg2} (cons @dots{} @var{argn})))}. Requires at least one
-argument. If given one argument, that argument is returned as
-result. This function is called @code{list*} in some other
-Schemes and in Common LISP.
-@end deffn
-
-@deffn {Scheme Procedure} list-copy lst
-@deffnx {C Function} scm_list_copy (lst)
-Return a (newly-created) copy of @var{lst}.
-@end deffn
-
-@deffn {Scheme Procedure} make-list n [init]
-Create a list containing of @var{n} elements, where each element is
-initialized to @var{init}. @var{init} defaults to the empty list
-@code{()} if not given.
-@end deffn
-
-Note that @code{list-copy} only makes a copy of the pairs which make up
-the spine of the lists. The list elements are not copied, which means
-that modifying the elements of the new list also modifies the elements
-of the old list. On the other hand, applying procedures like
-@code{set-cdr!} or @code{delv!} to the new list will not alter the old
-list. If you also need to copy the list elements (making a deep copy),
-use the procedure @code{copy-tree} (@pxref{Copying}).
-
-@node List Selection
-@subsection List Selection
-
-These procedures are used to get some information about a list, or to
-retrieve one or more elements of a list.
-
-@rnindex length
-@deffn {Scheme Procedure} length lst
-@deffnx {C Function} scm_length (lst)
-Return the number of elements in list @var{lst}.
-@end deffn
-
-@deffn {Scheme Procedure} last-pair lst
-@deffnx {C Function} scm_last_pair (lst)
-Return a pointer to the last pair in @var{lst}, signalling an error if
-@var{lst} is circular.
-@end deffn
-
-@rnindex list-ref
-@deffn {Scheme Procedure} list-ref list k
-@deffnx {C Function} scm_list_ref (list, k)
-Return the @var{k}th element from @var{list}.
-@end deffn
-
-@rnindex list-tail
-@deffn {Scheme Procedure} list-tail lst k
-@deffnx {Scheme Procedure} list-cdr-ref lst k
-@deffnx {C Function} scm_list_tail (lst, k)
-Return the "tail" of @var{lst} beginning with its @var{k}th element.
-The first element of the list is considered to be element 0.
-
-@code{list-tail} and @code{list-cdr-ref} are identical. It may help to
-think of @code{list-cdr-ref} as accessing the @var{k}th cdr of the list,
-or returning the results of cdring @var{k} times down @var{lst}.
-@end deffn
-
-@deffn {Scheme Procedure} list-head lst k
-@deffnx {C Function} scm_list_head (lst, k)
-Copy the first @var{k} elements from @var{lst} into a new list, and
-return it.
-@end deffn
-
-@node Append/Reverse
-@subsection Append and Reverse
-
-@code{append} and @code{append!} are used to concatenate two or more
-lists in order to form a new list. @code{reverse} and @code{reverse!}
-return lists with the same elements as their arguments, but in reverse
-order. The procedure variants with an @code{!} directly modify the
-pairs which form the list, whereas the other procedures create new
-pairs. This is why you should be careful when using the side-effecting
-variants.
-
-@rnindex append
-@deffn {Scheme Procedure} append . args
-@deffnx {C Function} scm_append (args)
-Return a list consisting of the elements the lists passed as
-arguments.
-@lisp
-(append '(x) '(y)) @result{} (x y)
-(append '(a) '(b c d)) @result{} (a b c d)
-(append '(a (b)) '((c))) @result{} (a (b) (c))
-@end lisp
-The resulting list is always newly allocated, except that it
-shares structure with the last list argument. The last
-argument may actually be any object; an improper list results
-if the last argument is not a proper list.
-@lisp
-(append '(a b) '(c . d)) @result{} (a b c . d)
-(append '() 'a) @result{} a
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} append! . lists
-@deffnx {C Function} scm_append_x (lists)
-A destructive version of @code{append} (@pxref{Pairs and
-lists,,,r5rs, The Revised^5 Report on Scheme}). The cdr field
-of each list's final pair is changed to point to the head of
-the next list, so no consing is performed. Return a pointer to
-the mutated list.
-@end deffn
-
-@rnindex reverse
-@deffn {Scheme Procedure} reverse lst
-@deffnx {C Function} scm_reverse (lst)
-Return a new list that contains the elements of @var{lst} but
-in reverse order.
-@end deffn
-
-@c NJFIXME explain new_tail
-@deffn {Scheme Procedure} reverse! lst [new_tail]
-@deffnx {C Function} scm_reverse_x (lst, new_tail)
-A destructive version of @code{reverse} (@pxref{Pairs and lists,,,r5rs,
-The Revised^5 Report on Scheme}). The cdr of each cell in @var{lst} is
-modified to point to the previous list element. Return a pointer to the
-head of the reversed list.
-
-Caveat: because the list is modified in place, the tail of the original
-list now becomes its head, and the head of the original list now becomes
-the tail. Therefore, the @var{lst} symbol to which the head of the
-original list was bound now points to the tail. To ensure that the head
-of the modified list is not lost, it is wise to save the return value of
-@code{reverse!}
-@end deffn
-
-@node List Modification
-@subsection List Modification
-
-The following procedures modify an existing list, either by changing
-elements of the list, or by changing the list structure itself.
-
-@deffn {Scheme Procedure} list-set! list k val
-@deffnx {C Function} scm_list_set_x (list, k, val)
-Set the @var{k}th element of @var{list} to @var{val}.
-@end deffn
-
-@deffn {Scheme Procedure} list-cdr-set! list k val
-@deffnx {C Function} scm_list_cdr_set_x (list, k, val)
-Set the @var{k}th cdr of @var{list} to @var{val}.
-@end deffn
-
-@deffn {Scheme Procedure} delq item lst
-@deffnx {C Function} scm_delq (item, lst)
-Return a newly-created copy of @var{lst} with elements
-@code{eq?} to @var{item} removed. This procedure mirrors
-@code{memq}: @code{delq} compares elements of @var{lst} against
-@var{item} with @code{eq?}.
-@end deffn
-
-@deffn {Scheme Procedure} delv item lst
-@deffnx {C Function} scm_delv (item, lst)
-Return a newly-created copy of @var{lst} with elements
-@code{eqv?} to @var{item} removed. This procedure mirrors
-@code{memv}: @code{delv} compares elements of @var{lst} against
-@var{item} with @code{eqv?}.
-@end deffn
-
-@deffn {Scheme Procedure} delete item lst
-@deffnx {C Function} scm_delete (item, lst)
-Return a newly-created copy of @var{lst} with elements
-@code{equal?} to @var{item} removed. This procedure mirrors
-@code{member}: @code{delete} compares elements of @var{lst}
-against @var{item} with @code{equal?}.
-@end deffn
-
-@deffn {Scheme Procedure} delq! item lst
-@deffnx {Scheme Procedure} delv! item lst
-@deffnx {Scheme Procedure} delete! item lst
-@deffnx {C Function} scm_delq_x (item, lst)
-@deffnx {C Function} scm_delv_x (item, lst)
-@deffnx {C Function} scm_delete_x (item, lst)
-These procedures are destructive versions of @code{delq}, @code{delv}
-and @code{delete}: they modify the pointers in the existing @var{lst}
-rather than creating a new list. Caveat evaluator: Like other
-destructive list functions, these functions cannot modify the binding of
-@var{lst}, and so cannot be used to delete the first element of
-@var{lst} destructively.
-@end deffn
-
-@deffn {Scheme Procedure} delq1! item lst
-@deffnx {C Function} scm_delq1_x (item, lst)
-Like @code{delq!}, but only deletes the first occurrence of
-@var{item} from @var{lst}. Tests for equality using
-@code{eq?}. See also @code{delv1!} and @code{delete1!}.
-@end deffn
-
-@deffn {Scheme Procedure} delv1! item lst
-@deffnx {C Function} scm_delv1_x (item, lst)
-Like @code{delv!}, but only deletes the first occurrence of
-@var{item} from @var{lst}. Tests for equality using
-@code{eqv?}. See also @code{delq1!} and @code{delete1!}.
-@end deffn
-
-@deffn {Scheme Procedure} delete1! item lst
-@deffnx {C Function} scm_delete1_x (item, lst)
-Like @code{delete!}, but only deletes the first occurrence of
-@var{item} from @var{lst}. Tests for equality using
-@code{equal?}. See also @code{delq1!} and @code{delv1!}.
-@end deffn
-
-@node List Searching
-@subsection List Searching
-
-The following procedures search lists for particular elements. They use
-different comparison predicates for comparing list elements with the
-object to be searched. When they fail, they return @code{#f}, otherwise
-they return the sublist whose car is equal to the search object, where
-equality depends on the equality predicate used.
-
-@rnindex memq
-@deffn {Scheme Procedure} memq x lst
-@deffnx {C Function} scm_memq (x, lst)
-Return the first sublist of @var{lst} whose car is @code{eq?}
-to @var{x} where the sublists of @var{lst} are the non-empty
-lists returned by @code{(list-tail @var{lst} @var{k})} for
-@var{k} less than the length of @var{lst}. If @var{x} does not
-occur in @var{lst}, then @code{#f} (not the empty list) is
-returned.
-@end deffn
-
-@rnindex memv
-@deffn {Scheme Procedure} memv x lst
-@deffnx {C Function} scm_memv (x, lst)
-Return the first sublist of @var{lst} whose car is @code{eqv?}
-to @var{x} where the sublists of @var{lst} are the non-empty
-lists returned by @code{(list-tail @var{lst} @var{k})} for
-@var{k} less than the length of @var{lst}. If @var{x} does not
-occur in @var{lst}, then @code{#f} (not the empty list) is
-returned.
-@end deffn
-
-@rnindex member
-@deffn {Scheme Procedure} member x lst
-@deffnx {C Function} scm_member (x, lst)
-Return the first sublist of @var{lst} whose car is
-@code{equal?} to @var{x} where the sublists of @var{lst} are
-the non-empty lists returned by @code{(list-tail @var{lst}
-@var{k})} for @var{k} less than the length of @var{lst}. If
-@var{x} does not occur in @var{lst}, then @code{#f} (not the
-empty list) is returned.
-@end deffn
-
-
-@node List Mapping
-@subsection List Mapping
-
-List processing is very convenient in Scheme because the process of
-iterating over the elements of a list can be highly abstracted. The
-procedures in this section are the most basic iterating procedures for
-lists. They take a procedure and one or more lists as arguments, and
-apply the procedure to each element of the list. They differ in their
-return value.
-
-@rnindex map
-@c begin (texi-doc-string "guile" "map")
-@deffn {Scheme Procedure} map proc arg1 arg2 @dots{}
-@deffnx {Scheme Procedure} map-in-order proc arg1 arg2 @dots{}
-@deffnx {C Function} scm_map (proc, arg1, args)
-Apply @var{proc} to each element of the list @var{arg1} (if only two
-arguments are given), or to the corresponding elements of the argument
-lists (if more than two arguments are given). The result(s) of the
-procedure applications are saved and returned in a list. For
-@code{map}, the order of procedure applications is not specified,
-@code{map-in-order} applies the procedure from left to right to the list
-elements.
-@end deffn
-
-@rnindex for-each
-@c begin (texi-doc-string "guile" "for-each")
-@deffn {Scheme Procedure} for-each proc arg1 arg2 @dots{}
-Like @code{map}, but the procedure is always applied from left to right,
-and the result(s) of the procedure applications are thrown away. The
-return value is not specified.
-@end deffn
-
-
-@node Vectors
-@section Vectors
-@tpindex Vectors
-
-Vectors are sequences of Scheme objects. Unlike lists, the length of a
-vector, once the vector is created, cannot be changed. The advantage of
-vectors over lists is that the time required to access one element of a vector
-given its @dfn{position} (synonymous with @dfn{index}), a zero-origin number,
-is constant, whereas lists have an access time linear to the position of the
-accessed element in the list.
-
-Vectors can contain any kind of Scheme object; it is even possible to have
-different types of objects in the same vector. For vectors containing
-vectors, you may wish to use arrays, instead. Note, too, that some array
-procedures operate happily on vectors (@pxref{Arrays}).
-
-@menu
-* Vector Syntax:: Read syntax for vectors.
-* Vector Creation:: Dynamic vector creation and validation.
-* Vector Accessors:: Accessing and modifying vector contents.
-@end menu
-
-
-@node Vector Syntax
-@subsection Read Syntax for Vectors
-
-Vectors can literally be entered in source code, just like strings,
-characters or some of the other data types. The read syntax for vectors
-is as follows: A sharp sign (@code{#}), followed by an opening
-parentheses, all elements of the vector in their respective read syntax,
-and finally a closing parentheses. The following are examples of the
-read syntax for vectors; where the first vector only contains numbers
-and the second three different object types: a string, a symbol and a
-number in hexadecimal notation.
-
-@lisp
-#(1 2 3)
-#("Hello" foo #xdeadbeef)
-@end lisp
-
-
-@node Vector Creation
-@subsection Dynamic Vector Creation and Validation
-
-Instead of creating a vector implicitly by using the read syntax just
-described, you can create a vector dynamically by calling one of the
-@code{vector} and @code{list->vector} primitives with the list of Scheme
-values that you want to place into a vector. The size of the vector
-thus created is determined implicitly by the number of arguments given.
-
-@rnindex vector
-@rnindex list->vector
-@deffn {Scheme Procedure} vector . l
-@deffnx {Scheme Procedure} list->vector l
-@deffnx {C Function} scm_vector (l)
-Return a newly allocated vector composed of the
-given arguments. Analogous to @code{list}.
-
-@lisp
-(vector 'a 'b 'c) @result{} #(a b c)
-@end lisp
-@end deffn
-
-(As an aside, an interesting implementation detail is that the Guile
-reader reads the @code{#(@dots{})} syntax by reading everything but the
-initial @code{#} as a @emph{list}, and then passing the list that
-results to @code{list->vector}. Notice how neatly this fits with the
-similarity between the read (and print) syntaxes for lists and vectors.)
-
-The inverse operation is @code{vector->list}:
-
-@rnindex vector->list
-@deffn {Scheme Procedure} vector->list v
-@deffnx {C Function} scm_vector_to_list (v)
-Return a newly allocated list composed of the elements of @var{v}.
-
-@lisp
-(vector->list '#(dah dah didah)) @result{} (dah dah didah)
-(list->vector '(dididit dah)) @result{} #(dididit dah)
-@end lisp
-@end deffn
-
-To allocate a vector with an explicitly specified size, use
-@code{make-vector}. With this primitive you can also specify an initial
-value for the vector elements (the same value for all elements, that
-is):
-
-@rnindex make-vector
-@deffn {Scheme Procedure} make-vector k [fill]
-@deffnx {C Function} scm_make_vector (k, fill)
-Return a newly allocated vector of @var{k} elements. If a
-second argument is given, then each position is initialized to
-@var{fill}. Otherwise the initial contents of each position is
-unspecified.
-@end deffn
-
-To check whether an arbitrary Scheme value @emph{is} a vector, use the
-@code{vector?} primitive:
-
-@rnindex vector?
-@deffn {Scheme Procedure} vector? obj
-@deffnx {C Function} scm_vector_p (obj)
-Return @code{#t} if @var{obj} is a vector, otherwise return
-@code{#f}.
-@end deffn
-
-
-@node Vector Accessors
-@subsection Accessing and Modifying Vector Contents
-
-@code{vector-length} and @code{vector-ref} return information about a
-given vector, respectively its size and the elements that are contained
-in the vector.
-
-@rnindex vector-length
-@deffn {Scheme Procedure} vector-length vector
-@deffnx {C Function} scm_vector_length vector
-Return the number of elements in @var{vector} as an exact integer.
-@end deffn
-
-@rnindex vector-ref
-@deffn {Scheme Procedure} vector-ref vector k
-@deffnx {C Function} scm_vector_ref vector k
-Return the contents of position @var{k} of @var{vector}.
-@var{k} must be a valid index of @var{vector}.
-@lisp
-(vector-ref '#(1 1 2 3 5 8 13 21) 5) @result{} 8
-(vector-ref '#(1 1 2 3 5 8 13 21)
- (let ((i (round (* 2 (acos -1)))))
- (if (inexact? i)
- (inexact->exact i)
- i))) @result{} 13
-@end lisp
-@end deffn
-
-A vector created by one of the dynamic vector constructor procedures
-(@pxref{Vector Creation}) can be modified using the following
-procedures.
-
-@emph{NOTE:} According to R5RS, it is an error to use any of these
-procedures on a literally read vector, because such vectors should be
-considered as constants. Currently, however, Guile does not detect this
-error.
-
-@rnindex vector-set!
-@deffn {Scheme Procedure} vector-set! vector k obj
-@deffnx {C Function} scm_vector_set_x vector k obj
-Store @var{obj} in position @var{k} of @var{vector}.
-@var{k} must be a valid index of @var{vector}.
-The value returned by @samp{vector-set!} is unspecified.
-@lisp
-(let ((vec (vector 0 '(2 2 2 2) "Anna")))
- (vector-set! vec 1 '("Sue" "Sue"))
- vec) @result{} #(0 ("Sue" "Sue") "Anna")
-@end lisp
-@end deffn
-
-@rnindex vector-fill!
-@deffn {Scheme Procedure} vector-fill! v fill
-@deffnx {C Function} scm_vector_fill_x (v, fill)
-Store @var{fill} in every position of @var{vector}. The value
-returned by @code{vector-fill!} is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} vector-move-left! vec1 start1 end1 vec2 start2
-@deffnx {C Function} scm_vector_move_left_x (vec1, start1, end1, vec2, start2)
-Copy elements from @var{vec1}, positions @var{start1} to @var{end1},
-to @var{vec2} starting at position @var{start2}. @var{start1} and
-@var{start2} are inclusive indices; @var{end1} is exclusive.
-
-@code{vector-move-left!} copies elements in leftmost order.
-Therefore, in the case where @var{vec1} and @var{vec2} refer to the
-same vector, @code{vector-move-left!} is usually appropriate when
-@var{start1} is greater than @var{start2}.
-@end deffn
-
-@deffn {Scheme Procedure} vector-move-right! vec1 start1 end1 vec2 start2
-@deffnx {C Function} scm_vector_move_right_x (vec1, start1, end1, vec2, start2)
-Copy elements from @var{vec1}, positions @var{start1} to @var{end1},
-to @var{vec2} starting at position @var{start2}. @var{start1} and
-@var{start2} are inclusive indices; @var{end1} is exclusive.
-
-@code{vector-move-right!} copies elements in rightmost order.
-Therefore, in the case where @var{vec1} and @var{vec2} refer to the
-same vector, @code{vector-move-right!} is usually appropriate when
-@var{start1} is less than @var{start2}.
-@end deffn
-
-
-@node Records
-@section Records
-
-A @dfn{record type} is a first class object representing a user-defined
-data type. A @dfn{record} is an instance of a record type.
-
-@deffn {Scheme Procedure} record? obj
-Return @code{#t} if @var{obj} is a record of any type and @code{#f}
-otherwise.
-
-Note that @code{record?} may be true of any Scheme value; there is no
-promise that records are disjoint with other Scheme types.
-@end deffn
-
-@deffn {Scheme Procedure} make-record-type type-name field-names
-Return a @dfn{record-type descriptor}, a value representing a new data
-type disjoint from all others. The @var{type-name} argument must be a
-string, but is only used for debugging purposes (such as the printed
-representation of a record of the new type). The @var{field-names}
-argument is a list of symbols naming the @dfn{fields} of a record of the
-new type. It is an error if the list contains any duplicates. It is
-unspecified how record-type descriptors are represented.
-@end deffn
-
-@deffn {Scheme Procedure} record-constructor rtd [field-names]
-Return a procedure for constructing new members of the type represented
-by @var{rtd}. The returned procedure accepts exactly as many arguments
-as there are symbols in the given list, @var{field-names}; these are
-used, in order, as the initial values of those fields in a new record,
-which is returned by the constructor procedure. The values of any
-fields not named in that list are unspecified. The @var{field-names}
-argument defaults to the list of field names in the call to
-@code{make-record-type} that created the type represented by @var{rtd};
-if the @var{field-names} argument is provided, it is an error if it
-contains any duplicates or any symbols not in the default list.
-@end deffn
-
-@deffn {Scheme Procedure} record-predicate rtd
-Return a procedure for testing membership in the type represented by
-@var{rtd}. The returned procedure accepts exactly one argument and
-returns a true value if the argument is a member of the indicated record
-type; it returns a false value otherwise.
-@end deffn
-
-@deffn {Scheme Procedure} record-accessor rtd field-name
-Return a procedure for reading the value of a particular field of a
-member of the type represented by @var{rtd}. The returned procedure
-accepts exactly one argument which must be a record of the appropriate
-type; it returns the current value of the field named by the symbol
-@var{field-name} in that record. The symbol @var{field-name} must be a
-member of the list of field-names in the call to @code{make-record-type}
-that created the type represented by @var{rtd}.
-@end deffn
-
-@deffn {Scheme Procedure} record-modifier rtd field-name
-Return a procedure for writing the value of a particular field of a
-member of the type represented by @var{rtd}. The returned procedure
-accepts exactly two arguments: first, a record of the appropriate type,
-and second, an arbitrary Scheme value; it modifies the field named by
-the symbol @var{field-name} in that record to contain the given value.
-The returned value of the modifier procedure is unspecified. The symbol
-@var{field-name} must be a member of the list of field-names in the call
-to @code{make-record-type} that created the type represented by
-@var{rtd}.
-@end deffn
-
-@deffn {Scheme Procedure} record-type-descriptor record
-Return a record-type descriptor representing the type of the given
-record. That is, for example, if the returned descriptor were passed to
-@code{record-predicate}, the resulting predicate would return a true
-value when passed the given record. Note that it is not necessarily the
-case that the returned descriptor is the one that was passed to
-@code{record-constructor} in the call that created the constructor
-procedure that created the given record.
-@end deffn
-
-@deffn {Scheme Procedure} record-type-name rtd
-Return the type-name associated with the type represented by rtd. The
-returned value is @code{eqv?} to the @var{type-name} argument given in
-the call to @code{make-record-type} that created the type represented by
-@var{rtd}.
-@end deffn
-
-@deffn {Scheme Procedure} record-type-fields rtd
-Return a list of the symbols naming the fields in members of the type
-represented by @var{rtd}. The returned value is @code{equal?} to the
-field-names argument given in the call to @code{make-record-type} that
-created the type represented by @var{rtd}.
-@end deffn
-
-
-@node Structures
-@section Structures
-@tpindex Structures
-
-[FIXME: this is pasted in from Tom Lord's original guile.texi and should
-be reviewed]
-
-A @dfn{structure type} is a first class user-defined data type. A
-@dfn{structure} is an instance of a structure type. A structure type is
-itself a structure.
-
-Structures are less abstract and more general than traditional records.
-In fact, in Guile Scheme, records are implemented using structures.
-
-@menu
-* Structure Concepts:: The structure of Structures
-* Structure Layout:: Defining the layout of structure types
-* Structure Basics:: make-, -ref and -set! procedures for structs
-* Vtables:: Accessing type-specific data
-@end menu
-
-@node Structure Concepts
-@subsection Structure Concepts
-
-A structure object consists of a handle, structure data, and a vtable.
-The handle is a Scheme value which points to both the vtable and the
-structure's data. Structure data is a dynamically allocated region of
-memory, private to the structure, divided up into typed fields. A
-vtable is another structure used to hold type-specific data. Multiple
-structures can share a common vtable.
-
-Three concepts are key to understanding structures.
-
-@itemize @bullet{}
-@item @dfn{layout specifications}
-
-Layout specifications determine how memory allocated to structures is
-divided up into fields. Programmers must write a layout specification
-whenever a new type of structure is defined.
-
-@item @dfn{structural accessors}
-
-Structure access is by field number. There is only one set of
-accessors common to all structure objects.
-
-@item @dfn{vtables}
-
-Vtables, themselves structures, are first class representations of
-disjoint sub-types of structures in general. In most cases, when a
-new structure is created, programmers must specify a vtable for the
-new structure. Each vtable has a field describing the layout of its
-instances. Vtables can have additional, user-defined fields as well.
-@end itemize
-
-
-
-@node Structure Layout
-@subsection Structure Layout
-
-When a structure is created, a region of memory is allocated to hold its
-state. The @dfn{layout} of the structure's type determines how that
-memory is divided into fields.
-
-Each field has a specified type. There are only three types allowed, each
-corresponding to a one letter code. The allowed types are:
-
-@itemize @bullet{}
-@item 'u' -- unprotected
-
-The field holds binary data that is not GC protected.
-
-@item 'p' -- protected
-
-The field holds a Scheme value and is GC protected.
-
-@item 's' -- self
-
-The field holds a Scheme value and is GC protected. When a structure is
-created with this type of field, the field is initialized to refer to
-the structure's own handle. This kind of field is mainly useful when
-mixing Scheme and C code in which the C code may need to compute a
-structure's handle given only the address of its malloc'd data.
-@end itemize
-
-
-Each field also has an associated access protection. There are only
-three kinds of protection, each corresponding to a one letter code.
-The allowed protections are:
-
-@itemize @bullet{}
-@item 'w' -- writable
-
-The field can be read and written.
-
-@item 'r' -- readable
-
-The field can be read, but not written.
-
-@item 'o' -- opaque
-
-The field can be neither read nor written. This kind
-of protection is for fields useful only to built-in routines.
-@end itemize
-
-A layout specification is described by stringing together pairs
-of letters: one to specify a field type and one to specify a field
-protection. For example, a traditional cons pair type object could
-be described as:
-
-@example
-; cons pairs have two writable fields of Scheme data
-"pwpw"
-@end example
-
-A pair object in which the first field is held constant could be:
-
-@example
-"prpw"
-@end example
-
-Binary fields, (fields of type "u"), hold one @dfn{word} each. The
-size of a word is a machine dependent value defined to be equal to the
-value of the C expression: @code{sizeof (long)}.
-
-The last field of a structure layout may specify a tail array.
-A tail array is indicated by capitalizing the field's protection
-code ('W', 'R' or 'O'). A tail-array field is replaced by
-a read-only binary data field containing an array size. The array
-size is determined at the time the structure is created. It is followed
-by a corresponding number of fields of the type specified for the
-tail array. For example, a conventional Scheme vector can be
-described as:
-
-@example
-; A vector is an arbitrary number of writable fields holding Scheme
-; values:
-"pW"
-@end example
-
-In the above example, field 0 contains the size of the vector and
-fields beginning at 1 contain the vector elements.
-
-A kind of tagged vector (a constant tag followed by conventional
-vector elements) might be:
-
-@example
-"prpW"
-@end example
-
-
-Structure layouts are represented by specially interned symbols whose
-name is a string of type and protection codes. To create a new
-structure layout, use this procedure:
-
-@deffn {Scheme Procedure} make-struct-layout fields
-@deffnx {C Function} scm_make_struct_layout (fields)
-Return a new structure layout object.
-
-@var{fields} must be a string made up of pairs of characters
-strung together. The first character of each pair describes a field
-type, the second a field protection. Allowed types are 'p' for
-GC-protected Scheme data, 'u' for unprotected binary data, and 's' for
-a field that points to the structure itself. Allowed protections
-are 'w' for mutable fields, 'r' for read-only fields, and 'o' for opaque
-fields. The last field protection specification may be capitalized to
-indicate that the field is a tail-array.
-@end deffn
-
-
-
-@node Structure Basics
-@subsection Structure Basics
-
-This section describes the basic procedures for creating and accessing
-structures.
-
-@deffn {Scheme Procedure} make-struct vtable tail_array_size . init
-@deffnx {C Function} scm_make_struct (vtable, tail_array_size, init)
-Create a new structure.
-
-@var{type} must be a vtable structure (@pxref{Vtables}).
-
-@var{tail-elts} must be a non-negative integer. If the layout
-specification indicated by @var{type} includes a tail-array,
-this is the number of elements allocated to that array.
-
-The @var{init1}, @dots{} are optional arguments describing how
-successive fields of the structure should be initialized. Only fields
-with protection 'r' or 'w' can be initialized, except for fields of
-type 's', which are automatically initialized to point to the new
-structure itself; fields with protection 'o' can not be initialized by
-Scheme programs.
-
-If fewer optional arguments than initializable fields are supplied,
-fields of type 'p' get default value #f while fields of type 'u' are
-initialized to 0.
-
-Structs are currently the basic representation for record-like data
-structures in Guile. The plan is to eventually replace them with a
-new representation which will at the same time be easier to use and
-more powerful.
-
-For more information, see the documentation for @code{make-vtable-vtable}.
-@end deffn
-
-@deffn {Scheme Procedure} struct? x
-@deffnx {C Function} scm_struct_p (x)
-Return @code{#t} iff @var{x} is a structure object, else
-@code{#f}.
-@end deffn
-
-
-@deffn {Scheme Procedure} struct-ref handle pos
-@deffnx {Scheme Procedure} struct-set! struct n value
-@deffnx {C Function} scm_struct_ref (handle, pos)
-@deffnx {C Function} scm_struct_set_x (struct, n, value)
-Access (or modify) the @var{n}th field of @var{struct}.
-
-If the field is of type 'p', then it can be set to an arbitrary value.
-
-If the field is of type 'u', then it can only be set to a non-negative
-integer value small enough to fit in one machine word.
-@end deffn
-
-
-
-@node Vtables
-@subsection Vtables
-
-Vtables are structures that are used to represent structure types. Each
-vtable contains a layout specification in field
-@code{vtable-index-layout} -- instances of the type are laid out
-according to that specification. Vtables contain additional fields
-which are used only internally to libguile. The variable
-@code{vtable-offset-user} is bound to a field number. Vtable fields
-at that position or greater are user definable.
-
-@deffn {Scheme Procedure} struct-vtable handle
-@deffnx {C Function} scm_struct_vtable (handle)
-Return the vtable structure that describes the type of @var{struct}.
-@end deffn
-
-@deffn {Scheme Procedure} struct-vtable? x
-@deffnx {C Function} scm_struct_vtable_p (x)
-Return @code{#t} iff @var{x} is a vtable structure.
-@end deffn
-
-If you have a vtable structure, @code{V}, you can create an instance of
-the type it describes by using @code{(make-struct V ...)}. But where
-does @code{V} itself come from? One possibility is that @code{V} is an
-instance of a user-defined vtable type, @code{V'}, so that @code{V} is
-created by using @code{(make-struct V' ...)}. Another possibility is
-that @code{V} is an instance of the type it itself describes. Vtable
-structures of the second sort are created by this procedure:
-
-@deffn {Scheme Procedure} make-vtable-vtable user_fields tail_array_size . init
-@deffnx {C Function} scm_make_vtable_vtable (user_fields, tail_array_size, init)
-Return a new, self-describing vtable structure.
-
-@var{user-fields} is a string describing user defined fields of the
-vtable beginning at index @code{vtable-offset-user}
-(see @code{make-struct-layout}).
-
-@var{tail-size} specifies the size of the tail-array (if any) of
-this vtable.
-
-@var{init1}, @dots{} are the optional initializers for the fields of
-the vtable.
-
-Vtables have one initializable system field---the struct printer.
-This field comes before the user fields in the initializers passed
-to @code{make-vtable-vtable} and @code{make-struct}, and thus works as
-a third optional argument to @code{make-vtable-vtable} and a fourth to
-@code{make-struct} when creating vtables:
-
-If the value is a procedure, it will be called instead of the standard
-printer whenever a struct described by this vtable is printed.
-The procedure will be called with arguments STRUCT and PORT.
-
-The structure of a struct is described by a vtable, so the vtable is
-in essence the type of the struct. The vtable is itself a struct with
-a vtable. This could go on forever if it weren't for the
-vtable-vtables which are self-describing vtables, and thus terminate
-the chain.
-
-There are several potential ways of using structs, but the standard
-one is to use three kinds of structs, together building up a type
-sub-system: one vtable-vtable working as the root and one or several
-"types", each with a set of "instances". (The vtable-vtable should be
-compared to the class <class> which is the class of itself.)
-
-@lisp
-(define ball-root (make-vtable-vtable "pr" 0))
-
-(define (make-ball-type ball-color)
- (make-struct ball-root 0
- (make-struct-layout "pw")
- (lambda (ball port)
- (format port "#<a ~A ball owned by ~A>"
- (color ball)
- (owner ball)))
- ball-color))
-(define (color ball) (struct-ref (struct-vtable ball) vtable-offset-user))
-(define (owner ball) (struct-ref ball 0))
-
-(define red (make-ball-type 'red))
-(define green (make-ball-type 'green))
-
-(define (make-ball type owner) (make-struct type 0 owner))
-
-(define ball (make-ball green 'Nisse))
-ball @result{} #<a green ball owned by Nisse>
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} struct-vtable-name vtable
-@deffnx {C Function} scm_struct_vtable_name (vtable)
-Return the name of the vtable @var{vtable}.
-@end deffn
-
-@deffn {Scheme Procedure} set-struct-vtable-name! vtable name
-@deffnx {C Function} scm_set_struct_vtable_name_x (vtable, name)
-Set the name of the vtable @var{vtable} to @var{name}.
-@end deffn
-
-@deffn {Scheme Procedure} struct-vtable-tag handle
-@deffnx {C Function} scm_struct_vtable_tag (handle)
-Return the vtable tag of the structure @var{handle}.
-@end deffn
-
-
-@node Arrays
-@section Arrays
-@tpindex Arrays
-
-@menu
-* Conventional Arrays:: Arrays with arbitrary data.
-* Array Mapping:: Applying a procedure to the contents of an array.
-* Uniform Arrays:: Arrays with data of a single type.
-* Bit Vectors:: Vectors of bits.
-@end menu
-
-@node Conventional Arrays
-@subsection Conventional Arrays
-
-@dfn{Conventional arrays} are a collection of cells organized into an
-arbitrary number of dimensions. Each cell can hold any kind of Scheme
-value and can be accessed in constant time by supplying an index for
-each dimension. This contrasts with uniform arrays, which use memory
-more efficiently but can hold data of only a single type, and lists
-where inserting and deleting cells is more efficient, but more time
-is usually required to access a particular cell.
-
-A conventional array is displayed as @code{#} followed by the @dfn{rank}
-(number of dimensions) followed by the cells, organized into dimensions
-using parentheses. The nesting depth of the parentheses is equal to
-the rank.
-
-When an array is created, the number of dimensions and range of each
-dimension must be specified, e.g., to create a 2x3 array with a
-zero-based index:
-
-@example
-(make-array 'ho 2 3) @result{}
-#2((ho ho ho) (ho ho ho))
-@end example
-
-The range of each dimension can also be given explicitly, e.g., another
-way to create the same array:
-
-@example
-(make-array 'ho '(0 1) '(0 2)) @result{}
-#2((ho ho ho) (ho ho ho))
-@end example
-
-A conventional array with one dimension based at zero is identical to
-a vector:
-
-@example
-(make-array 'ho 3) @result{}
-#(ho ho ho)
-@end example
-
-The following procedures can be used with conventional arrays (or vectors).
-
-@deffn {Scheme Procedure} array? v [prot]
-@deffnx {C Function} scm_array_p (v, prot)
-Return @code{#t} if the @var{obj} is an array, and @code{#f} if
-not. The @var{prototype} argument is used with uniform arrays
-and is described elsewhere.
-@end deffn
-
-@deffn {Scheme Procedure} make-array initial-value bound1 bound2 @dots{}
-Create and return an array that has as many dimensions as there are
-@var{bound}s and fill it with @var{initial-value}. Each @var{bound}
-may be a positive non-zero integer @var{N}, in which case the index for
-that dimension can range from 0 through @var{N-1}; or an explicit index
-range specifier in the form @code{(LOWER UPPER)}, where both @var{lower}
-and @var{upper} are integers, possibly less than zero, and possibly the
-same number (however, @var{lower} cannot be greater than @var{upper}).
-@end deffn
-
-@c array-ref's type is `compiled-closure'. There's some weird stuff
-@c going on in array.c, too. Let's call it a primitive. -twp
-
-@deffn {Scheme Procedure} uniform-vector-ref v args
-@deffnx {Scheme Procedure} array-ref v . args
-@deffnx {C Function} scm_uniform_vector_ref (v, args)
-Return the element at the @code{(index1, index2)} element in
-@var{array}.
-@end deffn
-
-@deffn {Scheme Procedure} array-in-bounds? v . args
-@deffnx {C Function} scm_array_in_bounds_p (v, args)
-Return @code{#t} if its arguments would be acceptable to
-@code{array-ref}.
-@end deffn
-
-@c fixme: why do these sigs differ? -ttn 2001/07/19 01:14:12
-@deffn {Scheme Procedure} array-set! v obj . args
-@deffnx {Scheme Procedure} uniform-array-set1! v obj args
-@deffnx {C Function} scm_array_set_x (v, obj, args)
-Set the element at the @code{(index1, index2)} element in @var{array} to
-@var{new-value}. The value returned by array-set! is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} make-shared-array oldra mapfunc . dims
-@deffnx {C Function} scm_make_shared_array (oldra, mapfunc, dims)
-@code{make-shared-array} can be used to create shared subarrays of other
-arrays. The @var{mapper} is a function that translates coordinates in
-the new array into coordinates in the old array. A @var{mapper} must be
-linear, and its range must stay within the bounds of the old array, but
-it can be otherwise arbitrary. A simple example:
-@lisp
-(define fred (make-array #f 8 8))
-(define freds-diagonal
- (make-shared-array fred (lambda (i) (list i i)) 8))
-(array-set! freds-diagonal 'foo 3)
-(array-ref fred 3 3) @result{} foo
-(define freds-center
- (make-shared-array fred (lambda (i j) (list (+ 3 i) (+ 3 j))) 2 2))
-(array-ref freds-center 0 0) @result{} foo
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} shared-array-increments ra
-@deffnx {C Function} scm_shared_array_increments (ra)
-For each dimension, return the distance between elements in the root vector.
-@end deffn
-
-@deffn {Scheme Procedure} shared-array-offset ra
-@deffnx {C Function} scm_shared_array_offset (ra)
-Return the root vector index of the first element in the array.
-@end deffn
-
-@deffn {Scheme Procedure} shared-array-root ra
-@deffnx {C Function} scm_shared_array_root (ra)
-Return the root vector of a shared array.
-@end deffn
-
-@deffn {Scheme Procedure} transpose-array ra . args
-@deffnx {C Function} scm_transpose_array (ra, args)
-Return an array sharing contents with @var{array}, but with
-dimensions arranged in a different order. There must be one
-@var{dim} argument for each dimension of @var{array}.
-@var{dim0}, @var{dim1}, @dots{} should be integers between 0
-and the rank of the array to be returned. Each integer in that
-range must appear at least once in the argument list.
-
-The values of @var{dim0}, @var{dim1}, @dots{} correspond to
-dimensions in the array to be returned, their positions in the
-argument list to dimensions of @var{array}. Several @var{dim}s
-may have the same value, in which case the returned array will
-have smaller rank than @var{array}.
-
-@lisp
-(transpose-array '#2((a b) (c d)) 1 0) @result{} #2((a c) (b d))
-(transpose-array '#2((a b) (c d)) 0 0) @result{} #1(a d)
-(transpose-array '#3(((a b c) (d e f)) ((1 2 3) (4 5 6))) 1 1 0) @result{}
- #2((a 4) (b 5) (c 6))
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} enclose-array ra . axes
-@deffnx {C Function} scm_enclose_array (ra, axes)
-@var{dim0}, @var{dim1} @dots{} should be nonnegative integers less than
-the rank of @var{array}. @var{enclose-array} returns an array
-resembling an array of shared arrays. The dimensions of each shared
-array are the same as the @var{dim}th dimensions of the original array,
-the dimensions of the outer array are the same as those of the original
-array that did not match a @var{dim}.
-
-An enclosed array is not a general Scheme array. Its elements may not
-be set using @code{array-set!}. Two references to the same element of
-an enclosed array will be @code{equal?} but will not in general be
-@code{eq?}. The value returned by @var{array-prototype} when given an
-enclosed array is unspecified.
-
-examples:
-@lisp
-(enclose-array '#3(((a b c) (d e f)) ((1 2 3) (4 5 6))) 1) @result{}
- #<enclosed-array (#1(a d) #1(b e) #1(c f)) (#1(1 4) #1(2 5) #1(3 6))>
-
-(enclose-array '#3(((a b c) (d e f)) ((1 2 3) (4 5 6))) 1 0) @result{}
- #<enclosed-array #2((a 1) (d 4)) #2((b 2) (e 5)) #2((c 3) (f 6))>
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} array-shape array
-Return a list of inclusive bounds of integers.
-@example
-(array-shape (make-array 'foo '(-1 3) 5)) @result{} ((-1 3) (0 4))
-@end example
-@end deffn
-
-@deffn {Scheme Procedure} array-dimensions ra
-@deffnx {C Function} scm_array_dimensions (ra)
-@code{Array-dimensions} is similar to @code{array-shape} but replaces
-elements with a @code{0} minimum with one greater than the maximum. So:
-@lisp
-(array-dimensions (make-array 'foo '(-1 3) 5)) @result{} ((-1 3) 5)
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} array-rank ra
-@deffnx {C Function} scm_array_rank (ra)
-Return the number of dimensions of @var{obj}. If @var{obj} is
-not an array, @code{0} is returned.
-@end deffn
-
-@deffn {Scheme Procedure} array->list v
-@deffnx {C Function} scm_array_to_list (v)
-Return a list consisting of all the elements, in order, of
-@var{array}.
-@end deffn
-
-@deffn {Scheme Procedure} array-copy! src dst
-@deffnx {Scheme Procedure} array-copy-in-order! src dst
-@deffnx {C Function} scm_array_copy_x (src, dst)
-Copy every element from vector or array @var{source} to the
-corresponding element of @var{destination}. @var{destination} must have
-the same rank as @var{source}, and be at least as large in each
-dimension. The order is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} array-fill! ra fill
-@deffnx {C Function} scm_array_fill_x (ra, fill)
-Store @var{fill} in every element of @var{array}. The value returned
-is unspecified.
-@end deffn
-
-@c begin (texi-doc-string "guile" "array-equal?")
-@deffn {Scheme Procedure} array-equal? ra0 ra1
-Return @code{#t} iff all arguments are arrays with the same shape, the
-same type, and have corresponding elements which are either
-@code{equal?} or @code{array-equal?}. This function differs from
-@code{equal?} in that a one dimensional shared array may be
-@var{array-equal?} but not @var{equal?} to a vector or uniform vector.
-@end deffn
-
-@deffn {Scheme Procedure} array-contents array [strict]
-@deffnx {C Function} scm_array_contents (array, strict)
-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{make-array} and
-@var{make-uniform-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
-be returned only if its elements are stored internally contiguous in
-memory.
-@end deffn
-
-@node Array Mapping
-@subsection Array Mapping
-
-@deffn {Scheme Procedure} array-map! ra0 proc . lra
-@deffnx {Scheme Procedure} array-map-in-order! ra0 proc . lra
-@deffnx {C Function} scm_array_map_x (ra0, proc, lra)
-@var{array1}, @dots{} must have the same number of dimensions as
-@var{array0} and have a range for each index which includes the range
-for the corresponding index in @var{array0}. @var{proc} is applied to
-each tuple of elements of @var{array1} @dots{} and the result is stored
-as the corresponding element in @var{array0}. The value returned is
-unspecified. The order of application is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} array-for-each proc ra0 . lra
-@deffnx {C Function} scm_array_for_each (proc, ra0, lra)
-Apply @var{proc} to each tuple of elements of @var{array0} @dots{}
-in row-major order. The value returned is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} array-index-map! ra proc
-@deffnx {C Function} scm_array_index_map_x (ra, proc)
-Apply @var{proc} to the indices of each element of @var{array} in
-turn, storing the result in the corresponding element. The value
-returned and the order of application are unspecified.
-
-One can implement @var{array-indexes} as
-@lisp
-(define (array-indexes array)
- (let ((ra (apply make-array #f (array-shape array))))
- (array-index-map! ra (lambda x x))
- ra))
-@end lisp
-Another example:
-@lisp
-(define (apl:index-generator n)
- (let ((v (make-uniform-vector n 1)))
- (array-index-map! v (lambda (i) i))
- v))
-@end lisp
-@end deffn
-
-@node Uniform Arrays
-@subsection Uniform Arrays
-@tpindex Uniform Arrays
-
-@noindent
-@dfn{Uniform arrays} have elements all of the
-same type and occupy less storage than conventional
-arrays. Uniform arrays with a single zero-based dimension
-are also known as @dfn{uniform vectors}. The procedures in
-this section can also be used on conventional arrays, vectors,
-bit-vectors and strings.
-
-@noindent
-When creating a uniform array, the type of data to be stored
-is indicated with a @var{prototype} argument. The following table
-lists the types available and example prototypes:
-
-@example
-prototype type printing character
-
-#t boolean (bit-vector) b
-#\a char (string) a
-#\nul byte (integer) y
-'s short (integer) h
-1 unsigned long (integer) u
--1 signed long (integer) e
-'l signed long long (integer) l
-1.0 float (single precision) s
-1/3 double (double precision float) i
-0+i complex (double precision) c
-() conventional vector
-@end example
-
-@noindent
-Unshared uniform arrays of characters with a single zero-based dimension
-are identical to strings:
-
-@example
-(make-uniform-array #\a 3) @result{}
-"aaa"
-@end example
-
-@noindent
-Unshared uniform arrays of booleans with a single zero-based dimension
-are identical to @ref{Bit Vectors, bit-vectors}.
-
-@example
-(make-uniform-array #t 3) @result{}
-#*111
-@end example
-
-@noindent
-Other uniform vectors are written in a form similar to that of vectors,
-except that a single character from the above table is put between
-@code{#} and @code{(}. For example, a uniform vector of signed
-long integers is displayed in the form @code{'#e(3 5 9)}.
-
-@deffn {Scheme Procedure} array? v [prot]
-Return @code{#t} if the @var{obj} is an array, and @code{#f} if not.
-
-The @var{prototype} argument is used with uniform arrays and is described
-elsewhere.
-@end deffn
-
-@deffn {Scheme Procedure} make-uniform-array prototype bound1 bound2 @dots{}
-Create and return a uniform array of type corresponding to
-@var{prototype} that has as many dimensions as there are @var{bound}s
-and fill it with @var{prototype}.
-@end deffn
-
-@deffn {Scheme Procedure} array-prototype ra
-@deffnx {C Function} scm_array_prototype (ra)
-Return an object that would produce an array of the same type
-as @var{array}, if used as the @var{prototype} for
-@code{make-uniform-array}.
-@end deffn
-
-@deffn {Scheme Procedure} list->uniform-array ndim prot lst
-@deffnx {Scheme Procedure} list->uniform-vector prot lst
-@deffnx {C Function} scm_list_to_uniform_array (ndim, prot, lst)
-Return a uniform array of the type indicated by prototype
-@var{prot} with elements the same as those of @var{lst}.
-Elements must be of the appropriate type, no coercions are
-done.
-@end deffn
-
-@deffn {Scheme Procedure} uniform-vector-fill! uve fill
-Store @var{fill} in every element of @var{uve}. The value returned is
-unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} uniform-vector-length v
-@deffnx {C Function} scm_uniform_vector_length (v)
-Return the number of elements in @var{uve}.
-@end deffn
-
-@deffn {Scheme Procedure} dimensions->uniform-array dims prot [fill]
-@deffnx {Scheme Procedure} make-uniform-vector length prototype [fill]
-@deffnx {C Function} scm_dimensions_to_uniform_array (dims, prot, fill)
-Create and return a uniform array or vector of type
-corresponding to @var{prototype} with dimensions @var{dims} or
-length @var{length}. If @var{fill} is supplied, it's used to
-fill the array, otherwise @var{prototype} is used.
-@end deffn
-
-@c Another compiled-closure. -twp
-
-@deffn {Scheme Procedure} uniform-array-read! ra [port_or_fd [start [end]]]
-@deffnx {Scheme Procedure} uniform-vector-read! uve [port-or-fdes] [start] [end]
-@deffnx {C Function} scm_uniform_array_read_x (ra, port_or_fd, start, end)
-Attempt to read all elements of @var{ura}, in lexicographic order, as
-binary objects from @var{port-or-fdes}.
-If an end of file is encountered,
-the objects up to that point are put into @var{ura}
-(starting at the beginning) and the remainder of the array is
-unchanged.
-
-The optional arguments @var{start} and @var{end} allow
-a specified region of a vector (or linearized array) to be read,
-leaving the remainder of the vector unchanged.
-
-@code{uniform-array-read!} returns the number of objects read.
-@var{port-or-fdes} may be omitted, in which case it defaults to the value
-returned by @code{(current-input-port)}.
-@end deffn
-
-@deffn {Scheme Procedure} uniform-array-write v [port_or_fd [start [end]]]
-@deffnx {Scheme Procedure} uniform-vector-write uve [port-or-fdes] [start] [end]
-@deffnx {C Function} scm_uniform_array_write (v, port_or_fd, start, end)
-Writes all elements of @var{ura} as binary objects to
-@var{port-or-fdes}.
-
-The optional arguments @var{start}
-and @var{end} allow
-a specified region of a vector (or linearized array) to be written.
-
-The number of objects actually written is returned.
-@var{port-or-fdes} may be
-omitted, in which case it defaults to the value returned by
-@code{(current-output-port)}.
-@end deffn
-
-@node Bit Vectors
-@subsection Bit Vectors
-
-@noindent
-Bit vectors are a specific type of uniform array: an array of booleans
-with a single zero-based index.
-
-@noindent
-They are displayed as a sequence of @code{0}s and
-@code{1}s prefixed by @code{#*}, e.g.,
-
-@example
-(make-uniform-vector 8 #t #f) @result{}
-#*00000000
-
-#b(#t #f #t) @result{}
-#*101
-@end example
-
-@deffn {Scheme Procedure} bit-count b bitvector
-@deffnx {C Function} scm_bit_count (b, bitvector)
-Return the number of occurrences of the boolean @var{b} in
-@var{bitvector}.
-@end deffn
-
-@deffn {Scheme Procedure} bit-position item v k
-@deffnx {C Function} scm_bit_position (item, v, k)
-Return the minimum index of an occurrence of @var{bool} in
-@var{bv} which is at least @var{k}. If no @var{bool} occurs
-within the specified range @code{#f} is returned.
-@end deffn
-
-@deffn {Scheme Procedure} bit-invert! v
-@deffnx {C Function} scm_bit_invert_x (v)
-Modify @var{bv} by replacing each element with its negation.
-@end deffn
-
-@deffn {Scheme Procedure} bit-set*! v kv obj
-@deffnx {C Function} scm_bit_set_star_x (v, kv, obj)
-If uve is a bit-vector @var{bv} and uve must be of the same
-length. If @var{bool} is @code{#t}, uve is OR'ed into
-@var{bv}; If @var{bool} is @code{#f}, the inversion of uve is
-AND'ed into @var{bv}.
-
-If uve is a unsigned long integer vector all the elements of uve
-must be between 0 and the @code{length} of @var{bv}. The bits
-of @var{bv} corresponding to the indexes in uve are set to
-@var{bool}. The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} bit-count* v kv obj
-@deffnx {C Function} scm_bit_count_star (v, kv, obj)
-Return
-@lisp
-(bit-count (bit-set*! (if bool bv (bit-invert! bv)) uve #t) #t).
-@end lisp
-@var{bv} is not modified.
-@end deffn
-
-
-@node Association Lists and Hash Tables
-@section Association Lists and Hash Tables
-
-This chapter discusses dictionary objects: data structures that are
-useful for organizing and indexing large bodies of information.
-
-@menu
-* Dictionary Types:: About dictionary types; what they're good for.
-* Association Lists:: List-based dictionaries.
-* Hash Tables:: Table-based dictionaries.
-@end menu
-
-@node Dictionary Types
-@subsection Dictionary Types
-
-A @dfn{dictionary} object is a data structure used to index
-information in a user-defined way. In standard Scheme, the main
-aggregate data types are lists and vectors. Lists are not really
-indexed at all, and vectors are indexed only by number
-(e.g. @code{(vector-ref foo 5)}). Often you will find it useful
-to index your data on some other type; for example, in a library
-catalog you might want to look up a book by the name of its
-author. Dictionaries are used to help you organize information in
-such a way.
-
-An @dfn{association list} (or @dfn{alist} for short) is a list of
-key-value pairs. Each pair represents a single quantity or
-object; the @code{car} of the pair is a key which is used to
-identify the object, and the @code{cdr} is the object's value.
-
-A @dfn{hash table} also permits you to index objects with
-arbitrary keys, but in a way that makes looking up any one object
-extremely fast. A well-designed hash system makes hash table
-lookups almost as fast as conventional array or vector references.
-
-Alists are popular among Lisp programmers because they use only
-the language's primitive operations (lists, @dfn{car}, @dfn{cdr}
-and the equality primitives). No changes to the language core are
-necessary. Therefore, with Scheme's built-in list manipulation
-facilities, it is very convenient to handle data stored in an
-association list. Also, alists are highly portable and can be
-easily implemented on even the most minimal Lisp systems.
-
-However, alists are inefficient, especially for storing large
-quantities of data. Because we want Guile to be useful for large
-software systems as well as small ones, Guile provides a rich set
-of tools for using either association lists or hash tables.
-
-@node Association Lists
-@subsection Association Lists
-@tpindex Association Lists
-@tpindex Alist
-
-@cindex Association List
-@cindex Alist
-@cindex Database
-
-An association list is a conventional data structure that is often used
-to implement simple key-value databases. It consists of a list of
-entries in which each entry is a pair. The @dfn{key} of each entry is
-the @code{car} of the pair and the @dfn{value} of each entry is the
-@code{cdr}.
-
-@example
-ASSOCIATION LIST ::= '( (KEY1 . VALUE1)
- (KEY2 . VALUE2)
- (KEY3 . VALUE3)
- @dots{}
- )
-@end example
-
-@noindent
-Association lists are also known, for short, as @dfn{alists}.
-
-The structure of an association list is just one example of the infinite
-number of possible structures that can be built using pairs and lists.
-As such, the keys and values in an association list can be manipulated
-using the general list structure procedures @code{cons}, @code{car},
-@code{cdr}, @code{set-car!}, @code{set-cdr!} and so on. However,
-because association lists are so useful, Guile also provides specific
-procedures for manipulating them.
-
-@menu
-* Alist Key Equality::
-* Adding or Setting Alist Entries::
-* Retrieving Alist Entries::
-* Removing Alist Entries::
-* Sloppy Alist Functions::
-* Alist Example::
-@end menu
-
-@node Alist Key Equality
-@subsubsection Alist Key Equality
-
-All of Guile's dedicated association list procedures, apart from
-@code{acons}, come in three flavours, depending on the level of equality
-that is required to decide whether an existing key in the association
-list is the same as the key that the procedure call uses to identify the
-required entry.
-
-@itemize @bullet
-@item
-Procedures with @dfn{assq} in their name use @code{eq?} to determine key
-equality.
-
-@item
-Procedures with @dfn{assv} in their name use @code{eqv?} to determine
-key equality.
-
-@item
-Procedures with @dfn{assoc} in their name use @code{equal?} to
-determine key equality.
-@end itemize
-
-@code{acons} is an exception because it is used to build association
-lists which do not require their entries' keys to be unique.
-
-@node Adding or Setting Alist Entries
-@subsubsection Adding or Setting Alist Entries
-
-@code{acons} adds a new entry to an association list and returns the
-combined association list. The combined alist is formed by consing the
-new entry onto the head of the alist specified in the @code{acons}
-procedure call. So the specified alist is not modified, but its
-contents become shared with the tail of the combined alist that
-@code{acons} returns.
-
-In the most common usage of @code{acons}, a variable holding the
-original association list is updated with the combined alist:
-
-@example
-(set! address-list (acons name address address-list))
-@end example
-
-In such cases, it doesn't matter that the old and new values of
-@code{address-list} share some of their contents, since the old value is
-usually no longer independently accessible.
-
-Note that @code{acons} adds the specified new entry regardless of
-whether the alist may already contain entries with keys that are, in
-some sense, the same as that of the new entry. Thus @code{acons} is
-ideal for building alists where there is no concept of key uniqueness.
-
-@example
-(set! task-list (acons 3 "pay gas bill" '()))
-task-list
-@result{}
-((3 . "pay gas bill"))
-
-(set! task-list (acons 3 "tidy bedroom" task-list))
-task-list
-@result{}
-((3 . "tidy bedroom") (3 . "pay gas bill"))
-@end example
-
-@code{assq-set!}, @code{assv-set!} and @code{assoc-set!} are used to add
-or replace an entry in an association list where there @emph{is} a
-concept of key uniqueness. If the specified association list already
-contains an entry whose key is the same as that specified in the
-procedure call, the existing entry is replaced by the new one.
-Otherwise, the new entry is consed onto the head of the old association
-list to create the combined alist. In all cases, these procedures
-return the combined alist.
-
-@code{assq-set!} and friends @emph{may} destructively modify the
-structure of the old association list in such a way that an existing
-variable is correctly updated without having to @code{set!} it to the
-value returned:
-
-@example
-address-list
-@result{}
-(("mary" . "34 Elm Road") ("james" . "16 Bow Street"))
-
-(assoc-set! address-list "james" "1a London Road")
-@result{}
-(("mary" . "34 Elm Road") ("james" . "1a London Road"))
-
-address-list
-@result{}
-(("mary" . "34 Elm Road") ("james" . "1a London Road"))
-@end example
-
-Or they may not:
-
-@example
-(assoc-set! address-list "bob" "11 Newington Avenue")
-@result{}
-(("bob" . "11 Newington Avenue") ("mary" . "34 Elm Road")
- ("james" . "1a London Road"))
-
-address-list
-@result{}
-(("mary" . "34 Elm Road") ("james" . "1a London Road"))
-@end example
-
-The only safe way to update an association list variable when adding or
-replacing an entry like this is to @code{set!} the variable to the
-returned value:
-
-@example
-(set! address-list
- (assoc-set! address-list "bob" "11 Newington Avenue"))
-address-list
-@result{}
-(("bob" . "11 Newington Avenue") ("mary" . "34 Elm Road")
- ("james" . "1a London Road"))
-@end example
-
-Because of this slight inconvenience, you may find it more convenient to
-use hash tables to store dictionary data. If your application will not
-be modifying the contents of an alist very often, this may not make much
-difference to you.
-
-If you need to keep the old value of an association list in a form
-independent from the list that results from modification by
-@code{acons}, @code{assq-set!}, @code{assv-set!} or @code{assoc-set!},
-use @code{list-copy} to copy the old association list before modifying
-it.
-
-@deffn {Scheme Procedure} acons key value alist
-@deffnx {C Function} scm_acons (key, value, alist)
-Add a new key-value pair to @var{alist}. A new pair is
-created whose car is @var{key} and whose cdr is @var{value}, and the
-pair is consed onto @var{alist}, and the new list is returned. This
-function is @emph{not} destructive; @var{alist} is not modified.
-@end deffn
-
-@deffn {Scheme Procedure} assq-set! alist key val
-@deffnx {Scheme Procedure} assv-set! alist key value
-@deffnx {Scheme Procedure} assoc-set! alist key value
-@deffnx {C Function} scm_assq_set_x (alist, key, val)
-@deffnx {C Function} scm_assv_set_x (alist, key, val)
-@deffnx {C Function} scm_assoc_set_x (alist, key, val)
-Reassociate @var{key} in @var{alist} with @var{value}: find any existing
-@var{alist} entry for @var{key} and associate it with the new
-@var{value}. If @var{alist} does not contain an entry for @var{key},
-add a new one. Return the (possibly new) alist.
-
-These functions do not attempt to verify the structure of @var{alist},
-and so may cause unusual results if passed an object that is not an
-association list.
-@end deffn
-
-@node Retrieving Alist Entries
-@subsubsection Retrieving Alist Entries
-@rnindex assq
-@rnindex assv
-@rnindex assoc
-
-@code{assq}, @code{assv} and @code{assoc} take an alist and a key as
-arguments and return the entry for that key if an entry exists, or
-@code{#f} if there is no entry for that key. Note that, in the cases
-where an entry exists, these procedures return the complete entry, that
-is @code{(KEY . VALUE)}, not just the value.
-
-@deffn {Scheme Procedure} assq key alist
-@deffnx {Scheme Procedure} assv key alist
-@deffnx {Scheme Procedure} assoc key alist
-@deffnx {C Function} scm_assq (key, alist)
-@deffnx {C Function} scm_assv (key, alist)
-@deffnx {C Function} scm_assoc (key, alist)
-Fetch the entry in @var{alist} that is associated with @var{key}. To
-decide whether the argument @var{key} matches a particular entry in
-@var{alist}, @code{assq} compares keys with @code{eq?}, @code{assv}
-uses @code{eqv?} and @code{assoc} uses @code{equal?}. If @var{key}
-cannot be found in @var{alist} (according to whichever equality
-predicate is in use), then return @code{#f}. These functions
-return the entire alist entry found (i.e. both the key and the value).
-@end deffn
-
-@code{assq-ref}, @code{assv-ref} and @code{assoc-ref}, on the other
-hand, take an alist and a key and return @emph{just the value} for that
-key, if an entry exists. If there is no entry for the specified key,
-these procedures return @code{#f}.
-
-This creates an ambiguity: if the return value is @code{#f}, it means
-either that there is no entry with the specified key, or that there
-@emph{is} an entry for the specified key, with value @code{#f}.
-Consequently, @code{assq-ref} and friends should only be used where it
-is known that an entry exists, or where the ambiguity doesn't matter
-for some other reason.
-
-@deffn {Scheme Procedure} assq-ref alist key
-@deffnx {Scheme Procedure} assv-ref alist key
-@deffnx {Scheme Procedure} assoc-ref alist key
-@deffnx {C Function} scm_assq_ref (alist, key)
-@deffnx {C Function} scm_assv_ref (alist, key)
-@deffnx {C Function} scm_assoc_ref (alist, key)
-Like @code{assq}, @code{assv} and @code{assoc}, except that only the
-value associated with @var{key} in @var{alist} is returned. These
-functions are equivalent to
-
-@lisp
-(let ((ent (@var{associator} @var{key} @var{alist})))
- (and ent (cdr ent)))
-@end lisp
-
-where @var{associator} is one of @code{assq}, @code{assv} or @code{assoc}.
-@end deffn
-
-@node Removing Alist Entries
-@subsubsection Removing Alist Entries
-
-To remove the element from an association list whose key matches a
-specified key, use @code{assq-remove!}, @code{assv-remove!} or
-@code{assoc-remove!} (depending, as usual, on the level of equality
-required between the key that you specify and the keys in the
-association list).
-
-As with @code{assq-set!} and friends, the specified alist may or may not
-be modified destructively, and the only safe way to update a variable
-containing the alist is to @code{set!} it to the value that
-@code{assq-remove!} and friends return.
-
-@example
-address-list
-@result{}
-(("bob" . "11 Newington Avenue") ("mary" . "34 Elm Road")
- ("james" . "1a London Road"))
-
-(set! address-list (assoc-remove! address-list "mary"))
-address-list
-@result{}
-(("bob" . "11 Newington Avenue") ("james" . "1a London Road"))
-@end example
-
-Note that, when @code{assq/v/oc-remove!} is used to modify an
-association list that has been constructed only using the corresponding
-@code{assq/v/oc-set!}, there can be at most one matching entry in the
-alist, so the question of multiple entries being removed in one go does
-not arise. If @code{assq/v/oc-remove!} is applied to an association
-list that has been constructed using @code{acons}, or an
-@code{assq/v/oc-set!} with a different level of equality, or any mixture
-of these, it removes only the first matching entry from the alist, even
-if the alist might contain further matching entries. For example:
-
-@example
-(define address-list '())
-(set! address-list (assq-set! address-list "mary" "11 Elm Street"))
-(set! address-list (assq-set! address-list "mary" "57 Pine Drive"))
-address-list
-@result{}
-(("mary" . "57 Pine Drive") ("mary" . "11 Elm Street"))
-
-(set! address-list (assoc-remove! address-list "mary"))
-address-list
-@result{}
-(("mary" . "11 Elm Street"))
-@end example
-
-In this example, the two instances of the string "mary" are not the same
-when compared using @code{eq?}, so the two @code{assq-set!} calls add
-two distinct entries to @code{address-list}. When compared using
-@code{equal?}, both "mary"s in @code{address-list} are the same as the
-"mary" in the @code{assoc-remove!} call, but @code{assoc-remove!} stops
-after removing the first matching entry that it finds, and so one of the
-"mary" entries is left in place.
-
-@deffn {Scheme Procedure} assq-remove! alist key
-@deffnx {Scheme Procedure} assv-remove! alist key
-@deffnx {Scheme Procedure} assoc-remove! alist key
-@deffnx {C Function} scm_assq_remove_x (alist, key)
-@deffnx {C Function} scm_assv_remove_x (alist, key)
-@deffnx {C Function} scm_assoc_remove_x (alist, key)
-Delete the first entry in @var{alist} associated with @var{key}, and return
-the resulting alist.
-@end deffn
-
-@node Sloppy Alist Functions
-@subsubsection Sloppy Alist Functions
-
-@code{sloppy-assq}, @code{sloppy-assv} and @code{sloppy-assoc} behave
-like the corresponding non-@code{sloppy-} procedures, except that they
-return @code{#f} when the specified association list is not well-formed,
-where the non-@code{sloppy-} versions would signal an error.
-
-Specifically, there are two conditions for which the non-@code{sloppy-}
-procedures signal an error, which the @code{sloppy-} procedures handle
-instead by returning @code{#f}. Firstly, if the specified alist as a
-whole is not a proper list:
-
-@example
-(assoc "mary" '((1 . 2) ("key" . "door") . "open sesame"))
-@result{}
-ERROR: In procedure assoc in expression (assoc "mary" (quote #)):
-ERROR: Wrong type argument in position 2 (expecting NULLP): "open sesame"
-ABORT: (wrong-type-arg)
-
-(sloppy-assoc "mary" '((1 . 2) ("key" . "door") . "open sesame"))
-@result{}
-#f
-@end example
-
-@noindent
-Secondly, if one of the entries in the specified alist is not a pair:
-
-@example
-(assoc 2 '((1 . 1) 2 (3 . 9)))
-@result{}
-ERROR: In procedure assoc in expression (assoc 2 (quote #)):
-ERROR: Wrong type argument in position 2 (expecting CONSP): 2
-ABORT: (wrong-type-arg)
-
-(sloppy-assoc 2 '((1 . 1) 2 (3 . 9)))
-@result{}
-#f
-@end example
-
-Unless you are explicitly working with badly formed association lists,
-it is much safer to use the non-@code{sloppy-} procedures, because they
-help to highlight coding and data errors that the @code{sloppy-}
-versions would silently cover up.
-
-@deffn {Scheme Procedure} sloppy-assq key alist
-@deffnx {C Function} scm_sloppy_assq (key, alist)
-Behaves like @code{assq} but does not do any error checking.
-Recommended only for use in Guile internals.
-@end deffn
-
-@deffn {Scheme Procedure} sloppy-assv key alist
-@deffnx {C Function} scm_sloppy_assv (key, alist)
-Behaves like @code{assv} but does not do any error checking.
-Recommended only for use in Guile internals.
-@end deffn
-
-@deffn {Scheme Procedure} sloppy-assoc key alist
-@deffnx {C Function} scm_sloppy_assoc (key, alist)
-Behaves like @code{assoc} but does not do any error checking.
-Recommended only for use in Guile internals.
-@end deffn
-
-@node Alist Example
-@subsubsection Alist Example
-
-Here is a longer example of how alists may be used in practice.
-
-@lisp
-(define capitals '(("New York" . "Albany")
- ("Oregon" . "Salem")
- ("Florida" . "Miami")))
-
-;; What's the capital of Oregon?
-(assoc "Oregon" capitals) @result{} ("Oregon" . "Salem")
-(assoc-ref capitals "Oregon") @result{} "Salem"
-
-;; We left out South Dakota.
-(set! capitals
- (assoc-set! capitals "South Dakota" "Pierre"))
-capitals
-@result{} (("South Dakota" . "Pierre")
- ("New York" . "Albany")
- ("Oregon" . "Salem")
- ("Florida" . "Miami"))
-
-;; And we got Florida wrong.
-(set! capitals
- (assoc-set! capitals "Florida" "Tallahassee"))
-capitals
-@result{} (("South Dakota" . "Pierre")
- ("New York" . "Albany")
- ("Oregon" . "Salem")
- ("Florida" . "Tallahassee"))
-
-;; After Oregon secedes, we can remove it.
-(set! capitals
- (assoc-remove! capitals "Oregon"))
-capitals
-@result{} (("South Dakota" . "Pierre")
- ("New York" . "Albany")
- ("Florida" . "Tallahassee"))
-@end lisp
-
-@node Hash Tables
-@subsection Hash Tables
-@tpindex Hash Tables
-
-@c FIXME::martin: Review me!
-
-Hash tables are dictionaries which offer similar functionality as
-association lists: They provide a mapping from keys to values. The
-difference is that association lists need time linear in the size of
-elements when searching for entries, whereas hash tables can normally
-search in constant time. The drawback is that hash tables require a
-little bit more memory, and that you can not use the normal list
-procedures (@pxref{Lists}) for working with them.
-
-@menu
-* Hash Table Examples:: Demonstration of hash table usage.
-* Hash Table Reference:: Hash table procedure descriptions.
-@end menu
-
-
-@node Hash Table Examples
-@subsubsection Hash Table Examples
-
-@c FIXME::martin: Review me!
-
-For demonstration purposes, this section gives a few usage examples of
-some hash table procedures, together with some explanation what they do.
-
-First we start by creating a new hash table with 31 slots, and
-populate it with two key/value pairs.
-
-@lisp
-(define h (make-hash-table 31))
-
-(hashq-create-handle! h 'foo "bar")
-@result{}
-(foo . "bar")
-
-(hashq-create-handle! h 'braz "zonk")
-@result{}
-(braz . "zonk")
-
-(hashq-create-handle! h 'frob #f)
-@result{}
-(frob . #f)
-@end lisp
-
-You can get the value for a given key with the procedure
-@code{hashq-ref}, but the problem with this procedure is that you
-cannot reliably determine whether a key does exists in the table. The
-reason is that the procedure returns @code{#f} if the key is not in
-the table, but it will return the same value if the key is in the
-table and just happens to have the value @code{#f}, as you can see in
-the following examples.
-
-@lisp
-(hashq-ref h 'foo)
-@result{}
-"bar"
-
-(hashq-ref h 'frob)
-@result{}
-#f
-
-(hashq-ref h 'not-there)
-@result{}
-#f
-@end lisp
-
-Better is to use the procedure @code{hashq-get-handle}, which makes a
-distinction between the two cases. Just like @code{assq}, this
-procedure returns a key/value-pair on success, and @code{#f} if the
-key is not found.
-
-@lisp
-(hashq-get-handle h 'foo)
-@result{}
-(foo . "bar")
-
-(hashq-get-handle h 'not-there)
-@result{}
-#f
-@end lisp
-
-There is no procedure for calculating the number of key/value-pairs in
-a hash table, but @code{hash-fold} can be used for doing exactly that.
-
-@lisp
-(hash-fold (lambda (key value seed) (+ 1 seed)) 0 h)
-@result{}
-3
-@end lisp
-
-@node Hash Table Reference
-@subsubsection Hash Table Reference
-
-Like the association list functions, the hash table functions come
-in several varieties: @code{hashq}, @code{hashv}, and @code{hash}.
-The @code{hashq} functions use @code{eq?} to determine whether two
-keys match. The @code{hashv} functions use @code{eqv?}, and the
-@code{hash} functions use @code{equal?}.
-
-In each of the functions that follow, the @var{table} argument
-must be a vector. The @var{key} and @var{value} arguments may be
-any Scheme object.
-
-@deffn {Scheme Procedure} make-hash-table size
-Create a new hash table of @var{size} slots. Note that the number of
-slots does not limit the size of the table, it just tells how large
-the underlying vector will be. The @var{size} should be similar to
-the expected number of elements which will be added to the table, but
-they need not match. For good performance, it might be a good idea to
-use a prime number as the @var{size}.
-@end deffn
-
-@deffn {Scheme Procedure} hashq-ref table key [dflt]
-@deffnx {C Function} scm_hashq_ref (table, key, dflt)
-Look up @var{key} in the hash table @var{table}, and return the
-value (if any) associated with it. If @var{key} is not found,
-return @var{default} (or @code{#f} if no @var{default} argument
-is supplied). Uses @code{eq?} for equality testing.
-@end deffn
-
-@deffn {Scheme Procedure} hashv-ref table key [dflt]
-@deffnx {C Function} scm_hashv_ref (table, key, dflt)
-Look up @var{key} in the hash table @var{table}, and return the
-value (if any) associated with it. If @var{key} is not found,
-return @var{default} (or @code{#f} if no @var{default} argument
-is supplied). Uses @code{eqv?} for equality testing.
-@end deffn
-
-@deffn {Scheme Procedure} hash-ref table key [dflt]
-@deffnx {C Function} scm_hash_ref (table, key, dflt)
-Look up @var{key} in the hash table @var{table}, and return the
-value (if any) associated with it. If @var{key} is not found,
-return @var{default} (or @code{#f} if no @var{default} argument
-is supplied). Uses @code{equal?} for equality testing.
-@end deffn
-
-@deffn {Scheme Procedure} hashq-set! table key val
-@deffnx {C Function} scm_hashq_set_x (table, key, val)
-Find the entry in @var{table} associated with @var{key}, and
-store @var{value} there. Uses @code{eq?} for equality testing.
-@end deffn
-
-@deffn {Scheme Procedure} hashv-set! table key val
-@deffnx {C Function} scm_hashv_set_x (table, key, val)
-Find the entry in @var{table} associated with @var{key}, and
-store @var{value} there. Uses @code{eqv?} for equality testing.
-@end deffn
-
-@deffn {Scheme Procedure} hash-set! table key val
-@deffnx {C Function} scm_hash_set_x (table, key, val)
-Find the entry in @var{table} associated with @var{key}, and
-store @var{value} there. Uses @code{equal?} for equality
-testing.
-@end deffn
-
-@deffn {Scheme Procedure} hashq-remove! table key
-@deffnx {C Function} scm_hashq_remove_x (table, key)
-Remove @var{key} (and any value associated with it) from
-@var{table}. Uses @code{eq?} for equality tests.
-@end deffn
-
-@deffn {Scheme Procedure} hashv-remove! table key
-@deffnx {C Function} scm_hashv_remove_x (table, key)
-Remove @var{key} (and any value associated with it) from
-@var{table}. Uses @code{eqv?} for equality tests.
-@end deffn
-
-@deffn {Scheme Procedure} hash-remove! table key
-@deffnx {C Function} scm_hash_remove_x (table, key)
-Remove @var{key} (and any value associated with it) from
-@var{table}. Uses @code{equal?} for equality tests.
-@end deffn
-
-The standard hash table functions may be too limited for some
-applications. For example, you may want a hash table to store
-strings in a case-insensitive manner, so that references to keys
-named ``foobar'', ``FOOBAR'' and ``FooBaR'' will all yield the
-same item. Guile provides you with @dfn{extended} hash tables
-that permit you to specify a hash function and associator function
-of your choosing. The functions described in the rest of this section
-can be used to implement such custom hash table structures.
-
-If you are unfamiliar with the inner workings of hash tables, then
-this facility will probably be a little too abstract for you to
-use comfortably. If you are interested in learning more, see an
-introductory textbook on data structures or algorithms for an
-explanation of how hash tables are implemented.
-
-@deffn {Scheme Procedure} hashq key size
-@deffnx {C Function} scm_hashq (key, size)
-Determine a hash value for @var{key} that is suitable for
-lookups in a hash table of size @var{size}, where @code{eq?} is
-used as the equality predicate. The function returns an
-integer in the range 0 to @var{size} - 1. Note that
-@code{hashq} may use internal addresses. Thus two calls to
-hashq where the keys are @code{eq?} are not guaranteed to
-deliver the same value if the key object gets garbage collected
-in between. This can happen, for example with symbols:
-@code{(hashq 'foo n) (gc) (hashq 'foo n)} may produce two
-different values, since @code{foo} will be garbage collected.
-@end deffn
-
-@deffn {Scheme Procedure} hashv key size
-@deffnx {C Function} scm_hashv (key, size)
-Determine a hash value for @var{key} that is suitable for
-lookups in a hash table of size @var{size}, where @code{eqv?} is
-used as the equality predicate. The function returns an
-integer in the range 0 to @var{size} - 1. Note that
-@code{(hashv key)} may use internal addresses. Thus two calls
-to hashv where the keys are @code{eqv?} are not guaranteed to
-deliver the same value if the key object gets garbage collected
-in between. This can happen, for example with symbols:
-@code{(hashv 'foo n) (gc) (hashv 'foo n)} may produce two
-different values, since @code{foo} will be garbage collected.
-@end deffn
-
-@deffn {Scheme Procedure} hash key size
-@deffnx {C Function} scm_hash (key, size)
-Determine a hash value for @var{key} that is suitable for
-lookups in a hash table of size @var{size}, where @code{equal?}
-is used as the equality predicate. The function returns an
-integer in the range 0 to @var{size} - 1.
-@end deffn
-
-@deffn {Scheme Procedure} hashx-ref hash assoc table key [dflt]
-@deffnx {C Function} scm_hashx_ref (hash, assoc, table, key, dflt)
-This behaves the same way as the corresponding @code{ref}
-function, but uses @var{hash} as a hash function and
-@var{assoc} to compare keys. @code{hash} must be a function
-that takes two arguments, a key to be hashed and a table size.
-@code{assoc} must be an associator function, like @code{assoc},
-@code{assq} or @code{assv}.
-
-By way of illustration, @code{hashq-ref table key} is
-equivalent to @code{hashx-ref hashq assq table key}.
-@end deffn
-
-@deffn {Scheme Procedure} hashx-set! hash assoc table key val
-@deffnx {C Function} scm_hashx_set_x (hash, assoc, table, key, val)
-This behaves the same way as the corresponding @code{set!}
-function, but uses @var{hash} as a hash function and
-@var{assoc} to compare keys. @code{hash} must be a function
-that takes two arguments, a key to be hashed and a table size.
-@code{assoc} must be an associator function, like @code{assoc},
-@code{assq} or @code{assv}.
-
- By way of illustration, @code{hashq-set! table key} is
-equivalent to @code{hashx-set! hashq assq table key}.
-@end deffn
-
-@deffn {Scheme Procedure} hashq-get-handle table key
-@deffnx {C Function} scm_hashq_get_handle (table, key)
-This procedure returns the @code{(key . value)} pair from the
-hash table @var{table}. If @var{table} does not hold an
-associated value for @var{key}, @code{#f} is returned.
-Uses @code{eq?} for equality testing.
-@end deffn
-
-@deffn {Scheme Procedure} hashv-get-handle table key
-@deffnx {C Function} scm_hashv_get_handle (table, key)
-This procedure returns the @code{(key . value)} pair from the
-hash table @var{table}. If @var{table} does not hold an
-associated value for @var{key}, @code{#f} is returned.
-Uses @code{eqv?} for equality testing.
-@end deffn
-
-@deffn {Scheme Procedure} hash-get-handle table key
-@deffnx {C Function} scm_hash_get_handle (table, key)
-This procedure returns the @code{(key . value)} pair from the
-hash table @var{table}. If @var{table} does not hold an
-associated value for @var{key}, @code{#f} is returned.
-Uses @code{equal?} for equality testing.
-@end deffn
-
-@deffn {Scheme Procedure} hashx-get-handle hash assoc table key
-@deffnx {C Function} scm_hashx_get_handle (hash, assoc, table, key)
-This behaves the same way as the corresponding
-@code{-get-handle} function, but uses @var{hash} as a hash
-function and @var{assoc} to compare keys. @code{hash} must be
-a function that takes two arguments, a key to be hashed and a
-table size. @code{assoc} must be an associator function, like
-@code{assoc}, @code{assq} or @code{assv}.
-@end deffn
-
-@deffn {Scheme Procedure} hashq-create-handle! table key init
-@deffnx {C Function} scm_hashq_create_handle_x (table, key, init)
-This function looks up @var{key} in @var{table} and returns its handle.
-If @var{key} is not already present, a new handle is created which
-associates @var{key} with @var{init}.
-@end deffn
-
-@deffn {Scheme Procedure} hashv-create-handle! table key init
-@deffnx {C Function} scm_hashv_create_handle_x (table, key, init)
-This function looks up @var{key} in @var{table} and returns its handle.
-If @var{key} is not already present, a new handle is created which
-associates @var{key} with @var{init}.
-@end deffn
-
-@deffn {Scheme Procedure} hash-create-handle! table key init
-@deffnx {C Function} scm_hash_create_handle_x (table, key, init)
-This function looks up @var{key} in @var{table} and returns its handle.
-If @var{key} is not already present, a new handle is created which
-associates @var{key} with @var{init}.
-@end deffn
-
-@deffn {Scheme Procedure} hashx-create-handle! hash assoc table key init
-@deffnx {C Function} scm_hashx_create_handle_x (hash, assoc, table, key, init)
-This behaves the same way as the corresponding
-@code{-create-handle} function, but uses @var{hash} as a hash
-function and @var{assoc} to compare keys. @code{hash} must be
-a function that takes two arguments, a key to be hashed and a
-table size. @code{assoc} must be an associator function, like
-@code{assoc}, @code{assq} or @code{assv}.
-@end deffn
-
-@deffn {Scheme Procedure} hash-fold proc init table
-@deffnx {C Function} scm_hash_fold (proc, init, table)
-An iterator over hash-table elements.
-Accumulates and returns a result by applying PROC successively.
-The arguments to PROC are "(key value prior-result)" where key
-and value are successive pairs from the hash table TABLE, and
-prior-result is either INIT (for the first application of PROC)
-or the return value of the previous application of PROC.
-For example, @code{(hash-fold acons '() tab)} will convert a hash
-table into an a-list of key-value pairs.
-@end deffn
-
-
-@c Local Variables:
-@c TeX-master: "guile.texi"
-@c End:
diff --git a/doc/ref/scheme-control.texi b/doc/ref/scheme-control.texi
deleted file mode 100644
index 184ccae9d..000000000
--- a/doc/ref/scheme-control.texi
+++ /dev/null
@@ -1,979 +0,0 @@
-@page
-@node Control Mechanisms
-@chapter Controlling the Flow of Program Execution
-
-@menu
-* begin:: Evaluating a sequence of expressions.
-* if cond case:: Simple conditional evaluation.
-* and or:: Conditional evaluation of a sequence.
-* while do:: Iteration mechanisms.
-* Continuations:: Continuations.
-* Multiple Values:: Returning and accepting multiple values.
-* Exceptions:: Throwing and catching exceptions.
-* Error Reporting:: Procedures for signaling errors.
-* Dynamic Wind:: Guarding against non-local entrance/exit.
-* Handling Errors:: How to handle errors in C code.
-@end menu
-
-
-@node begin
-@section Evaluating a Sequence of Expressions
-
-@c FIXME::martin: Review me!
-
-@c FIXME::martin: Maybe add examples?
-
-@cindex begin
-@cindex sequencing
-@cindex expression sequencing
-
-@code{begin} is used for grouping several expression together so that
-they syntactically are treated as if they were one expression. This is
-particularly important when syntactic expressions are used which only
-allow one expression, but the programmer wants to use more than one
-expression in that place. As an example, consider the conditional
-expression below:
-
-@lisp
-(if (> x 0)
- (begin (display "greater") (newline)))
-@end lisp
-
-If the two calls to @code{display} and @code{newline} were not embedded
-in a @code{begin}-statement, the call to @code{newline} would get
-misinterpreted as the else-branch of the @code{if}-expression.
-
-@deffn syntax begin expr1 expr2 @dots{}
-The expression(s) are evaluated in left-to-right order and the value
-of the last expression is returned as the value of the
-@code{begin}-expression. This expression type is used when the
-expressions before the last one are evaluated for their side effects.
-@end deffn
-
-@node if cond case
-@section Simple Conditional Evaluation
-
-@c FIXME::martin: Review me!
-
-@c FIXME::martin: Maybe add examples?
-
-@cindex conditional evaluation
-@cindex if
-@cindex case
-@cindex cond
-
-Guile provides three syntactic constructs for conditional evaluation.
-@code{if} is the normal if-then-else expression (with an optional else
-branch), @code{cond} is a conditional expression with multiple branches
-and @code{case} branches if an expression has one of a set of constant
-values.
-
-@deffn syntax if test consequent [alternate]
-All arguments may be arbitrary expressions. First, @var{test} is
-evaluated. If it returns a true value, the expression @var{consequent}
-is evaluated and @var{alternate} is ignored. If @var{test} evaluates to
-@code{#f}, @var{alternate} is evaluated instead. The value of the
-evaluated branch (@var{consequent} or @var{alternate}) is returned as
-the value of the @code{if} expression.
-
-When @var{alternate} is omitted and the @var{test} evaluates to
-@code{#f}, the value of the expression is not specified.
-@end deffn
-
-@deffn syntax cond clause1 clause2 @dots{}
-Each @code{cond}-clause must look like this:
-
-@lisp
-(@var{test} @var{expression} @dots{})
-@end lisp
-
-where @var{test} and @var{expression} are arbitrary expression, or like
-this
-
-@lisp
-(@var{test} => @var{expression}
-@end lisp
-
-where @var{expression} must evaluate to a procedure.
-
-The @var{test}s of the clauses are evaluated in order and as soon as one
-of them evaluates to a true values, the corresponding @var{expression}s
-are evaluated in order and the last value is returned as the value of
-the @code{cond}-expression. For the @code{=>} clause type,
-@var{expression} is evaluated and the resulting procedure is applied to
-the value of @var{test}. The result of this procedure application is
-then the result of the @code{cond}-expression.
-
-The @var{test} of the last @var{clause} may be the keyword @code{else}.
-Then, if none of the preceding @var{test}s is true, the @var{expression}s following the @code{else} are evaluated to produce the result of the @code{cond}-expression.
-@end deffn
-
-@deffn syntax case key clause1 clause2 @dots{}
-@var{key} may be any expression, the @var{clause}s must have the form
-
-@lisp
-((@var{datum1} @dots{}) @var{expr1} @var{expr2} @dots{})
-@end lisp
-
-and the last @var{clause} may have the form
-
-@lisp
-(else @var{expr1} @var{expr2} @dots{})
-@end lisp
-
-All @var{datum}s must be distinct. First, @var{key} is evaluated. The
-the result of this evaluation is compared against all @var{datum}s using
-@code{eqv?}. When this comparison succeeds, the expression(s) following
-the @var{datum} are evaluated from left to right, returning the value of
-the last expression as the result of the @code{case} expression.
-
-If the @var{key} matches no @var{datum} and there is an
-@code{else}-clause, the expressions following the @code{else} are
-evaluated. If there is no such clause, the result of the expression is
-unspecified.
-@end deffn
-
-
-@node and or
-@section Conditional Evaluation of a Sequence of Expressions
-
-@c FIXME::martin: Review me!
-
-@c FIXME::martin: Maybe add examples?
-
-@code{and} and @code{or} evaluate all their arguments, similar to
-@code{begin}, but evaluation stops as soon as one of the expressions
-evaluates to false or true, respectively.
-
-@deffn syntax and expr @dots{}
-Evaluate the @var{expr}s from left to right and stop evaluation as soon
-as one expression evaluates to @code{#f}; the remaining expressions are
-not evaluated. The value of the last evaluated expression is returned.
-If no expression evaluates to @code{#f}, the value of the last
-expression is returned.
-
-If used without expressions, @code{#t} is returned.
-@end deffn
-
-@deffn syntax or expr @dots{}
-Evaluate the @var{expr}s from left to right and stop evaluation as soon
-as one expression evaluates to a true value (that is, a value different
-from @code{#f}); the remaining expressions are not evaluated. The value
-of the last evaluated expression is returned. If all expressions
-evaluate to @code{#f}, @code{#f} is returned.
-
-If used without expressions, @code{#f} is returned.
-@end deffn
-
-
-@node while do
-@section Iteration mechanisms
-
-@c FIXME::martin: Review me!
-
-@c FIXME::martin: Maybe add examples?
-
-@cindex iteration
-@cindex looping
-@cindex named let
-
-Scheme has only few iteration mechanisms, mainly because iteration in
-Scheme programs is normally expressed using recursion. Nevertheless,
-R5RS defines a construct for programming loops, calling @code{do}. In
-addition, Guile has an explicit looping syntax called @code{while}.
-
-@deffn syntax do ((variable1 init1 step1) @dots{}) (test expr @dots{}) command @dots{}
-The @var{init} expressions are evaluated and the @var{variables} are
-bound to their values. Then looping starts with testing the @var{test}
-expression. If @var{test} evaluates to a true value, the @var{expr}
-following the @var{test} are evaluated and the value of the last
-@var{expr} is returned as the value of the @code{do} expression. If
-@var{test} evaluates to false, the @var{command}s are evaluated in
-order, the @var{step}s are evaluated and stored into the @var{variables}
-and the next iteration starts.
-
-Any of the @var{step} expressions may be omitted, so that the
-corresponding variable is not changed during looping.
-@end deffn
-
-@deffn syntax while cond body @dots{}
-Evaluate all expressions in @var{body} in order, as long as @var{cond}
-evaluates to a true value. The @var{cond} expression is tested before
-every iteration, so that the body is not evaluated at all if @var{cond}
-is @code{#f} right from the start.
-@end deffn
-
-@cindex named let
-Another very common way of expressing iteration in Scheme programs is
-the use of the so-called @dfn{named let}.
-
-Named let is a variant of @code{let} which creates a procedure and calls
-it in one step. Because of the newly created procedure, named let is
-more powerful than @code{do}--it can be used for iteration, but also
-for arbitrary recursion.
-
-@deffn syntax let variable bindings body
-For the definition of @var{bindings} see the documentation about
-@code{let} (@pxref{Local Bindings}).
-
-Named @code{let} works as follows:
-
-@itemize @bullet
-@item
-A new procedure which accepts as many arguments as are in @var{bindings}
-is created and bound locally (using @code{let}) to @var{variable}. The
-new procedure's formal argument names are the name of the
-@var{variables}.
-
-@item
-The @var{body} expressions are inserted into the newly created procedure.
-
-@item
-The procedure is called with the @var{init} expressions as the formal
-arguments.
-@end itemize
-
-The next example implements a loop which iterates (by recursion) 1000
-times.
-
-@lisp
-(let lp ((x 1000))
- (if (positive? x)
- (lp (- x 1))
- x))
-@result{}
-0
-@end lisp
-@end deffn
-
-
-@node Continuations
-@section Continuations
-
-@cindex call/cc
-@cindex call-with-current-continuation
-The ability to explicitly capture continuations using
-@code{call-with-current-continuation} (also often called @code{call/cc}
-for short), and to invoke such continuations later any number of times,
-and from any other point in a program, provides maybe the most powerful
-control structure known. All other control structures, such as loops
-and coroutines, can be emulated using continuations.
-
-@c NJFIXME - need a little something here about what continuations are
-@c and what they do for you.
-
-The implementation of continuations in Guile is not as efficient as one
-might hope, because it is constrained by the fact that Guile is designed
-to cooperate with programs written in other languages, such as C, which
-do not know about continuations. So continuations should be used when
-there is no other simple way of achieving the desired behaviour, or
-where the advantages of the elegant continuation mechanism outweigh the
-need for optimum performance. If you find yourself using @code{call/cc}
-for escape procedures and your program is running too slow, you might
-want to use exceptions (@pxref{Exceptions}) instead.
-
-@rnindex call-with-current-continuation
-@deffn {Scheme Procedure} call-with-current-continuation proc
-Capture the current continuation and call @var{proc} with the captured
-continuation as the single argument. This continuation can then be
-called with arbitrarily many arguments. Such a call will work like a
-goto to the invocation location of
-@code{call-with-current-continuation}, passing the arguments in a way
-that they are returned by the call to
-@code{call-with-current-continuation}. Since it is legal to store the
-captured continuation in a variable or to pass it to other procedures,
-it is possible that a procedure returns more than once, even if it is
-called only one time. This can be confusing at times.
-@end deffn
-
-@c FIXME::martin: Better example needed.
-@lisp
-(define kont #f)
-(call-with-current-continuation
- (lambda (k)
- (set! kont k)
- 1))
-@result{}
-1
-
-(kont 2)
-@result{}
-2
-@end lisp
-
-
-@node Multiple Values
-@section Returning and Accepting Multiple Values
-
-@c FIXME::martin: Review me!
-@cindex multiple values
-@cindex receive
-
-Scheme allows a procedure to return more than one value to its caller.
-This is quite different to other languages which only allow
-single-value returns. Returning multiple values is different from
-returning a list (or pair or vector) of values to the caller, because
-conceptually not @emph{one} compound object is returned, but several
-distinct values.
-
-The primitive procedures for handling multiple values are @code{values}
-and @code{call-with-values}. @code{values} is used for returning
-multiple values from a procedure. This is done by placing a call to
-@code{values} with zero or more arguments in tail position in a
-procedure body. @code{call-with-values} combines a procedure returning
-multiple values with a procedure which accepts these values as
-parameters.
-
-@rnindex values
-@deffn {Scheme Procedure} values . args
-@deffnx {C Function} scm_values (args)
-Delivers all of its arguments to its continuation. Except for
-continuations created by the @code{call-with-values} procedure,
-all continuations take exactly one value. The effect of
-passing no value or more than one value to continuations that
-were not created by @code{call-with-values} is unspecified.
-@end deffn
-
-@rnindex call-with-values
-@deffn {Scheme Procedure} call-with-values producer consumer
-Calls its @var{producer} argument with no values and a
-continuation that, when passed some values, calls the
-@var{consumer} procedure with those values as arguments. The
-continuation for the call to @var{consumer} is the continuation
-of the call to @code{call-with-values}.
-
-@example
-(call-with-values (lambda () (values 4 5))
- (lambda (a b) b))
- ==> 5
-
-@end example
-@example
-(call-with-values * -) ==> -1
-@end example
-@end deffn
-
-In addition to the fundamental procedures described above, Guile has a
-module which exports a syntax called @code{receive}, which is much more
-convenient. If you want to use it in your programs, you have to load
-the module @code{(ice-9 receive)} with the statement
-
-@lisp
-(use-modules (ice-9 receive))
-@end lisp
-
-@deffn {library syntax} receive formals expr body @dots{}
-Evaluate the expression @var{expr}, and bind the result values (zero or
-more) to the formal arguments in the formal argument list @var{formals}.
-@var{formals} must have the same syntax like the formal argument list
-used in @code{lambda} (@pxref{Lambda}). After binding the variables,
-the expressions in @var{body} @dots{} are evaluated in order.
-@end deffn
-
-
-@node Exceptions
-@section Exceptions
-@cindex error handling
-@cindex exception handling
-
-A common requirement in applications is to want to jump
-@dfn{non-locally} from the depths of a computation back to, say, the
-application's main processing loop. Usually, the place that is the
-target of the jump is somewhere in the calling stack of procedures that
-called the procedure that wants to jump back. For example, typical
-logic for a key press driven application might look something like this:
-
-@example
-main-loop:
- read the next key press and call dispatch-key
-
-dispatch-key:
- lookup the key in a keymap and call an appropriate procedure,
- say find-file
-
-find-file:
- interactively read the required file name, then call
- find-specified-file
-
-find-specified-file:
- check whether file exists; if not, jump back to main-loop
- @dots{}
-@end example
-
-The jump back to @code{main-loop} could be achieved by returning through
-the stack one procedure at a time, using the return value of each
-procedure to indicate the error condition, but Guile (like most modern
-programming languages) provides an additional mechanism called
-@dfn{exception handling} that can be used to implement such jumps much
-more conveniently.
-
-@menu
-* Exception Terminology:: Different ways to say the same thing.
-* Catch:: Setting up to catch exceptions.
-* Throw:: Throwing an exception.
-* Lazy Catch:: Catch without unwinding the stack.
-* Exception Implementation:: How Guile implements exceptions.
-@end menu
-
-
-@node Exception Terminology
-@subsection Exception Terminology
-
-There are several variations on the terminology for dealing with
-non-local jumps. It is useful to be aware of them, and to realize
-that they all refer to the same basic mechanism.
-
-@itemize @bullet
-@item
-Actually making a non-local jump may be called @dfn{raising an
-exception}, @dfn{raising a signal}, @dfn{throwing an exception} or
-@dfn{doing a long jump}. When the jump indicates an error condition,
-people may talk about @dfn{signalling}, @dfn{raising} or @dfn{throwing}
-@dfn{an error}.
-
-@item
-Handling the jump at its target may be referred to as @dfn{catching} or
-@dfn{handling} the @dfn{exception}, @dfn{signal} or, where an error
-condition is involved, @dfn{error}.
-@end itemize
-
-Where @dfn{signal} and @dfn{signalling} are used, special care is needed
-to avoid the risk of confusion with POSIX signals. (Especially
-considering that Guile handles POSIX signals by throwing a corresponding
-kind of exception: REFFIXME.)
-
-This manual prefers to speak of throwing and catching exceptions, since
-this terminology matches the corresponding Guile primitives.
-
-
-@node Catch
-@subsection Catching Exceptions
-
-@code{catch} is used to set up a target for a possible non-local jump.
-The arguments of a @code{catch} expression are a @dfn{key}, which
-restricts the set of exceptions to which this @code{catch} applies, a
-thunk that specifies the @dfn{normal case} code --- i.e. what should
-happen if no exceptions are thrown --- and a @dfn{handler} procedure
-that says what to do if an exception is thrown. Note that if the
-@dfn{normal case} thunk executes @dfn{normally}, which means without
-throwing any exceptions, the handler procedure is not executed at all.
-
-When an exception is thrown using the @code{throw} primitive, the first
-argument of the @code{throw} is a symbol that indicates the type of the
-exception. For example, Guile throws an exception using the symbol
-@code{numerical-overflow} to indicate numerical overflow errors such as
-division by zero:
-
-@lisp
-(/ 1 0)
-@result{}
-ABORT: (numerical-overflow)
-@end lisp
-
-The @var{key} argument in a @code{catch} expression corresponds to this
-symbol. @var{key} may be a specific symbol, such as
-@code{numerical-overflow}, in which case the @code{catch} applies
-specifically to exceptions of that type; or it may be @code{#t}, which
-means that the @code{catch} applies to all exceptions, irrespective of
-their type.
-
-The second argument of a @code{catch} expression should be a thunk
-(i.e. a procedure that accepts no arguments) that specifies the normal
-case code. The @code{catch} is active for the execution of this thunk,
-including any code called directly or indirectly by the thunk's body.
-Evaluation of the @code{catch} expression activates the catch and then
-calls this thunk.
-
-The third argument of a @code{catch} expression is a handler procedure.
-If an exception is thrown, this procedure is called with exactly the
-arguments specified by the @code{throw}. Therefore, the handler
-procedure must be designed to accept a number of arguments that
-corresponds to the number of arguments in all @code{throw} expressions
-that can be caught by this @code{catch}.
-
-@deffn {Scheme Procedure} catch key thunk handler
-@deffnx {C Function} scm_catch (key, thunk, handler)
-Invoke @var{thunk} in the dynamic context of @var{handler} for
-exceptions matching @var{key}. If thunk throws to the symbol
-@var{key}, then @var{handler} is invoked this way:
-@lisp
-(handler key args ...)
-@end lisp
-
-@var{key} is a symbol or @code{#t}.
-
-@var{thunk} takes no arguments. If @var{thunk} returns
-normally, that is the return value of @code{catch}.
-
-Handler is invoked outside the scope of its own @code{catch}.
-If @var{handler} again throws to the same key, a new handler
-from further up the call chain is invoked.
-
-If the key is @code{#t}, then a throw to @emph{any} symbol will
-match this call to @code{catch}.
-@end deffn
-
-If the handler procedure needs to match a variety of @code{throw}
-expressions with varying numbers of arguments, you should write it like
-this:
-
-@lisp
-(lambda (key . args)
- @dots{})
-@end lisp
-
-@noindent
-The @var{key} argument is guaranteed always to be present, because a
-@code{throw} without a @var{key} is not valid. The number and
-interpretation of the @var{args} varies from one type of exception to
-another, but should be specified by the documentation for each exception
-type.
-
-Note that, once the handler procedure is invoked, the catch that led to
-the handler procedure being called is no longer active. Therefore, if
-the handler procedure itself throws an exception, that exception can
-only be caught by another active catch higher up the call stack, if
-there is one.
-
-
-@node Throw
-@subsection Throwing Exceptions
-
-The @code{throw} primitive is used to throw an exception. One argument,
-the @var{key}, is mandatory, and must be a symbol; it indicates the type
-of exception that is being thrown. Following the @var{key},
-@code{throw} accepts any number of additional arguments, whose meaning
-depends on the exception type. The documentation for each possible type
-of exception should specify the additional arguments that are expected
-for that kind of exception.
-
-@deffn {Scheme Procedure} throw key . args
-@deffnx {C Function} scm_throw (key, args)
-Invoke the catch form matching @var{key}, passing @var{args} to the
-@var{handler}.
-
-@var{key} is a symbol. It will match catches of the same symbol or of
-@code{#t}.
-
-If there is no handler at all, Guile prints an error and then exits.
-@end deffn
-
-When an exception is thrown, it will be caught by the innermost
-@code{catch} expression that applies to the type of the thrown
-exception; in other words, the innermost @code{catch} whose @var{key} is
-@code{#t} or is the same symbol as that used in the @code{throw}
-expression. Once Guile has identified the appropriate @code{catch}, it
-handles the exception by applying that @code{catch} expression's handler
-procedure to the arguments of the @code{throw}.
-
-If there is no appropriate @code{catch} for a thrown exception, Guile
-prints an error to the current error port indicating an uncaught
-exception, and then exits. In practice, it is quite difficult to
-observe this behaviour, because Guile when used interactively installs a
-top level @code{catch} handler that will catch all exceptions and print
-an appropriate error message @emph{without} exiting. For example, this
-is what happens if you try to throw an unhandled exception in the
-standard Guile REPL; note that Guile's command loop continues after the
-error message:
-
-@lisp
-guile> (throw 'badex)
-<unnamed port>:3:1: In procedure gsubr-apply @dots{}
-<unnamed port>:3:1: unhandled-exception: badex
-ABORT: (misc-error)
-guile>
-@end lisp
-
-The default uncaught exception behaviour can be observed by evaluating a
-@code{throw} expression from the shell command line:
-
-@example
-$ guile -c "(begin (throw 'badex) (display \"here\\n\"))"
-guile: uncaught throw to badex: ()
-$
-@end example
-
-@noindent
-That Guile exits immediately following the uncaught exception
-is shown by the absence of any output from the @code{display}
-expression, because Guile never gets to the point of evaluating that
-expression.
-
-
-@node Lazy Catch
-@subsection Catch Without Unwinding
-
-A @dfn{lazy catch} is used in the same way as a normal @code{catch},
-with @var{key}, @var{thunk} and @var{handler} arguments specifying the
-exception type, normal case code and handler procedure, but differs in
-one important respect: the handler procedure is executed without
-unwinding the call stack from the context of the @code{throw} expression
-that caused the handler to be invoked.
-
-@deffn {Scheme Procedure} lazy-catch key thunk handler
-@deffnx {C Function} scm_lazy_catch (key, thunk, handler)
-This behaves exactly like @code{catch}, except that it does
-not unwind the stack before invoking @var{handler}.
-The @var{handler} procedure is not allowed to return:
-it must throw to another catch, or otherwise exit non-locally.
-@end deffn
-
-Typically, @var{handler} should save any desired state associated with
-the stack at the point where the corresponding @code{throw} occurred,
-and then throw an exception itself --- usually the same exception as the
-one it caught. If @var{handler} is invoked and does @emph{not} throw an
-exception, Guile itself throws an exception with key @code{misc-error}.
-
-Not unwinding the stack means that throwing an exception that is caught
-by a @code{lazy-catch} is @emph{almost} equivalent to calling the
-@code{lazy-catch}'s handler inline instead of each @code{throw}, and
-then omitting the surrounding @code{lazy-catch}. In other words,
-
-@lisp
-(lazy-catch 'key
- (lambda () @dots{} (throw 'key args @dots{}) @dots{})
- handler)
-@end lisp
-
-@noindent
-is @emph{almost} equivalent to
-
-@lisp
-((lambda () @dots{} (handler 'key args @dots{}) @dots{}))
-@end lisp
-
-@noindent
-But why only @emph{almost}? The difference is that with
-@code{lazy-catch} (as with normal @code{catch}), the dynamic context is
-unwound back to just outside the @code{lazy-catch} expression before
-invoking the handler. (For an introduction to what is meant by dynamic
-context, @xref{Dynamic Wind}.)
-
-Then, when the handler @emph{itself} throws an exception, that exception
-must be caught by some kind of @code{catch} (including perhaps another
-@code{lazy-catch}) higher up the call stack.
-
-The dynamic context also includes @code{with-fluids} blocks (REFFIXME),
-so the effect of unwinding the dynamic context can also be seen in fluid
-variable values. This is illustrated by the following code, in which
-the normal case thunk uses @code{with-fluids} to temporarily change the
-value of a fluid:
-
-@lisp
-(define f (make-fluid))
-(fluid-set! f "top level value")
-
-(define (handler . args)
- (cons (fluid-ref f) args))
-
-(lazy-catch 'foo
- (lambda ()
- (with-fluids ((f "local value"))
- (throw 'foo)))
- handler)
-@result{}
-("top level value" foo)
-
-((lambda ()
- (with-fluids ((f "local value"))
- (handler 'foo))))
-@result{}
-("local value" foo)
-@end lisp
-
-@noindent
-In the @code{lazy-catch} version, the unwinding of dynamic context
-restores @code{f} to its value outside the @code{with-fluids} block
-before the handler is invoked, so the handler's @code{(fluid-ref f)}
-returns the external value.
-
-@code{lazy-catch} is useful because it permits the implementation of
-debuggers and other reflective programming tools that need to access the
-state of the call stack at the exact point where an exception or an
-error is thrown. For an example of this, see REFFIXME:stack-catch.
-
-
-@node Exception Implementation
-@subsection How Guile Implements Exceptions
-
-It is traditional in Scheme to implement exception systems using
-@code{call-with-current-continuation}. Continuations
-(@pxref{Continuations}) are such a powerful concept that any other
-control mechanism --- including @code{catch} and @code{throw} --- can be
-implemented in terms of them.
-
-Guile does not implement @code{catch} and @code{throw} like this,
-though. Why not? Because Guile is specifically designed to be easy to
-integrate with applications written in C. In a mixed Scheme/C
-environment, the concept of @dfn{continuation} must logically include
-``what happens next'' in the C parts of the application as well as the
-Scheme parts, and it turns out that the only reasonable way of
-implementing continuations like this is to save and restore the complete
-C stack.
-
-So Guile's implementation of @code{call-with-current-continuation} is a
-stack copying one. This allows it to interact well with ordinary C
-code, but means that creating and calling a continuation is slowed down
-by the time that it takes to copy the C stack.
-
-The more targeted mechanism provided by @code{catch} and @code{throw}
-does not need to save and restore the C stack because the @code{throw}
-always jumps to a location higher up the stack of the code that executes
-the @code{throw}. Therefore Guile implements the @code{catch} and
-@code{throw} primitives independently of
-@code{call-with-current-continuation}, in a way that takes advantage of
-this @emph{upwards only} nature of exceptions.
-
-
-@node Error Reporting
-@section Procedures for Signaling Errors
-
-Guile provides a set of convenience procedures for signaling error
-conditions that are implemented on top of the exception primitives just
-described.
-
-@deffn {Scheme Procedure} error msg args @dots{}
-Raise an error with key @code{misc-error} and a message constructed by
-displaying @var{msg} and writing @var{args}.
-@end deffn
-
-@deffn {Scheme Procedure} scm-error key subr message args data
-@deffnx {C Function} scm_error_scm (key, subr, message, args, data)
-Raise an error with key @var{key}. @var{subr} can be a string
-naming the procedure associated with the error, or @code{#f}.
-@var{message} is the error message string, possibly containing
-@code{~S} and @code{~A} escapes. When an error is reported,
-these are replaced by formatting the corresponding members of
-@var{args}: @code{~A} (was @code{%s} in older versions of
-Guile) formats using @code{display} and @code{~S} (was
-@code{%S}) formats using @code{write}. @var{data} is a list or
-@code{#f} depending on @var{key}: if @var{key} is
-@code{system-error} then it should be a list containing the
-Unix @code{errno} value; If @var{key} is @code{signal} then it
-should be a list containing the Unix signal number; otherwise
-it will usually be @code{#f}.
-@end deffn
-
-@deffn {Scheme Procedure} strerror err
-@deffnx {C Function} scm_strerror (err)
-Return the Unix error message corresponding to @var{err}, which
-must be an integer value.
-@end deffn
-
-@c begin (scm-doc-string "boot-9.scm" "false-if-exception")
-@deffn syntax false-if-exception expr
-Returns the result of evaluating its argument; however
-if an exception occurs then @code{#f} is returned instead.
-@end deffn
-@c end
-
-
-@node Dynamic Wind
-@section Dynamic Wind
-
-[FIXME: this is pasted in from Tom Lord's original guile.texi and should
-be reviewed]
-
-@rnindex dynamic-wind
-@deffn {Scheme Procedure} dynamic-wind in_guard thunk out_guard
-@deffnx {C Function} scm_dynamic_wind (in_guard, thunk, out_guard)
-All three arguments must be 0-argument procedures.
-@var{in_guard} is called, then @var{thunk}, then
-@var{out_guard}.
-
-If, any time during the execution of @var{thunk}, the
-continuation of the @code{dynamic_wind} expression is escaped
-non-locally, @var{out_guard} is called. If the continuation of
-the dynamic-wind is re-entered, @var{in_guard} is called. Thus
-@var{in_guard} and @var{out_guard} may be called any number of
-times.
-@lisp
-(define x 'normal-binding)
-@result{} x
-(define a-cont (call-with-current-continuation
- (lambda (escape)
- (let ((old-x x))
- (dynamic-wind
- ;; in-guard:
- ;;
- (lambda () (set! x 'special-binding))
-
- ;; thunk
- ;;
- (lambda () (display x) (newline)
- (call-with-current-continuation escape)
- (display x) (newline)
- x)
-
- ;; out-guard:
- ;;
- (lambda () (set! x old-x)))))))
-
-;; Prints:
-special-binding
-;; Evaluates to:
-@result{} a-cont
-x
-@result{} normal-binding
-(a-cont #f)
-;; Prints:
-special-binding
-;; Evaluates to:
-@result{} a-cont ;; the value of the (define a-cont...)
-x
-@result{} normal-binding
-a-cont
-@result{} special-binding
-@end lisp
-@end deffn
-
-
-@node Handling Errors
-@section How to Handle Errors in C Code
-
-Error handling is based on @code{catch} and @code{throw}. Errors are
-always thrown with a @var{key} and four arguments:
-
-@itemize @bullet
-@item
-@var{key}: a symbol which indicates the type of error. The symbols used
-by libguile are listed below.
-
-@item
-@var{subr}: the name of the procedure from which the error is thrown, or
-@code{#f}.
-
-@item
-@var{message}: a string (possibly language and system dependent)
-describing the error. The tokens @code{~A} and @code{~S} can be
-embedded within the message: they will be replaced with members of the
-@var{args} list when the message is printed. @code{~A} indicates an
-argument printed using @code{display}, while @code{~S} indicates an
-argument printed using @code{write}. @var{message} can also be
-@code{#f}, to allow it to be derived from the @var{key} by the error
-handler (may be useful if the @var{key} is to be thrown from both C and
-Scheme).
-
-@item
-@var{args}: a list of arguments to be used to expand @code{~A} and
-@code{~S} tokens in @var{message}. Can also be @code{#f} if no
-arguments are required.
-
-@item
-@var{rest}: a list of any additional objects required. e.g., when the
-key is @code{'system-error}, this contains the C errno value. Can also
-be @code{#f} if no additional objects are required.
-@end itemize
-
-In addition to @code{catch} and @code{throw}, the following Scheme
-facilities are available:
-
-@deffn {Scheme Procedure} scm-error key subr message args rest
-Throw an error, with arguments
-as described above.
-@end deffn
-
-@deffn {Scheme Procedure} error msg arg @dots{}
-Throw an error using the key @code{'misc-error}. The error
-message is created by displaying @var{msg} and writing the @var{args}.
-@end deffn
-
-@deffn {Scheme Procedure} display-error stack port subr message args rest
-@deffnx {C Function} scm_display_error (stack, port, subr, message, args, rest)
-Display an error message to the output port @var{port}.
-@var{stack} is the saved stack for the error, @var{subr} is
-the name of the procedure in which the error occurred and
-@var{message} is the actual error message, which may contain
-formatting instructions. These will format the arguments in
-the list @var{args} accordingly. @var{rest} is currently
-ignored.
-@end deffn
-
-The following are the error keys defined by libguile and the situations
-in which they are used:
-
-@itemize @bullet
-@item
-@code{error-signal}: thrown after receiving an unhandled fatal signal
-such as SIGSEGV, SIGBUS, SIGFPE etc. The @var{rest} argument in the throw
-contains the coded signal number (at present this is not the same as the
-usual Unix signal number).
-
-@item
-@code{system-error}: thrown after the operating system indicates an
-error condition. The @var{rest} argument in the throw contains the
-errno value.
-
-@item
-@code{numerical-overflow}: numerical overflow.
-
-@item
-@code{out-of-range}: the arguments to a procedure do not fall within the
-accepted domain.
-
-@item
-@code{wrong-type-arg}: an argument to a procedure has the wrong type.
-
-@item
-@code{wrong-number-of-args}: a procedure was called with the wrong number
-of arguments.
-
-@item
-@code{memory-allocation-error}: memory allocation error.
-
-@item
-@code{stack-overflow}: stack overflow error.
-
-@item
-@code{regex-error}: errors generated by the regular expression library.
-
-@item
-@code{misc-error}: other errors.
-@end itemize
-
-
-@subsection C Support
-
-SCM scm_error (SCM key, char *subr, char *message, SCM args, SCM rest)
-
-Throws an error, after converting the char * arguments to Scheme strings.
-subr is the Scheme name of the procedure, NULL is converted to #f.
-Likewise a NULL message is converted to #f.
-
-The following procedures invoke scm_error with various error keys and
-arguments. The first three call scm_error with the system-error key
-and automatically supply errno in the "rest" argument: scm_syserror
-generates messages using strerror, scm_sysmissing is used when
-facilities are not available. Care should be taken that the errno
-value is not reset (e.g. due to an interrupt).
-
-@itemize @bullet
-@item
-void scm_syserror (char *subr);
-@item
-void scm_syserror_msg (char *subr, char *message, SCM args);
-@item
-void scm_sysmissing (char *subr);
-@item
-void scm_num_overflow (char *subr);
-@item
-void scm_out_of_range (char *subr, SCM bad_value);
-@item
-void scm_wrong_num_args (SCM proc);
-@item
-void scm_wrong_type_arg (char *subr, int pos, SCM bad_value);
-@item
-void scm_memory_error (char *subr);
-@item
-static void scm_regex_error (char *subr, int code); (only used in rgx.c).
-@end itemize
-
-Exception handlers can also be installed from C, using
-scm_internal_catch, scm_lazy_catch, or scm_stack_catch from
-libguile/throw.c. These have not yet been documented, however the
-source contains some useful comments.
-
-
-@c Local Variables:
-@c TeX-master: "guile.texi"
-@c End:
diff --git a/doc/ref/scheme-data.texi b/doc/ref/scheme-data.texi
deleted file mode 100755
index fc4a84afd..000000000
--- a/doc/ref/scheme-data.texi
+++ /dev/null
@@ -1,3086 +0,0 @@
-@page
-@node Simple Data Types
-@chapter Simple Generic Data Types
-
-This chapter describes those of Guile's simple data types which are
-primarily used for their role as items of generic data. By
-@dfn{simple} we mean data types that are not primarily used as
-containers to hold other data --- i.e. pairs, lists, vectors and so on.
-For the documentation of such @dfn{compound} data types, see
-@ref{Compound Data Types}.
-
-One of the great strengths of Scheme is that there is no straightforward
-distinction between ``data'' and ``functionality''. For example,
-Guile's support for dynamic linking could be described
-
-@itemize @bullet
-@item
-either in a ``data-centric'' way, as the behaviour and properties of the
-``dynamically linked object'' data type, and the operations that may be
-applied to instances of this type
-
-@item
-or in a ``functionality-centric'' way, as the set of procedures that
-constitute Guile's support for dynamic linking, in the context of the
-module system.
-@end itemize
-
-The contents of this chapter are, therefore, a matter of judgment. By
-@dfn{generic}, we mean to select those data types whose typical use as
-@emph{data} in a wide variety of programming contexts is more important
-than their use in the implementation of a particular piece of
-@emph{functionality}. The last section of this chapter provides
-references for all the data types that are documented not here but in a
-``functionality-centric'' way elsewhere in the manual.
-
-@menu
-* Booleans:: True/false values.
-* Numbers:: Numerical data types.
-* Characters:: New character names.
-* Strings:: Special things about strings.
-* Regular Expressions:: Pattern matching and substitution.
-* Symbols:: Symbols.
-* Keywords:: Self-quoting, customizable display keywords.
-* Other Types:: "Functionality-centric" data types.
-@end menu
-
-
-@node Booleans
-@section Booleans
-@tpindex Booleans
-
-The two boolean values are @code{#t} for true and @code{#f} for false.
-
-Boolean values are returned by predicate procedures, such as the general
-equality predicates @code{eq?}, @code{eqv?} and @code{equal?}
-(@pxref{Equality}) and numerical and string comparison operators like
-@code{string=?} (@pxref{String Comparison}) and @code{<=}
-(@pxref{Comparison}).
-
-@lisp
-(<= 3 8)
-@result{}
-#t
-
-(<= 3 -3)
-@result{}
-#f
-
-(equal? "house" "houses")
-@result{}
-#f
-
-(eq? #f #f)
-@result{}
-#t
-@end lisp
-
-In test condition contexts like @code{if} and @code{cond} (@pxref{if
-cond case}), where a group of subexpressions will be evaluated only if a
-@var{condition} expression evaluates to ``true'', ``true'' means any
-value at all except @code{#f}.
-
-@lisp
-(if #t "yes" "no")
-@result{}
-"yes"
-
-(if 0 "yes" "no")
-@result{}
-"yes"
-
-(if #f "yes" "no")
-@result{}
-"no"
-@end lisp
-
-A result of this asymmetry is that typical Scheme source code more often
-uses @code{#f} explicitly than @code{#t}: @code{#f} is necessary to
-represent an @code{if} or @code{cond} false value, whereas @code{#t} is
-not necessary to represent an @code{if} or @code{cond} true value.
-
-It is important to note that @code{#f} is @strong{not} equivalent to any
-other Scheme value. In particular, @code{#f} is not the same as the
-number 0 (like in C and C++), and not the same as the ``empty list''
-(like in some Lisp dialects).
-
-The @code{not} procedure returns the boolean inverse of its argument:
-
-@rnindex not
-@deffn {Scheme Procedure} not x
-@deffnx {C Function} scm_not (x)
-Return @code{#t} iff @var{x} is @code{#f}, else return @code{#f}.
-@end deffn
-
-The @code{boolean?} procedure is a predicate that returns @code{#t} if
-its argument is one of the boolean values, otherwise @code{#f}.
-
-@rnindex boolean?
-@deffn {Scheme Procedure} boolean? obj
-@deffnx {C Function} scm_boolean_p (obj)
-Return @code{#t} iff @var{obj} is either @code{#t} or @code{#f}.
-@end deffn
-
-
-@node Numbers
-@section Numerical data types
-@tpindex Numbers
-
-Guile supports a rich ``tower'' of numerical types --- integer,
-rational, real and complex --- and provides an extensive set of
-mathematical and scientific functions for operating on numerical
-data. This section of the manual documents those types and functions.
-
-You may also find it illuminating to read R5RS's presentation of numbers
-in Scheme, which is particularly clear and accessible: see
-@xref{Numbers,,,r5rs}.
-
-@menu
-* Numerical Tower:: Scheme's numerical "tower".
-* Integers:: Whole numbers.
-* Reals and Rationals:: Real and rational numbers.
-* Complex Numbers:: Complex numbers.
-* Exactness:: Exactness and inexactness.
-* Number Syntax:: Read syntax for numerical data.
-* Integer Operations:: Operations on integer values.
-* Comparison:: Comparison predicates.
-* Conversion:: Converting numbers to and from strings.
-* Complex:: Complex number operations.
-* Arithmetic:: Arithmetic functions.
-* Scientific:: Scientific functions.
-* Primitive Numerics:: Primitive numeric functions.
-* Bitwise Operations:: Logical AND, OR, NOT, and so on.
-* Random:: Random number generation.
-@end menu
-
-
-@node Numerical Tower
-@subsection Scheme's Numerical ``Tower''
-@rnindex number?
-
-Scheme's numerical ``tower'' consists of the following categories of
-numbers:
-
-@itemize @bullet
-@item
-integers (whole numbers)
-
-@item
-rationals (the set of numbers that can be expressed as P/Q where P and Q
-are integers)
-
-@item
-real numbers (the set of numbers that describes all possible positions
-along a one dimensional line)
-
-@item
-complex numbers (the set of numbers that describes all possible
-positions in a two dimensional space)
-@end itemize
-
-It is called a tower because each category ``sits on'' the one that
-follows it, in the sense that every integer is also a rational, every
-rational is also real, and every real number is also a complex number
-(but with zero imaginary part).
-
-Of these, Guile implements integers, reals and complex numbers as
-distinct types. Rationals are implemented as regards the read syntax
-for rational numbers that is specified by R5RS, but are immediately
-converted by Guile to the corresponding real number.
-
-The @code{number?} predicate may be applied to any Scheme value to
-discover whether the value is any of the supported numerical types.
-
-@deffn {Scheme Procedure} number? obj
-@deffnx {C Function} scm_number_p (obj)
-Return @code{#t} if @var{obj} is any kind of number, else @code{#f}.
-@end deffn
-
-For example:
-
-@lisp
-(number? 3)
-@result{}
-#t
-
-(number? "hello there!")
-@result{}
-#f
-
-(define pi 3.141592654)
-(number? pi)
-@result{}
-#t
-@end lisp
-
-The next few subsections document each of Guile's numerical data types
-in detail.
-
-@node Integers
-@subsection Integers
-
-@tpindex Integer numbers
-
-@rnindex integer?
-
-Integers are whole numbers, that is numbers with no fractional part,
-such as 2, 83 and -3789.
-
-Integers in Guile can be arbitrarily big, as shown by the following
-example.
-
-@lisp
-(define (factorial n)
- (let loop ((n n) (product 1))
- (if (= n 0)
- product
- (loop (- n 1) (* product n)))))
-
-(factorial 3)
-@result{}
-6
-
-(factorial 20)
-@result{}
-2432902008176640000
-
-(- (factorial 45))
-@result{}
--119622220865480194561963161495657715064383733760000000000
-@end lisp
-
-Readers whose background is in programming languages where integers are
-limited by the need to fit into just 4 or 8 bytes of memory may find
-this surprising, or suspect that Guile's representation of integers is
-inefficient. In fact, Guile achieves a near optimal balance of
-convenience and efficiency by using the host computer's native
-representation of integers where possible, and a more general
-representation where the required number does not fit in the native
-form. Conversion between these two representations is automatic and
-completely invisible to the Scheme level programmer.
-
-The infinities @code{+inf.0} and @code{-inf.0} are considered to be
-inexact integers. They are explained in detail in the next section,
-together with reals and rationals.
-
-@c REFFIXME Maybe point here to discussion of handling immediates/bignums
-@c on the C level, where the conversion is not so automatic - NJ
-
-@deffn {Scheme Procedure} integer? x
-@deffnx {C Function} scm_integer_p (x)
-Return @code{#t} if @var{x} is an integer number, else @code{#f}.
-
-@lisp
-(integer? 487)
-@result{}
-#t
-
-(integer? -3.4)
-@result{}
-#f
-
-(integer? +inf.0)
-@result{}
-#t
-@end lisp
-@end deffn
-
-
-@node Reals and Rationals
-@subsection Real and Rational Numbers
-@tpindex Real numbers
-@tpindex Rational numbers
-
-@rnindex real?
-@rnindex rational?
-
-Mathematically, the real numbers are the set of numbers that describe
-all possible points along a continuous, infinite, one-dimensional line.
-The rational numbers are the set of all numbers that can be written as
-fractions P/Q, where P and Q are integers. All rational numbers are
-also real, but there are real numbers that are not rational, for example
-the square root of 2, and pi.
-
-Guile represents both real and rational numbers approximately using a
-floating point encoding with limited precision. Even though the actual
-encoding is in binary, it may be helpful to think of it as a decimal
-number with a limited number of significant figures and a decimal point
-somewhere, since this corresponds to the standard notation for non-whole
-numbers. For example:
-
-@lisp
-0.34
--0.00000142857931198
--5648394822220000000000.0
-4.0
-@end lisp
-
-The limited precision of Guile's encoding means that any ``real'' number
-in Guile can be written in a rational form, by multiplying and then dividing
-by sufficient powers of 10 (or in fact, 2). For example,
-@code{-0.00000142857931198} is the same as @code{142857931198} divided by
-@code{100000000000000000}. In Guile's current incarnation, therefore,
-the @code{rational?} and @code{real?} predicates are equivalent.
-
-Another aspect of this equivalence is that Guile currently does not
-preserve the exactness that is possible with rational arithmetic.
-If such exactness is needed, it is of course possible to implement
-exact rational arithmetic at the Scheme level using Guile's arbitrary
-size integers.
-
-A planned future revision of Guile's numerical tower will make it
-possible to implement exact representations and arithmetic for both
-rational numbers and real irrational numbers such as square roots,
-and in such a way that the new kinds of number integrate seamlessly
-with those that are already implemented.
-
-Dividing by an exact zero leads to a error message, as one might
-expect. However, dividing by an inexact zero does not produce an
-error. Instead, the result of the division is either plus or minus
-infinity, depending on the sign of the divided number.
-
-The infinities are written @samp{+inf.0} and @samp{-inf.0},
-respectibly. This syntax is also recognized by @code{read} as an
-extension to the usual Scheme syntax.
-
-Dividing zero by zero yields something that is not a number at all:
-@samp{+nan.0}. This is the special 'not a number' value.
-
-On platforms that follow IEEE 754 for their floating point arithmetic,
-the @samp{+inf.0}, @samp{-inf.0}, and @samp{+nan.0} values are
-implemented using the corresponding IEEE 754 values. They behave in
-arithmetic operations like IEEE 754 describes it, i.e., @code{(=
-+nan.0 +nan.0) @result{#f}}.
-
-The infinities are inexact integers and are considered to be both even
-and odd. While @samp{+nan.0} is not @code{=} to itself, it is
-@code{eqv?} to itself.
-
-To test for the special values, use the functions @code{inf?} and
-@code{nan?}.
-
-@deffn {Scheme Procedure} real? obj
-@deffnx {C Function} scm_real_p (obj)
-Return @code{#t} if @var{obj} is a real number, else @code{#f}.
-Note that the sets of integer and rational values form subsets
-of the set of real numbers, so the predicate will also be fulfilled
-if @var{obj} is an integer number or a rational number.
-@end deffn
-
-@deffn {Scheme Procedure} rational? x
-@deffnx {C Function} scm_real_p (x)
-Return @code{#t} if @var{x} is a rational number, @code{#f}
-otherwise. Note that the set of integer values forms a subset of
-the set of rational numbers, i. e. the predicate will also be
-fulfilled if @var{x} is an integer number. Real numbers
-will also satisfy this predicate, because of their limited
-precision.
-@end deffn
-
-@deffn {Scheme Procedure} inf? x
-Return @code{#t} if @var{x} is either @samp{+inf.0} or @samp{-inf.0},
-@code{#f} otherwise.
-@end deffn
-
-@deffn {Scheme Procedure} nan? x
-Return @code{#t} if @var{x} is @samp{+nan.0}, @code{#f} otherwise.
-@end deffn
-
-@node Complex Numbers
-@subsection Complex Numbers
-@tpindex Complex numbers
-
-@rnindex complex?
-
-Complex numbers are the set of numbers that describe all possible points
-in a two-dimensional space. The two coordinates of a particular point
-in this space are known as the @dfn{real} and @dfn{imaginary} parts of
-the complex number that describes that point.
-
-In Guile, complex numbers are written in rectangular form as the sum of
-their real and imaginary parts, using the symbol @code{i} to indicate
-the imaginary part.
-
-@lisp
-3+4i
-@result{}
-3.0+4.0i
-
-(* 3-8i 2.3+0.3i)
-@result{}
-9.3-17.5i
-@end lisp
-
-Guile represents a complex number as a pair of numbers both of which are
-real, so the real and imaginary parts of a complex number have the same
-properties of inexactness and limited precision as single real numbers.
-
-@deffn {Scheme Procedure} complex? x
-@deffnx {C Function} scm_number_p (x)
-Return @code{#t} if @var{x} is a complex number, @code{#f}
-otherwise. Note that the sets of real, rational and integer
-values form subsets of the set of complex numbers, i. e. the
-predicate will also be fulfilled if @var{x} is a real,
-rational or integer number.
-@end deffn
-
-
-@node Exactness
-@subsection Exact and Inexact Numbers
-@tpindex Exact numbers
-@tpindex Inexact numbers
-
-@rnindex exact?
-@rnindex inexact?
-@rnindex exact->inexact
-@rnindex inexact->exact
-
-R5RS requires that a calculation involving inexact numbers always
-produces an inexact result. To meet this requirement, Guile
-distinguishes between an exact integer value such as @code{5} and the
-corresponding inexact real value which, to the limited precision
-available, has no fractional part, and is printed as @code{5.0}. Guile
-will only convert the latter value to the former when forced to do so by
-an invocation of the @code{inexact->exact} procedure.
-
-@deffn {Scheme Procedure} exact? x
-@deffnx {C Function} scm_exact_p (x)
-Return @code{#t} if @var{x} is an exact number, @code{#f}
-otherwise.
-@end deffn
-
-@deffn {Scheme Procedure} inexact? x
-@deffnx {C Function} scm_inexact_p (x)
-Return @code{#t} if @var{x} is an inexact number, @code{#f}
-else.
-@end deffn
-
-@deffn {Scheme Procedure} inexact->exact z
-@deffnx {C Function} scm_inexact_to_exact (z)
-Return an exact number that is numerically closest to @var{z}.
-@end deffn
-
-@c begin (texi-doc-string "guile" "exact->inexact")
-@deffn {Scheme Procedure} exact->inexact z
-Convert the number @var{z} to its inexact representation.
-@end deffn
-
-
-@node Number Syntax
-@subsection Read Syntax for Numerical Data
-
-The read syntax for integers is a string of digits, optionally
-preceded by a minus or plus character, a code indicating the
-base in which the integer is encoded, and a code indicating whether
-the number is exact or inexact. The supported base codes are:
-
-@itemize @bullet
-@item
-@code{#b}, @code{#B} --- the integer is written in binary (base 2)
-
-@item
-@code{#o}, @code{#O} --- the integer is written in octal (base 8)
-
-@item
-@code{#d}, @code{#D} --- the integer is written in decimal (base 10)
-
-@item
-@code{#x}, @code{#X} --- the integer is written in hexadecimal (base 16).
-@end itemize
-
-If the base code is omitted, the integer is assumed to be decimal. The
-following examples show how these base codes are used.
-
-@lisp
--13
-@result{}
--13
-
-#d-13
-@result{}
--13
-
-#x-13
-@result{}
--19
-
-#b+1101
-@result{}
-13
-
-#o377
-@result{}
-255
-@end lisp
-
-The codes for indicating exactness (which can, incidentally, be applied
-to all numerical values) are:
-
-@itemize @bullet
-@item
-@code{#e}, @code{#E} --- the number is exact
-
-@item
-@code{#i}, @code{#I} --- the number is inexact.
-@end itemize
-
-If the exactness indicator is omitted, the integer is assumed to be exact,
-since Guile's internal representation for integers is always exact.
-Real numbers have limited precision similar to the precision of the
-@code{double} type in C. A consequence of the limited precision is that
-all real numbers in Guile are also rational, since any number R with a
-limited number of decimal places, say N, can be made into an integer by
-multiplying by 10^N.
-
-Guile also understands the syntax @samp{+inf.0} and @samp{-inf.0} for
-plus and minus infinity, respectively. The value must be written
-exactly as shown, that is, the always must have a sign and exactly one
-zero digit after the decimal point. It also understands @samp{+nan.0}
-and @samp{-nan.0} for the special 'not-a-number' value. The sign is
-ignored for 'not-a-number' and the value is always printed as @samp{+nan.0}.
-
-@node Integer Operations
-@subsection Operations on Integer Values
-@rnindex odd?
-@rnindex even?
-@rnindex quotient
-@rnindex remainder
-@rnindex modulo
-@rnindex gcd
-@rnindex lcm
-
-@deffn {Scheme Procedure} odd? n
-@deffnx {C Function} scm_odd_p (n)
-Return @code{#t} if @var{n} is an odd number, @code{#f}
-otherwise.
-@end deffn
-
-@deffn {Scheme Procedure} even? n
-@deffnx {C Function} scm_even_p (n)
-Return @code{#t} if @var{n} is an even number, @code{#f}
-otherwise.
-@end deffn
-
-@c begin (texi-doc-string "guile" "quotient")
-@deffn {Scheme Procedure} quotient
-Return the quotient of the numbers @var{x} and @var{y}.
-@end deffn
-
-@c begin (texi-doc-string "guile" "remainder")
-@deffn {Scheme Procedure} remainder
-Return the remainder of the numbers @var{x} and @var{y}.
-@lisp
-(remainder 13 4) @result{} 1
-(remainder -13 4) @result{} -1
-@end lisp
-@end deffn
-
-@c begin (texi-doc-string "guile" "modulo")
-@deffn {Scheme Procedure} modulo
-Return the modulo of the numbers @var{x} and @var{y}.
-@lisp
-(modulo 13 4) @result{} 1
-(modulo -13 4) @result{} 3
-@end lisp
-@end deffn
-
-@c begin (texi-doc-string "guile" "gcd")
-@deffn {Scheme Procedure} gcd
-Return the greatest common divisor of all arguments.
-If called without arguments, 0 is returned.
-@end deffn
-
-@c begin (texi-doc-string "guile" "lcm")
-@deffn {Scheme Procedure} lcm
-Return the least common multiple of the arguments.
-If called without arguments, 1 is returned.
-@end deffn
-
-
-@node Comparison
-@subsection Comparison Predicates
-@rnindex zero?
-@rnindex positive?
-@rnindex negative?
-
-@c begin (texi-doc-string "guile" "=")
-@deffn {Scheme Procedure} =
-Return @code{#t} if all parameters are numerically equal.
-@end deffn
-
-@c begin (texi-doc-string "guile" "<")
-@deffn {Scheme Procedure} <
-Return @code{#t} if the list of parameters is monotonically
-increasing.
-@end deffn
-
-@c begin (texi-doc-string "guile" ">")
-@deffn {Scheme Procedure} >
-Return @code{#t} if the list of parameters is monotonically
-decreasing.
-@end deffn
-
-@c begin (texi-doc-string "guile" "<=")
-@deffn {Scheme Procedure} <=
-Return @code{#t} if the list of parameters is monotonically
-non-decreasing.
-@end deffn
-
-@c begin (texi-doc-string "guile" ">=")
-@deffn {Scheme Procedure} >=
-Return @code{#t} if the list of parameters is monotonically
-non-increasing.
-@end deffn
-
-@c begin (texi-doc-string "guile" "zero?")
-@deffn {Scheme Procedure} zero?
-Return @code{#t} if @var{z} is an exact or inexact number equal to
-zero.
-@end deffn
-
-@c begin (texi-doc-string "guile" "positive?")
-@deffn {Scheme Procedure} positive?
-Return @code{#t} if @var{x} is an exact or inexact number greater than
-zero.
-@end deffn
-
-@c begin (texi-doc-string "guile" "negative?")
-@deffn {Scheme Procedure} negative?
-Return @code{#t} if @var{x} is an exact or inexact number less than
-zero.
-@end deffn
-
-
-@node Conversion
-@subsection Converting Numbers To and From Strings
-@rnindex number->string
-@rnindex string->number
-
-@deffn {Scheme Procedure} number->string n [radix]
-@deffnx {C Function} scm_number_to_string (n, radix)
-Return a string holding the external representation of the
-number @var{n} in the given @var{radix}. If @var{n} is
-inexact, a radix of 10 will be used.
-@end deffn
-
-@deffn {Scheme Procedure} string->number string [radix]
-@deffnx {C Function} scm_string_to_number (string, radix)
-Return a number of the maximally precise representation
-expressed by the given @var{string}. @var{radix} must be an
-exact integer, either 2, 8, 10, or 16. If supplied, @var{radix}
-is a default radix that may be overridden by an explicit radix
-prefix in @var{string} (e.g. "#o177"). If @var{radix} is not
-supplied, then the default radix is 10. If string is not a
-syntactically valid notation for a number, then
-@code{string->number} returns @code{#f}.
-@end deffn
-
-
-@node Complex
-@subsection Complex Number Operations
-@rnindex make-rectangular
-@rnindex make-polar
-@rnindex real-part
-@rnindex imag-part
-@rnindex magnitude
-@rnindex angle
-
-@deffn {Scheme Procedure} make-rectangular real imaginary
-@deffnx {C Function} scm_make_rectangular (real, imaginary)
-Return a complex number constructed of the given @var{real} and
-@var{imaginary} parts.
-@end deffn
-
-@deffn {Scheme Procedure} make-polar x y
-@deffnx {C Function} scm_make_polar (x, y)
-Return the complex number @var{x} * e^(i * @var{y}).
-@end deffn
-
-@c begin (texi-doc-string "guile" "real-part")
-@deffn {Scheme Procedure} real-part
-Return the real part of the number @var{z}.
-@end deffn
-
-@c begin (texi-doc-string "guile" "imag-part")
-@deffn {Scheme Procedure} imag-part
-Return the imaginary part of the number @var{z}.
-@end deffn
-
-@c begin (texi-doc-string "guile" "magnitude")
-@deffn {Scheme Procedure} magnitude
-Return the magnitude of the number @var{z}. This is the same as
-@code{abs} for real arguments, but also allows complex numbers.
-@end deffn
-
-@c begin (texi-doc-string "guile" "angle")
-@deffn {Scheme Procedure} angle
-Return the angle of the complex number @var{z}.
-@end deffn
-
-
-@node Arithmetic
-@subsection Arithmetic Functions
-@rnindex max
-@rnindex min
-@rnindex +
-@rnindex *
-@rnindex -
-@rnindex /
-@rnindex abs
-@rnindex floor
-@rnindex ceiling
-@rnindex truncate
-@rnindex round
-
-@c begin (texi-doc-string "guile" "+")
-@deffn {Scheme Procedure} + z1 @dots{}
-Return the sum of all parameter values. Return 0 if called without any
-parameters.
-@end deffn
-
-@c begin (texi-doc-string "guile" "-")
-@deffn {Scheme Procedure} - z1 z2 @dots{}
-If called with one argument @var{z1}, -@var{z1} is returned. Otherwise
-the sum of all but the first argument are subtracted from the first
-argument.
-@end deffn
-
-@c begin (texi-doc-string "guile" "*")
-@deffn {Scheme Procedure} * z1 @dots{}
-Return the product of all arguments. If called without arguments, 1 is
-returned.
-@end deffn
-
-@c begin (texi-doc-string "guile" "/")
-@deffn {Scheme Procedure} / z1 z2 @dots{}
-Divide the first argument by the product of the remaining arguments. If
-called with one argument @var{z1}, 1/@var{z1} is returned.
-@end deffn
-
-@c begin (texi-doc-string "guile" "abs")
-@deffn {Scheme Procedure} abs x
-@deffnx {C Function} scm_abs (x)
-Return the absolute value of @var{x}.
-
-@var{x} must be a number with zero imaginary part. To calculate the
-magnitude of a complex number, use @code{magnitude} instead.
-@end deffn
-
-@c begin (texi-doc-string "guile" "max")
-@deffn {Scheme Procedure} max x1 x2 @dots{}
-Return the maximum of all parameter values.
-@end deffn
-
-@c begin (texi-doc-string "guile" "min")
-@deffn {Scheme Procedure} min x1 x2 @dots{}
-Return the minimum of all parameter values.
-@end deffn
-
-@c begin (texi-doc-string "guile" "truncate")
-@deffn {Scheme Procedure} truncate
-Round the inexact number @var{x} towards zero.
-@end deffn
-
-@c begin (texi-doc-string "guile" "round")
-@deffn {Scheme Procedure} round x
-Round the inexact number @var{x} towards zero.
-@end deffn
-
-@c begin (texi-doc-string "guile" "floor")
-@deffn {Scheme Procedure} floor x
-Round the number @var{x} towards minus infinity.
-@end deffn
-
-@c begin (texi-doc-string "guile" "ceiling")
-@deffn {Scheme Procedure} ceiling x
-Round the number @var{x} towards infinity.
-@end deffn
-
-For the @code{truncate} and @code{round} procedures, the Guile library
-exports equivalent C functions, but taking and returning arguments of
-type @code{double} rather than the usual @code{SCM}.
-
-@deftypefn {C Function} double scm_truncate (double x)
-@deftypefnx {C Function} double scm_round (double x)
-@end deftypefn
-
-For @code{floor} and @code{ceiling}, the equivalent C functions are
-@code{floor} and @code{ceil} from the standard mathematics library
-(which also take and return @code{double} arguments).
-
-
-@node Scientific
-@subsection Scientific Functions
-
-The following procedures accept any kind of number as arguments,
-including complex numbers.
-
-@rnindex sqrt
-@c begin (texi-doc-string "guile" "sqrt")
-@deffn {Scheme Procedure} sqrt z
-Return the square root of @var{z}.
-@end deffn
-
-@rnindex expt
-@c begin (texi-doc-string "guile" "expt")
-@deffn {Scheme Procedure} expt z1 z2
-Return @var{z1} raised to the power of @var{z2}.
-@end deffn
-
-@rnindex sin
-@c begin (texi-doc-string "guile" "sin")
-@deffn {Scheme Procedure} sin z
-Return the sine of @var{z}.
-@end deffn
-
-@rnindex cos
-@c begin (texi-doc-string "guile" "cos")
-@deffn {Scheme Procedure} cos z
-Return the cosine of @var{z}.
-@end deffn
-
-@rnindex tan
-@c begin (texi-doc-string "guile" "tan")
-@deffn {Scheme Procedure} tan z
-Return the tangent of @var{z}.
-@end deffn
-
-@rnindex asin
-@c begin (texi-doc-string "guile" "asin")
-@deffn {Scheme Procedure} asin z
-Return the arcsine of @var{z}.
-@end deffn
-
-@rnindex acos
-@c begin (texi-doc-string "guile" "acos")
-@deffn {Scheme Procedure} acos z
-Return the arccosine of @var{z}.
-@end deffn
-
-@rnindex atan
-@c begin (texi-doc-string "guile" "atan")
-@deffn {Scheme Procedure} atan z
-Return the arctangent of @var{z}.
-@end deffn
-
-@rnindex exp
-@c begin (texi-doc-string "guile" "exp")
-@deffn {Scheme Procedure} exp z
-Return e to the power of @var{z}, where e is the base of natural
-logarithms (2.71828@dots{}).
-@end deffn
-
-@rnindex log
-@c begin (texi-doc-string "guile" "log")
-@deffn {Scheme Procedure} log z
-Return the natural logarithm of @var{z}.
-@end deffn
-
-@c begin (texi-doc-string "guile" "log10")
-@deffn {Scheme Procedure} log10 z
-Return the base 10 logarithm of @var{z}.
-@end deffn
-
-@c begin (texi-doc-string "guile" "sinh")
-@deffn {Scheme Procedure} sinh z
-Return the hyperbolic sine of @var{z}.
-@end deffn
-
-@c begin (texi-doc-string "guile" "cosh")
-@deffn {Scheme Procedure} cosh z
-Return the hyperbolic cosine of @var{z}.
-@end deffn
-
-@c begin (texi-doc-string "guile" "tanh")
-@deffn {Scheme Procedure} tanh z
-Return the hyperbolic tangent of @var{z}.
-@end deffn
-
-@c begin (texi-doc-string "guile" "asinh")
-@deffn {Scheme Procedure} asinh z
-Return the hyperbolic arcsine of @var{z}.
-@end deffn
-
-@c begin (texi-doc-string "guile" "acosh")
-@deffn {Scheme Procedure} acosh z
-Return the hyperbolic arccosine of @var{z}.
-@end deffn
-
-@c begin (texi-doc-string "guile" "atanh")
-@deffn {Scheme Procedure} atanh z
-Return the hyperbolic arctangent of @var{z}.
-@end deffn
-
-
-@node Primitive Numerics
-@subsection Primitive Numeric Functions
-
-Many of Guile's numeric procedures which accept any kind of numbers as
-arguments, including complex numbers, are implemented as Scheme
-procedures that use the following real number-based primitives. These
-primitives signal an error if they are called with complex arguments.
-
-@c begin (texi-doc-string "guile" "$abs")
-@deffn {Scheme Procedure} $abs x
-Return the absolute value of @var{x}.
-@end deffn
-
-@c begin (texi-doc-string "guile" "$sqrt")
-@deffn {Scheme Procedure} $sqrt x
-Return the square root of @var{x}.
-@end deffn
-
-@deffn {Scheme Procedure} $expt x y
-@deffnx {C Function} scm_sys_expt (x, y)
-Return @var{x} raised to the power of @var{y}. This
-procedure does not accept complex arguments.
-@end deffn
-
-@c begin (texi-doc-string "guile" "$sin")
-@deffn {Scheme Procedure} $sin x
-Return the sine of @var{x}.
-@end deffn
-
-@c begin (texi-doc-string "guile" "$cos")
-@deffn {Scheme Procedure} $cos x
-Return the cosine of @var{x}.
-@end deffn
-
-@c begin (texi-doc-string "guile" "$tan")
-@deffn {Scheme Procedure} $tan x
-Return the tangent of @var{x}.
-@end deffn
-
-@c begin (texi-doc-string "guile" "$asin")
-@deffn {Scheme Procedure} $asin x
-Return the arcsine of @var{x}.
-@end deffn
-
-@c begin (texi-doc-string "guile" "$acos")
-@deffn {Scheme Procedure} $acos x
-Return the arccosine of @var{x}.
-@end deffn
-
-@c begin (texi-doc-string "guile" "$atan")
-@deffn {Scheme Procedure} $atan x
-Return the arctangent of @var{x} in the range -PI/2 to PI/2.
-@end deffn
-
-@deffn {Scheme Procedure} $atan2 x y
-@deffnx {C Function} scm_sys_atan2 (x, y)
-Return the arc tangent of the two arguments @var{x} and
-@var{y}. This is similar to calculating the arc tangent of
-@var{x} / @var{y}, except that the signs of both arguments
-are used to determine the quadrant of the result. This
-procedure does not accept complex arguments.
-@end deffn
-
-@c begin (texi-doc-string "guile" "$exp")
-@deffn {Scheme Procedure} $exp x
-Return e to the power of @var{x}, where e is the base of natural
-logarithms (2.71828@dots{}).
-@end deffn
-
-@c begin (texi-doc-string "guile" "$log")
-@deffn {Scheme Procedure} $log x
-Return the natural logarithm of @var{x}.
-@end deffn
-
-@c begin (texi-doc-string "guile" "$sinh")
-@deffn {Scheme Procedure} $sinh x
-Return the hyperbolic sine of @var{x}.
-@end deffn
-
-@c begin (texi-doc-string "guile" "$cosh")
-@deffn {Scheme Procedure} $cosh x
-Return the hyperbolic cosine of @var{x}.
-@end deffn
-
-@c begin (texi-doc-string "guile" "$tanh")
-@deffn {Scheme Procedure} $tanh x
-Return the hyperbolic tangent of @var{x}.
-@end deffn
-
-@c begin (texi-doc-string "guile" "$asinh")
-@deffn {Scheme Procedure} $asinh x
-Return the hyperbolic arcsine of @var{x}.
-@end deffn
-
-@c begin (texi-doc-string "guile" "$acosh")
-@deffn {Scheme Procedure} $acosh x
-Return the hyperbolic arccosine of @var{x}.
-@end deffn
-
-@c begin (texi-doc-string "guile" "$atanh")
-@deffn {Scheme Procedure} $atanh x
-Return the hyperbolic arctangent of @var{x}.
-@end deffn
-
-For the hyperbolic arc-functions, the Guile library exports C functions
-corresponding to these Scheme procedures, but taking and returning
-arguments of type @code{double} rather than the usual @code{SCM}.
-
-@deftypefn {C Function} double scm_asinh (double x)
-@deftypefnx {C Function} double scm_acosh (double x)
-@deftypefnx {C Function} double scm_atanh (double x)
-Return the hyperbolic arcsine, arccosine or arctangent of @var{x}
-respectively.
-@end deftypefn
-
-For all the other Scheme procedures above, except @code{expt} and
-@code{atan2} (whose entries specifically mention an equivalent C
-function), the equivalent C functions are those provided by the standard
-mathematics library. The mapping is as follows.
-
-@multitable {xx} {Scheme Procedure} {C Function}
-@item @tab Scheme Procedure @tab C Function
-
-@item @tab @code{$abs} @tab @code{fabs}
-@item @tab @code{$sqrt} @tab @code{sqrt}
-@item @tab @code{$sin} @tab @code{sin}
-@item @tab @code{$cos} @tab @code{cos}
-@item @tab @code{$tan} @tab @code{tan}
-@item @tab @code{$asin} @tab @code{asin}
-@item @tab @code{$acos} @tab @code{acos}
-@item @tab @code{$atan} @tab @code{atan}
-@item @tab @code{$exp} @tab @code{exp}
-@item @tab @code{$log} @tab @code{log}
-@item @tab @code{$sinh} @tab @code{sinh}
-@item @tab @code{$cosh} @tab @code{cosh}
-@item @tab @code{$tanh} @tab @code{tanh}
-@end multitable
-
-@noindent
-Naturally, these C functions expect and return @code{double} arguments.
-
-
-@node Bitwise Operations
-@subsection Bitwise Operations
-
-@deffn {Scheme Procedure} logand n1 n2
-Return the bitwise AND of the integer arguments.
-
-@lisp
-(logand) @result{} -1
-(logand 7) @result{} 7
-(logand #b111 #b011 #b001) @result{} 1
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} logior n1 n2
-Return the bitwise OR of the integer arguments.
-
-@lisp
-(logior) @result{} 0
-(logior 7) @result{} 7
-(logior #b000 #b001 #b011) @result{} 3
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} logxor n1 n2
-Return the bitwise XOR of the integer arguments. A bit is
-set in the result if it is set in an odd number of arguments.
-@lisp
-(logxor) @result{} 0
-(logxor 7) @result{} 7
-(logxor #b000 #b001 #b011) @result{} 2
-(logxor #b000 #b001 #b011 #b011) @result{} 1
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} lognot n
-@deffnx {C Function} scm_lognot (n)
-Return the integer which is the 2s-complement of the integer
-argument.
-
-@lisp
-(number->string (lognot #b10000000) 2)
- @result{} "-10000001"
-(number->string (lognot #b0) 2)
- @result{} "-1"
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} logtest j k
-@deffnx {C Function} scm_logtest (j, k)
-@lisp
-(logtest j k) @equiv{} (not (zero? (logand j k)))
-
-(logtest #b0100 #b1011) @result{} #f
-(logtest #b0100 #b0111) @result{} #t
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} logbit? index j
-@deffnx {C Function} scm_logbit_p (index, j)
-@lisp
-(logbit? index j) @equiv{} (logtest (integer-expt 2 index) j)
-
-(logbit? 0 #b1101) @result{} #t
-(logbit? 1 #b1101) @result{} #f
-(logbit? 2 #b1101) @result{} #t
-(logbit? 3 #b1101) @result{} #t
-(logbit? 4 #b1101) @result{} #f
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} ash n cnt
-@deffnx {C Function} scm_ash (n, cnt)
-The function ash performs an arithmetic shift left by @var{cnt}
-bits (or shift right, if @var{cnt} is negative). 'Arithmetic'
-means, that the function does not guarantee to keep the bit
-structure of @var{n}, but rather guarantees that the result
-will always be rounded towards minus infinity. Therefore, the
-results of ash and a corresponding bitwise shift will differ if
-@var{n} is negative.
-
-Formally, the function returns an integer equivalent to
-@code{(inexact->exact (floor (* @var{n} (expt 2 @var{cnt}))))}.
-
-@lisp
-(number->string (ash #b1 3) 2) @result{} "1000"
-(number->string (ash #b1010 -1) 2) @result{} "101"
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} logcount n
-@deffnx {C Function} scm_logcount (n)
-Return the number of bits in integer @var{n}. If integer is
-positive, the 1-bits in its binary representation are counted.
-If negative, the 0-bits in its two's-complement binary
-representation are counted. If 0, 0 is returned.
-
-@lisp
-(logcount #b10101010)
- @result{} 4
-(logcount 0)
- @result{} 0
-(logcount -2)
- @result{} 1
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} integer-length n
-@deffnx {C Function} scm_integer_length (n)
-Return the number of bits necessary to represent @var{n}.
-
-@lisp
-(integer-length #b10101010)
- @result{} 8
-(integer-length 0)
- @result{} 0
-(integer-length #b1111)
- @result{} 4
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} integer-expt n k
-@deffnx {C Function} scm_integer_expt (n, k)
-Return @var{n} raised to the non-negative integer exponent
-@var{k}.
-
-@lisp
-(integer-expt 2 5)
- @result{} 32
-(integer-expt -3 3)
- @result{} -27
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} bit-extract n start end
-@deffnx {C Function} scm_bit_extract (n, start, end)
-Return the integer composed of the @var{start} (inclusive)
-through @var{end} (exclusive) bits of @var{n}. The
-@var{start}th bit becomes the 0-th bit in the result.
-
-@lisp
-(number->string (bit-extract #b1101101010 0 4) 2)
- @result{} "1010"
-(number->string (bit-extract #b1101101010 4 9) 2)
- @result{} "10110"
-@end lisp
-@end deffn
-
-
-@node Random
-@subsection Random Number Generation
-
-@deffn {Scheme Procedure} copy-random-state [state]
-@deffnx {C Function} scm_copy_random_state (state)
-Return a copy of the random state @var{state}.
-@end deffn
-
-@deffn {Scheme Procedure} random n [state]
-@deffnx {C Function} scm_random (n, state)
-Return a number in [0,N).
-
-Accepts a positive integer or real n and returns a
-number of the same type between zero (inclusive) and
-N (exclusive). The values returned have a uniform
-distribution.
-
-The optional argument @var{state} must be of the type produced
-by @code{seed->random-state}. It defaults to the value of the
-variable @var{*random-state*}. This object is used to maintain
-the state of the pseudo-random-number generator and is altered
-as a side effect of the random operation.
-@end deffn
-
-@deffn {Scheme Procedure} random:exp [state]
-@deffnx {C Function} scm_random_exp (state)
-Return an inexact real in an exponential distribution with mean
-1. For an exponential distribution with mean u use (* u
-(random:exp)).
-@end deffn
-
-@deffn {Scheme Procedure} random:hollow-sphere! v [state]
-@deffnx {C Function} scm_random_hollow_sphere_x (v, state)
-Fills vect with inexact real random numbers
-the sum of whose squares is equal to 1.0.
-Thinking of vect as coordinates in space of
-dimension n = (vector-length vect), the coordinates
-are uniformly distributed over the surface of the
-unit n-sphere.
-@end deffn
-
-@deffn {Scheme Procedure} random:normal [state]
-@deffnx {C Function} scm_random_normal (state)
-Return an inexact real in a normal distribution. The
-distribution used has mean 0 and standard deviation 1. For a
-normal distribution with mean m and standard deviation d use
-@code{(+ m (* d (random:normal)))}.
-@end deffn
-
-@deffn {Scheme Procedure} random:normal-vector! v [state]
-@deffnx {C Function} scm_random_normal_vector_x (v, state)
-Fills vect with inexact real random numbers that are
-independent and standard normally distributed
-(i.e., with mean 0 and variance 1).
-@end deffn
-
-@deffn {Scheme Procedure} random:solid-sphere! v [state]
-@deffnx {C Function} scm_random_solid_sphere_x (v, state)
-Fills vect with inexact real random numbers
-the sum of whose squares is less than 1.0.
-Thinking of vect as coordinates in space of
-dimension n = (vector-length vect), the coordinates
-are uniformly distributed within the unit n-sphere.
-The sum of the squares of the numbers is returned.
-@end deffn
-
-@deffn {Scheme Procedure} random:uniform [state]
-@deffnx {C Function} scm_random_uniform (state)
-Return a uniformly distributed inexact real random number in
-[0,1).
-@end deffn
-
-@deffn {Scheme Procedure} seed->random-state seed
-@deffnx {C Function} scm_seed_to_random_state (seed)
-Return a new random state using @var{seed}.
-@end deffn
-
-
-@node Characters
-@section Characters
-@tpindex Characters
-
-Most of the characters in the ASCII character set may be referred to by
-name: for example, @code{#\tab}, @code{#\esc}, @code{#\stx}, and so on.
-The following table describes the ASCII names for each character.
-
-@multitable @columnfractions .25 .25 .25 .25
-@item 0 = @code{#\nul}
- @tab 1 = @code{#\soh}
- @tab 2 = @code{#\stx}
- @tab 3 = @code{#\etx}
-@item 4 = @code{#\eot}
- @tab 5 = @code{#\enq}
- @tab 6 = @code{#\ack}
- @tab 7 = @code{#\bel}
-@item 8 = @code{#\bs}
- @tab 9 = @code{#\ht}
- @tab 10 = @code{#\nl}
- @tab 11 = @code{#\vt}
-@item 12 = @code{#\np}
- @tab 13 = @code{#\cr}
- @tab 14 = @code{#\so}
- @tab 15 = @code{#\si}
-@item 16 = @code{#\dle}
- @tab 17 = @code{#\dc1}
- @tab 18 = @code{#\dc2}
- @tab 19 = @code{#\dc3}
-@item 20 = @code{#\dc4}
- @tab 21 = @code{#\nak}
- @tab 22 = @code{#\syn}
- @tab 23 = @code{#\etb}
-@item 24 = @code{#\can}
- @tab 25 = @code{#\em}
- @tab 26 = @code{#\sub}
- @tab 27 = @code{#\esc}
-@item 28 = @code{#\fs}
- @tab 29 = @code{#\gs}
- @tab 30 = @code{#\rs}
- @tab 31 = @code{#\us}
-@item 32 = @code{#\sp}
-@end multitable
-
-The @code{delete} character (octal 177) may be referred to with the name
-@code{#\del}.
-
-Several characters have more than one name:
-
-@itemize @bullet
-@item
-@code{#\space}, @code{#\sp}
-@item
-@code{#\newline}, @code{#\nl}
-@item
-@code{#\tab}, @code{#\ht}
-@item
-@code{#\backspace}, @code{#\bs}
-@item
-@code{#\return}, @code{#\cr}
-@item
-@code{#\page}, @code{#\np}
-@item
-@code{#\null}, @code{#\nul}
-@end itemize
-
-@rnindex char?
-@deffn {Scheme Procedure} char? x
-@deffnx {C Function} scm_char_p (x)
-Return @code{#t} iff @var{x} is a character, else @code{#f}.
-@end deffn
-
-@rnindex char=?
-@deffn {Scheme Procedure} char=? x y
-Return @code{#t} iff @var{x} is the same character as @var{y}, else @code{#f}.
-@end deffn
-
-@rnindex char<?
-@deffn {Scheme Procedure} char<? x y
-Return @code{#t} iff @var{x} is less than @var{y} in the ASCII sequence,
-else @code{#f}.
-@end deffn
-
-@rnindex char<=?
-@deffn {Scheme Procedure} char<=? x y
-Return @code{#t} iff @var{x} is less than or equal to @var{y} in the
-ASCII sequence, else @code{#f}.
-@end deffn
-
-@rnindex char>?
-@deffn {Scheme Procedure} char>? x y
-Return @code{#t} iff @var{x} is greater than @var{y} in the ASCII
-sequence, else @code{#f}.
-@end deffn
-
-@rnindex char>=?
-@deffn {Scheme Procedure} char>=? x y
-Return @code{#t} iff @var{x} is greater than or equal to @var{y} in the
-ASCII sequence, else @code{#f}.
-@end deffn
-
-@rnindex char-ci=?
-@deffn {Scheme Procedure} char-ci=? x y
-Return @code{#t} iff @var{x} is the same character as @var{y} ignoring
-case, else @code{#f}.
-@end deffn
-
-@rnindex char-ci<?
-@deffn {Scheme Procedure} char-ci<? x y
-Return @code{#t} iff @var{x} is less than @var{y} in the ASCII sequence
-ignoring case, else @code{#f}.
-@end deffn
-
-@rnindex char-ci<=?
-@deffn {Scheme Procedure} char-ci<=? x y
-Return @code{#t} iff @var{x} is less than or equal to @var{y} in the
-ASCII sequence ignoring case, else @code{#f}.
-@end deffn
-
-@rnindex char-ci>?
-@deffn {Scheme Procedure} char-ci>? x y
-Return @code{#t} iff @var{x} is greater than @var{y} in the ASCII
-sequence ignoring case, else @code{#f}.
-@end deffn
-
-@rnindex char-ci>=?
-@deffn {Scheme Procedure} char-ci>=? x y
-Return @code{#t} iff @var{x} is greater than or equal to @var{y} in the
-ASCII sequence ignoring case, else @code{#f}.
-@end deffn
-
-@rnindex char-alphabetic?
-@deffn {Scheme Procedure} char-alphabetic? chr
-@deffnx {C Function} scm_char_alphabetic_p (chr)
-Return @code{#t} iff @var{chr} is alphabetic, else @code{#f}.
-Alphabetic means the same thing as the isalpha C library function.
-@end deffn
-
-@rnindex char-numeric?
-@deffn {Scheme Procedure} char-numeric? chr
-@deffnx {C Function} scm_char_numeric_p (chr)
-Return @code{#t} iff @var{chr} is numeric, else @code{#f}.
-Numeric means the same thing as the isdigit C library function.
-@end deffn
-
-@rnindex char-whitespace?
-@deffn {Scheme Procedure} char-whitespace? chr
-@deffnx {C Function} scm_char_whitespace_p (chr)
-Return @code{#t} iff @var{chr} is whitespace, else @code{#f}.
-Whitespace means the same thing as the isspace C library function.
-@end deffn
-
-@rnindex char-upper-case?
-@deffn {Scheme Procedure} char-upper-case? chr
-@deffnx {C Function} scm_char_upper_case_p (chr)
-Return @code{#t} iff @var{chr} is uppercase, else @code{#f}.
-Uppercase means the same thing as the isupper C library function.
-@end deffn
-
-@rnindex char-lower-case?
-@deffn {Scheme Procedure} char-lower-case? chr
-@deffnx {C Function} scm_char_lower_case_p (chr)
-Return @code{#t} iff @var{chr} is lowercase, else @code{#f}.
-Lowercase means the same thing as the islower C library function.
-@end deffn
-
-@deffn {Scheme Procedure} char-is-both? chr
-@deffnx {C Function} scm_char_is_both_p (chr)
-Return @code{#t} iff @var{chr} is either uppercase or lowercase, else @code{#f}.
-Uppercase and lowercase are as defined by the isupper and islower
-C library functions.
-@end deffn
-
-@rnindex char->integer
-@deffn {Scheme Procedure} char->integer chr
-@deffnx {C Function} scm_char_to_integer (chr)
-Return the number corresponding to ordinal position of @var{chr} in the
-ASCII sequence.
-@end deffn
-
-@rnindex integer->char
-@deffn {Scheme Procedure} integer->char n
-@deffnx {C Function} scm_integer_to_char (n)
-Return the character at position @var{n} in the ASCII sequence.
-@end deffn
-
-@rnindex char-upcase
-@deffn {Scheme Procedure} char-upcase chr
-@deffnx {C Function} scm_char_upcase (chr)
-Return the uppercase character version of @var{chr}.
-@end deffn
-
-@rnindex char-downcase
-@deffn {Scheme Procedure} char-downcase chr
-@deffnx {C Function} scm_char_downcase (chr)
-Return the lowercase character version of @var{chr}.
-@end deffn
-
-
-@node Strings
-@section Strings
-@tpindex Strings
-
-Strings are fixed-length sequences of characters. They can be created
-by calling constructor procedures, but they can also literally get
-entered at the REPL or in Scheme source files.
-
-Guile provides a rich set of string processing procedures, because text
-handling is very important when Guile is used as a scripting language.
-
-Strings always carry the information about how many characters they are
-composed of with them, so there is no special end-of-string character,
-like in C. That means that Scheme strings can contain any character,
-even the NUL character @code{'\0'}. But note: Since most operating
-system calls dealing with strings (such as for file operations) expect
-strings to be zero-terminated, they might do unexpected things when
-called with string containing unusual characters.
-
-@menu
-* String Syntax:: Read syntax for strings.
-* String Predicates:: Testing strings for certain properties.
-* String Constructors:: Creating new string objects.
-* List/String Conversion:: Converting from/to lists of characters.
-* String Selection:: Select portions from strings.
-* String Modification:: Modify parts or whole strings.
-* String Comparison:: Lexicographic ordering predicates.
-* String Searching:: Searching in strings.
-* Alphabetic Case Mapping:: Convert the alphabetic case of strings.
-* Appending Strings:: Appending strings to form a new string.
-@end menu
-
-@node String Syntax
-@subsection String Read Syntax
-
-The read syntax for strings is an arbitrarily long sequence of
-characters enclosed in double quotes (@code{"}). @footnote{Actually, the
-current implementation restricts strings to a length of 2^24
-characters.} If you want to insert a double quote character into a
-string literal, it must be prefixed with a backslash @code{\} character
-(called an @dfn{escape character}).
-
-The following are examples of string literals:
-
-@lisp
-"foo"
-"bar plonk"
-"Hello World"
-"\"Hi\", he said."
-@end lisp
-
-@c FIXME::martin: What about escape sequences like \r, \n etc.?
-
-@node String Predicates
-@subsection String Predicates
-
-The following procedures can be used to check whether a given string
-fulfills some specified property.
-
-@rnindex string?
-@deffn {Scheme Procedure} string? obj
-@deffnx {C Function} scm_string_p (obj)
-Return @code{#t} if @var{obj} is a string, else @code{#f}.
-@end deffn
-
-@deffn {Scheme Procedure} string-null? str
-@deffnx {C Function} scm_string_null_p (str)
-Return @code{#t} if @var{str}'s length is zero, and
-@code{#f} otherwise.
-@lisp
-(string-null? "") @result{} #t
-y @result{} "foo"
-(string-null? y) @result{} #f
-@end lisp
-@end deffn
-
-@node String Constructors
-@subsection String Constructors
-
-The string constructor procedures create new string objects, possibly
-initializing them with some specified character data.
-
-@c FIXME::martin: list->string belongs into `List/String Conversion'
-
-@rnindex string
-@rnindex list->string
-@deffn {Scheme Procedure} string . chrs
-@deffnx {Scheme Procedure} list->string chrs
-@deffnx {C Function} scm_string (chrs)
-Return a newly allocated string composed of the arguments,
-@var{chrs}.
-@end deffn
-
-@rnindex make-string
-@deffn {Scheme Procedure} make-string k [chr]
-@deffnx {C Function} scm_make_string (k, chr)
-Return a newly allocated string of
-length @var{k}. If @var{chr} is given, then all elements of
-the string are initialized to @var{chr}, otherwise the contents
-of the @var{string} are unspecified.
-@end deffn
-
-@node List/String Conversion
-@subsection List/String conversion
-
-When processing strings, it is often convenient to first convert them
-into a list representation by using the procedure @code{string->list},
-work with the resulting list, and then convert it back into a string.
-These procedures are useful for similar tasks.
-
-@rnindex string->list
-@deffn {Scheme Procedure} string->list str
-@deffnx {C Function} scm_string_to_list (str)
-Return a newly allocated list of the characters that make up
-the given string @var{str}. @code{string->list} and
-@code{list->string} are inverses as far as @samp{equal?} is
-concerned.
-@end deffn
-
-@deffn {Scheme Procedure} string-split str chr
-@deffnx {C Function} scm_string_split (str, chr)
-Split the string @var{str} into the a list of the substrings delimited
-by appearances of the character @var{chr}. Note that an empty substring
-between separator characters will result in an empty string in the
-result list.
-
-@lisp
-(string-split "root:x:0:0:root:/root:/bin/bash" #\:)
-@result{}
-("root" "x" "0" "0" "root" "/root" "/bin/bash")
-
-(string-split "::" #\:)
-@result{}
-("" "" "")
-
-(string-split "" #\:)
-@result{}
-("")
-@end lisp
-@end deffn
-
-
-@node String Selection
-@subsection String Selection
-
-Portions of strings can be extracted by these procedures.
-@code{string-ref} delivers individual characters whereas
-@code{substring} can be used to extract substrings from longer strings.
-
-@rnindex string-length
-@deffn {Scheme Procedure} string-length string
-@deffnx {C Function} scm_string_length (string)
-Return the number of characters in @var{string}.
-@end deffn
-
-@rnindex string-ref
-@deffn {Scheme Procedure} string-ref str k
-@deffnx {C Function} scm_string_ref (str, k)
-Return character @var{k} of @var{str} using zero-origin
-indexing. @var{k} must be a valid index of @var{str}.
-@end deffn
-
-@rnindex string-copy
-@deffn {Scheme Procedure} string-copy str
-@deffnx {C Function} scm_string_copy (str)
-Return a newly allocated copy of the given @var{string}.
-@end deffn
-
-@rnindex substring
-@deffn {Scheme Procedure} substring str start [end]
-@deffnx {C Function} scm_substring (str, start, end)
-Return a newly allocated string formed from the characters
-of @var{str} beginning with index @var{start} (inclusive) and
-ending with index @var{end} (exclusive).
-@var{str} must be a string, @var{start} and @var{end} must be
-exact integers satisfying:
-
-0 <= @var{start} <= @var{end} <= (string-length @var{str}).
-@end deffn
-
-@node String Modification
-@subsection String Modification
-
-These procedures are for modifying strings in-place. This means that the
-result of the operation is not a new string; instead, the original string's
-memory representation is modified.
-
-@rnindex string-set!
-@deffn {Scheme Procedure} string-set! str k chr
-@deffnx {C Function} scm_string_set_x (str, k, chr)
-Store @var{chr} in element @var{k} of @var{str} and return
-an unspecified value. @var{k} must be a valid index of
-@var{str}.
-@end deffn
-
-@rnindex string-fill!
-@deffn {Scheme Procedure} string-fill! str chr
-@deffnx {C Function} scm_string_fill_x (str, chr)
-Store @var{char} in every element of the given @var{string} and
-return an unspecified value.
-@end deffn
-
-@deffn {Scheme Procedure} substring-fill! str start end fill
-@deffnx {C Function} scm_substring_fill_x (str, start, end, fill)
-Change every character in @var{str} between @var{start} and
-@var{end} to @var{fill}.
-
-@lisp
-(define y "abcdefg")
-(substring-fill! y 1 3 #\r)
-y
-@result{} "arrdefg"
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} substring-move! str1 start1 end1 str2 start2
-@deffnx {C Function} scm_substring_move_x (str1, start1, end1, str2, start2)
-Copy the substring of @var{str1} bounded by @var{start1} and @var{end1}
-into @var{str2} beginning at position @var{start2}.
-@var{str1} and @var{str2} can be the same string.
-@end deffn
-
-
-@node String Comparison
-@subsection String Comparison
-
-The procedures in this section are similar to the character ordering
-predicates (@pxref{Characters}), but are defined on character sequences.
-They all return @code{#t} on success and @code{#f} on failure. The
-predicates ending in @code{-ci} ignore the character case when comparing
-strings.
-
-
-@rnindex string=?
-@deffn {Scheme Procedure} string=? s1 s2
-Lexicographic equality predicate; return @code{#t} if the two
-strings are the same length and contain the same characters in
-the same positions, otherwise return @code{#f}.
-
-The procedure @code{string-ci=?} treats upper and lower case
-letters as though they were the same character, but
-@code{string=?} treats upper and lower case as distinct
-characters.
-@end deffn
-
-@rnindex string<?
-@deffn {Scheme Procedure} string<? s1 s2
-Lexicographic ordering predicate; return @code{#t} if @var{s1}
-is lexicographically less than @var{s2}.
-@end deffn
-
-@rnindex string<=?
-@deffn {Scheme Procedure} string<=? s1 s2
-Lexicographic ordering predicate; return @code{#t} if @var{s1}
-is lexicographically less than or equal to @var{s2}.
-@end deffn
-
-@rnindex string>?
-@deffn {Scheme Procedure} string>? s1 s2
-Lexicographic ordering predicate; return @code{#t} if @var{s1}
-is lexicographically greater than @var{s2}.
-@end deffn
-
-@rnindex string>=?
-@deffn {Scheme Procedure} string>=? s1 s2
-Lexicographic ordering predicate; return @code{#t} if @var{s1}
-is lexicographically greater than or equal to @var{s2}.
-@end deffn
-
-@rnindex string-ci=?
-@deffn {Scheme Procedure} string-ci=? s1 s2
-Case-insensitive string equality predicate; return @code{#t} if
-the two strings are the same length and their component
-characters match (ignoring case) at each position; otherwise
-return @code{#f}.
-@end deffn
-
-@rnindex string-ci<
-@deffn {Scheme Procedure} string-ci<? s1 s2
-Case insensitive lexicographic ordering predicate; return
-@code{#t} if @var{s1} is lexicographically less than @var{s2}
-regardless of case.
-@end deffn
-
-@rnindex string<=?
-@deffn {Scheme Procedure} string-ci<=? s1 s2
-Case insensitive lexicographic ordering predicate; return
-@code{#t} if @var{s1} is lexicographically less than or equal
-to @var{s2} regardless of case.
-@end deffn
-
-@rnindex string-ci>?
-@deffn {Scheme Procedure} string-ci>? s1 s2
-Case insensitive lexicographic ordering predicate; return
-@code{#t} if @var{s1} is lexicographically greater than
-@var{s2} regardless of case.
-@end deffn
-
-@rnindex string-ci>=?
-@deffn {Scheme Procedure} string-ci>=? s1 s2
-Case insensitive lexicographic ordering predicate; return
-@code{#t} if @var{s1} is lexicographically greater than or
-equal to @var{s2} regardless of case.
-@end deffn
-
-
-@node String Searching
-@subsection String Searching
-
-When searching for the index of a character in a string, these
-procedures can be used.
-
-@deffn {Scheme Procedure} string-index str chr [frm [to]]
-@deffnx {C Function} scm_string_index (str, chr, frm, to)
-Return the index of the first occurrence of @var{chr} in
-@var{str}. The optional integer arguments @var{frm} and
-@var{to} limit the search to a portion of the string. This
-procedure essentially implements the @code{index} or
-@code{strchr} functions from the C library.
-
-@lisp
-(string-index "weiner" #\e)
-@result{} 1
-
-(string-index "weiner" #\e 2)
-@result{} 4
-
-(string-index "weiner" #\e 2 4)
-@result{} #f
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} string-rindex str chr [frm [to]]
-@deffnx {C Function} scm_string_rindex (str, chr, frm, to)
-Like @code{string-index}, but search from the right of the
-string rather than from the left. This procedure essentially
-implements the @code{rindex} or @code{strrchr} functions from
-the C library.
-
-@lisp
-(string-rindex "weiner" #\e)
-@result{} 4
-
-(string-rindex "weiner" #\e 2 4)
-@result{} #f
-
-(string-rindex "weiner" #\e 2 5)
-@result{} 4
-@end lisp
-@end deffn
-
-@node Alphabetic Case Mapping
-@subsection Alphabetic Case Mapping
-
-These are procedures for mapping strings to their upper- or lower-case
-equivalents, respectively, or for capitalizing strings.
-
-@deffn {Scheme Procedure} string-upcase str
-@deffnx {C Function} scm_string_upcase (str)
-Return a freshly allocated string containing the characters of
-@var{str} in upper case.
-@end deffn
-
-@deffn {Scheme Procedure} string-upcase! str
-@deffnx {C Function} scm_string_upcase_x (str)
-Destructively upcase every character in @var{str} and return
-@var{str}.
-@lisp
-y @result{} "arrdefg"
-(string-upcase! y) @result{} "ARRDEFG"
-y @result{} "ARRDEFG"
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} string-downcase str
-@deffnx {C Function} scm_string_downcase (str)
-Return a freshly allocation string containing the characters in
-@var{str} in lower case.
-@end deffn
-
-@deffn {Scheme Procedure} string-downcase! str
-@deffnx {C Function} scm_string_downcase_x (str)
-Destructively downcase every character in @var{str} and return
-@var{str}.
-@lisp
-y @result{} "ARRDEFG"
-(string-downcase! y) @result{} "arrdefg"
-y @result{} "arrdefg"
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} string-capitalize str
-@deffnx {C Function} scm_string_capitalize (str)
-Return a freshly allocated string with the characters in
-@var{str}, where the first character of every word is
-capitalized.
-@end deffn
-
-@deffn {Scheme Procedure} string-capitalize! str
-@deffnx {C Function} scm_string_capitalize_x (str)
-Upcase the first character of every word in @var{str}
-destructively and return @var{str}.
-
-@lisp
-y @result{} "hello world"
-(string-capitalize! y) @result{} "Hello World"
-y @result{} "Hello World"
-@end lisp
-@end deffn
-
-
-@node Appending Strings
-@subsection Appending Strings
-
-The procedure @code{string-append} appends several strings together to
-form a longer result string.
-
-@rnindex string-append
-@deffn {Scheme Procedure} string-append . args
-@deffnx {C Function} scm_string_append (args)
-Return a newly allocated string whose characters form the
-concatenation of the given strings, @var{args}.
-@end deffn
-
-
-@node Regular Expressions
-@section Regular Expressions
-@tpindex Regular expressions
-
-@cindex regular expressions
-@cindex regex
-@cindex emacs regexp
-
-A @dfn{regular expression} (or @dfn{regexp}) is a pattern that
-describes a whole class of strings. A full description of regular
-expressions and their syntax is beyond the scope of this manual;
-an introduction can be found in the Emacs manual (@pxref{Regexps,
-, Syntax of Regular Expressions, emacs, The GNU Emacs Manual}), or
-in many general Unix reference books.
-
-If your system does not include a POSIX regular expression library, and
-you have not linked Guile with a third-party regexp library such as Rx,
-these functions will not be available. You can tell whether your Guile
-installation includes regular expression support by checking whether the
-@code{*features*} list includes the @code{regex} symbol.
-
-@menu
-* Regexp Functions:: Functions that create and match regexps.
-* Match Structures:: Finding what was matched by a regexp.
-* Backslash Escapes:: Removing the special meaning of regexp
- meta-characters.
-@end menu
-
-[FIXME: it may be useful to include an Examples section. Parts of this
-interface are bewildering on first glance.]
-
-@node Regexp Functions
-@subsection Regexp Functions
-
-By default, Guile supports POSIX extended regular expressions.
-That means that the characters @samp{(}, @samp{)}, @samp{+} and
-@samp{?} are special, and must be escaped if you wish to match the
-literal characters.
-
-This regular expression interface was modeled after that
-implemented by SCSH, the Scheme Shell. It is intended to be
-upwardly compatible with SCSH regular expressions.
-
-@c begin (scm-doc-string "regex.scm" "string-match")
-@deffn {Scheme Procedure} string-match pattern str [start]
-Compile the string @var{pattern} into a regular expression and compare
-it with @var{str}. The optional numeric argument @var{start} specifies
-the position of @var{str} at which to begin matching.
-
-@code{string-match} returns a @dfn{match structure} which
-describes what, if anything, was matched by the regular
-expression. @xref{Match Structures}. If @var{str} does not match
-@var{pattern} at all, @code{string-match} returns @code{#f}.
-@end deffn
-
-Each time @code{string-match} is called, it must compile its
-@var{pattern} argument into a regular expression structure. This
-operation is expensive, which makes @code{string-match} inefficient if
-the same regular expression is used several times (for example, in a
-loop). For better performance, you can compile a regular expression in
-advance and then match strings against the compiled regexp.
-
-@deffn {Scheme Procedure} make-regexp pat . flags
-@deffnx {C Function} scm_make_regexp (pat, flags)
-Compile the regular expression described by @var{pat}, and
-return the compiled regexp structure. If @var{pat} does not
-describe a legal regular expression, @code{make-regexp} throws
-a @code{regular-expression-syntax} error.
-
-The @var{flags} arguments change the behavior of the compiled
-regular expression. The following flags may be supplied:
-
-@table @code
-@item regexp/icase
-Consider uppercase and lowercase letters to be the same when
-matching.
-@item regexp/newline
-If a newline appears in the target string, then permit the
-@samp{^} and @samp{$} operators to match immediately after or
-immediately before the newline, respectively. Also, the
-@samp{.} and @samp{[^...]} operators will never match a newline
-character. The intent of this flag is to treat the target
-string as a buffer containing many lines of text, and the
-regular expression as a pattern that may match a single one of
-those lines.
-@item regexp/basic
-Compile a basic (``obsolete'') regexp instead of the extended
-(``modern'') regexps that are the default. Basic regexps do
-not consider @samp{|}, @samp{+} or @samp{?} to be special
-characters, and require the @samp{@{...@}} and @samp{(...)}
-metacharacters to be backslash-escaped (@pxref{Backslash
-Escapes}). There are several other differences between basic
-and extended regular expressions, but these are the most
-significant.
-@item regexp/extended
-Compile an extended regular expression rather than a basic
-regexp. This is the default behavior; this flag will not
-usually be needed. If a call to @code{make-regexp} includes
-both @code{regexp/basic} and @code{regexp/extended} flags, the
-one which comes last will override the earlier one.
-@end table
-@end deffn
-
-@deffn {Scheme Procedure} regexp-exec rx str [start [flags]]
-@deffnx {C Function} scm_regexp_exec (rx, str, start, flags)
-Match the compiled regular expression @var{rx} against
-@code{str}. If the optional integer @var{start} argument is
-provided, begin matching from that position in the string.
-Return a match structure describing the results of the match,
-or @code{#f} if no match could be found.
-
-The @var{flags} arguments change the matching behavior.
-The following flags may be supplied:
-
-@table @code
-@item regexp/notbol
-Operator @samp{^} always fails (unless @code{regexp/newline}
-is used). Use this when the beginning of the string should
-not be considered the beginning of a line.
-@item regexp/noteol
-Operator @samp{$} always fails (unless @code{regexp/newline}
-is used). Use this when the end of the string should not be
-considered the end of a line.
-@end table
-@end deffn
-
-@deffn {Scheme Procedure} regexp? obj
-@deffnx {C Function} scm_regexp_p (obj)
-Return @code{#t} if @var{obj} is a compiled regular expression,
-or @code{#f} otherwise.
-@end deffn
-
-Regular expressions are commonly used to find patterns in one string and
-replace them with the contents of another string.
-
-@c begin (scm-doc-string "regex.scm" "regexp-substitute")
-@deffn {Scheme Procedure} regexp-substitute port match [item@dots{}]
-Write to the output port @var{port} selected contents of the match
-structure @var{match}. Each @var{item} specifies what should be
-written, and may be one of the following arguments:
-
-@itemize @bullet
-@item
-A string. String arguments are written out verbatim.
-
-@item
-An integer. The submatch with that number is written.
-
-@item
-The symbol @samp{pre}. The portion of the matched string preceding
-the regexp match is written.
-
-@item
-The symbol @samp{post}. The portion of the matched string following
-the regexp match is written.
-@end itemize
-
-@var{port} may be @code{#f}, in which case nothing is written; instead,
-@code{regexp-substitute} constructs a string from the specified
-@var{item}s and returns that.
-@end deffn
-
-@c begin (scm-doc-string "regex.scm" "regexp-substitute")
-@deffn {Scheme Procedure} regexp-substitute/global port regexp target [item@dots{}]
-Similar to @code{regexp-substitute}, but can be used to perform global
-substitutions on @var{str}. Instead of taking a match structure as an
-argument, @code{regexp-substitute/global} takes two string arguments: a
-@var{regexp} string describing a regular expression, and a @var{target}
-string which should be matched against this regular expression.
-
-Each @var{item} behaves as in @var{regexp-substitute}, with the
-following exceptions:
-
-@itemize @bullet
-@item
-A function may be supplied. When this function is called, it will be
-passed one argument: a match structure for a given regular expression
-match. It should return a string to be written out to @var{port}.
-
-@item
-The @samp{post} symbol causes @code{regexp-substitute/global} to recurse
-on the unmatched portion of @var{str}. This @emph{must} be supplied in
-order to perform global search-and-replace on @var{str}; if it is not
-present among the @var{item}s, then @code{regexp-substitute/global} will
-return after processing a single match.
-@end itemize
-@end deffn
-
-@node Match Structures
-@subsection Match Structures
-
-@cindex match structures
-
-A @dfn{match structure} is the object returned by @code{string-match} and
-@code{regexp-exec}. It describes which portion of a string, if any,
-matched the given regular expression. Match structures include: a
-reference to the string that was checked for matches; the starting and
-ending positions of the regexp match; and, if the regexp included any
-parenthesized subexpressions, the starting and ending positions of each
-submatch.
-
-In each of the regexp match functions described below, the @code{match}
-argument must be a match structure returned by a previous call to
-@code{string-match} or @code{regexp-exec}. Most of these functions
-return some information about the original target string that was
-matched against a regular expression; we will call that string
-@var{target} for easy reference.
-
-@c begin (scm-doc-string "regex.scm" "regexp-match?")
-@deffn {Scheme Procedure} regexp-match? obj
-Return @code{#t} if @var{obj} is a match structure returned by a
-previous call to @code{regexp-exec}, or @code{#f} otherwise.
-@end deffn
-
-@c begin (scm-doc-string "regex.scm" "match:substring")
-@deffn {Scheme Procedure} match:substring match [n]
-Return the portion of @var{target} matched by subexpression number
-@var{n}. Submatch 0 (the default) represents the entire regexp match.
-If the regular expression as a whole matched, but the subexpression
-number @var{n} did not match, return @code{#f}.
-@end deffn
-
-@c begin (scm-doc-string "regex.scm" "match:start")
-@deffn {Scheme Procedure} match:start match [n]
-Return the starting position of submatch number @var{n}.
-@end deffn
-
-@c begin (scm-doc-string "regex.scm" "match:end")
-@deffn {Scheme Procedure} match:end match [n]
-Return the ending position of submatch number @var{n}.
-@end deffn
-
-@c begin (scm-doc-string "regex.scm" "match:prefix")
-@deffn {Scheme Procedure} match:prefix match
-Return the unmatched portion of @var{target} preceding the regexp match.
-@end deffn
-
-@c begin (scm-doc-string "regex.scm" "match:suffix")
-@deffn {Scheme Procedure} match:suffix match
-Return the unmatched portion of @var{target} following the regexp match.
-@end deffn
-
-@c begin (scm-doc-string "regex.scm" "match:count")
-@deffn {Scheme Procedure} match:count match
-Return the number of parenthesized subexpressions from @var{match}.
-Note that the entire regular expression match itself counts as a
-subexpression, and failed submatches are included in the count.
-@end deffn
-
-@c begin (scm-doc-string "regex.scm" "match:string")
-@deffn {Scheme Procedure} match:string match
-Return the original @var{target} string.
-@end deffn
-
-@node Backslash Escapes
-@subsection Backslash Escapes
-
-Sometimes you will want a regexp to match characters like @samp{*} or
-@samp{$} exactly. For example, to check whether a particular string
-represents a menu entry from an Info node, it would be useful to match
-it against a regexp like @samp{^* [^:]*::}. However, this won't work;
-because the asterisk is a metacharacter, it won't match the @samp{*} at
-the beginning of the string. In this case, we want to make the first
-asterisk un-magic.
-
-You can do this by preceding the metacharacter with a backslash
-character @samp{\}. (This is also called @dfn{quoting} the
-metacharacter, and is known as a @dfn{backslash escape}.) When Guile
-sees a backslash in a regular expression, it considers the following
-glyph to be an ordinary character, no matter what special meaning it
-would ordinarily have. Therefore, we can make the above example work by
-changing the regexp to @samp{^\* [^:]*::}. The @samp{\*} sequence tells
-the regular expression engine to match only a single asterisk in the
-target string.
-
-Since the backslash is itself a metacharacter, you may force a regexp to
-match a backslash in the target string by preceding the backslash with
-itself. For example, to find variable references in a @TeX{} program,
-you might want to find occurrences of the string @samp{\let\} followed
-by any number of alphabetic characters. The regular expression
-@samp{\\let\\[A-Za-z]*} would do this: the double backslashes in the
-regexp each match a single backslash in the target string.
-
-@c begin (scm-doc-string "regex.scm" "regexp-quote")
-@deffn {Scheme Procedure} regexp-quote str
-Quote each special character found in @var{str} with a backslash, and
-return the resulting string.
-@end deffn
-
-@strong{Very important:} Using backslash escapes in Guile source code
-(as in Emacs Lisp or C) can be tricky, because the backslash character
-has special meaning for the Guile reader. For example, if Guile
-encounters the character sequence @samp{\n} in the middle of a string
-while processing Scheme code, it replaces those characters with a
-newline character. Similarly, the character sequence @samp{\t} is
-replaced by a horizontal tab. Several of these @dfn{escape sequences}
-are processed by the Guile reader before your code is executed.
-Unrecognized escape sequences are ignored: if the characters @samp{\*}
-appear in a string, they will be translated to the single character
-@samp{*}.
-
-This translation is obviously undesirable for regular expressions, since
-we want to be able to include backslashes in a string in order to
-escape regexp metacharacters. Therefore, to make sure that a backslash
-is preserved in a string in your Guile program, you must use @emph{two}
-consecutive backslashes:
-
-@lisp
-(define Info-menu-entry-pattern (make-regexp "^\\* [^:]*"))
-@end lisp
-
-The string in this example is preprocessed by the Guile reader before
-any code is executed. The resulting argument to @code{make-regexp} is
-the string @samp{^\* [^:]*}, which is what we really want.
-
-This also means that in order to write a regular expression that matches
-a single backslash character, the regular expression string in the
-source code must include @emph{four} backslashes. Each consecutive pair
-of backslashes gets translated by the Guile reader to a single
-backslash, and the resulting double-backslash is interpreted by the
-regexp engine as matching a single backslash character. Hence:
-
-@lisp
-(define tex-variable-pattern (make-regexp "\\\\let\\\\=[A-Za-z]*"))
-@end lisp
-
-The reason for the unwieldiness of this syntax is historical. Both
-regular expression pattern matchers and Unix string processing systems
-have traditionally used backslashes with the special meanings
-described above. The POSIX regular expression specification and ANSI C
-standard both require these semantics. Attempting to abandon either
-convention would cause other kinds of compatibility problems, possibly
-more severe ones. Therefore, without extending the Scheme reader to
-support strings with different quoting conventions (an ungainly and
-confusing extension when implemented in other languages), we must adhere
-to this cumbersome escape syntax.
-
-
-@node Symbols
-@section Symbols
-@tpindex Symbols
-
-Symbols in Scheme are widely used in three ways: as items of discrete
-data, as lookup keys for alists and hash tables, and to denote variable
-references.
-
-A @dfn{symbol} is similar to a string in that it is defined by a
-sequence of characters. The sequence of characters is known as the
-symbol's @dfn{name}. In the usual case --- that is, where the symbol's
-name doesn't include any characters that could be confused with other
-elements of Scheme syntax --- a symbol is written in a Scheme program by
-writing the sequence of characters that make up the name, @emph{without}
-any quotation marks or other special syntax. For example, the symbol
-whose name is ``multiply-by-2'' is written, simply:
-
-@lisp
-multiply-by-2
-@end lisp
-
-Notice how this differs from a @emph{string} with contents
-``multiply-by-2'', which is written with double quotation marks, like
-this:
-
-@lisp
-"multiply-by-2"
-@end lisp
-
-Looking beyond how they are written, symbols are different from strings
-in two important respects.
-
-The first important difference is uniqueness. If the same-looking
-string is read twice from two different places in a program, the result
-is two @emph{different} string objects whose contents just happen to be
-the same. If, on the other hand, the same-looking symbol is read twice
-from two different places in a program, the result is the @emph{same}
-symbol object both times.
-
-Given two read symbols, you can use @code{eq?} to test whether they are
-the same (that is, have the same name). @code{eq?} is the most
-efficient comparison operator in Scheme, and comparing two symbols like
-this is as fast as comparing, for example, two numbers. Given two
-strings, on the other hand, you must use @code{equal?} or
-@code{string=?}, which are much slower comparison operators, to
-determine whether the strings have the same contents.
-
-@lisp
-(define sym1 (quote hello))
-(define sym2 (quote hello))
-(eq? sym1 sym2) @result{} #t
-
-(define str1 "hello")
-(define str2 "hello")
-(eq? str1 str2) @result{} #f
-(equal? str1 str2) @result{} #t
-@end lisp
-
-The second important difference is that symbols, unlike strings, are not
-self-evaluating. This is why we need the @code{(quote @dots{})}s in the
-example above: @code{(quote hello)} evaluates to the symbol named
-"hello" itself, whereas an unquoted @code{hello} is @emph{read} as the
-symbol named "hello" and evaluated as a variable reference @dots{} about
-which more below (@pxref{Symbol Variables}).
-
-@menu
-* Symbol Data:: Symbols as discrete data.
-* Symbol Keys:: Symbols as lookup keys.
-* Symbol Variables:: Symbols as denoting variables.
-* Symbol Primitives:: Operations related to symbols.
-* Symbol Props:: Function slots and property lists.
-* Symbol Read Syntax:: Extended read syntax for symbols.
-* Symbol Uninterned:: Uninterned symbols.
-@end menu
-
-
-@node Symbol Data
-@subsection Symbols as Discrete Data
-
-Numbers and symbols are similar to the extent that they both lend
-themselves to @code{eq?} comparison. But symbols are more descriptive
-than numbers, because a symbol's name can be used directly to describe
-the concept for which that symbol stands.
-
-For example, imagine that you need to represent some colours in a
-computer program. Using numbers, you would have to choose arbitrarily
-some mapping between numbers and colours, and then take care to use that
-mapping consistently:
-
-@lisp
-;; 1=red, 2=green, 3=purple
-
-(if (eq? (colour-of car) 1)
- ...)
-@end lisp
-
-@noindent
-You can make the mapping more explicit and the code more readable by
-defining constants:
-
-@lisp
-(define red 1)
-(define green 2)
-(define purple 3)
-
-(if (eq? (colour-of car) red)
- ...)
-@end lisp
-
-@noindent
-But the simplest and clearest approach is not to use numbers at all, but
-symbols whose names specify the colours that they refer to:
-
-@lisp
-(if (eq? (colour-of car) 'red)
- ...)
-@end lisp
-
-The descriptive advantages of symbols over numbers increase as the set
-of concepts that you want to describe grows. Suppose that a car object
-can have other properties as well, such as whether it has or uses:
-
-@itemize @bullet
-@item
-automatic or manual transmission
-@item
-leaded or unleaded fuel
-@item
-power steering (or not).
-@end itemize
-
-@noindent
-Then a car's combined property set could be naturally represented and
-manipulated as a list of symbols:
-
-@lisp
-(properties-of car1)
-@result{}
-(red manual unleaded power-steering)
-
-(if (memq 'power-steering (properties-of car1))
- (display "Unfit people can drive this car.\n")
- (display "You'll need strong arms to drive this car!\n"))
-@print{}
-Unfit people can drive this car.
-@end lisp
-
-Remember, the fundamental property of symbols that we are relying on
-here is that an occurrence of @code{'red} in one part of a program is an
-@emph{indistinguishable} symbol from an occurrence of @code{'red} in
-another part of a program; this means that symbols can usefully be
-compared using @code{eq?}. At the same time, symbols have naturally
-descriptive names. This combination of efficiency and descriptive power
-makes them ideal for use as discrete data.
-
-
-@node Symbol Keys
-@subsection Symbols as Lookup Keys
-
-Given their efficiency and descriptive power, it is natural to use
-symbols as the keys in an association list or hash table.
-
-To illustrate this, consider a more structured representation of the car
-properties example from the preceding subsection. Rather than
-mixing all the properties up together in a flat list, we could use an
-association list like this:
-
-@lisp
-(define car1-properties '((colour . red)
- (transmission . manual)
- (fuel . unleaded)
- (steering . power-assisted)))
-@end lisp
-
-Notice how this structure is more explicit and extensible than the flat
-list. For example it makes clear that @code{manual} refers to the
-transmission rather than, say, the windows or the locking of the car.
-It also allows further properties to use the same symbols among their
-possible values without becoming ambiguous:
-
-@lisp
-(define car1-properties '((colour . red)
- (transmission . manual)
- (fuel . unleaded)
- (steering . power-assisted)
- (seat-colour . red)
- (locking . manual)))
-@end lisp
-
-With a representation like this, it is easy to use the efficient
-@code{assq-XXX} family of procedures (@pxref{Association Lists}) to
-extract or change individual pieces of information:
-
-@lisp
-(assq-ref car1-properties 'fuel) @result{} unleaded
-(assq-ref car1-properties 'transmission) @result{} manual
-
-(assq-set! car1-properties 'seat-colour 'black)
-@result{}
-((colour . red)
- (transmission . manual)
- (fuel . unleaded)
- (steering . power-assisted)
- (seat-colour . black)
- (locking . manual)))
-@end lisp
-
-Hash tables also have keys, and exactly the same arguments apply to the
-use of symbols in hash tables as in association lists. The hash value
-that Guile uses to decide where to add a symbol-keyed entry to a hash
-table can be obtained by calling the @code{symbol-hash} procedure:
-
-@deffn {Scheme Procedure} symbol-hash symbol
-@deffnx {C Function} scm_symbol_hash (symbol)
-Return a hash value for @var{symbol}.
-@end deffn
-
-See @ref{Hash Tables} for information about hash tables in general, and
-for why you might choose to use a hash table rather than an association
-list.
-
-
-@node Symbol Variables
-@subsection Symbols as Denoting Variables
-
-When an unquoted symbol in a Scheme program is evaluated, it is
-interpreted as a variable reference, and the result of the evaluation is
-the appropriate variable's value.
-
-For example, when the expression @code{(string-length "abcd")} is read
-and evaluated, the sequence of characters @code{string-length} is read
-as the symbol whose name is "string-length". This symbol is associated
-with a variable whose value is the procedure that implements string
-length calculation. Therefore evaluation of the @code{string-length}
-symbol results in that procedure.
-
-The details of the connection between an unquoted symbol and the
-variable to which it refers are explained elsewhere. See @ref{Binding
-Constructs}, for how associations between symbols and variables are
-created, and @ref{Modules}, for how those associations are affected by
-Guile's module system.
-
-
-@node Symbol Primitives
-@subsection Operations Related to Symbols
-
-Given any Scheme value, you can determine whether it is a symbol using
-the @code{symbol?} primitive:
-
-@rnindex symbol?
-@deffn {Scheme Procedure} symbol? obj
-@deffnx {C Function} scm_symbol_p (obj)
-Return @code{#t} if @var{obj} is a symbol, otherwise return
-@code{#f}.
-@end deffn
-
-Once you know that you have a symbol, you can obtain its name as a
-string by calling @code{symbol->string}. Note that Guile differs by
-default from R5RS on the details of @code{symbol->string} as regards
-case-sensitivity:
-
-@rnindex symbol->string
-@deffn {Scheme Procedure} symbol->string s
-@deffnx {C Function} scm_symbol_to_string (s)
-Return the name of symbol @var{s} as a string. By default, Guile reads
-symbols case-sensitively, so the string returned will have the same case
-variation as the sequence of characters that caused @var{s} to be
-created.
-
-If Guile is set to read symbols case-insensitively (as specified by
-R5RS), and @var{s} comes into being as part of a literal expression
-(@pxref{Literal expressions,,,r5rs, The Revised^5 Report on Scheme}) or
-by a call to the @code{read} or @code{string-ci->symbol} procedures,
-Guile converts any alphabetic characters in the symbol's name to
-lower case before creating the symbol object, so the string returned
-here will be in lower case.
-
-If @var{s} was created by @code{string->symbol}, the case of characters
-in the string returned will be the same as that in the string that was
-passed to @code{string->symbol}, regardless of Guile's case-sensitivity
-setting at the time @var{s} was created.
-
-It is an error to apply mutation procedures like @code{string-set!} to
-strings returned by this procedure.
-@end deffn
-
-Most symbols are created by writing them literally in code. However it
-is also possible to create symbols programmatically using the following
-@code{string->symbol} and @code{string-ci->symbol} procedures:
-
-@rnindex string->symbol
-@deffn {Scheme Procedure} string->symbol string
-@deffnx {C Function} scm_string_to_symbol (string)
-Return the symbol whose name is @var{string}. This procedure can create
-symbols with names containing special characters or letters in the
-non-standard case, but it is usually a bad idea to create such symbols
-because in some implementations of Scheme they cannot be read as
-themselves.
-@end deffn
-
-@deffn {Scheme Procedure} string-ci->symbol str
-@deffnx {C Function} scm_string_ci_to_symbol (str)
-Return the symbol whose name is @var{str}. If Guile is currently
-reading symbols case-insensitively, @var{str} is converted to lowercase
-before the returned symbol is looked up or created.
-@end deffn
-
-The following examples illustrate Guile's detailed behaviour as regards
-the case-sensitivity of symbols:
-
-@lisp
-(read-enable 'case-insensitive) ; R5RS compliant behaviour
-
-(symbol->string 'flying-fish) @result{} "flying-fish"
-(symbol->string 'Martin) @result{} "martin"
-(symbol->string
- (string->symbol "Malvina")) @result{} "Malvina"
-
-(eq? 'mISSISSIppi 'mississippi) @result{} #t
-(string->symbol "mISSISSIppi") @result{} mISSISSIppi
-(eq? 'bitBlt (string->symbol "bitBlt")) @result{} #f
-(eq? 'LolliPop
- (string->symbol (symbol->string 'LolliPop))) @result{} #t
-(string=? "K. Harper, M.D."
- (symbol->string
- (string->symbol "K. Harper, M.D."))) @result{} #t
-
-(read-disable 'case-insensitive) ; Guile default behaviour
-
-(symbol->string 'flying-fish) @result{} "flying-fish"
-(symbol->string 'Martin) @result{} "Martin"
-(symbol->string
- (string->symbol "Malvina")) @result{} "Malvina"
-
-(eq? 'mISSISSIppi 'mississippi) @result{} #f
-(string->symbol "mISSISSIppi") @result{} mISSISSIppi
-(eq? 'bitBlt (string->symbol "bitBlt")) @result{} #t
-(eq? 'LolliPop
- (string->symbol (symbol->string 'LolliPop))) @result{} #t
-(string=? "K. Harper, M.D."
- (symbol->string
- (string->symbol "K. Harper, M.D."))) @result{} #t
-@end lisp
-
-Finally, some applications, especially those that generate new Scheme
-code dynamically, need to generate symbols for use in the generated
-code. The @code{gensym} primitive meets this need:
-
-@deffn {Scheme Procedure} gensym [prefix]
-@deffnx {C Function} scm_gensym (prefix)
-Create a new symbol with a name constructed from a prefix and a counter
-value. The string @var{prefix} can be specified as an optional
-argument. Default prefix is @samp{ g}. The counter is increased by 1
-at each call. There is no provision for resetting the counter.
-@end deffn
-
-The symbols generated by @code{gensym} are @emph{likely} to be unique,
-since their names begin with a space and it is only otherwise possible
-to generate such symbols if a programmer goes out of their way to do
-so. The 1.8 release of Guile will include a way of creating
-symbols that are @emph{guaranteed} to be unique.
-
-
-@node Symbol Props
-@subsection Function Slots and Property Lists
-
-In traditional Lisp dialects, symbols are often understood as having
-three kinds of value at once:
-
-@itemize @bullet
-@item
-a @dfn{variable} value, which is used when the symbol appears in
-code in a variable reference context
-
-@item
-a @dfn{function} value, which is used when the symbol appears in
-code in a function name position (i.e. as the first element in an
-unquoted list)
-
-@item
-a @dfn{property list} value, which is used when the symbol is given as
-the first argument to Lisp's @code{put} or @code{get} functions.
-@end itemize
-
-Although Scheme (as one of its simplifications with respect to Lisp)
-does away with the distinction between variable and function namespaces,
-Guile currently retains some elements of the traditional structure in
-case they turn out to be useful when implementing translators for other
-languages, in particular Emacs Lisp.
-
-Specifically, Guile symbols have two extra slots. for a symbol's
-property list, and for its ``function value.'' The following procedures
-are provided to access these slots.
-
-@deffn {Scheme Procedure} symbol-fref symbol
-@deffnx {C Function} scm_symbol_fref (symbol)
-Return the contents of @var{symbol}'s @dfn{function slot}.
-@end deffn
-
-@deffn {Scheme Procedure} symbol-fset! symbol value
-@deffnx {C Function} scm_symbol_fset_x (symbol, value)
-Set the contents of @var{symbol}'s function slot to @var{value}.
-@end deffn
-
-@deffn {Scheme Procedure} symbol-pref symbol
-@deffnx {C Function} scm_symbol_pref (symbol)
-Return the @dfn{property list} currently associated with @var{symbol}.
-@end deffn
-
-@deffn {Scheme Procedure} symbol-pset! symbol value
-@deffnx {C Function} scm_symbol_pset_x (symbol, value)
-Set @var{symbol}'s property list to @var{value}.
-@end deffn
-
-@deffn {Scheme Procedure} symbol-property sym prop
-From @var{sym}'s property list, return the value for property
-@var{prop}. The assumption is that @var{sym}'s property list is an
-association list whose keys are distinguished from each other using
-@code{equal?}; @var{prop} should be one of the keys in that list. If
-the property list has no entry for @var{prop}, @code{symbol-property}
-returns @code{#f}.
-@end deffn
-
-@deffn {Scheme Procedure} set-symbol-property sym prop val
-In @var{sym}'s property list, set the value for property @var{prop} to
-@var{val}, or add a new entry for @var{prop}, with value @var{val}, if
-none already exists. For the structure of the property list, see
-@code{symbol-property}.
-@end deffn
-
-@deffn {Scheme Procedure} symbol-property-remove! sym prop
-From @var{sym}'s property list, remove the entry for property
-@var{prop}, if there is one. For the structure of the property list,
-see @code{symbol-property}.
-@end deffn
-
-Support for these extra slots may be removed in a future release, and it
-is probably better to avoid using them. (In release 1.6, Guile itself
-uses the property list slot sparingly, and the function slot not at
-all.) For a more modern and Schemely approach to properties, see
-@ref{Object Properties}.
-
-
-@node Symbol Read Syntax
-@subsection Extended Read Syntax for Symbols
-
-The read syntax for a symbol is a sequence of letters, digits, and
-@dfn{extended alphabetic characters}, beginning with a character that
-cannot begin a number. In addition, the special cases of @code{+},
-@code{-}, and @code{...} are read as symbols even though numbers can
-begin with @code{+}, @code{-} or @code{.}.
-
-Extended alphabetic characters may be used within identifiers as if
-they were letters. The set of extended alphabetic characters is:
-
-@example
-! $ % & * + - . / : < = > ? @@ ^ _ ~
-@end example
-
-In addition to the standard read syntax defined above (which is taken
-from R5RS (@pxref{Formal syntax,,,r5rs,The Revised^5 Report on
-Scheme})), Guile provides an extended symbol read syntax that allows the
-inclusion of unusual characters such as space characters, newlines and
-parentheses. If (for whatever reason) you need to write a symbol
-containing characters not mentioned above, you can do so as follows.
-
-@itemize @bullet
-@item
-Begin the symbol with the characters @code{#@{},
-
-@item
-write the characters of the symbol and
-
-@item
-finish the symbol with the characters @code{@}#}.
-@end itemize
-
-Here are a few examples of this form of read syntax. The first symbol
-needs to use extended syntax because it contains a space character, the
-second because it contains a line break, and the last because it looks
-like a number.
-
-@lisp
-#@{foo bar@}#
-
-#@{what
-ever@}#
-
-#@{4242@}#
-@end lisp
-
-Although Guile provides this extended read syntax for symbols,
-widespread usage of it is discouraged because it is not portable and not
-very readable.
-
-
-@node Symbol Uninterned
-@subsection Uninterned Symbols
-
-What makes symbols useful is that they are automatically kept unique.
-There are no two symbols that are distinct objects but have the same
-name. But of course, there is no rule without exception. In addition
-to the normal symbols that have been discussed up to now, you can also
-create special @dfn{uninterned} symbols that behave slightly
-differently.
-
-To understand what is different about them and why they might be useful,
-we look at how normal symbols are actually kept unique.
-
-Whenever Guile wants to find the symbol with a specific name, for
-example during @code{read} or when executing @code{string->symbol}, it
-first looks into a table of all existing symbols to find out whether a
-symbol with the given name already exists. When this is the case, Guile
-just returns that symbol. When not, a new symbol with the name is
-created and entered into the table so that it can be found later.
-
-Sometimes you might want to create a symbol that is guaranteed `fresh',
-i.e. a symbol that did not exist previously. You might also want to
-somehow guarantee that no one else will ever unintentionally stumble
-across your symbol in the future. These properties of a symbol are
-often needed when generating code during macro expansion. When
-introducing new temporary variables, you want to guarantee that they
-don't conflict with variables in other people's code.
-
-The simplest way to arrange for this is to create a new symbol but
-not enter it into the global table of all symbols. That way, no one
-will ever get access to your symbol by chance. Symbols that are not in
-the table are called @dfn{uninterned}. Of course, symbols that
-@emph{are} in the table are called @dfn{interned}.
-
-You create new uninterned symbols with the function @code{make-symbol}.
-You can test whether a symbol is interned or not with
-@code{symbol-interned?}.
-
-Uninterned symbols break the rule that the name of a symbol uniquely
-identifies the symbol object. Because of this, they can not be written
-out and read back in like interned symbols. Currently, Guile has no
-support for reading uninterned symbols. Note that the function
-@code{gensym} does not return uninterned symbols for this reason.
-
-@deffn {Scheme Procedure} make-symbol name
-@deffnx {C Function} scm_make_symbol (name)
-Return a new uninterned symbol with the name @var{name}. The returned
-symbol is guaranteed to be unique and future calls to
-@code{string->symbol} will not return it.
-@end deffn
-
-@deffn {Scheme Procedure} symbol-interned? symbol
-@deffnx {C Function} scm_symbol_interned_p (symbol)
-Return @code{#t} if @var{symbol} is interned, otherwise return
-@code{#f}.
-@end deffn
-
-For example:
-
-@lisp
-(define foo-1 (string->symbol "foo"))
-(define foo-2 (string->symbol "foo"))
-(define foo-3 (make-symbol "foo"))
-(define foo-4 (make-symbol "foo"))
-
-(eq? foo-1 foo-2)
-@result{} #t
-; Two interned symbols with the same name are the same object,
-
-(eq? foo-1 foo-3)
-@result{} #f
-; but a call to make-symbol with the same name returns a
-; distinct object.
-
-(eq? foo-3 foo-4)
-@result{} #f
-; A call to make-symbol always returns a new object, even for
-; the same name.
-
-foo-3
-@result{} #<uninterned-symbol foo 8085290>
-; Uninterned symbols print differently from interned symbols,
-
-(symbol? foo-3)
-@result{} #t
-; but they are still symbols,
-
-(symbol-interned? foo-3)
-@result{} #f
-; just not interned.
-@end lisp
-
-
-@node Keywords
-@section Keywords
-@tpindex Keywords
-
-Keywords are self-evaluating objects with a convenient read syntax that
-makes them easy to type.
-
-Guile's keyword support conforms to R5RS, and adds a (switchable) read
-syntax extension to permit keywords to begin with @code{:} as well as
-@code{#:}.
-
-@menu
-* Why Use Keywords?:: Motivation for keyword usage.
-* Coding With Keywords:: How to use keywords.
-* Keyword Read Syntax:: Read syntax for keywords.
-* Keyword Procedures:: Procedures for dealing with keywords.
-* Keyword Primitives:: The underlying primitive procedures.
-@end menu
-
-@node Why Use Keywords?
-@subsection Why Use Keywords?
-
-Keywords are useful in contexts where a program or procedure wants to be
-able to accept a large number of optional arguments without making its
-interface unmanageable.
-
-To illustrate this, consider a hypothetical @code{make-window}
-procedure, which creates a new window on the screen for drawing into
-using some graphical toolkit. There are many parameters that the caller
-might like to specify, but which could also be sensibly defaulted, for
-example:
-
-@itemize @bullet
-@item
-color depth -- Default: the color depth for the screen
-
-@item
-background color -- Default: white
-
-@item
-width -- Default: 600
-
-@item
-height -- Default: 400
-@end itemize
-
-If @code{make-window} did not use keywords, the caller would have to
-pass in a value for each possible argument, remembering the correct
-argument order and using a special value to indicate the default value
-for that argument:
-
-@lisp
-(make-window 'default ;; Color depth
- 'default ;; Background color
- 800 ;; Width
- 100 ;; Height
- @dots{}) ;; More make-window arguments
-@end lisp
-
-With keywords, on the other hand, defaulted arguments are omitted, and
-non-default arguments are clearly tagged by the appropriate keyword. As
-a result, the invocation becomes much clearer:
-
-@lisp
-(make-window #:width 800 #:height 100)
-@end lisp
-
-On the other hand, for a simpler procedure with few arguments, the use
-of keywords would be a hindrance rather than a help. The primitive
-procedure @code{cons}, for example, would not be improved if it had to
-be invoked as
-
-@lisp
-(cons #:car x #:cdr y)
-@end lisp
-
-So the decision whether to use keywords or not is purely pragmatic: use
-them if they will clarify the procedure invocation at point of call.
-
-@node Coding With Keywords
-@subsection Coding With Keywords
-
-If a procedure wants to support keywords, it should take a rest argument
-and then use whatever means is convenient to extract keywords and their
-corresponding arguments from the contents of that rest argument.
-
-The following example illustrates the principle: the code for
-@code{make-window} uses a helper procedure called
-@code{get-keyword-value} to extract individual keyword arguments from
-the rest argument.
-
-@lisp
-(define (get-keyword-value args keyword default)
- (let ((kv (memq keyword args)))
- (if (and kv (>= (length kv) 2))
- (cadr kv)
- default)))
-
-(define (make-window . args)
- (let ((depth (get-keyword-value args #:depth screen-depth))
- (bg (get-keyword-value args #:bg "white"))
- (width (get-keyword-value args #:width 800))
- (height (get-keyword-value args #:height 100))
- @dots{})
- @dots{}))
-@end lisp
-
-But you don't need to write @code{get-keyword-value}. The @code{(ice-9
-optargs)} module provides a set of powerful macros that you can use to
-implement keyword-supporting procedures like this:
-
-@lisp
-(use-modules (ice-9 optargs))
-
-(define (make-window . args)
- (let-keywords args #f ((depth screen-depth)
- (bg "white")
- (width 800)
- (height 100))
- ...))
-@end lisp
-
-@noindent
-Or, even more economically, like this:
-
-@lisp
-(use-modules (ice-9 optargs))
-
-(define* (make-window #:key (depth screen-depth)
- (bg "white")
- (width 800)
- (height 100))
- ...)
-@end lisp
-
-For further details on @code{let-keywords}, @code{define*} and other
-facilities provided by the @code{(ice-9 optargs)} module, see
-@ref{Optional Arguments}.
-
-
-@node Keyword Read Syntax
-@subsection Keyword Read Syntax
-
-Guile, by default, only recognizes the keyword syntax specified by R5RS.
-A token of the form @code{#:NAME}, where @code{NAME} has the same syntax
-as a Scheme symbol (@pxref{Symbol Read Syntax}), is the external
-representation of the keyword named @code{NAME}. Keyword objects print
-using this syntax as well, so values containing keyword objects can be
-read back into Guile. When used in an expression, keywords are
-self-quoting objects.
-
-If the @code{keyword} read option is set to @code{'prefix}, Guile also
-recognizes the alternative read syntax @code{:NAME}. Otherwise, tokens
-of the form @code{:NAME} are read as symbols, as required by R5RS.
-
-To enable and disable the alternative non-R5RS keyword syntax, you use
-the @code{read-options} procedure documented in @ref{General option
-interface} and @ref{Reader options}.
-
-@smalllisp
-(read-set! keywords 'prefix)
-
-#:type
-@result{}
-#:type
-
-:type
-@result{}
-#:type
-
-(read-set! keywords #f)
-
-#:type
-@result{}
-#:type
-
-:type
-@print{}
-ERROR: In expression :type:
-ERROR: Unbound variable: :type
-ABORT: (unbound-variable)
-@end smalllisp
-
-@node Keyword Procedures
-@subsection Keyword Procedures
-
-The following procedures can be used for converting symbols to keywords
-and back.
-
-@deffn {Scheme Procedure} symbol->keyword sym
-Return a keyword with the same characters as in @var{sym}.
-@end deffn
-
-@deffn {Scheme Procedure} keyword->symbol kw
-Return a symbol with the same characters as in @var{kw}.
-@end deffn
-
-
-@node Keyword Primitives
-@subsection Keyword Primitives
-
-Internally, a keyword is implemented as something like a tagged symbol,
-where the tag identifies the keyword as being self-evaluating, and the
-symbol, known as the keyword's @dfn{dash symbol} has the same name as
-the keyword name but prefixed by a single dash. For example, the
-keyword @code{#:name} has the corresponding dash symbol @code{-name}.
-
-Most keyword objects are constructed automatically by the reader when it
-reads a token beginning with @code{#:}. However, if you need to
-construct a keyword object programmatically, you can do so by calling
-@code{make-keyword-from-dash-symbol} with the corresponding dash symbol
-(as the reader does). The dash symbol for a keyword object can be
-retrieved using the @code{keyword-dash-symbol} procedure.
-
-@deffn {Scheme Procedure} make-keyword-from-dash-symbol symbol
-@deffnx {C Function} scm_make_keyword_from_dash_symbol (symbol)
-Make a keyword object from a @var{symbol} that starts with a dash.
-@end deffn
-
-@deffn {Scheme Procedure} keyword? obj
-@deffnx {C Function} scm_keyword_p (obj)
-Return @code{#t} if the argument @var{obj} is a keyword, else
-@code{#f}.
-@end deffn
-
-@deffn {Scheme Procedure} keyword-dash-symbol keyword
-@deffnx {C Function} scm_keyword_dash_symbol (keyword)
-Return the dash symbol for @var{keyword}.
-This is the inverse of @code{make-keyword-from-dash-symbol}.
-@end deffn
-
-
-@node Other Types
-@section ``Functionality-Centric'' Data Types
-
-Procedures and macros are documented in their own chapter: see
-@ref{Procedures and Macros}.
-
-Variable objects are documented as part of the description of Guile's
-module system: see @ref{Variables}.
-
-Asyncs, dynamic roots and fluids are described in the chapter on
-scheduling: see @ref{Scheduling}.
-
-Hooks are documented in the chapter on general utility functions: see
-@ref{Hooks}.
-
-Ports are described in the chapter on I/O: see @ref{Input and Output}.
-
-
-@c Local Variables:
-@c TeX-master: "guile.texi"
-@c End:
diff --git a/doc/ref/scheme-debug.texi b/doc/ref/scheme-debug.texi
deleted file mode 100644
index 670bd0884..000000000
--- a/doc/ref/scheme-debug.texi
+++ /dev/null
@@ -1,206 +0,0 @@
-@page
-@node Debugging
-@chapter Debugging Infrastructure
-
-@deffn {Scheme Procedure} debug-options-interface [setting]
-@deffnx {C Function} scm_debug_options (setting)
-Option interface for the debug options. Instead of using
-this procedure directly, use the procedures @code{debug-enable},
-@code{debug-disable}, @code{debug-set!} and @code{debug-options}.
-@end deffn
-
-
-@section Using Traps
-
-@deffn {Scheme Procedure} with-traps thunk
-@deffnx {C Function} scm_with_traps (thunk)
-Call @var{thunk} with traps enabled.
-@end deffn
-
-@deffn {Scheme Procedure} debug-object? obj
-@deffnx {C Function} scm_debug_object_p (obj)
-Return @code{#t} if @var{obj} is a debug object.
-@end deffn
-
-
-@section Capturing the Stack or Innermost Stack Frame
-
-When an error occurs in a running program, or the program hits a
-breakpoint, its state at that point can be represented by a @dfn{stack}
-of all the evaluations and procedure applications that are logically in
-progress at that time, each of which is known as a @dfn{frame}. The
-programmer can learn more about the program's state at the point of
-interruption or error by inspecting the stack and its frames.
-
-@deffn {Scheme Procedure} make-stack obj . args
-@deffnx {C Function} scm_make_stack (obj, args)
-Create a new stack. If @var{obj} is @code{#t}, the current
-evaluation stack is used for creating the stack frames,
-otherwise the frames are taken from @var{obj} (which must be
-either a debug object or a continuation).
-
-@var{args} should be a list containing any combination of
-integer, procedure and @code{#t} values.
-
-These values specify various ways of cutting away uninteresting
-stack frames from the top and bottom of the stack that
-@code{make-stack} returns. They come in pairs like this:
-@code{(@var{inner_cut_1} @var{outer_cut_1} @var{inner_cut_2}
-@var{outer_cut_2} @dots{})}.
-
-Each @var{inner_cut_N} can be @code{#t}, an integer, or a
-procedure. @code{#t} means to cut away all frames up to but
-excluding the first user module frame. An integer means to cut
-away exactly that number of frames. A procedure means to cut
-away all frames up to but excluding the application frame whose
-procedure matches the specified one.
-
-Each @var{outer_cut_N} can be an integer or a procedure. An
-integer means to cut away that number of frames. A procedure
-means to cut away frames down to but excluding the application
-frame whose procedure matches the specified one.
-
-If the @var{outer_cut_N} of the last pair is missing, it is
-taken as 0.
-@end deffn
-
-@deffn {Scheme Procedure} last-stack-frame obj
-@deffnx {C Function} scm_last_stack_frame (obj)
-Return a stack which consists of a single frame, which is the
-last stack frame for @var{obj}. @var{obj} must be either a
-debug object or a continuation.
-@end deffn
-
-
-@section Examining the Stack
-
-@deffn {Scheme Procedure} stack? obj
-@deffnx {C Function} scm_stack_p (obj)
-Return @code{#t} if @var{obj} is a calling stack.
-@end deffn
-
-@deffn {Scheme Procedure} stack-id stack
-@deffnx {C Function} scm_stack_id (stack)
-Return the identifier given to @var{stack} by @code{start-stack}.
-@end deffn
-
-@deffn {Scheme Procedure} stack-length stack
-@deffnx {C Function} scm_stack_length (stack)
-Return the length of @var{stack}.
-@end deffn
-
-@deffn {Scheme Procedure} stack-ref stack index
-@deffnx {C Function} scm_stack_ref (stack, index)
-Return the @var{index}'th frame from @var{stack}.
-@end deffn
-
-@deffn {Scheme Procedure} display-backtrace stack port [first [depth]]
-@deffnx {C Function} scm_display_backtrace (stack, port, first, depth)
-Display a backtrace to the output port @var{port}. @var{stack}
-is the stack to take the backtrace from, @var{first} specifies
-where in the stack to start and @var{depth} how much frames
-to display. Both @var{first} and @var{depth} can be @code{#f},
-which means that default values will be used.
-@end deffn
-
-
-@section Examining Stack Frames
-
-@deffn {Scheme Procedure} frame? obj
-@deffnx {C Function} scm_frame_p (obj)
-Return @code{#t} if @var{obj} is a stack frame.
-@end deffn
-
-@deffn {Scheme Procedure} frame-number frame
-@deffnx {C Function} scm_frame_number (frame)
-Return the frame number of @var{frame}.
-@end deffn
-
-@deffn {Scheme Procedure} frame-previous frame
-@deffnx {C Function} scm_frame_previous (frame)
-Return the previous frame of @var{frame}, or @code{#f} if
-@var{frame} is the first frame in its stack.
-@end deffn
-
-@deffn {Scheme Procedure} frame-next frame
-@deffnx {C Function} scm_frame_next (frame)
-Return the next frame of @var{frame}, or @code{#f} if
-@var{frame} is the last frame in its stack.
-@end deffn
-
-@deffn {Scheme Procedure} frame-source frame
-@deffnx {C Function} scm_frame_source (frame)
-Return the source of @var{frame}.
-@end deffn
-
-@deffn {Scheme Procedure} frame-procedure? frame
-@deffnx {C Function} scm_frame_procedure_p (frame)
-Return @code{#t} if a procedure is associated with @var{frame}.
-@end deffn
-
-@deffn {Scheme Procedure} frame-procedure frame
-@deffnx {C Function} scm_frame_procedure (frame)
-Return the procedure for @var{frame}, or @code{#f} if no
-procedure is associated with @var{frame}.
-@end deffn
-
-@deffn {Scheme Procedure} frame-arguments frame
-@deffnx {C Function} scm_frame_arguments (frame)
-Return the arguments of @var{frame}.
-@end deffn
-
-@deffn {Scheme Procedure} frame-evaluating-args? frame
-@deffnx {C Function} scm_frame_evaluating_args_p (frame)
-Return @code{#t} if @var{frame} contains evaluated arguments.
-@end deffn
-
-@deffn {Scheme Procedure} frame-overflow? frame
-@deffnx {C Function} scm_frame_overflow_p (frame)
-Return @code{#t} if @var{frame} is an overflow frame.
-@end deffn
-
-@deffn {Scheme Procedure} frame-real? frame
-@deffnx {C Function} scm_frame_real_p (frame)
-Return @code{#t} if @var{frame} is a real frame.
-@end deffn
-
-@deffn {Scheme Procedure} display-application frame [port [indent]]
-@deffnx {C Function} scm_display_application (frame, port, indent)
-Display a procedure application @var{frame} to the output port
-@var{port}. @var{indent} specifies the indentation of the
-output.
-@end deffn
-
-
-@section Decoding Memoized Source Expressions
-
-@deffn {Scheme Procedure} memoized? obj
-@deffnx {C Function} scm_memoized_p (obj)
-Return @code{#t} if @var{obj} is memoized.
-@end deffn
-
-@deffn {Scheme Procedure} unmemoize m
-@deffnx {C Function} scm_unmemoize (m)
-Unmemoize the memoized expression @var{m},
-@end deffn
-
-@deffn {Scheme Procedure} memoized-environment m
-@deffnx {C Function} scm_memoized_environment (m)
-Return the environment of the memoized expression @var{m}.
-@end deffn
-
-
-@section Starting a New Stack
-
-@deffn {Scheme Syntax} start-stack id exp
-Evaluate @var{exp} on a new calling stack with identity @var{id}. If
-@var{exp} is interrupted during evaluation, backtraces will not display
-frames farther back than @var{exp}'s top-level form. This macro is a
-way of artificially limiting backtraces and stack procedures, largely as
-a convenience to the user.
-@end deffn
-
-
-@c Local Variables:
-@c TeX-master: "guile.texi"
-@c End:
diff --git a/doc/ref/scheme-evaluation.texi b/doc/ref/scheme-evaluation.texi
deleted file mode 100644
index b73f8316d..000000000
--- a/doc/ref/scheme-evaluation.texi
+++ /dev/null
@@ -1,426 +0,0 @@
-@page
-@node Read/Load/Eval
-@chapter Reading and Evaluating Scheme Code
-
-This chapter describes Guile functions that are concerned with reading,
-loading and evaluating Scheme code at run time.
-
-@menu
-* Scheme Syntax:: Standard and extended Scheme syntax.
-* Scheme Read:: Reading Scheme code.
-* Fly Evaluation:: Procedures for on the fly evaluation.
-* Loading:: Loading Scheme code from file.
-* Delayed Evaluation:: Postponing evaluation until it is needed.
-* Local Evaluation:: Evaluation in a local environment.
-* Evaluator Behaviour:: Modifying Guile's evaluator.
-@end menu
-
-
-@node Scheme Syntax
-@section Scheme Syntax: Standard and Guile Extensions
-
-@menu
-* Expression Syntax::
-* Comments::
-* Block Comments::
-* Case Sensitivity::
-* Keyword Syntax::
-* Reader Extensions::
-@end menu
-
-
-@node Expression Syntax
-@subsection Expression Syntax
-
-
-@node Comments
-@subsection Comments
-
-@c FIXME::martin: Review me!
-
-Comments in Scheme source files are written by starting them with a
-semicolon character (@code{;}). The comment then reaches up to the end
-of the line. Comments can begin at any column, and the may be inserted
-on the same line as Scheme code.
-
-@lisp
-; Comment
-;; Comment too
-(define x 1) ; Comment after expression
-(let ((y 1))
- ;; Display something.
- (display y)
-;;; Comment at left margin.
- (display (+ y 1)))
-@end lisp
-
-It is common to use a single semicolon for comments following
-expressions on a line, to use two semicolons for comments which are
-indented like code, and three semicolons for comments which start at
-column 0, even if they are inside an indented code block. This
-convention is used when indenting code in Emacs' Scheme mode.
-
-
-@node Block Comments
-@subsection Block Comments
-
-@c FIXME::martin: Review me!
-
-@cindex multiline comments
-In addition to the standard line comments defined by R5RS, Guile has
-another comment type for multiline comments, called @dfn{block
-comments}. This type of comment begins with the character sequence
-@code{#!} and ends with the characters @code{!#}, which must appear on a
-line of their own. These comments are compatible with the block
-comments in the Scheme Shell @file{scsh} (@pxref{The Scheme shell
-(scsh)}). The characters @code{#!} were chosen because they are the
-magic characters used in shell scripts for indicating that the name of
-the program for executing the script follows on the same line.
-
-Thus a Guile script often starts like this.
-
-@lisp
-#! /usr/local/bin/guile -s
-!#
-@end lisp
-
-More details on Guile scripting can be found in the scripting section
-(@pxref{Guile Scripting}).
-
-
-@node Case Sensitivity
-@subsection Case Sensitivity
-
-@c FIXME::martin: Review me!
-
-Scheme as defined in R5RS is not case sensitive when reading symbols.
-Guile, on the contrary is case sensitive by default, so the identifiers
-
-@lisp
-guile-whuzzy
-Guile-Whuzzy
-@end lisp
-
-are the same in R5RS Scheme, but are different in Guile.
-
-It is possible to turn off case sensitivity in Guile by setting the
-reader option @code{case-insensitive}. More on reader options can be
-found at (@pxref{Reader options}).
-
-@lisp
-(read-enable 'case-insensitive)
-@end lisp
-
-Note that this is seldom a problem, because Scheme programmers tend not
-to use uppercase letters in their identifiers anyway.
-
-
-@node Keyword Syntax
-@subsection Keyword Syntax
-
-
-@node Reader Extensions
-@subsection Reader Extensions
-
-@deffn {Scheme Procedure} read-hash-extend chr proc
-@deffnx {C Function} scm_read_hash_extend (chr, proc)
-Install the procedure @var{proc} for reading expressions
-starting with the character sequence @code{#} and @var{chr}.
-@var{proc} will be called with two arguments: the character
-@var{chr} and the port to read further data from. The object
-returned will be the return value of @code{read}.
-@end deffn
-
-
-@node Scheme Read
-@section Reading Scheme Code
-
-@rnindex read
-@deffn {Scheme Procedure} read [port]
-@deffnx {C Function} scm_read (port)
-Read an s-expression from the input port @var{port}, or from
-the current input port if @var{port} is not specified.
-Any whitespace before the next token is discarded.
-@end deffn
-
-The behaviour of Guile's Scheme reader can be modified by manipulating
-its read options. For more information about options, @xref{General
-option interface}. If you want to know which reader options are
-available, @xref{Reader options}.
-
-@c FIXME::martin: This is taken from libguile/options.c. Is there
-@c actually a difference between 'help and 'full?
-
-@deffn {Scheme Procedure} read-options [setting]
-Display the current settings of the read options. If @var{setting} is
-omitted, only a short form of the current read options is printed.
-Otherwise, @var{setting} should be one of the following symbols:
-@table @code
-@item help
-Display the complete option settings.
-@item full
-Like @code{help}, but also print programmer options.
-@end table
-@end deffn
-
-@deffn {Scheme Procedure} read-enable option-name
-@deffnx {Scheme Procedure} read-disable option-name
-@deffnx {Scheme Procedure} read-set! option-name value
-Modify the read options. @code{read-enable} should be used with boolean
-options and switches them on, @code{read-disable} switches them off.
-@code{read-set!} can be used to set an option to a specific value.
-@end deffn
-
-@deffn {Scheme Procedure} read-options-interface [setting]
-@deffnx {C Function} scm_read_options (setting)
-Option interface for the read options. Instead of using
-this procedure directly, use the procedures @code{read-enable},
-@code{read-disable}, @code{read-set!} and @code{read-options}.
-@end deffn
-
-
-@node Fly Evaluation
-@section Procedures for On the Fly Evaluation
-
-@xref{Environments}.
-
-@rnindex eval
-@c ARGFIXME environment/environment specifier
-@deffn {Scheme Procedure} eval exp module
-@deffnx {C Function} scm_eval (exp, module)
-Evaluate @var{exp}, a list representing a Scheme expression,
-in the top-level environment specified by @var{module}.
-While @var{exp} is evaluated (using @code{primitive-eval}),
-@var{module} is made the current module. The current module
-is reset to its previous value when @var{eval} returns.
-@end deffn
-
-@rnindex interaction-environment
-@deffn {Scheme Procedure} interaction-environment
-@deffnx {C Function} scm_interaction_environment ()
-Return a specifier for the environment that contains
-implementation--defined bindings, typically a superset of those
-listed in the report. The intent is that this procedure will
-return the environment in which the implementation would
-evaluate expressions dynamically typed by the user.
-@end deffn
-
-@deffn {Scheme Procedure} eval-string string
-@deffnx {C Function} scm_eval_string (string)
-Evaluate @var{string} as the text representation of a Scheme
-form or forms, and return whatever value they produce.
-Evaluation takes place in the environment returned by the
-procedure @code{interaction-environment}.
-@end deffn
-
-@deffn {Scheme Procedure} apply:nconc2last lst
-@deffnx {C Function} scm_nconc2last (lst)
-Given a list (@var{arg1} @dots{} @var{args}), this function
-conses the @var{arg1} @dots{} arguments onto the front of
-@var{args}, and returns the resulting list. Note that
-@var{args} is a list; thus, the argument to this function is
-a list whose last element is a list.
-Note: Rather than do new consing, @code{apply:nconc2last}
-destroys its argument, so use with care.
-@end deffn
-
-@rnindex apply
-@deffn {Scheme Procedure} apply proc arg1 @dots{} args
-@var{proc} must be a procedure and @var{args} must be a list. Call
-@var{proc} with the elements of the list @code{(append (list @var{arg1}
-@dots{}) @var{args})} as the actual arguments.
-@end deffn
-
-@deffn {Scheme Procedure} primitive-eval exp
-@deffnx {C Function} scm_primitive_eval (exp)
-Evaluate @var{exp} in the top-level environment specified by
-the current module.
-@end deffn
-
-
-@node Loading
-@section Loading Scheme Code from File
-
-@rnindex load
-@deffn {Scheme Procedure} load filename
-Load @var{filename} and evaluate its contents in the top-level
-environment. The load paths are not searched. If the variable
-@code{%load-hook} is defined, it should be bound to a procedure that
-will be called before any code is loaded. See documentation for
-@code{%load-hook} later in this section.
-@end deffn
-
-@deffn {Scheme Procedure} load-from-path filename
-Similar to @code{load}, but searches for @var{filename} in the load
-paths.
-@end deffn
-
-@deffn {Scheme Procedure} primitive-load filename
-@deffnx {C Function} scm_primitive_load (filename)
-Load the file named @var{filename} and evaluate its contents in
-the top-level environment. The load paths are not searched;
-@var{filename} must either be a full pathname or be a pathname
-relative to the current directory. If the variable
-@code{%load-hook} is defined, it should be bound to a procedure
-that will be called before any code is loaded. See the
-documentation for @code{%load-hook} later in this section.
-@end deffn
-
-@deffn {Scheme Procedure} primitive-load-path filename
-@deffnx {C Function} scm_primitive_load_path (filename)
-Search @var{%load-path} for the file named @var{filename} and
-load it into the top-level environment. If @var{filename} is a
-relative pathname and is not found in the list of search paths,
-an error is signalled.
-@end deffn
-
-@deffn {Scheme Procedure} %search-load-path filename
-@deffnx {C Function} scm_sys_search_load_path (filename)
-Search @var{%load-path} for the file named @var{filename},
-which must be readable by the current user. If @var{filename}
-is found in the list of paths to search or is an absolute
-pathname, return its full pathname. Otherwise, return
-@code{#f}. Filenames may have any of the optional extensions
-in the @code{%load-extensions} list; @code{%search-load-path}
-will try each extension automatically.
-@end deffn
-
-@defvar %load-hook
-A procedure to be run whenever @code{primitive-load} is called. If this
-procedure is defined, it will be called with the filename argument that
-was passed to @code{primitive-load}.
-
-@example
-(define %load-hook (lambda (file)
- (display "Loading ")
- (display file)
- (write-line "...."))) @result{} undefined
-(load-from-path "foo.scm")
-@print{} Loading /usr/local/share/guile/site/foo.scm....
-@end example
-
-@end defvar
-
-@deffn {Scheme Procedure} current-load-port
-@deffnx {C Function} scm_current_load_port ()
-Return the current-load-port.
-The load port is used internally by @code{primitive-load}.
-@end deffn
-
-@defvar %load-extensions
-A list of default file extensions for files containing Scheme code.
-@code{%search-load-path} tries each of these extensions when looking for
-a file to load. By default, @code{%load-extensions} is bound to the
-list @code{("" ".scm")}.
-@end defvar
-
-
-@node Delayed Evaluation
-@section Delayed Evaluation
-
-[delay]
-
-@deffn {Scheme Procedure} promise? obj
-@deffnx {C Function} scm_promise_p (obj)
-Return true if @var{obj} is a promise, i.e. a delayed computation
-(@pxref{Delayed evaluation,,,r5rs.info,The Revised^5 Report on Scheme}).
-@end deffn
-
-@rnindex force
-@deffn {Scheme Procedure} force x
-@deffnx {C Function} scm_force (x)
-If the promise @var{x} has not been computed yet, compute and
-return @var{x}, otherwise just return the previously computed
-value.
-@end deffn
-
-
-@node Local Evaluation
-@section Local Evaluation
-
-[the-environment]
-
-@deffn {Scheme Procedure} local-eval exp [env]
-@deffnx {C Function} scm_local_eval (exp, env)
-Evaluate @var{exp} in its environment. If @var{env} is supplied,
-it is the environment in which to evaluate @var{exp}. Otherwise,
-@var{exp} must be a memoized code object (in which case, its environment
-is implicit).
-@end deffn
-
-
-@node Evaluator Behaviour
-@section Evaluator Behaviour
-
-@c FIXME::martin: Maybe this node name is bad, but the old name clashed with
-@c `Evaluator options' under `Options and Config'.
-
-The behaviour of Guile's evaluator can be modified by manipulating the
-evaluator options. For more information about options, @xref{General
-option interface}. If you want to know which evaluator options are
-available, @xref{Evaluator options}.
-
-@c FIXME::martin: This is taken from libguile/options.c. Is there
-@c actually a difference between 'help and 'full?
-
-@deffn {Scheme Procedure} eval-options [setting]
-Display the current settings of the evaluator options. If @var{setting}
-is omitted, only a short form of the current evaluator options is
-printed. Otherwise, @var{setting} should be one of the following
-symbols:
-@table @code
-@item help
-Display the complete option settings.
-@item full
-Like @code{help}, but also print programmer options.
-@end table
-@end deffn
-
-@deffn {Scheme Procedure} eval-enable option-name
-@deffnx {Scheme Procedure} eval-disable option-name
-@deffnx {Scheme Procedure} eval-set! option-name value
-Modify the evaluator options. @code{eval-enable} should be used with boolean
-options and switches them on, @code{eval-disable} switches them off.
-@code{eval-set!} can be used to set an option to a specific value.
-@end deffn
-
-@deffn {Scheme Procedure} eval-options-interface [setting]
-@deffnx {C Function} scm_eval_options_interface (setting)
-Option interface for the evaluation options. Instead of using
-this procedure directly, use the procedures @code{eval-enable},
-@code{eval-disable}, @code{eval-set!} and @code{eval-options}.
-@end deffn
-
-@c FIXME::martin: Why aren't these procedure named like the other options
-@c procedures?
-
-@deffn {Scheme Procedure} traps [setting]
-Display the current settings of the evaluator traps options. If
-@var{setting} is omitted, only a short form of the current evaluator
-traps options is printed. Otherwise, @var{setting} should be one of the
-following symbols:
-@table @code
-@item help
-Display the complete option settings.
-@item full
-Like @code{help}, but also print programmer options.
-@end table
-@end deffn
-
-@deffn {Scheme Procedure} trap-enable option-name
-@deffnx {Scheme Procedure} trap-disable option-name
-@deffnx {Scheme Procedure} trap-set! option-name value
-Modify the evaluator options. @code{trap-enable} should be used with boolean
-options and switches them on, @code{trap-disable} switches them off.
-@code{trap-set!} can be used to set an option to a specific value.
-@end deffn
-
-@deffn {Scheme Procedure} evaluator-traps-interface [setting]
-@deffnx {C Function} scm_evaluator_traps (setting)
-Option interface for the evaluator trap options.
-@end deffn
-
-
-@c Local Variables:
-@c TeX-master: "guile.texi"
-@c End:
diff --git a/doc/ref/scheme-ideas.texi b/doc/ref/scheme-ideas.texi
deleted file mode 100644
index 98ed953e8..000000000
--- a/doc/ref/scheme-ideas.texi
+++ /dev/null
@@ -1,1459 +0,0 @@
-@page
-@node Basic Ideas
-@chapter Basic Ideas in Scheme
-
-In this chapter, we introduce the basic concepts that underpin the
-elegance and power of the Scheme language.
-
-Readers who already possess a background knowledge of Scheme may happily
-skip this chapter. For the reader who is new to the language, however,
-the following discussions on data, procedures, expressions and closure
-are designed to provide a minimum level of Scheme understanding that is
-more or less assumed by the reference chapters that follow.
-
-The style of this introductory material aims about halfway between the
-terse precision of R5RS and the discursive randomness of a Scheme
-tutorial.
-
-@menu
-* About Data:: Latent typing, types, values and variables.
-* About Procedures:: The representation and use of procedures.
-* About Expressions:: All kinds of expressions and their meaning.
-* About Closure:: Closure, scoping and environments.
-@end menu
-
-
-@node About Data
-@section Data Types, Values and Variables
-
-This section discusses the representation of data types and values, what
-it means for Scheme to be a @dfn{latently typed} language, and the role
-of variables. We conclude by introducing the Scheme syntaxes for
-defining a new variable, and for changing the value of an existing
-variable.
-
-@menu
-* Latent Typing:: Scheme as a "latently typed" language.
-* Values and Variables:: About data types, values and variables.
-* Definition:: Defining variables and setting their values.
-@end menu
-
-
-@node Latent Typing
-@subsection Latent Typing
-
-The term @dfn{latent typing} is used to describe a computer language,
-such as Scheme, for which you cannot, @emph{in general}, simply look at
-a program's source code and determine what type of data will be
-associated with a particular variable, or with the result of a
-particular expression.
-
-Sometimes, of course, you @emph{can} tell from the code what the type of
-an expression will be. If you have a line in your program that sets the
-variable @code{x} to the numeric value 1, you can be certain that,
-immediately after that line has executed (and in the absence of multiple
-threads), @code{x} has the numeric value 1. Or if you write a procedure
-that is designed to concatenate two strings, it is likely that the rest
-of your application will always invoke this procedure with two string
-parameters, and quite probable that the procedure would go wrong in some
-way if it was ever invoked with parameters that were not both strings.
-
-Nevertheless, the point is that there is nothing in Scheme which
-requires the procedure parameters always to be strings, or @code{x}
-always to hold a numeric value, and there is no way of declaring in your
-program that such constraints should always be obeyed. In the same
-vein, there is no way to declare the expected type of a procedure's
-return value.
-
-Instead, the types of variables and expressions are only known -- in
-general -- at run time. If you @emph{need} to check at some point that
-a value has the expected type, Scheme provides run time procedures that
-you can invoke to do so. But equally, it can be perfectly valid for two
-separate invocations of the same procedure to specify arguments with
-different types, and to return values with different types.
-
-The next subsection explains what this means in practice, for the ways
-that Scheme programs use data types, values and variables.
-
-
-@node Values and Variables
-@subsection Values and Variables
-
-Scheme provides many data types that you can use to represent your data.
-Primitive types include characters, strings, numbers and procedures.
-Compound types, which allow a group of primitive and compound values to
-be stored together, include lists, pairs, vectors and multi-dimensional
-arrays. In addition, Guile allows applications to define their own data
-types, with the same status as the built-in standard Scheme types.
-
-As a Scheme program runs, values of all types pop in and out of
-existence. Sometimes values are stored in variables, but more commonly
-they pass seamlessly from being the result of one computation to being
-one of the parameters for the next.
-
-Consider an example. A string value is created because the interpreter
-reads in a literal string from your program's source code. Then a
-numeric value is created as the result of calculating the length of the
-string. A second numeric value is created by doubling the calculated
-length. Finally the program creates a list with two elements -- the
-doubled length and the original string itself -- and stores this list in
-a program variable.
-
-All of the values involved here -- in fact, all values in Scheme --
-carry their type with them. In other words, every value ``knows,'' at
-runtime, what kind of value it is. A number, a string, a list,
-whatever.
-
-A variable, on the other hand, has no fixed type. A variable --
-@code{x}, say -- is simply the name of a location -- a box -- in which
-you can store any kind of Scheme value. So the same variable in a
-program may hold a number at one moment, a list of procedures the next,
-and later a pair of strings. The ``type'' of a variable -- insofar as
-the idea is meaningful at all -- is simply the type of whatever value
-the variable happens to be storing at a particular moment.
-
-
-@node Definition
-@subsection Defining and Setting Variables
-
-To define a new variable, you use Scheme's @code{define} syntax like
-this:
-
-@lisp
-(define @var{variable-name} @var{value})
-@end lisp
-
-This makes a new variable called @var{variable-name} and stores
-@var{value} in it as the variable's initial value. For example:
-
-@lisp
-;; Make a variable `x' with initial numeric value 1.
-(define x 1)
-
-;; Make a variable `organization' with an initial string value.
-(define organization "Free Software Foundation")
-@end lisp
-
-(In Scheme, a semicolon marks the beginning of a comment that continues
-until the end of the line. So the lines beginning @code{;;} are
-comments.)
-
-Changing the value of an already existing variable is very similar,
-except that @code{define} is replaced by the Scheme syntax @code{set!},
-like this:
-
-@lisp
-(set! @var{variable-name} @var{new-value})
-@end lisp
-
-Remember that variables do not have fixed types, so @var{new-value} may
-have a completely different type from whatever was previously stored in
-the location named by @var{variable-name}. Both of the following
-examples are therefore correct.
-
-@lisp
-;; Change the value of `x' to 5.
-(set! x 5)
-
-;; Change the value of `organization' to the FSF's street number.
-(set! organization 545)
-@end lisp
-
-In these examples, @var{value} and @var{new-value} are literal numeric
-or string values. In general, however, @var{value} and @var{new-value}
-can be any Scheme expression. Even though we have not yet covered the
-forms that Scheme expressions can take (@pxref{About Expressions}), you
-can probably guess what the following @code{set!} example does@dots{}
-
-@lisp
-(set! x (+ x 1))
-@end lisp
-
-(Note: this is not a complete description of @code{define} and
-@code{set!}, because we need to introduce some other aspects of Scheme
-before the missing pieces can be filled in. If, however, you are
-already familiar with the structure of Scheme, you may like to read
-about those missing pieces immediately by jumping ahead to the following
-references.
-
-@itemize @bullet
-@item
-@ref{Lambda Alternatives}, to read about an alternative form of the
-@code{define} syntax that can be used when defining new procedures.
-
-@item
-@ref{Procedures with Setters}, to read about an alternative form of the
-@code{set!} syntax that helps with changing a single value in the depths
-of a compound data structure.)
-
-@item
-@xref{Internal Definitions}, to read about using @code{define} other
-than at top level in a Scheme program, including a discussion of when it
-works to use @code{define} rather than @code{set!} to change the value
-of an existing variable.
-@end itemize
-
-
-@node About Procedures
-@section The Representation and Use of Procedures
-
-This section introduces the basics of using and creating Scheme
-procedures. It discusses the representation of procedures as just
-another kind of Scheme value, and shows how procedure invocation
-expressions are constructed. We then explain how @code{lambda} is used
-to create new procedures, and conclude by presenting the various
-shorthand forms of @code{define} that can be used instead of writing an
-explicit @code{lambda} expression.
-
-@menu
-* Procedures as Values:: Procedures are values like everything else.
-* Simple Invocation:: How to write a simple procedure invocation.
-* Creating a Procedure:: How to create your own procedures.
-* Lambda Alternatives:: Other ways of writing procedure definitions.
-@end menu
-
-
-@node Procedures as Values
-@subsection Procedures as Values
-
-One of the great simplifications of Scheme is that a procedure is just
-another type of value, and that procedure values can be passed around
-and stored in variables in exactly the same way as, for example, strings
-and lists. When we talk about a built-in standard Scheme procedure such
-as @code{open-input-file}, what we actually mean is that there is a
-pre-defined top level variable called @code{open-input-file}, whose
-value is a procedure that implements what R5RS says that
-@code{open-input-file} should do.
-
-Note that this is quite different from many dialects of Lisp ---
-including Emacs Lisp --- in which a program can use the same name with
-two quite separate meanings: one meaning identifies a Lisp function,
-while the other meaning identifies a Lisp variable, whose value need
-have nothing to do with the function that is associated with the first
-meaning. In these dialects, functions and variables are said to live in
-different @dfn{namespaces}.
-
-In Scheme, on the other hand, all names belong to a single unified
-namespace, and the variables that these names identify can hold any kind
-of Scheme value, including procedure values.
-
-One consequence of the ``procedures as values'' idea is that, if you
-don't happen to like the standard name for a Scheme procedure, you can
-change it.
-
-For example, @code{call-with-current-continuation} is a very important
-standard Scheme procedure, but it also has a very long name! So, many
-programmers use the following definition to assign the same procedure
-value to the more convenient name @code{call/cc}.
-
-@lisp
-(define call/cc call-with-current-continuation)
-@end lisp
-
-Let's understand exactly how this works. The definition creates a new
-variable @code{call/cc}, and then sets its value to the value of the
-variable @code{call-with-current-continuation}; the latter value is a
-procedure that implements the behaviour that R5RS specifies under the
-name ``call-with-current-continuation''. So @code{call/cc} ends up
-holding this value as well.
-
-Now that @code{call/cc} holds the required procedure value, you could
-choose to use @code{call-with-current-continuation} for a completely
-different purpose, or just change its value so that you will get an
-error if you accidentally use @code{call-with-current-continuation} as a
-procedure in your program rather than @code{call/cc}. For example:
-
-@lisp
-(set! call-with-current-continuation "Not a procedure any more!")
-@end lisp
-
-Or you could just leave @code{call-with-current-continuation} as it was.
-It's perfectly fine for more than one variable to hold the same
-procedure value.
-
-
-@node Simple Invocation
-@subsection Simple Procedure Invocation
-
-A procedure invocation in Scheme is written like this:
-
-@lisp
-(@var{procedure} [@var{arg1} [@var{arg2} @dots{}]])
-@end lisp
-
-In this expression, @var{procedure} can be any Scheme expression whose
-value is a procedure. Most commonly, however, @var{procedure} is simply
-the name of a variable whose value is a procedure.
-
-For example, @code{string-append} is a standard Scheme procedure whose
-behaviour is to concatenate together all the arguments, which are
-expected to be strings, that it is given. So the expression
-
-@lisp
-(string-append "/home" "/" "andrew")
-@end lisp
-
-@noindent
-is a procedure invocation whose result is the string value
-@code{"/home/andrew"}.
-
-Similarly, @code{string-length} is a standard Scheme procedure that
-returns the length of a single string argument, so
-
-@lisp
-(string-length "abc")
-@end lisp
-
-@noindent
-is a procedure invocation whose result is the numeric value 3.
-
-Each of the parameters in a procedure invocation can itself be any
-Scheme expression. Since a procedure invocation is itself a type of
-expression, we can put these two examples together to get
-
-@lisp
-(string-length (string-append "/home" "/" "andrew"))
-@end lisp
-
-@noindent
---- a procedure invocation whose result is the numeric value 12.
-
-(You may be wondering what happens if the two examples are combined the
-other way round. If we do this, we can make a procedure invocation
-expression that is @emph{syntactically} correct:
-
-@lisp
-(string-append "/home" (string-length "abc"))
-@end lisp
-
-@noindent
-but when this expression is executed, it will cause an error, because
-the result of @code{(string-length "abc")} is a numeric value, and
-@code{string-append} is not designed to accept a numeric value as one of
-its arguments.)
-
-
-@node Creating a Procedure
-@subsection Creating and Using a New Procedure
-
-Scheme has lots of standard procedures, and Guile provides all of these
-via predefined top level variables. All of these standard procedures
-are documented in the later chapters of this reference manual.
-
-Before very long, though, you will want to create new procedures that
-encapsulate aspects of your own applications' functionality. To do
-this, you can use the famous @code{lambda} syntax.
-
-For example, the value of the following Scheme expression
-
-@lisp
-(lambda (name address) @var{expression} @dots{})
-@end lisp
-
-@noindent
-is a newly created procedure that takes two arguments:
-@code{name} and @code{address}. The behaviour of the
-new procedure is determined by the sequence of @var{expression}s in the
-@dfn{body} of the procedure definition. (Typically, these
-@var{expression}s would use the arguments in some way, or else there
-wouldn't be any point in giving them to the procedure.) When invoked,
-the new procedure returns a value that is the value of the last
-@var{expression} in the procedure body.
-
-To make things more concrete, let's suppose that the two arguments are
-both strings, and that the purpose of this procedure is to form a
-combined string that includes these arguments. Then the full lambda
-expression might look like this:
-
-@lisp
-(lambda (name address)
- (string-append "Name=" name ":Address=" address))
-@end lisp
-
-We noted in the previous subsection that the @var{procedure} part of a
-procedure invocation expression can be any Scheme expression whose value
-is a procedure. But that's exactly what a lambda expression is! So we
-can use a lambda expression directly in a procedure invocation, like
-this:
-
-@lisp
-((lambda (name address)
- (string-append "Name=" name ":Address=" address))
- "FSF"
- "Cambridge")
-@end lisp
-
-@noindent
-This is a valid procedure invocation expression, and its result is the
-string @code{"Name=FSF:Address=Cambridge"}.
-
-It it more common, though, to store the procedure value in a variable ---
-
-@lisp
-(define make-combined-string
- (lambda (name address)
- (string-append "Name=" name ":Address=" address)))
-@end lisp
-
-@noindent
---- and then to use the variable name in the procedure invocation:
-
-@lisp
-(make-combined-string "FSF" "Cambridge")
-@end lisp
-
-@noindent
-Which has exactly the same result.
-
-It's important to note that procedures created using @code{lambda} have
-exactly the same status as the standard built in Scheme procedures, and
-can be invoked, passed around, and stored in variables in exactly the
-same ways.
-
-
-@node Lambda Alternatives
-@subsection Lambda Alternatives
-
-Since it is so common in Scheme programs to want to create a procedure
-and then store it in a variable, there is an alternative form of the
-@code{define} syntax that allows you to do just that.
-
-A @code{define} expression of the form
-
-@lisp
-(define (@var{name} [@var{arg1} [@var{arg2} @dots{}]])
- @var{expression} @dots{})
-@end lisp
-
-@noindent
-is exactly equivalent to the longer form
-
-@lisp
-(define @var{name}
- (lambda ([@var{arg1} [@var{arg2} @dots{}]])
- @var{expression} @dots{}))
-@end lisp
-
-So, for example, the definition of @code{make-combined-string} in the
-previous subsection could equally be written:
-
-@lisp
-(define (make-combined-string name address)
- (string-append "Name=" name ":Address=" address))
-@end lisp
-
-This kind of procedure definition creates a procedure that requires
-exactly the expected number of arguments. There are two further forms
-of the @code{lambda} expression, which create a procedure that can
-accept a variable number of arguments:
-
-@lisp
-(lambda (@var{arg1} @dots{} . @var{args}) @var{expression} @dots{})
-
-(lambda @var{args} @var{expression} @dots{})
-@end lisp
-
-@noindent
-The corresponding forms of the alternative @code{define} syntax are:
-
-@lisp
-(define (@var{name} @var{arg1} @dots{} . @var{args}) @var{expression} @dots{})
-
-(define (@var{name} . @var{args}) @var{expression} @dots{})
-@end lisp
-
-@noindent
-For details on how these forms work, see @xref{Lambda}.
-
-(It could be argued that the alternative @code{define} forms are rather
-confusing, especially for newcomers to the Scheme language, as they hide
-both the role of @code{lambda} and the fact that procedures are values
-that are stored in variables in the some way as any other kind of value.
-On the other hand, they are very convenient, and they are also a good
-example of another of Scheme's powerful features: the ability to specify
-arbitrary syntactic transformations at run time, which can be applied to
-subsequently read input.)
-
-
-@node About Expressions
-@section Expressions and Evaluation
-
-So far, we have met expressions that @emph{do} things, such as the
-@code{define} expressions that create and initialize new variables, and
-we have also talked about expressions that have @emph{values}, for
-example the value of the procedure invocation expression:
-
-@lisp
-(string-append "/home" "/" "andrew")
-@end lisp
-
-@noindent
-but we haven't yet been precise about what causes an expression like
-this procedure invocation to be reduced to its ``value'', or how the
-processing of such expressions relates to the execution of a Scheme
-program as a whole.
-
-This section clarifies what we mean by an expression's value, by
-introducing the idea of @dfn{evaluation}. It discusses the side effects
-that evaluation can have, explains how each of the various types of
-Scheme expression is evaluated, and describes the behaviour and use of
-the Guile REPL as a mechanism for exploring evaluation. The section
-concludes with a very brief summary of Scheme's common syntactic
-expressions.
-
-@menu
-* Evaluating:: How a Scheme program is executed.
-* The REPL:: Interacting with the Guile interpreter.
-* Syntax Summary:: Common syntactic expressions -- in brief.
-@end menu
-
-
-@node Evaluating
-@subsection Evaluating Expressions and Executing Programs
-
-In Scheme, the process of executing an expression is known as
-@dfn{evaluation}. Evaluation has two kinds of result:
-
-@itemize @bullet
-@item
-the @dfn{value} of the evaluated expression
-
-@item
-the @dfn{side effects} of the evaluation, which consist of any effects of
-evaluating the expression that are not represented by the value.
-@end itemize
-
-Of the expressions that we have met so far, @code{define} and
-@code{set!} expressions have side effects --- the creation or
-modification of a variable --- but no value; @code{lambda} expressions
-have values --- the newly constructed procedures --- but no side
-effects; and procedure invocation expressions, in general, have either
-values, or side effects, or both.
-
-It is tempting to try to define more intuitively what we mean by
-``value'' and ``side effects'', and what the difference between them is.
-In general, though, this is extremely difficult. It is also
-unnecessary; instead, we can quite happily define the behaviour of a
-Scheme program by specifying how Scheme executes a program as a whole,
-and then by describing the value and side effects of evaluation for each
-type of expression individually.
-
-@noindent
-So, some@footnote{These definitions are approximate. For the whole and
-detailed truth, see @xref{Formal syntax and semantics,R5RS
-syntax,,r5rs}.} definitions@dots{}
-
-@itemize @bullet
-
-@item
-A Scheme program consists of a sequence of expressions.
-
-@item
-A Scheme interpreter executes the program by evaluating these
-expressions in order, one by one.
-
-@item
-An expression can be
-
-@itemize @bullet
-@item
-a piece of literal data, such as a number @code{2.3} or a string
-@code{"Hello world!"}
-@item
-a variable name
-@item
-a procedure invocation expression
-@item
-one of Scheme's special syntactic expressions.
-@end itemize
-@end itemize
-
-@noindent
-The following subsections describe how each of these types of expression
-is evaluated.
-
-@menu
-* Eval Literal:: Evaluating literal data.
-* Eval Variable:: Evaluating variable references.
-* Eval Procedure:: Evaluating procedure invocation expressions.
-* Eval Special:: Evaluating special syntactic expressions.
-@end menu
-
-@node Eval Literal
-@subsubsection Evaluating Literal Data
-
-When a literal data expression is evaluated, the value of the expression
-is simply the value that the expression describes. The evaluation of a
-literal data expression has no side effects.
-
-@noindent
-So, for example,
-
-@itemize @bullet
-@item
-the value of the expression @code{"abc"} is the string value
-@code{"abc"}
-
-@item
-the value of the expression @code{3+4i} is the complex number 3 + 4i
-
-@item
-the value of the expression @code{#(1 2 3)} is a three-element vector
-containing the numeric values 1, 2 and 3.
-@end itemize
-
-For any data type which can be expressed literally like this, the syntax
-of the literal data expression for that data type --- in other words,
-what you need to write in your code to indicate a literal value of that
-type --- is known as the data type's @dfn{read syntax}. This manual
-specifies the read syntax for each such data type in the section that
-describes that data type.
-
-Some data types do not have a read syntax. Procedures, for example,
-cannot be expressed as literal data; they must be created using a
-@code{lambda} expression (@pxref{Creating a Procedure}) or implicitly
-using the shorthand form of @code{define} (@pxref{Lambda Alternatives}).
-
-
-@node Eval Variable
-@subsubsection Evaluating a Variable Reference
-
-When an expression that consists simply of a variable name is evaluated,
-the value of the expression is the value of the named variable. The
-evaluation of a variable reference expression has no side effects.
-
-So, after
-
-@lisp
-(define key "Paul Evans")
-@end lisp
-
-@noindent
-the value of the expression @code{key} is the string value @code{"Paul
-Evans"}. If @var{key} is then modified by
-
-@lisp
-(set! key 3.74)
-@end lisp
-
-@noindent
-the value of the expression @code{key} is the numeric value 3.74.
-
-If there is no variable with the specified name, evaluation of the
-variable reference expression signals an error.
-
-
-@node Eval Procedure
-@subsubsection Evaluating a Procedure Invocation Expression
-
-This is where evaluation starts getting interesting! As already noted,
-a procedure invocation expression has the form
-
-@lisp
-(@var{procedure} [@var{arg1} [@var{arg2} @dots{}]])
-@end lisp
-
-@noindent
-where @var{procedure} must be an expression whose value, when evaluated,
-is a procedure.
-
-The evaluation of a procedure invocation expression like this proceeds
-by
-
-@itemize @bullet
-@item
-evaluating individually the expressions @var{procedure}, @var{arg1},
-@var{arg2}, and so on
-
-@item
-calling the procedure that is the value of the @var{procedure}
-expression with the list of values obtained from the evaluations of
-@var{arg1}, @var{arg2} etc. as its parameters.
-@end itemize
-
-For a procedure defined in Scheme, ``calling the procedure with the list
-of values as its parameters'' means binding the values to the
-procedure's formal parameters and then evaluating the sequence of
-expressions that make up the body of the procedure definition. The
-value of the procedure invocation expression is the value of the last
-evaluated expression in the procedure body. The side effects of calling
-the procedure are the combination of the side effects of the sequence of
-evaluations of expressions in the procedure body.
-
-For a built-in procedure, the value and side-effects of calling the
-procedure are best described by that procedure's documentation.
-
-Note that the complete side effects of evaluating a procedure invocation
-expression consist not only of the side effects of the procedure call,
-but also of any side effects of the preceding evaluation of the
-expressions @var{procedure}, @var{arg1}, @var{arg2}, and so on.
-
-To illustrate this, let's look again at the procedure invocation
-expression:
-
-@lisp
-(string-length (string-append "/home" "/" "andrew"))
-@end lisp
-
-In the outermost expression, @var{procedure} is @code{string-length} and
-@var{arg1} is @code{(string-append "/home" "/" "andrew")}.
-
-@itemize @bullet
-@item
-Evaluation of @code{string-length}, which is a variable, gives a
-procedure value that implements the expected behaviour for
-``string-length''.
-
-@item
-Evaluation of @code{(string-append "/home" "/" "andrew")}, which is
-another procedure invocation expression, means evaluating each of
-
-@itemize @bullet
-@item
-@code{string-append}, which gives a procedure value that implements the
-expected behaviour for ``string-append''
-
-@item
-@code{"/home"}, which gives the string value @code{"/home"}
-
-@item
-@code{"/"}, which gives the string value @code{"/"}
-
-@item
-@code{"andrew"}, which gives the string value @code{"andrew"}
-@end itemize
-
-and then invoking the procedure value with this list of string values as
-its arguments. The resulting value is a single string value that is the
-concatenation of all the arguments, namely @code{"/home/andrew"}.
-@end itemize
-
-In the evaluation of the outermost expression, the interpreter can now
-invoke the procedure value obtained from @var{procedure} with the value
-obtained from @var{arg1} as its arguments. The resulting value is a
-numeric value that is the length of the argument string, which is 12.
-
-
-@node Eval Special
-@subsubsection Evaluating Special Syntactic Expressions
-
-When a procedure invocation expression is evaluated, the procedure and
-@emph{all} the argument expressions must be evaluated before the
-procedure can be invoked. Special syntactic expressions are special
-because they are able to manipulate their arguments in an unevaluated
-form, and can choose whether to evaluate any or all of the argument
-expressions.
-
-Why is this needed? Consider a program fragment that asks the user
-whether or not to delete a file, and then deletes the file if the user
-answers yes.
-
-@lisp
-(if (string=? (read-answer "Should I delete this file?")
- "yes")
- (delete-file file))
-@end lisp
-
-If the outermost @code{(if @dots{})} expression here was a procedure
-invocation expression, the expression @code{(delete-file file)}, whose
-side effect is to actually delete a file, would already have been
-evaluated before the @code{if} procedure even got invoked! Clearly this
-is no use --- the whole point of an @code{if} expression is that the
-@dfn{consequent} expression is only evaluated if the condition of the
-@code{if} expression is ``true''.
-
-Therefore @code{if} must be special syntax, not a procedure. Other
-special syntaxes that we have already met are @code{define}, @code{set!}
-and @code{lambda}. @code{define} and @code{set!} are syntax because
-they need to know the variable @emph{name} that is given as the first
-argument in a @code{define} or @code{set!} expression, not that
-variable's value. @code{lambda} is syntax because it does not
-immediately evaluate the expressions that define the procedure body;
-instead it creates a procedure object that incorporates these
-expressions so that they can be evaluated in the future, when that
-procedure is invoked.
-
-The rules for evaluating each special syntactic expression are specified
-individually for each special syntax. For a summary of standard special
-syntax, see @xref{Syntax Summary}.
-
-
-@node The REPL
-@subsection Using the Guile REPL
-
-If you start Guile without specifying a particular program for it to
-execute, Guile enters its standard Read Evaluate Print Loop --- or
-@dfn{REPL} for short. In this mode, Guile repeatedly reads in the next
-Scheme expression that the user types, evaluates it, and prints the
-resulting value.
-
-The REPL is a useful mechanism for exploring the evaluation behaviour
-described in the previous subsection. If you type @code{string-append},
-for example, the REPL replies @code{#<primitive-procedure
-string-append>}, illustrating the relationship between the variable
-@code{string-append} and the procedure value stored in that variable.
-
-In this manual, the notation @result{} is used to mean ``evaluates
-to''. Wherever you see an example of the form
-
-@lisp
-@var{expression}
-@result{}
-@var{result}
-@end lisp
-
-@noindent
-feel free to try it out yourself by typing @var{expression} into the
-REPL and checking that it gives the expected @var{result}.
-
-
-@node Syntax Summary
-@subsection Summary of Common Syntax
-
-This subsection lists the most commonly used Scheme syntactic
-expressions, simply so that you will recognize common special syntax
-when you see it. For a full description of each of these syntaxes,
-follow the appropriate reference.
-
-@code{lambda} (@pxref{Lambda}) is used to construct procedure objects.
-
-@code{define} (@pxref{Top Level}) is used to create a new variable and
-set its initial value.
-
-@code{set!} (@pxref{Top Level}) is used to modify an existing variable's
-value.
-
-@code{let}, @code{let*} and @code{letrec} (@pxref{Local Bindings})
-create an inner lexical environment for the evaluation of a sequence of
-expressions, in which a specified set of local variables is bound to the
-values of a corresponding set of expressions. For an introduction to
-environments, see @xref{About Closure}.
-
-@code{begin} (@pxref{begin}) executes a sequence of expressions in order
-and returns the value of the last expression. Note that this is not the
-same as a procedure which returns its last argument, because the
-evaluation of a procedure invocation expression does not guarantee to
-evaluate the arguments in order.
-
-@code{if} and @code{cond} (@pxref{if cond case}) provide conditional
-evaluation of argument expressions depending on whether one or more
-conditions evaluate to ``true'' or ``false''.
-
-@code{case} (@pxref{if cond case}) provides conditional evaluation of
-argument expressions depending on whether a variable has one of a
-specified group of values.
-
-@code{and} (@pxref{and or}) executes a sequence of expressions in order
-until either there are no expressions left, or one of them evaluates to
-``false''.
-
-@code{or} (@pxref{and or}) executes a sequence of expressions in order
-until either there are no expressions left, or one of them evaluates to
-``true''.
-
-
-@node About Closure
-@section The Concept of Closure
-
-@cindex closure
-
-The concept of @dfn{closure} is the idea that a lambda expression
-``captures'' the variable bindings that are in lexical scope at the
-point where the lambda expression occurs. The procedure created by the
-lambda expression can refer to and mutate the captured bindings, and the
-values of those bindings persist between procedure calls.
-
-This section explains and explores the various parts of this idea in
-more detail.
-
-@menu
-* About Environments:: Names, locations, values and environments.
-* Local Variables:: Local variables and local environments.
-* Chaining:: Environment chaining.
-* Lexical Scope:: The meaning of lexical scoping.
-* Closure:: Explaining the concept of closure.
-* Serial Number:: Example 1: a serial number generator.
-* Shared Variable:: Example 2: a shared persistent variable.
-* Callback Closure:: Example 3: the callback closure problem.
-* OO Closure:: Example 4: object orientation.
-@end menu
-
-@node About Environments
-@subsection Names, Locations, Values and Environments
-
-@cindex location
-@cindex environment
-@cindex vcell
-@cindex top level environment
-@cindex environment, top level
-
-We said earlier that a variable name in a Scheme program is associated
-with a location in which any kind of Scheme value may be stored.
-(Incidentally, the term ``vcell'' is often used in Lisp and Scheme
-circles as an alternative to ``location''.) Thus part of what we mean
-when we talk about ``creating a variable'' is in fact establishing an
-association between a name, or identifier, that is used by the Scheme
-program code, and the variable location to which that name refers.
-Although the value that is stored in that location may change, the
-location to which a given name refers is always the same.
-
-We can illustrate this by breaking down the operation of the
-@code{define} syntax into three parts: @code{define}
-
-@itemize @bullet
-@item
-creates a new location
-
-@item
-establishes an association between that location and the name specified
-as the first argument of the @code{define} expression
-
-@item
-stores in that location the value obtained by evaluating the second
-argument of the @code{define} expression.
-@end itemize
-
-A collection of associations between names and locations is called an
-@dfn{environment}. When you create a top level variable in a program
-using @code{define}, the name-location association for that variable is
-added to the ``top level'' environment. The ``top level'' environment
-also includes name-location associations for all the procedures that are
-supplied by standard Scheme.
-
-It is also possible to create environments other than the top level one,
-and to create variable bindings, or name-location associations, in those
-environments. This ability is a key ingredient in the concept of
-closure; the next subsection shows how it is done.
-
-
-@node Local Variables
-@subsection Local Variables and Environments
-
-@cindex local variable
-@cindex variable, local
-@cindex local environment
-@cindex environment, local
-
-We have seen how to create top level variables using the @code{define}
-syntax (@pxref{Definition}). It is often useful to create variables
-that are more limited in their scope, typically as part of a procedure
-body. In Scheme, this is done using the @code{let} syntax, or one of
-its modified forms @code{let*} and @code{letrec}. These syntaxes are
-described in full later in the manual (@pxref{Local Bindings}). Here
-our purpose is to illustrate their use just enough that we can see how
-local variables work.
-
-For example, the following code uses a local variable @code{s} to
-simplify the computation of the area of a triangle given the lengths of
-its three sides.
-
-@lisp
-(define a 5.3)
-(define b 4.7)
-(define c 2.8)
-
-(define area
- (let ((s (/ (+ a b c) 2)))
- (sqrt (* s (- s a) (- s b) (- s c)))))
-@end lisp
-
-The effect of the @code{let} expression is to create a new environment
-and, within this environment, an association between the name @code{s}
-and a new location whose initial value is obtained by evaluating
-@code{(/ (+ a b c) 2)}. The expressions in the body of the @code{let},
-namely @code{(sqrt (* s (- s a) (- s b) (- s c)))}, are then evaluated
-in the context of the new environment, and the value of the last
-expression evaluated becomes the value of the whole @code{let}
-expression, and therefore the value of the variable @code{area}.
-
-
-@node Chaining
-@subsection Environment Chaining
-
-@cindex shadowing an imported variable binding
-@cindex chaining environments
-
-In the example of the previous subsection, we glossed over an important
-point. The body of the @code{let} expression in that example refers not
-only to the local variable @code{s}, but also to the top level variables
-@code{a}, @code{b}, @code{c} and @code{sqrt}. (@code{sqrt} is the
-standard Scheme procedure for calculating a square root.) If the body
-of the @code{let} expression is evaluated in the context of the
-@emph{local} @code{let} environment, how does the evaluation get at the
-values of these top level variables?
-
-The answer is that the local environment created by a @code{let}
-expression automatically has a reference to its containing environment
---- in this case the top level environment --- and that the Scheme
-interpreter automatically looks for a variable binding in the containing
-environment if it doesn't find one in the local environment. More
-generally, every environment except for the top level one has a
-reference to its containing environment, and the interpreter keeps
-searching back up the chain of environments --- from most local to top
-level --- until it either finds a variable binding for the required
-identifier or exhausts the chain.
-
-This description also determines what happens when there is more than
-one variable binding with the same name. Suppose, continuing the
-example of the previous subsection, that there was also a pre-existing
-top level variable @code{s} created by the expression:
-
-@lisp
-(define s "Some beans, my lord!")
-@end lisp
-
-Then both the top level environment and the local @code{let} environment
-would contain bindings for the name @code{s}. When evaluating code
-within the @code{let} body, the interpreter looks first in the local
-@code{let} environment, and so finds the binding for @code{s} created by
-the @code{let} syntax. Even though this environment has a reference to
-the top level environment, which also has a binding for @code{s}, the
-interpreter doesn't get as far as looking there. When evaluating code
-outside the @code{let} body, the interpreter looks up variable names in
-the top level environment, so the name @code{s} refers to the top level
-variable.
-
-Within the @code{let} body, the binding for @code{s} in the local
-environment is said to @dfn{shadow} the binding for @code{s} in the top
-level environment.
-
-
-@node Lexical Scope
-@subsection Lexical Scope
-
-The rules that we have just been describing are the details of how
-Scheme implements ``lexical scoping''. This subsection takes a brief
-diversion to explain what lexical scope means in general and to present
-an example of non-lexical scoping.
-
-``Lexical scope'' in general is the idea that
-
-@itemize @bullet
-@item
-an identifier at a particular place in a program always refers to the
-same variable location --- where ``always'' means ``every time that the
-containing expression is executed'', and that
-
-@item
-the variable location to which it refers can be determined by static
-examination of the source code context in which that identifier appears,
-without having to consider the flow of execution through the program as
-a whole.
-@end itemize
-
-In practice, lexical scoping is the norm for most programming languages,
-and probably corresponds to what you would intuitively consider to be
-``normal''. You may even be wondering how the situation could possibly
---- and usefully --- be otherwise. To demonstrate that another kind of
-scoping is possible, therefore, and to compare it against lexical
-scoping, the following subsection presents an example of non-lexical
-scoping and examines in detail how its behavior differs from the
-corresponding lexically scoped code.
-
-@menu
-* Scoping Example:: An example of non-lexical scoping.
-@end menu
-
-
-@node Scoping Example
-@subsubsection An Example of Non-Lexical Scoping
-
-To demonstrate that non-lexical scoping does exist and can be useful, we
-present the following example from Emacs Lisp, which is a ``dynamically
-scoped'' language.
-
-@lisp
-(defvar currency-abbreviation "USD")
-
-(defun currency-string (units hundredths)
- (concat currency-abbreviation
- (number-to-string units)
- "."
- (number-to-string hundredths)))
-
-(defun french-currency-string (units hundredths)
- (let ((currency-abbreviation "FRF"))
- (currency-string units hundredths)))
-@end lisp
-
-The question to focus on here is: what does the identifier
-@code{currency-abbreviation} refer to in the @code{currency-string}
-function? The answer, in Emacs Lisp, is that all variable bindings go
-onto a single stack, and that @code{currency-abbreviation} refers to the
-topmost binding from that stack which has the name
-``currency-abbreviation''. The binding that is created by the
-@code{defvar} form, to the value @code{"USD"}, is only relevant if none
-of the code that calls @code{currency-string} rebinds the name
-``currency-abbreviation'' in the meanwhile.
-
-The second function @code{french-currency-string} works precisely by
-taking advantage of this behaviour. It creates a new binding for the
-name ``currency-abbreviation'' which overrides the one established by
-the @code{defvar} form.
-
-@lisp
-;; Note! This is Emacs Lisp evaluation, not Scheme!
-(french-currency-string 33 44)
-@result{}
-"FRF33.44"
-@end lisp
-
-Now let's look at the corresponding, @emph{lexically scoped} Scheme
-code:
-
-@lisp
-(define currency-abbreviation "USD")
-
-(define (currency-string units hundredths)
- (string-append currency-abbreviation
- (number->string units)
- "."
- (number->string hundredths)))
-
-(define (french-currency-string units hundredths)
- (let ((currency-abbreviation "FRF"))
- (currency-string units hundredths)))
-@end lisp
-
-According to the rules of lexical scoping, the
-@code{currency-abbreviation} in @code{currency-string} refers to the
-variable location in the innermost environment at that point in the code
-which has a binding for @code{currency-abbreviation}, which is the
-variable location in the top level environment created by the preceding
-@code{(define currency-abbreviation @dots{})} expression.
-
-In Scheme, therefore, the @code{french-currency-string} procedure does
-not work as intended. The variable binding that it creates for
-``currency-abbreviation'' is purely local to the code that forms the
-body of the @code{let} expression. Since this code doesn't directly use
-the name ``currency-abbreviation'' at all, the binding is pointless.
-
-@lisp
-(french-currency-string 33 44)
-@result{}
-"USD33.44"
-@end lisp
-
-This begs the question of how the Emacs Lisp behaviour can be
-implemented in Scheme. In general, this is a design question whose
-answer depends upon the problem that is being addressed. In this case,
-the best answer may be that @code{currency-string} should be
-redesigned so that it can take an optional third argument. This third
-argument, if supplied, is interpreted as a currency abbreviation that
-overrides the default.
-
-It is possible to change @code{french-currency-string} so that it mostly
-works without changing @code{currency-string}, but the fix is inelegant,
-and susceptible to interrupts that could leave the
-@code{currency-abbreviation} variable in the wrong state:
-
-@lisp
-(define (french-currency-string units hundredths)
- (set! currency-abbreviation "FRF")
- (let ((result (currency-string units hundredths)))
- (set! currency-abbreviation "USD")
- result))
-@end lisp
-
-The key point here is that the code does not create any local binding
-for the identifier @code{currency-abbreviation}, so all occurrences of
-this identifier refer to the top level variable.
-
-
-@node Closure
-@subsection Closure
-
-Consider a @code{let} expression that doesn't contain any
-@code{lambda}s:
-
-@lisp
-(let ((s (/ (+ a b c) 2)))
- (sqrt (* s (- s a) (- s b) (- s c))))
-@end lisp
-
-@noindent
-When the Scheme interpreter evaluates this, it
-
-@itemize @bullet
-@item
-creates a new environment with a reference to the environment that was
-current when it encountered the @code{let}
-
-@item
-creates a variable binding for @code{s} in the new environment, with
-value given by @code{(/ (+ a b c) 2)}
-
-@item
-evaluates the expression in the body of the @code{let} in the context of
-the new local environment, and remembers the value @code{V}
-
-@item
-forgets the local environment
-
-@item
-continues evaluating the expression that contained the @code{let}, using
-the value @code{V} as the value of the @code{let} expression, in the
-context of the containing environment.
-@end itemize
-
-After the @code{let} expression has been evaluated, the local
-environment that was created is simply forgotten, and there is no longer
-any way to access the binding that was created in this environment. If
-the same code is evaluated again, it will follow the same steps again,
-creating a second new local environment that has no connection with the
-first, and then forgetting this one as well.
-
-If the @code{let} body contains a @code{lambda} expression, however, the
-local environment is @emph{not} forgotten. Instead, it becomes
-associated with the procedure that is created by the @code{lambda}
-expression, and is reinstated every time that that procedure is called.
-In detail, this works as follows.
-
-@itemize @bullet
-@item
-When the Scheme interpreter evaluates a @code{lambda} expression, to
-create a procedure object, it stores the current environment as part of
-the procedure definition.
-
-@item
-Then, whenever that procedure is called, the interpreter reinstates the
-environment that is stored in the procedure definition and evaluates the
-procedure body within the context of that environment.
-@end itemize
-
-The result is that the procedure body is always evaluated in the context
-of the environment that was current when the procedure was created.
-
-This is what is meant by @dfn{closure}. The next few subsections
-present examples that explore the usefulness of this concept.
-
-
-@node Serial Number
-@subsection Example 1: A Serial Number Generator
-
-This example uses closure to create a procedure with a variable binding
-that is private to the procedure, like a local variable, but whose value
-persists between procedure calls.
-
-@lisp
-(define (make-serial-number-generator)
- (let ((current-serial-number 0))
- (lambda ()
- (set! current-serial-number (+ current-serial-number 1))
- current-serial-number)))
-
-(define entry-sn-generator (make-serial-number-generator))
-
-(entry-sn-generator)
-@result{}
-1
-
-(entry-sn-generator)
-@result{}
-2
-@end lisp
-
-When @code{make-serial-number-generator} is called, it creates a local
-environment with a binding for @code{current-serial-number} whose
-initial value is 0, then, within this environment, creates a procedure.
-The local environment is stored within the created procedure object and
-so persists for the lifetime of the created procedure.
-
-Every time the created procedure is invoked, it increments the value of
-the @code{current-serial-number} binding in the captured environment and
-then returns the current value.
-
-Note that @code{make-serial-number-generator} can be called again to
-create a second serial number generator that is independent of the
-first. Every new invocation of @code{make-serial-number-generator}
-creates a new local @code{let} environment and returns a new procedure
-object with an association to this environment.
-
-
-@node Shared Variable
-@subsection Example 2: A Shared Persistent Variable
-
-This example uses closure to create two procedures, @code{get-balance}
-and @code{deposit}, that both refer to the same captured local
-environment so that they can both access the @code{balance} variable
-binding inside that environment. The value of this variable binding
-persists between calls to either procedure.
-
-Note that the captured @code{balance} variable binding is private to
-these two procedures: it is not directly accessible to any other code.
-It can only be accessed indirectly via @code{get-balance} or
-@code{deposit}, as illustrated by the @code{withdraw} procedure.
-
-@lisp
-(define get-balance #f)
-(define deposit #f)
-
-(let ((balance 0))
- (set! get-balance
- (lambda ()
- balance))
- (set! deposit
- (lambda (amount)
- (set! balance (+ balance amount))
- balance)))
-
-(define (withdraw amount)
- (deposit (- amount)))
-
-(get-balance)
-@result{}
-0
-
-(deposit 50)
-@result{}
-50
-
-(withdraw 75)
-@result{}
--25
-@end lisp
-
-An important detail here is that the @code{get-balance} and
-@code{deposit} variables must be set up by @code{define}ing them at top
-level and then @code{set!}ing their values inside the @code{let} body.
-Using @code{define} within the @code{let} body would not work: this
-would create variable bindings within the local @code{let} environment
-that would not be accessible at top level.
-
-
-@node Callback Closure
-@subsection Example 3: The Callback Closure Problem
-
-A frequently used programming model for library code is to allow an
-application to register a callback function for the library to call when
-some particular event occurs. It is often useful for the application to
-make several such registrations using the same callback function, for
-example if several similar library events can be handled using the same
-application code, but the need then arises to distinguish the callback
-function calls that are associated with one callback registration from
-those that are associated with different callback registrations.
-
-In languages without the ability to create functions dynamically, this
-problem is usually solved by passing a @code{user_data} parameter on the
-registration call, and including the value of this parameter as one of
-the parameters on the callback function. Here is an example of
-declarations using this solution in C:
-
-@example
-typedef void (event_handler_t) (int event_type,
- void *user_data);
-
-void register_callback (int event_type,
- event_handler_t *handler,
- void *user_data);
-@end example
-
-In Scheme, closure can be used to achieve the same functionality without
-requiring the library code to store a @code{user-data} for each callback
-registration.
-
-@lisp
-;; In the library:
-
-(define (register-callback event-type handler-proc)
- @dots{})
-
-;; In the application:
-
-(define (make-handler event-type user-data)
- (lambda ()
- @dots{}
- <code referencing event-type and user-data>
- @dots{}))
-
-(register-callback event-type
- (make-handler event-type @dots{}))
-@end lisp
-
-As far as the library is concerned, @code{handler-proc} is a procedure
-with no arguments, and all the library has to do is call it when the
-appropriate event occurs. From the application's point of view, though,
-the handler procedure has used closure to capture an environment that
-includes all the context that the handler code needs ---
-@code{event-type} and @code{user-data} --- to handle the event
-correctly.
-
-
-@node OO Closure
-@subsection Example 4: Object Orientation
-
-Closure is the capture of an environment, containing persistent variable
-bindings, within the definition of a procedure or a set of related
-procedures. This is rather similar to the idea in some object oriented
-languages of encapsulating a set of related data variables inside an
-``object'', together with a set of ``methods'' that operate on the
-encapsulated data. The following example shows how closure can be used
-to emulate the ideas of objects, methods and encapsulation in Scheme.
-
-@lisp
-(define (make-account)
- (let ((balance 0))
- (define (get-balance)
- balance)
- (define (deposit amount)
- (set! balance (+ balance amount))
- balance)
- (define (withdraw amount)
- (deposit (- amount)))
-
- (lambda args
- (apply
- (case (car args)
- ((get-balance) get-balance)
- ((deposit) deposit)
- ((withdraw) withdraw)
- (else (error "Invalid method!")))
- (cdr args)))))
-@end lisp
-
-Each call to @code{make-account} creates and returns a new procedure,
-created by the expression in the example code that begins ``(lambda
-args''.
-
-@lisp
-(define my-account (make-account))
-
-my-account
-@result{}
-#<procedure args>
-@end lisp
-
-This procedure acts as an account object with methods
-@code{get-balance}, @code{deposit} and @code{withdraw}. To apply one of
-the methods to the account, you call the procedure with a symbol
-indicating the required method as the first parameter, followed by any
-other parameters that are required by that method.
-
-@lisp
-(my-account 'get-balance)
-@result{}
-0
-
-(my-account 'withdraw 5)
-@result{}
--5
-
-(my-account 'deposit 396)
-@result{}
-391
-
-(my-account 'get-balance)
-@result{}
-391
-@end lisp
-
-Note how, in this example, both the current balance and the helper
-procedures @code{get-balance}, @code{deposit} and @code{withdraw}, used
-to implement the guts of the account object's methods, are all stored in
-variable bindings within the private local environment captured by the
-@code{lambda} expression that creates the account object procedure.
-
-
-@c Local Variables:
-@c TeX-master: "guile.texi"
-@c End:
diff --git a/doc/ref/scheme-indices.texi b/doc/ref/scheme-indices.texi
deleted file mode 100644
index acecb3ff4..000000000
--- a/doc/ref/scheme-indices.texi
+++ /dev/null
@@ -1,10 +0,0 @@
-@page
-@node R5RS Index
-@unnumbered R5RS Index
-
-@printindex rn
-
-
-@c Local Variables:
-@c TeX-master: "guile.texi"
-@c End:
diff --git a/doc/ref/scheme-intro.texi b/doc/ref/scheme-intro.texi
deleted file mode 100644
index 22e875339..000000000
--- a/doc/ref/scheme-intro.texi
+++ /dev/null
@@ -1,36 +0,0 @@
-@page
-@node Guile Scheme
-@chapter Guile's Implementation of Scheme
-
-Guile's core language is Scheme, which is specified and described in the
-series of reports known as @dfn{RnRS}. @dfn{RnRS} is shorthand for the
-@iftex
-@dfn{Revised$^n$ Report on the Algorithmic Language Scheme}.
-@end iftex
-@ifnottex
-@dfn{Revised^n Report on the Algorithmic Language Scheme}.
-@end ifnottex
-The current latest revision of RnRS is version 5
-(@pxref{Top,R5RS,,r5rs}), and Guile 1.4 is fully compliant with the
-Scheme specification in this revision.
-
-But Guile, like most Scheme implementations, also goes beyond R5RS in
-many ways, because R5RS does not give specifications (or even
-recommendations) regarding many issues that are important in practical
-programming. Some of the areas where Guile extends R5RS are:
-
-@itemize @bullet
-@item
-Guile's interactive documentation system
-
-@item
-Guile's support for POSIX-compliant network programming
-
-@item
-GOOPS -- Guile's framework for object oriented programming.
-@end itemize
-
-
-@c Local Variables:
-@c TeX-master: "guile.texi"
-@c End:
diff --git a/doc/ref/scheme-io.texi b/doc/ref/scheme-io.texi
deleted file mode 100644
index 3df790051..000000000
--- a/doc/ref/scheme-io.texi
+++ /dev/null
@@ -1,1116 +0,0 @@
-@page
-@node Input and Output
-@chapter Input and Output
-
-@menu
-* Ports:: The idea of the port abstraction.
-* Reading:: Procedures for reading from a port.
-* Writing:: Procedures for writing to a port.
-* Closing:: Procedures to close a port.
-* Random Access:: Moving around a random access port.
-* Line/Delimited:: Read and write lines or delimited text.
-* Block Reading and Writing:: Reading and writing blocks of text.
-* Default Ports:: Defaults for input, output and errors.
-* Port Types:: Types of port and how to make them.
-* I/O Extensions:: Using and extending ports in C.
-@end menu
-
-
-@node Ports
-@section Ports
-
-[Concept of the port abstraction.]
-
-Sequential input/output in Scheme is represented by operations on a
-@dfn{port}. Characters can be read from an input port and
-written to an output port. This chapter explains the operations
-that Guile provides for working with ports.
-
-The formal definition of a port is very generic: an input port is
-simply ``an object which can deliver characters on command,'' and
-an output port is ``an object which can accept characters.''
-Because this definition is so loose, it is easy to write functions
-that simulate ports in software. @dfn{Soft ports} and @dfn{string
-ports} are two interesting and powerful examples of this technique.
-
-@rnindex input-port?
-@deffn {Scheme Procedure} input-port? x
-@deffnx {C Function} scm_input_port_p (x)
-Return @code{#t} if @var{x} is an input port, otherwise return
-@code{#f}. Any object satisfying this predicate also satisfies
-@code{port?}.
-@end deffn
-
-@rnindex output-port?
-@deffn {Scheme Procedure} output-port? x
-@deffnx {C Function} scm_output_port_p (x)
-Return @code{#t} if @var{x} is an output port, otherwise return
-@code{#f}. Any object satisfying this predicate also satisfies
-@code{port?}.
-@end deffn
-
-@deffn {Scheme Procedure} port? x
-@deffnx {C Function} scm_port_p (x)
-Return a boolean indicating whether @var{x} is a port.
-Equivalent to @code{(or (input-port? @var{x}) (output-port?
-@var{x}))}.
-@end deffn
-
-
-@node Reading
-@section Reading
-
-[Generic procedures for reading from ports.]
-
-@rnindex eof-object?
-@deffn {Scheme Procedure} eof-object? x
-@deffnx {C Function} scm_eof_object_p (x)
-Return @code{#t} if @var{x} is an end-of-file object; otherwise
-return @code{#f}.
-@end deffn
-
-@rnindex char-ready?
-@deffn {Scheme Procedure} char-ready? [port]
-@deffnx {C Function} scm_char_ready_p (port)
-Return @code{#t} if a character is ready on input @var{port}
-and return @code{#f} otherwise. If @code{char-ready?} returns
-@code{#t} then the next @code{read-char} operation on
-@var{port} is guaranteed not to hang. If @var{port} is a file
-port at end of file then @code{char-ready?} returns @code{#t}.
-@footnote{@code{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 make sure that characters whose existence
-has been asserted by @code{char-ready?} cannot be rubbed out.
-If @code{char-ready?} were to return @code{#f} at end of file,
-a port at end of file would be indistinguishable from an
-interactive port that has no ready characters.}
-@end deffn
-
-@rnindex read-char?
-@deffn {Scheme Procedure} read-char [port]
-@deffnx {C Function} scm_read_char (port)
-Return the next character available from @var{port}, updating
-@var{port} to point to the following character. If no more
-characters are available, the end-of-file object is returned.
-@end deffn
-
-@rnindex peek-char?
-@deffn {Scheme Procedure} peek-char [port]
-@deffnx {C Function} scm_peek_char (port)
-Return the next character available from @var{port},
-@emph{without} updating @var{port} to point to the following
-character. If no more characters are available, the
-end-of-file object is returned.@footnote{The value returned by
-a call to @code{peek-char} is the same as the value that would
-have been returned by a call to @code{read-char} on the same
-port. The only difference is that the very next call to
-@code{read-char} or @code{peek-char} on that @var{port} will
-return the value returned by the preceding call to
-@code{peek-char}. In particular, a call to @code{peek-char} on
-an interactive port will hang waiting for input whenever a call
-to @code{read-char} would have hung.}
-@end deffn
-
-@deffn {Scheme Procedure} unread-char cobj [port]
-@deffnx {C Function} scm_unread_char (cobj, port)
-Place @var{char} in @var{port} so that it will be read by the
-next read operation. If called multiple times, the unread characters
-will be read again in last-in first-out order. If @var{port} is
-not supplied, the current input port is used.
-@end deffn
-
-@deffn {Scheme Procedure} unread-string str port
-@deffnx {C Function} scm_unread_string (str, port)
-Place the string @var{str} in @var{port} so that its characters will be
-read in subsequent read operations. If called multiple times, the
-unread characters will be read again in last-in first-out order. If
-@var{port} is not supplied, the current-input-port is used.
-@end deffn
-
-@deffn {Scheme Procedure} drain-input port
-@deffnx {C Function} scm_drain_input (port)
-This procedure clears a port's input buffers, similar
-to the way that force-output clears the output buffer. The
-contents of the buffers are returned as a single string, e.g.,
-
-@lisp
-(define p (open-input-file ...))
-(drain-input p) => empty string, nothing buffered yet.
-(unread-char (read-char p) p)
-(drain-input p) => initial chars from p, up to the buffer size.
-@end lisp
-
-Draining the buffers may be useful for cleanly finishing
-buffered I/O so that the file descriptor can be used directly
-for further input.
-@end deffn
-
-@deffn {Scheme Procedure} port-column port
-@deffnx {Scheme Procedure} port-line port
-@deffnx {C Function} scm_port_column (port)
-@deffnx {C Function} scm_port_line (port)
-Return the current column number or line number of @var{port},
-using the current input port if none is specified. If the number is
-unknown, the result is #f. Otherwise, the result is a 0-origin integer
-- i.e. the first character of the first line is line 0, column 0.
-(However, when you display a file position, for example in an error
-message, we recommend you add 1 to get 1-origin integers. This is
-because lines and column numbers traditionally start with 1, and that is
-what non-programmers will find most natural.)
-@end deffn
-
-@deffn {Scheme Procedure} set-port-column! port column
-@deffnx {Scheme Procedure} set-port-line! port line
-@deffnx {C Function} scm_set_port_column_x (port, column)
-@deffnx {C Function} scm_set_port_line_x (port, line)
-Set the current column or line number of @var{port}, using the
-current input port if none is specified.
-@end deffn
-
-@node Writing
-@section Writing
-
-[Generic procedures for writing to ports.]
-
-@deffn {Scheme Procedure} get-print-state port
-@deffnx {C Function} scm_get_print_state (port)
-Return the print state of the port @var{port}. If @var{port}
-has no associated print state, @code{#f} is returned.
-@end deffn
-
-@rnindex display
-@deffn {Scheme Procedure} display obj [port]
-Send a representation of @var{obj} to @var{current-output-port}.
-Optional second arg @var{port} specifies an alternative output port.
-The representation is similar to that produced by @code{write} (REFFIXME),
-the differences being strings are not quoted (and their characters are not
-escaped), and characters are rendered as if with @code{write-char}.
-@end deffn
-
-@rnindex newline
-@deffn {Scheme Procedure} newline [port]
-@deffnx {C Function} scm_newline (port)
-Send a newline to @var{port}.
-If @var{port} is omitted, send to the current output port.
-@end deffn
-
-@deffn {Scheme Procedure} port-with-print-state port pstate
-@deffnx {C Function} scm_port_with_print_state (port, pstate)
-Create a new port which behaves like @var{port}, but with an
-included print state @var{pstate}.
-@end deffn
-
-@deffn {Scheme Procedure} print-options-interface [setting]
-@deffnx {C Function} scm_print_options (setting)
-Option interface for the print options. Instead of using
-this procedure directly, use the procedures
-@code{print-enable}, @code{print-disable}, @code{print-set!}
-and @code{print-options}.
-@end deffn
-
-@deffn {Scheme Procedure} simple-format destination message . args
-@deffnx {C Function} scm_simple_format (destination, message, args)
-Write @var{message} to @var{destination}, defaulting to
-the current output port.
-@var{message} can contain @code{~A} (was @code{%s}) and
-@code{~S} (was @code{%S}) escapes. When printed,
-the escapes are replaced with corresponding members of
-@var{ARGS}:
-@code{~A} formats using @code{display} and @code{~S} formats
-using @code{write}.
-If @var{destination} is @code{#t}, then use the current output
-port, if @var{destination} is @code{#f}, then return a string
-containing the formatted text. Does not add a trailing newline.
-@end deffn
-
-@rnindex write-char
-@deffn {Scheme Procedure} write-char chr [port]
-@deffnx {C Function} scm_write_char (chr, port)
-Send character @var{chr} to @var{port}.
-@end deffn
-
-@findex fflush
-@deffn {Scheme Procedure} force-output [port]
-@deffnx {C Function} scm_force_output (port)
-Flush the specified output port, or the current output port if @var{port}
-is omitted. The current output buffer contents are passed to the
-underlying port implementation (e.g., in the case of fports, the
-data will be written to the file and the output buffer will be cleared.)
-It has no effect on an unbuffered port.
-
-The return value is unspecified.
-@end deffn
-
-@deffn {Scheme Procedure} flush-all-ports
-@deffnx {C Function} scm_flush_all_ports ()
-Equivalent to calling @code{force-output} on
-all open output ports. The return value is unspecified.
-@end deffn
-
-
-@node Closing
-@section Closing
-
-@deffn {Scheme Procedure} close-port port
-@deffnx {C Function} scm_close_port (port)
-Close the specified port object. Return @code{#t} if it
-successfully closes a port or @code{#f} if it was already
-closed. An exception may be raised if an error occurs, for
-example when flushing buffered output. See also @ref{Ports and
-File Descriptors, close}, for a procedure which can close file
-descriptors.
-@end deffn
-
-@rnindex close-input-port
-@deffn {Scheme Procedure} close-input-port port
-@deffnx {C Function} scm_close_input_port (port)
-Close the specified input port object. The routine has no effect if
-the file has already been closed. An exception may be raised if an
-error occurs. The value returned is unspecified.
-
-See also @ref{Ports and File Descriptors, close}, for a procedure
-which can close file descriptors.
-@end deffn
-
-@rnindex close-output-port
-@deffn {Scheme Procedure} close-output-port port
-@deffnx {C Function} scm_close_output_port (port)
-Close the specified output port object. The routine has no effect if
-the file has already been closed. An exception may be raised if an
-error occurs. The value returned is unspecified.
-
-See also @ref{Ports and File Descriptors, close}, for a procedure
-which can close file descriptors.
-@end deffn
-
-@deffn {Scheme Procedure} port-closed? port
-@deffnx {C Function} scm_port_closed_p (port)
-Return @code{#t} if @var{port} is closed or @code{#f} if it is
-open.
-@end deffn
-
-
-@node Random Access
-@section Random Access
-
-@deffn {Scheme Procedure} seek fd_port offset whence
-@deffnx {C Function} scm_seek (fd_port, offset, whence)
-Sets the current position of @var{fd/port} to the integer
-@var{offset}, which is interpreted according to the value of
-@var{whence}.
-
-One of the following variables should be supplied for
-@var{whence}:
-@defvar SEEK_SET
-Seek from the beginning of the file.
-@end defvar
-@defvar SEEK_CUR
-Seek from the current position.
-@end defvar
-@defvar SEEK_END
-Seek from the end of the file.
-@end defvar
-If @var{fd/port} is a file descriptor, the underlying system
-call is @code{lseek}. @var{port} may be a string port.
-
-The value returned is the new position in the file. This means
-that the current position of a port can be obtained using:
-@lisp
-(seek port 0 SEEK_CUR)
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} ftell fd_port
-@deffnx {C Function} scm_ftell (fd_port)
-Return an integer representing the current position of
-@var{fd/port}, measured from the beginning. Equivalent to:
-
-@lisp
-(seek port 0 SEEK_CUR)
-@end lisp
-@end deffn
-
-@findex truncate
-@findex ftruncate
-@deffn {Scheme Procedure} truncate-file object [length]
-@deffnx {C Function} scm_truncate_file (object, length)
-Truncates the object referred to by @var{object} to at most
-@var{length} bytes. @var{object} can be a string containing a
-file name or an integer file descriptor or a port.
-@var{length} may be omitted if @var{object} is not a file name,
-in which case the truncation occurs at the current port.
-position. The return value is unspecified.
-@end deffn
-
-@node Line/Delimited
-@section Line Oriented and Delimited Text
-
-The delimited-I/O module can be accessed with:
-
-@smalllisp
-(use-modules (ice-9 rdelim))
-@end smalllisp
-
-It can be used to read or write lines of text, or read text delimited by
-a specified set of characters. It's similar to the @code{(scsh rdelim)}
-module from guile-scsh, but does not use multiple values or character
-sets and has an extra procedure @code{write-line}.
-
-@c begin (scm-doc-string "rdelim.scm" "read-line")
-@deffn {Scheme Procedure} read-line [port] [handle-delim]
-Return a line of text from @var{port} if specified, otherwise from the
-value returned by @code{(current-input-port)}. Under Unix, a line of text
-is terminated by the first end-of-line character or by end-of-file.
-
-If @var{handle-delim} is specified, it should be one of the following
-symbols:
-@table @code
-@item trim
-Discard the terminating delimiter. This is the default, but it will
-be impossible to tell whether the read terminated with a delimiter or
-end-of-file.
-@item concat
-Append the terminating delimiter (if any) to the returned string.
-@item peek
-Push the terminating delimiter (if any) back on to the port.
-@item split
-Return a pair containing the string read from the port and the
-terminating delimiter or end-of-file object.
-@end table
-@end deffn
-
-@c begin (scm-doc-string "rdelim.scm" "read-line!")
-@deffn {Scheme Procedure} read-line! buf [port]
-Read a line of text into the supplied string @var{buf} and return the
-number of characters added to @var{buf}. If @var{buf} is filled, then
-@code{#f} is returned.
-Read from @var{port} if
-specified, otherwise from the value returned by @code{(current-input-port)}.
-@end deffn
-
-@c begin (scm-doc-string "rdelim.scm" "read-delimited")
-@deffn {Scheme Procedure} read-delimited delims [port] [handle-delim]
-Read text until one of the characters in the string @var{delims} is found
-or end-of-file is reached. Read from @var{port} if supplied, otherwise
-from the value returned by @code{(current-input-port)}.
-@var{handle-delim} takes the same values as described for @code{read-line}.
-@end deffn
-
-@c begin (scm-doc-string "rdelim.scm" "read-delimited!")
-@deffn {Scheme Procedure} read-delimited! delims buf [port] [handle-delim] [start] [end]
-Read text into the supplied string @var{buf} and return the number of
-characters added to @var{buf} (subject to @var{handle-delim}, which takes
-the same values specified for @code{read-line}. If @var{buf} is filled,
-@code{#f} is returned for both the number of characters read and the
-delimiter. Also terminates if one of the characters in the string
-@var{delims} is found
-or end-of-file is reached. Read from @var{port} if supplied, otherwise
-from the value returned by @code{(current-input-port)}.
-@end deffn
-
-@deffn {Scheme Procedure} write-line obj [port]
-@deffnx {C Function} scm_write_line (obj, port)
-Display @var{obj} and a newline character to @var{port}. If
-@var{port} is not specified, @code{(current-output-port)} is
-used. This function is equivalent to:
-@lisp
-(display obj [port])
-(newline [port])
-@end lisp
-@end deffn
-
-Some of the abovementioned I/O functions rely on the following C
-primitives. These will mainly be of interest to people hacking Guile
-internals.
-
-@deffn {Scheme Procedure} %read-delimited! delims str gobble [port [start [end]]]
-@deffnx {C Function} scm_read_delimited_x (delims, str, gobble, port, start, end)
-Read characters from @var{port} into @var{str} until one of the
-characters in the @var{delims} string is encountered. If
-@var{gobble} is true, discard the delimiter character;
-otherwise, leave it in the input stream for the next read. If
-@var{port} is not specified, use the value of
-@code{(current-input-port)}. If @var{start} or @var{end} are
-specified, store data only into the substring of @var{str}
-bounded by @var{start} and @var{end} (which default to the
-beginning and end of the string, respectively).
-
- Return a pair consisting of the delimiter that terminated the
-string and the number of characters read. If reading stopped
-at the end of file, the delimiter returned is the
-@var{eof-object}; if the string was filled without encountering
-a delimiter, this value is @code{#f}.
-@end deffn
-
-@deffn {Scheme Procedure} %read-line [port]
-@deffnx {C Function} scm_read_line (port)
-Read a newline-terminated line from @var{port}, allocating storage as
-necessary. The newline terminator (if any) is removed from the string,
-and a pair consisting of the line and its delimiter is returned. The
-delimiter may be either a newline or the @var{eof-object}; if
-@code{%read-line} is called at the end of file, it returns the pair
-@code{(#<eof> . #<eof>)}.
-@end deffn
-
-@node Block Reading and Writing
-@section Block reading and writing
-
-The Block-string-I/O module can be accessed with:
-
-@smalllisp
-(use-modules (ice-9 rw))
-@end smalllisp
-
-It currently contains procedures that help to implement the
-@code{(scsh rw)} module in guile-scsh.
-
-@deffn {Scheme Procedure} read-string!/partial str [port_or_fdes [start [end]]]
-@deffnx {C Function} scm_read_string_x_partial (str, port_or_fdes, start, end)
-Read characters from a port or file descriptor into a
-string @var{str}. A port must have an underlying file
-descriptor --- a so-called fport. This procedure is
-scsh-compatible and can efficiently read large strings.
-It will:
-
-@itemize
-@item
-attempt to fill the entire string, unless the @var{start}
-and/or @var{end} arguments are supplied. i.e., @var{start}
-defaults to 0 and @var{end} defaults to
-@code{(string-length str)}
-@item
-use the current input port if @var{port_or_fdes} is not
-supplied.
-@item
-return fewer than the requested number of characters in some
-cases, e.g., on end of file, if interrupted by a signal, or if
-not all the characters are immediately available.
-@item
-wait indefinitely for some input if no characters are
-currently available,
-unless the port is in non-blocking mode.
-@item
-read characters from the port's input buffers if available,
-instead from the underlying file descriptor.
-@item
-return @code{#f} if end-of-file is encountered before reading
-any characters, otherwise return the number of characters
-read.
-@item
-return 0 if the port is in non-blocking mode and no characters
-are immediately available.
-@item
-return 0 if the request is for 0 bytes, with no
-end-of-file check.
-@end itemize
-@end deffn
-
-@deffn {Scheme Procedure} write-string/partial str [port_or_fdes [start [end]]]
-@deffnx {C Function} scm_write_string_partial (str, port_or_fdes, start, end)
-Write characters from a string @var{str} to a port or file
-descriptor. A port must have an underlying file descriptor
---- a so-called fport. This procedure is
-scsh-compatible and can efficiently write large strings.
-It will:
-
-@itemize
-@item
-attempt to write the entire string, unless the @var{start}
-and/or @var{end} arguments are supplied. i.e., @var{start}
-defaults to 0 and @var{end} defaults to
-@code{(string-length str)}
-@item
-use the current output port if @var{port_of_fdes} is not
-supplied.
-@item
-in the case of a buffered port, store the characters in the
-port's output buffer, if all will fit. If they will not fit
-then any existing buffered characters will be flushed
-before attempting
-to write the new characters directly to the underlying file
-descriptor. If the port is in non-blocking mode and
-buffered characters can not be flushed immediately, then an
-@code{EAGAIN} system-error exception will be raised (Note:
-scsh does not support the use of non-blocking buffered ports.)
-@item
-write fewer than the requested number of
-characters in some cases, e.g., if interrupted by a signal or
-if not all of the output can be accepted immediately.
-@item
-wait indefinitely for at least one character
-from @var{str} to be accepted by the port, unless the port is
-in non-blocking mode.
-@item
-return the number of characters accepted by the port.
-@item
-return 0 if the port is in non-blocking mode and can not accept
-at least one character from @var{str} immediately
-@item
-return 0 immediately if the request size is 0 bytes.
-@end itemize
-@end deffn
-
-@node Default Ports
-@section Default Ports for Input, Output and Errors
-
-@rnindex current-input-port
-@deffn {Scheme Procedure} current-input-port
-@deffnx {C Function} scm_current_input_port ()
-Return the current input port. This is the default port used
-by many input procedures. Initially, @code{current-input-port}
-returns the @dfn{standard input} in Unix and C terminology.
-@end deffn
-
-@rnindex current-output-port
-@deffn {Scheme Procedure} current-output-port
-@deffnx {C Function} scm_current_output_port ()
-Return the current output port. This is the default port used
-by many output procedures. Initially,
-@code{current-output-port} returns the @dfn{standard output} in
-Unix and C terminology.
-@end deffn
-
-@deffn {Scheme Procedure} current-error-port
-@deffnx {C Function} scm_current_error_port ()
-Return the port to which errors and warnings should be sent (the
-@dfn{standard error} in Unix and C terminology).
-@end deffn
-
-@deffn {Scheme Procedure} set-current-input-port port
-@deffnx {Scheme Procedure} set-current-output-port port
-@deffnx {Scheme Procedure} set-current-error-port port
-@deffnx {C Function} scm_set_current_input_port (port)
-@deffnx {C Function} scm_set_current_output_port (port)
-@deffnx {C Function} scm_set_current_error_port (port)
-Change the ports returned by @code{current-input-port},
-@code{current-output-port} and @code{current-error-port}, respectively,
-so that they use the supplied @var{port} for input or output.
-@end deffn
-
-@deffn {Scheme Procedure} set-current-output-port port
-Set the current default output port to PORT.
-@end deffn
-
-@deffn {Scheme Procedure} set-current-error-port port
-Set the current default error port to PORT.
-@end deffn
-
-
-@node Port Types
-@section Types of Port
-
-[Types of port; how to make them.]
-
-@menu
-* File Ports:: Ports on an operating system file.
-* String Ports:: Ports on a Scheme string.
-* Soft Ports:: Ports on arbitrary Scheme procedures.
-* Void Ports:: Ports on nothing at all.
-@end menu
-
-
-@node File Ports
-@subsection File Ports
-
-The following procedures are used to open file ports.
-See also @ref{Ports and File Descriptors, open}, for an interface
-to the Unix @code{open} system call.
-
-@deffn {Scheme Procedure} open-file filename mode
-@deffnx {C Function} scm_open_file (filename, mode)
-Open the file whose name is @var{filename}, and return a port
-representing that file. The attributes of the port are
-determined by the @var{mode} string. The way in which this is
-interpreted is similar to C stdio. The first character must be
-one of the following:
-@table @samp
-@item r
-Open an existing file for input.
-@item w
-Open a file for output, creating it if it doesn't already exist
-or removing its contents if it does.
-@item a
-Open a file for output, creating it if it doesn't already
-exist. All writes to the port will go to the end of the file.
-The "append mode" can be turned off while the port is in use
-@pxref{Ports and File Descriptors, fcntl}
-@end table
-The following additional characters can be appended:
-@table @samp
-@item +
-Open the port for both input and output. E.g., @code{r+}: open
-an existing file for both input and output.
-@item 0
-Create an "unbuffered" port. In this case input and output
-operations are passed directly to the underlying port
-implementation without additional buffering. This is likely to
-slow down I/O operations. The buffering mode can be changed
-while a port is in use @pxref{Ports and File Descriptors,
-setvbuf}
-@item l
-Add line-buffering to the port. The port output buffer will be
-automatically flushed whenever a newline character is written.
-@end table
-In theory we could create read/write ports which were buffered
-in one direction only. However this isn't included in the
-current interfaces. If a file cannot be opened with the access
-requested, @code{open-file} throws an exception.
-@end deffn
-
-@rnindex open-input-file
-@deffn {Scheme Procedure} open-input-file filename
-Open @var{filename} for input. Equivalent to
-@smalllisp
-(open-file @var{filename} "r")
-@end smalllisp
-@end deffn
-
-@rnindex open-output-file
-@deffn {Scheme Procedure} open-output-file filename
-Open @var{filename} for output. Equivalent to
-@smalllisp
-(open-file @var{filename} "w")
-@end smalllisp
-@end deffn
-
-@rnindex call-with-input-file
-@deffn {Scheme Procedure} call-with-input-file file proc
-@var{proc} should be a procedure of one argument, and @var{file} should
-be a string naming a file. The file must already exist. These
-procedures call @var{proc} with one argument: the port obtained by
-opening the named file for input or output. If the file cannot be
-opened, an error is signalled. If the procedure returns, then the port
-is closed automatically and the value yielded by the procedure is
-returned. If the procedure does not return, then the port will not be
-closed automatically unless it is possible to prove that the port will
-never again be used for a read or write operation.
-@end deffn
-
-@rnindex call-with-output-file
-@deffn {Scheme Procedure} call-with-output-file file proc
-@var{proc} should be a procedure of one argument, and @var{file} should
-be a string naming a file. The behaviour is unspecified if the file
-already exists. These procedures call @var{proc} with one argument: the
-port obtained by opening the named file for input or output. If the
-file cannot be opened, an error is signalled. If the procedure returns,
-then the port is closed automatically and the value yielded by the
-procedure is returned. If the procedure does not return, then the port
-will not be closed automatically unless it is possible to prove that the
-port will never again be used for a read or write operation.
-@end deffn
-
-@rnindex with-input-from-file
-@deffn {Scheme Procedure} with-input-from-file file thunk
-@var{thunk} must be a procedure of no arguments, and @var{file} must be
-a string naming a file. The file must already exist. The file is opened
-for input, an input port connected to it is made the default value
-returned by @code{current-input-port}, and the @var{thunk} is called
-with no arguments. When the @var{thunk} returns, the port is closed and
-the previous default is restored. Returns the value yielded by
-@var{thunk}. If an escape procedure is used to escape from the
-continuation of these procedures, their behavior is implementation
-dependent.
-@end deffn
-
-@rnindex with-output-to-file
-@deffn {Scheme Procedure} with-output-to-file file thunk
-@var{thunk} must be a procedure of no arguments, and @var{file} must be
-a string naming a file. The effect is unspecified if the file already
-exists. The file is opened for output, an output port connected to it
-is made the default value returned by @code{current-output-port}, and
-the @var{thunk} is called with no arguments. When the @var{thunk}
-returns, the port is closed and the previous default is restored.
-Returns the value yielded by @var{thunk}. If an escape procedure is
-used to escape from the continuation of these procedures, their behavior
-is implementation dependent.
-@end deffn
-
-@deffn {Scheme Procedure} with-error-to-file file thunk
-@var{thunk} must be a procedure of no arguments, and @var{file} must be
-a string naming a file. The effect is unspecified if the file already
-exists. The file is opened for output, an output port connected to it
-is made the default value returned by @code{current-error-port}, and the
-@var{thunk} is called with no arguments. When the @var{thunk} returns,
-the port is closed and the previous default is restored. Returns the
-value yielded by @var{thunk}. If an escape procedure is used to escape
-from the continuation of these procedures, their behavior is
-implementation dependent.
-@end deffn
-
-@deffn {Scheme Procedure} port-mode port
-@deffnx {C Function} scm_port_mode (port)
-Return the port modes associated with the open port @var{port}.
-These will not necessarily be identical to the modes used when
-the port was opened, since modes such as "append" which are
-used only during port creation are not retained.
-@end deffn
-
-@deffn {Scheme Procedure} port-filename port
-@deffnx {C Function} scm_port_filename (port)
-Return the filename associated with @var{port}. This function returns
-the strings "standard input", "standard output" and "standard error"
-when called on the current input, output and error ports respectively.
-@end deffn
-
-@deffn {Scheme Procedure} set-port-filename! port filename
-@deffnx {C Function} scm_set_port_filename_x (port, filename)
-Change the filename associated with @var{port}, using the current input
-port if none is specified. Note that this does not change the port's
-source of data, but only the value that is returned by
-@code{port-filename} and reported in diagnostic output.
-@end deffn
-
-@deffn {Scheme Procedure} file-port? obj
-@deffnx {C Function} scm_file_port_p (obj)
-Determine whether @var{obj} is a port that is related to a file.
-@end deffn
-
-
-@node String Ports
-@subsection String Ports
-
-The following allow string ports to be opened by analogy to R4R*
-file port facilities:
-
-@deffn {Scheme Procedure} call-with-output-string proc
-@deffnx {C Function} scm_call_with_output_string (proc)
-Calls the one-argument procedure @var{proc} with a newly created output
-port. When the function returns, the string composed of the characters
-written into the port is returned.
-@end deffn
-
-@deffn {Scheme Procedure} call-with-input-string string proc
-@deffnx {C Function} scm_call_with_input_string (string, proc)
-Calls the one-argument procedure @var{proc} with a newly
-created input port from which @var{string}'s contents may be
-read. The value yielded by the @var{proc} is returned.
-@end deffn
-
-@deffn {Scheme Procedure} with-output-to-string thunk
-Calls the zero-argument procedure @var{thunk} with the current output
-port set temporarily to a new string port. It returns a string
-composed of the characters written to the current output.
-@end deffn
-
-@deffn {Scheme Procedure} with-input-from-string string thunk
-Calls the zero-argument procedure @var{thunk} with the current input
-port set temporarily to a string port opened on the specified
-@var{string}. The value yielded by @var{thunk} is returned.
-@end deffn
-
-@deffn {Scheme Procedure} open-input-string str
-@deffnx {C Function} scm_open_input_string (str)
-Take a string and return an input port that delivers characters
-from the string. The port can be closed by
-@code{close-input-port}, though its storage will be reclaimed
-by the garbage collector if it becomes inaccessible.
-@end deffn
-
-@deffn {Scheme Procedure} open-output-string
-@deffnx {C Function} scm_open_output_string ()
-Return an output port that will accumulate characters for
-retrieval by @code{get-output-string}. The port can be closed
-by the procedure @code{close-output-port}, though its storage
-will be reclaimed by the garbage collector if it becomes
-inaccessible.
-@end deffn
-
-@deffn {Scheme Procedure} get-output-string port
-@deffnx {C Function} scm_get_output_string (port)
-Given an output port created by @code{open-output-string},
-return a string consisting of the characters that have been
-output to the port so far.
-@end deffn
-
-A string port can be used in many procedures which accept a port
-but which are not dependent on implementation details of fports.
-E.g., seeking and truncating will work on a string port,
-but trying to extract the file descriptor number will fail.
-
-
-@node Soft Ports
-@subsection Soft Ports
-
-A @dfn{soft-port} is a port based on a vector of procedures capable of
-accepting or delivering characters. It allows emulation of I/O ports.
-
-@deffn {Scheme Procedure} make-soft-port pv modes
-@deffnx {C Function} scm_make_soft_port (pv, modes)
-Return a port capable of receiving or delivering characters as
-specified by the @var{modes} string (@pxref{File Ports,
-open-file}). @var{pv} must be a vector of length 5. Its
-components are as follows:
-
-@enumerate 0
-@item
-procedure accepting one character for output
-@item
-procedure accepting a string for output
-@item
-thunk for flushing output
-@item
-thunk for getting one character
-@item
-thunk for closing port (not by garbage collection)
-@end enumerate
-
-For an output-only port only elements 0, 1, 2, and 4 need be
-procedures. For an input-only port only elements 3 and 4 need
-be procedures. Thunks 2 and 4 can instead be @code{#f} if
-there is no useful operation for them to perform.
-
-If thunk 3 returns @code{#f} or an @code{eof-object}
-(@pxref{Input, eof-object?, ,r5rs, The Revised^5 Report on
-Scheme}) it indicates that the port has reached end-of-file.
-For example:
-
-@lisp
-(define stdout (current-output-port))
-(define p (make-soft-port
- (vector
- (lambda (c) (write c stdout))
- (lambda (s) (display s stdout))
- (lambda () (display "." stdout))
- (lambda () (char-upcase (read-char)))
- (lambda () (display "@@" stdout)))
- "rw"))
-
-(write p p) @result{} #<input-output: soft 8081e20>
-@end lisp
-@end deffn
-
-
-@node Void Ports
-@subsection Void Ports
-
-This kind of port causes any data to be discarded when written to, and
-always returns the end-of-file object when read from.
-
-@deffn {Scheme Procedure} %make-void-port mode
-@deffnx {C Function} scm_sys_make_void_port (mode)
-Create and return a new void port. A void port acts like
-@file{/dev/null}. The @var{mode} argument
-specifies the input/output modes for this port: see the
-documentation for @code{open-file} in @ref{File Ports}.
-@end deffn
-
-
-@node I/O Extensions
-@section Using and Extending Ports in C
-
-@menu
-* C Port Interface:: Using ports from C.
-* Port Implementation:: How to implement a new port type in C.
-@end menu
-
-
-@node C Port Interface
-@subsection C Port Interface
-
-This section describes how to use Scheme ports from C.
-
-@subsubsection Port basics
-
-There are two main data structures. A port type object (ptob) is of
-type @code{scm_ptob_descriptor}. A port instance is of type
-@code{scm_port}. Given an @code{SCM} variable which points to a port,
-the corresponding C port object can be obtained using the
-@code{SCM_PTAB_ENTRY} macro. The ptob can be obtained by using
-@code{SCM_PTOBNUM} to give an index into the @code{scm_ptobs}
-global array.
-
-@subsubsection Port buffers
-
-An input port always has a read buffer and an output port always has a
-write buffer. However the size of these buffers is not guaranteed to be
-more than one byte (e.g., the @code{shortbuf} field in @code{scm_port}
-which is used when no other buffer is allocated). The way in which the
-buffers are allocated depends on the implementation of the ptob. For
-example in the case of an fport, buffers may be allocated with malloc
-when the port is created, but in the case of an strport the underlying
-string is used as the buffer.
-
-@subsubsection The @code{rw_random} flag
-
-Special treatment is required for ports which can be seeked at random.
-Before various operations, such as seeking the port or changing from
-input to output on a bidirectional port or vice versa, the port
-implementation must be given a chance to update its state. The write
-buffer is updated by calling the @code{flush} ptob procedure and the
-input buffer is updated by calling the @code{end_input} ptob procedure.
-In the case of an fport, @code{flush} causes buffered output to be
-written to the file descriptor, while @code{end_input} causes the
-descriptor position to be adjusted to account for buffered input which
-was never read.
-
-The special treatment must be performed if the @code{rw_random} flag in
-the port is non-zero.
-
-@subsubsection The @code{rw_active} variable
-
-The @code{rw_active} variable in the port is only used if
-@code{rw_random} is set. It's defined as an enum with the following
-values:
-
-@table @code
-@item SCM_PORT_READ
-the read buffer may have unread data.
-
-@item SCM_PORT_WRITE
-the write buffer may have unwritten data.
-
-@item SCM_PORT_NEITHER
-neither the write nor the read buffer has data.
-@end table
-
-@subsubsection Reading from a port.
-
-To read from a port, it's possible to either call existing libguile
-procedures such as @code{scm_getc} and @code{scm_read_line} or to read
-data from the read buffer directly. Reading from the buffer involves
-the following steps:
-
-@enumerate
-@item
-Flush output on the port, if @code{rw_active} is @code{SCM_PORT_WRITE}.
-
-@item
-Fill the read buffer, if it's empty, using @code{scm_fill_input}.
-
-@item Read the data from the buffer and update the read position in
-the buffer. Steps 2) and 3) may be repeated as many times as required.
-
-@item Set rw_active to @code{SCM_PORT_READ} if @code{rw_random} is set.
-
-@item update the port's line and column counts.
-@end enumerate
-
-@subsubsection Writing to a port.
-
-To write data to a port, calling @code{scm_lfwrite} should be sufficient for
-most purposes. This takes care of the following steps:
-
-@enumerate
-@item
-End input on the port, if @code{rw_active} is @code{SCM_PORT_READ}.
-
-@item
-Pass the data to the ptob implementation using the @code{write} ptob
-procedure. The advantage of using the ptob @code{write} instead of
-manipulating the write buffer directly is that it allows the data to be
-written in one operation even if the port is using the single-byte
-@code{shortbuf}.
-
-@item
-Set @code{rw_active} to @code{SCM_PORT_WRITE} if @code{rw_random}
-is set.
-@end enumerate
-
-
-@node Port Implementation
-@subsection Port Implementation
-
-This section describes how to implement a new port type in C.
-
-As described in the previous section, a port type object (ptob) is
-a structure of type @code{scm_ptob_descriptor}. A ptob is created by
-calling @code{scm_make_port_type}.
-
-All of the elements of the ptob, apart from @code{name}, are procedures
-which collectively implement the port behaviour. Creating a new port
-type mostly involves writing these procedures.
-
-@code{scm_make_port_type} initializes three elements of the structure
-(@code{name}, @code{fill_input} and @code{write}) from its arguments.
-The remaining elements are initialized with default values and can be
-set later if required.
-
-@table @code
-@item name
-A pointer to a NUL terminated string: the name of the port type. This
-is the only element of @code{scm_ptob_descriptor} which is not
-a procedure. Set via the first argument to @code{scm_make_port_type}.
-
-@item mark
-Called during garbage collection to mark any SCM objects that a port
-object may contain. It doesn't need to be set unless the port has
-@code{SCM} components. Set using @code{scm_set_port_mark}.
-
-@item free
-Called when the port is collected during gc. It
-should free any resources used by the port.
-Set using @code{scm_set_port_free}.
-
-@item print
-Called when @code{write} is called on the port object, to print a
-port description. e.g., for an fport it may produce something like:
-@code{#<input: /etc/passwd 3>}. Set using @code{scm_set_port_print}.
-
-@item equalp
-Not used at present. Set using @code{scm_set_port_equalp}.
-
-@item close
-Called when the port is closed, unless it was collected during gc. It
-should free any resources used by the port.
-Set using @code{scm_set_port_close}.
-
-@item write
-Accept data which is to be written using the port. The port implementation
-may choose to buffer the data instead of processing it directly.
-Set via the third argument to @code{scm_make_port_type}.
-
-@item flush
-Complete the processing of buffered output data. Reset the value of
-@code{rw_active} to @code{SCM_PORT_NEITHER}.
-Set using @code{scm_set_port_flush}.
-
-@item end_input
-Perform any synchronization required when switching from input to output
-on the port. Reset the value of @code{rw_active} to @code{SCM_PORT_NEITHER}.
-Set using @code{scm_set_port_end_input}.
-
-@item fill_input
-Read new data into the read buffer and return the first character. It
-can be assumed that the read buffer is empty when this procedure is called.
-Set via the second argument to @code{scm_make_port_type}.
-
-@item input_waiting
-Return a lower bound on the number of bytes that could be read from the
-port without blocking. It can be assumed that the current state of
-@code{rw_active} is @code{SCM_PORT_NEITHER}.
-Set using @code{scm_set_port_input_waiting}.
-
-@item seek
-Set the current position of the port. The procedure can not make
-any assumptions about the value of @code{rw_active} when it's
-called. It can reset the buffers first if desired by using something
-like:
-
-@example
- if (pt->rw_active == SCM_PORT_READ)
- scm_end_input (object);
- else if (pt->rw_active == SCM_PORT_WRITE)
- ptob->flush (object);
-@end example
-
-However note that this will have the side effect of discarding any data
-in the unread-char buffer, in addition to any side effects from the
-@code{end_input} and @code{flush} ptob procedures. This is undesirable
-when seek is called to measure the current position of the port, i.e.,
-@code{(seek p 0 SEEK_CUR)}. The libguile fport and string port
-implementations take care to avoid this problem.
-
-The procedure is set using @code{scm_set_port_seek}.
-
-@item truncate
-Truncate the port data to be specified length. It can be assumed that the
-current state of @code{rw_active} is @code{SCM_PORT_NEITHER}.
-Set using @code{scm_set_port_truncate}.
-
-@end table
-
-
-@c Local Variables:
-@c TeX-master: "guile.texi"
-@c End:
diff --git a/doc/ref/scheme-memory.texi b/doc/ref/scheme-memory.texi
deleted file mode 100644
index d6f0584c6..000000000
--- a/doc/ref/scheme-memory.texi
+++ /dev/null
@@ -1,396 +0,0 @@
-@page
-@node Memory Management
-@chapter Memory Management and Garbage Collection
-
-@menu
-* Garbage Collection::
-* Memory Blocks::
-* Weak References::
-* Guardians::
-@end menu
-
-
-@node Garbage Collection
-@section Garbage Collection
-
-@deffn {Scheme Procedure} gc
-@deffnx {C Function} scm_gc ()
-Scans all of SCM objects and reclaims for further use those that are
-no longer accessible. You normally don't need to call this function
-explicitely. It is called automatically when appropriate.
-@end deffn
-
-@deffn {Scheme Procedure} gc-stats
-@deffnx {C Function} scm_gc_stats ()
-Return an association list of statistics about Guile's current
-use of storage.
-@end deffn
-
-
-@node Memory Blocks
-@section Memory Blocks
-
-In C programs, dynamic management of memory blocks is normally done
-with the functions malloc, realloc, and free. Guile has additional
-functions for dynamic memory allocation that are integrated into the
-garbage collector and the error reporting system.
-
-Memory blocks that are associated with Scheme objects (for example a
-smob) should be allocated and freed with @code{scm_gc_malloc} and
-@code{scm_gc_free}. The function @code{scm_gc_malloc} will either
-return a valid pointer or signal an error. It will also assume that
-the new memory can be freed by a garbage collection. The garbage
-collector uses this information to decide when to try to actually
-collect some garbage. Memory blocks allocated with
-@code{scm_gc_malloc} must be freed with @code{scm_gc_free}.
-
-For memory that is not associated with a Scheme object, you can use
-@code{scm_malloc} instead of @code{malloc}. Like
-@code{scm_gc_malloc}, it will either return a valid pointer or signal
-an error. However, it will not assume that the new memory block can
-be freed by a garbage collection. The memory can be freed with
-@code{free}.
-
-There is also @code{scm_gc_realloc} and @code{scm_realloc}, to be used
-in place of @code{realloc} when appropriate.
-
-For really specialized needs, take at look at
-@code{scm_gc_register_collectable_memory} and
-@code{scm_gc_unregister_collectable_memory}.
-
-@deftypefn {C Function} void *scm_malloc (size_t @var{size})
-Allocate @var{size} bytes of memory and return a pointer to it. When
-@var{size} is 0, return @code{NULL}. When not enough memory is
-available, signal an error. This function runs the GC to free up some
-memory when it deems it appropriate.
-
-The memory is allocated by the libc @code{malloc} function and can be
-freed with @code{free}. There is no @code{scm_free} function to go
-with @code{scm_malloc} to make it easier to pass memory back and forth
-between different modules.
-@end deftypefn
-
-@deftypefn {C Function} void *scm_realloc (void *@var{mem}, size_t @var{new_size})
-Change the size of the memory block at @var{mem} to @var{new_size} and
-return its new location. When @var{new_size} is 0, this is the same
-as calling @code{free} on @var{mem} and @code{NULL} is returned. When
-@var{mem} is @code{NULL}, this function behaves like @code{scm_malloc}
-and allocates a new block of size @var{new_size}.
-
-When not enough memory is available, signal an error. This function
-runs the GC to free up some memory when it deems it appropriate.
-@end deftypefn
-
-@deftypefn {C Function} void scm_gc_register_collectable_memory (void *@var{mem}, size_t @var{size}, const char *@var{what})
-Informs the GC that the memory at @var{mem} of size @var{size} can
-potentially be freed during a GC. That is, announce that @var{mem} is
-part of a GC controlled object and when the GC happens to free that
-object, @var{size} bytes will be freed along with it. The GC will
-@strong{not} free the memory itself, it will just know that so-and-so
-much bytes of memory are associated with GC controlled objects and the
-memory system figures this into its decisions when to run a GC.
-
-@var{mem} does not need to come from @code{scm_malloc}. You can only
-call this function once for every memory block.
-
-The @var{what} argument is used for statistical purposes. It should
-describe the type of object that the memory will be used for so that
-users can identify just what strange objects are eating up their
-memory.
-@end deftypefn
-
-@deftypefn {C Function} void scm_gc_unregister_collectable_memory (void *@var{mem}, size_t @var{size})
-Informs the GC that the memory at @var{mem} of size @var{size} is no
-longer associated with a GC controlled object. You must take care to
-match up every call to @code{scm_gc_register_collectable_memory} with
-a call to @code{scm_gc_unregister_collectable_memory}. If you don't do
-this, the GC might have a wrong impression of what is going on and run
-much less efficiently than it could.
-@end deftypefn
-
-@deftypefn {C Function} void *scm_gc_malloc (size_t @var{size}, const char *@var{what})
-@deftypefnx {C Function} void *scm_gc_realloc (void *@var{mem}, size_t @var{old_size}, size_t @var{new_size}, const char *@var{what});
-Like @code{scm_malloc} or @code{scm_realloc}, but also call
-@code{scm_gc_register_collectable_memory}. Note that you need to pass
-the old size of a reallocated memory block as well. See below for a
-motivation.
-@end deftypefn
-
-@deftypefn {C Function} void scm_gc_free (void *@var{mem}, size_t @var{size}, const char *@var{what})
-Like @code{free}, but also call @code{scm_gc_unregister_collectable_memory}.
-
-Note that you need to explicitely pass the @var{size} parameter. This
-is done since it should normally be easy to provide this parameter
-(for memory that is associated with GC controlled objects) and this
-frees us from tracking this value in the GC itself, which will keep
-the memory management overhead very low.
-@end deftypefn
-
-@deffn {Scheme Procedure} malloc-stats
-Return an alist ((@var{what} . @var{n}) ...) describing number
-of malloced objects.
-@var{what} is the second argument to @code{scm_gc_malloc},
-@var{n} is the number of objects of that type currently
-allocated.
-@end deffn
-
-
-@subsection Upgrading from scm_must_malloc et al.
-
-Version 1.6 of Guile and earlier did not have the functions from the
-previous section. In their place, it had the functions
-@code{scm_must_malloc}, @code{scm_must_realloc} and
-@code{scm_must_free}. This section explains why we want you to stop
-using them, and how to do this.
-
-The functions @code{scm_must_malloc} and @code{scm_must_realloc}
-behaved like @code{scm_gc_malloc} and @code{scm_gc_realloc} do now,
-respectively. They would inform the GC about the newly allocated
-memory via the internal equivalent of
-@code{scm_gc_register_collectable_memory}. However,
-@code{scm_must_free} did not unregister the memory it was about to
-free. The usual way to unregister memory was to return its size from
-a smob free function.
-
-This disconnectedness of the actual freeing of memory and reporting
-this to the GC proved to be bad in practice. It was easy to make
-mistakes and report the wrong size because allocating and freeing was
-not done with symmetric code, and because it is cumbersome to compute
-the total size of nested data structures that were freed with multiple
-calls to @code{scm_must_free}. Additionally, there was no equivalent
-to @code{scm_malloc}, and it was tempting to just use
-@code{scm_must_malloc} and never to tell the GC that the memory has
-been freed.
-
-The effect was that the internal statistics kept by the GC drifted out
-of sync with reality and could even overflow in long running programs.
-When this happened, the result was a dramatic increase in (senseless)
-GC activity which would effectively stop the program dead.
-
-The functions @code{scm_done_malloc} and @code{scm_done_free} were
-introduced to help restore balance to the force, but existing bugs did
-not magically disappear, of course.
-
-Therefore we decided to force everybody to review their code by
-deprecating the existing functions and introducing new ones in their
-place that are hopefully easier to use correctly.
-
-For every use of @code{scm_must_malloc} you need to decide whether to
-use @code{scm_malloc} or @code{scm_gc_malloc} in its place. When the
-memory block is not part of a smob or some other Scheme object whose
-lifetime is ultimately managed by the garbage collector, use
-@code{scm_malloc} and @code{free}. When it is part of a smob, use
-@code{scm_gc_malloc} and change the smob free function to use
-@code{scm_gc_free} instead of @code{scm_must_free} or @code{free} and
-make it return zero.
-
-The important thing is to always pair @code{scm_malloc} with
-@code{free}; and to always pair @code{scm_gc_malloc} with
-@code{scm_gc_free}.
-
-The same reasoning applies to @code{scm_must_realloc} and
-@code{scm_realloc} versus @code{scm_gc_realloc}.
-
-
-@node Weak References
-@section Weak References
-
-[FIXME: This chapter is based on Mikael Djurfeldt's answer to a
-question by Michael Livshin. Any mistakes are not theirs, of course. ]
-
-Weak references let you attach bookkeeping information to data so that
-the additional information automatically disappears when the original
-data is no longer in use and gets garbage collected. In a weak key hash,
-the hash entry for that key disappears as soon as the key is no longer
-referenced from anywhere else. For weak value hashes, the same happens
-as soon as the value is no longer in use. Entries in a doubly weak hash
-disappear when either the key or the value are not used anywhere else
-anymore.
-
-Object properties offer the same kind of functionality as weak key
-hashes in many situations. (@pxref{Object Properties})
-
-Here's an example (a little bit strained perhaps, but one of the
-examples is actually used in Guile):
-
-Assume that you're implementing a debugging system where you want to
-associate information about filename and position of source code
-expressions with the expressions themselves.
-
-Hashtables can be used for that, but if you use ordinary hash tables
-it will be impossible for the scheme interpreter to "forget" old
-source when, for example, a file is reloaded.
-
-To implement the mapping from source code expressions to positional
-information it is necessary to use weak-key tables since we don't want
-the expressions to be remembered just because they are in our table.
-
-To implement a mapping from source file line numbers to source code
-expressions you would use a weak-value table.
-
-To implement a mapping from source code expressions to the procedures
-they constitute a doubly-weak table has to be used.
-
-@menu
-* Weak key hashes::
-* Weak vectors::
-@end menu
-
-
-@node Weak key hashes
-@subsection Weak key hashes
-
-@deffn {Scheme Procedure} make-weak-key-hash-table size
-@deffnx {Scheme Procedure} make-weak-value-hash-table size
-@deffnx {Scheme Procedure} make-doubly-weak-hash-table size
-@deffnx {C Function} scm_make_weak_key_hash_table (size)
-@deffnx {C Function} scm_make_weak_value_hash_table (size)
-@deffnx {C Function} scm_make_doubly_weak_hash_table (size)
-Return a weak hash table with @var{size} buckets. As with any
-hash table, choosing a good size for the table requires some
-caution.
-
-You can modify weak hash tables in exactly the same way you
-would modify regular hash tables. (@pxref{Hash Tables})
-@end deffn
-
-@deffn {Scheme Procedure} weak-key-hash-table? obj
-@deffnx {Scheme Procedure} weak-value-hash-table? obj
-@deffnx {Scheme Procedure} doubly-weak-hash-table? obj
-@deffnx {C Function} scm_weak_key_hash_table_p (obj)
-@deffnx {C Function} scm_weak_value_hash_table_p (obj)
-@deffnx {C Function} scm_doubly_weak_hash_table_p (obj)
-Return @code{#t} if @var{obj} is the specified weak hash
-table. Note that a doubly weak hash table is neither a weak key
-nor a weak value hash table.
-@end deffn
-
-@deffn {Scheme Procedure} make-weak-value-hash-table k
-@end deffn
-
-@deffn {Scheme Procedure} weak-value-hash-table? x
-@end deffn
-
-@deffn {Scheme Procedure} make-doubly-weak-hash-table k
-@end deffn
-
-@deffn {Scheme Procedure} doubly-weak-hash-table? x
-@end deffn
-
-
-@node Weak vectors
-@subsection Weak vectors
-
-Weak vectors are mainly useful in Guile's implementation of weak hash
-tables.
-
-@deffn {Scheme Procedure} make-weak-vector size [fill]
-@deffnx {C Function} scm_make_weak_vector (size, fill)
-Return a weak vector with @var{size} elements. If the optional
-argument @var{fill} is given, all entries in the vector will be
-set to @var{fill}. The default value for @var{fill} is the
-empty list.
-@end deffn
-
-@deffn {Scheme Procedure} weak-vector . l
-@deffnx {Scheme Procedure} list->weak-vector l
-@deffnx {C Function} scm_weak_vector (l)
-Construct a weak vector from a list: @code{weak-vector} uses
-the list of its arguments while @code{list->weak-vector} uses
-its only argument @var{l} (a list) to construct a weak vector
-the same way @code{list->vector} would.
-@end deffn
-
-@deffn {Scheme Procedure} weak-vector? obj
-@deffnx {C Function} scm_weak_vector_p (obj)
-Return @code{#t} if @var{obj} is a weak vector. Note that all
-weak hashes are also weak vectors.
-@end deffn
-
-
-@node Guardians
-@section Guardians
-
-@deffn {Scheme Procedure} make-guardian [greedy?]
-@deffnx {C Function} scm_make_guardian (greedy_p)
-Create a new guardian.
-A guardian protects a set of objects from garbage collection,
-allowing a program to apply cleanup or other actions.
-
-@code{make-guardian} returns a procedure representing the guardian.
-Calling the guardian procedure with an argument adds the
-argument to the guardian's set of protected objects.
-Calling the guardian procedure without an argument returns
-one of the protected objects which are ready for garbage
-collection, or @code{#f} if no such object is available.
-Objects which are returned in this way are removed from
-the guardian.
-
-@code{make-guardian} takes one optional argument that says whether the
-new guardian should be greedy or sharing. If there is any chance
-that any object protected by the guardian may be resurrected,
-then you should make the guardian greedy (this is the default).
-
-See R. Kent Dybvig, Carl Bruggeman, and David Eby (1993)
-"Guardians in a Generation-Based Garbage Collector".
-ACM SIGPLAN Conference on Programming Language Design
-and Implementation, June 1993.
-
-(the semantics are slightly different at this point, but the
-paper still (mostly) accurately describes the interface).
-@end deffn
-
-@deffn {Scheme Procedure} destroy-guardian! guardian
-@deffnx {C Function} scm_destroy_guardian_x (guardian)
-Destroys @var{guardian}, by making it impossible to put any more
-objects in it or get any objects from it. It also unguards any
-objects guarded by @var{guardian}.
-@end deffn
-
-@deffn {Scheme Procedure} guardian-greedy? guardian
-@deffnx {C Function} scm_guardian_greedy_p (guardian)
-Return @code{#t} if @var{guardian} is a greedy guardian, otherwise @code{#f}.
-@end deffn
-
-@deffn {Scheme Procedure} guardian-destroyed? guardian
-@deffnx {C Function} scm_guardian_destroyed_p (guardian)
-Return @code{#t} if @var{guardian} has been destroyed, otherwise @code{#f}.
-@end deffn
-
-
-@page
-@node Objects
-@chapter Objects
-
-@deffn {Scheme Procedure} entity? obj
-@deffnx {C Function} scm_entity_p (obj)
-Return @code{#t} if @var{obj} is an entity.
-@end deffn
-
-@deffn {Scheme Procedure} operator? obj
-@deffnx {C Function} scm_operator_p (obj)
-Return @code{#t} if @var{obj} is an operator.
-@end deffn
-
-@deffn {Scheme Procedure} set-object-procedure! obj proc
-@deffnx {C Function} scm_set_object_procedure_x (obj, proc)
-Set the object procedure of @var{obj} to @var{proc}.
-@var{obj} must be either an entity or an operator.
-@end deffn
-
-@deffn {Scheme Procedure} make-class-object metaclass layout
-@deffnx {C Function} scm_make_class_object (metaclass, layout)
-Create a new class object of class @var{metaclass}, with the
-slot layout specified by @var{layout}.
-@end deffn
-
-@deffn {Scheme Procedure} make-subclass-object class layout
-@deffnx {C Function} scm_make_subclass_object (class, layout)
-Create a subclass object of @var{class}, with the slot layout
-specified by @var{layout}.
-@end deffn
-
-
-@c Local Variables:
-@c TeX-master: "guile.texi"
-@c End:
diff --git a/doc/ref/scheme-modules.texi b/doc/ref/scheme-modules.texi
deleted file mode 100644
index c9279258c..000000000
--- a/doc/ref/scheme-modules.texi
+++ /dev/null
@@ -1,909 +0,0 @@
-@page
-@node Modules
-@chapter Modules
-@cindex modules
-
-When programs become large, naming conflicts can occur when a function
-or global variable defined in one file has the same name as a function
-or global variable in another file. Even just a @emph{similarity}
-between function names can cause hard-to-find bugs, since a programmer
-might type the wrong function name.
-
-The approach used to tackle this problem is called @emph{information
-encapsulation}, which consists of packaging functional units into a
-given name space that is clearly separated from other name spaces.
-@cindex encapsulation
-@cindex information encapsulation
-@cindex name space
-
-The language features that allow this are usually called @emph{the
-module system} because programs are broken up into modules that are
-compiled separately (or loaded separately in an interpreter).
-
-Older languages, like C, have limited support for name space
-manipulation and protection. In C a variable or function is public by
-default, and can be made local to a module with the @code{static}
-keyword. But you cannot reference public variables and functions from
-another module with different names.
-
-More advanced module systems have become a common feature in recently
-designed languages: ML, Python, Perl, and Modula 3 all allow the
-@emph{renaming} of objects from a foreign module, so they will not
-clutter the global name space.
-@cindex name space - private
-
-In addition, Guile offers variables as first-class objects. They can
-be used for interacting with the module system.
-
-@menu
-* provide and require:: The SLIB feature mechanism.
-* Environments:: R5RS top-level environments.
-* The Guile module system:: How Guile does it.
-* Dynamic Libraries:: Loading libraries of compiled code at run time.
-* Variables:: First-class variables.
-@end menu
-
-@node provide and require
-@section provide and require
-
-Aubrey Jaffer, mostly to support his portable Scheme library SLIB,
-implemented a provide/require mechanism for many Scheme implementations.
-Library files in SLIB @emph{provide} a feature, and when user programs
-@emph{require} that feature, the library file is loaded in.
-
-For example, the file @file{random.scm} in the SLIB package contains the
-line
-
-@smalllisp
-(provide 'random)
-@end smalllisp
-
-so to use its procedures, a user would type
-
-@smalllisp
-(require 'random)
-@end smalllisp
-
-and they would magically become available, @emph{but still have the same
-names!} So this method is nice, but not as good as a full-featured
-module system.
-
-When SLIB is used with Guile, provide and require can be used to access
-its facilities.
-
-@node Environments
-@section Environments
-@cindex environment
-
-Scheme, as defined in R5RS, does @emph{not} have a full module system.
-However it does define the concept of a top-level @dfn{environment}.
-Such an environment maps identifiers (symbols) to Scheme objects such
-as procedures and lists: @ref{About Closure}. In other words, it
-implements a set of @dfn{bindings}.
-
-Environments in R5RS can be passed as the second argument to
-@code{eval} (@pxref{Fly Evaluation}). Three procedures are defined to
-return environments: @code{scheme-report-environment},
-@code{null-environment} and @code{interaction-environment} (@pxref{Fly
-Evaluation}).
-
-In addition, in Guile any module can be used as an R5RS environment,
-i.e., passed as the second argument to @code{eval}.
-
-@deffn {Scheme Procedure} scheme-report-environment version
-@deffnx {Scheme Procedure} null-environment version
-@var{version} must be the exact integer `5', corresponding to revision
-5 of the Scheme report (the Revised^5 Report on Scheme).
-@code{scheme-report-environment} returns a specifier for an
-environment that is empty except for all bindings defined in the
-report that are either required or both optional and supported by the
-implementation. @code{null-environment} returns a specifier for an
-environment that is empty except for the (syntactic) bindings for all
-syntactic keywords defined in the report that are either required or
-both optional and supported by the implementation.
-
-Currently Guile does not support values of @var{version} for other
-revisions of the report.
-
-The effect of assigning (through the use of @code{eval}) a variable
-bound in a @code{scheme-report-environment} (for example @code{car})
-is unspecified. Currently the environments specified by
-@code{scheme-report-environment} are not immutable in Guile.
-@end deffn
-
-@node The Guile module system
-@section The Guile module system
-
-The Guile module system extends the concept of environments, discussed
-in the previous section, with mechanisms to define, use and customise
-sets of bindings.
-
-In 1996 Tom Lord implemented a full-featured module system for Guile which
-allows loading Scheme source files into a private name space. This system has
-been in available since at least Guile version 1.1.
-
-For Guile version 1.5.0 and later, the system has been improved to have better
-integration from C code, more fine-grained user control over interfaces, and
-documentation.
-
-Although it is anticipated that the module system implementation will
-change in the future, the Scheme programming interface described in this
-manual should be considered stable. The C programming interface is
-considered relatively stable, although at the time of this writing,
-there is still some flux.
-@c fixme: Review: Need better C code interface commentary.
-
-@menu
-* General Information about Modules:: Guile module basics.
-* Using Guile Modules:: How to use existing modules.
-* Creating Guile Modules:: How to package your code into modules.
-* More Module Procedures:: Low-level module code.
-* Module System Quirks:: Strange things to be aware of.
-* Included Guile Modules:: Which modules come with Guile?
-@end menu
-
-@node General Information about Modules
-@subsection General Information about Modules
-
-A Guile module can be thought of as a collection of named procedures,
-variables and macros. More precisely, it is a set of @dfn{bindings}
-of symbols (names) to Scheme objects.
-
-An environment is a mapping from identifiers (or symbols) to locations,
-i.e., a set of bindings.
-There are top-level environments and lexical environments.
-Environment in which a lambda is excuted is remembered as part of its
-definition.
-
-Within a module, all bindings are visible. Certain bindings
-can be declared @dfn{public}, in which case they are added to the
-module's so-called @dfn{export list}; this set of public bindings is
-called the module's @dfn{public interface} (@pxref{Creating Guile
-Modules}).
-
-A client module @dfn{uses} a providing module's bindings by either
-accessing the providing module's public interface, or by building a
-custom interface (and then accessing that). In a custom interface, the
-client module can @dfn{select} which bindings to access and can also
-algorithmically @dfn{rename} bindings. In contrast, when using the
-providing module's public interface, the entire export list is available
-without renaming (@pxref{Using Guile Modules}).
-
-To use a module, it must be found and loaded. All Guile modules have
-a unique @dfn{module name}, which is a list of one or more symbols.
-Examples are @code{(ice-9 popen)} or @code{(srfi srfi-11)}. When
-Guile searches for the code of a module, it constructs the name of the
-file to load by concatenating the name elements with slashes between
-the elements and appending a number of file name extensions from the
-list @code{%load-extensions} (@pxref{Loading}). The resulting file
-name is then searched in all directories in the variable
-@code{%load-path} (@pxref{Install Config}). For example, the
-@code{(ice-9 popen)} module would result in the filename
-@code{ice-9/popen.scm} and searched in the installation directories of
-Guile and in all other directories in the load path.
-
-@c FIXME::martin: Not sure about this, maybe someone knows better?
-Every module has a so-called syntax transformer associated with it.
-This is a procedure which performs all syntax transformation for the
-time the module is read in and evaluated. When working with modules,
-you can manipulate the current syntax transformer using the
-@code{use-syntax} syntactic form or the @code{#:use-syntax} module
-definition option (@pxref{Creating Guile Modules}).
-
-Please note that there are some problems with the current module system
-you should keep in mind (@pxref{Module System Quirks}). We hope to
-address these eventually.
-
-
-@node Using Guile Modules
-@subsection Using Guile Modules
-
-To use a Guile module is to access either its public interface or a
-custom interface (@pxref{General Information about Modules}). Both
-types of access are handled by the syntactic form @code{use-modules},
-which accepts one or more interface specifications and, upon
-evaluation, arranges for those interfaces to be available to the
-current module. This process may include locating and loading code
-for a given module if that code has not yet been loaded, following
-%load-path (@pxref{Install Config}).
-
-An @dfn{interface specification} has one of two forms. The first
-variation is simply to name the module, in which case its public
-interface is the one accessed. For example:
-
-@smalllisp
-(use-modules (ice-9 popen))
-@end smalllisp
-
-Here, the interface specification is @code{(ice-9 popen)}, and the
-result is that the current module now has access to @code{open-pipe},
-@code{close-pipe}, @code{open-input-pipe}, and so on (@pxref{Included
-Guile Modules}).
-
-Note in the previous example that if the current module had already
-defined @code{open-pipe}, that definition would be overwritten by the
-definition in @code{(ice-9 popen)}. For this reason (and others), there
-is a second variation of interface specification that not only names a
-module to be accessed, but also selects bindings from it and renames
-them to suit the current module's needs. For example:
-
-@smalllisp
-(use-modules ((ice-9 popen)
- :select ((open-pipe . pipe-open) close-pipe)
- :renamer (symbol-prefix-proc 'unixy:)))
-@end smalllisp
-
-Here, the interface specification is more complex than before, and the
-result is that a custom interface with only two bindings is created and
-subsequently accessed by the current module. The mapping of old to new
-names is as follows:
-
-@c Use `smallexample' since `table' is ugly. --ttn
-@smallexample
-(ice-9 popen) sees: current module sees:
-open-pipe unixy:pipe-open
-close-pipe unixy:close-pipe
-@end smallexample
-
-This example also shows how to use the convenience procedure
-@code{symbol-prefix-proc}.
-
-@c begin (scm-doc-string "boot-9.scm" "symbol-prefix-proc")
-@deffn {Scheme Procedure} symbol-prefix-proc prefix-sym
-Return a procedure that prefixes its arg (a symbol) with
-@var{prefix-sym}.
-@c Insert gratuitous C++ slam here. --ttn
-@end deffn
-
-@c begin (scm-doc-string "boot-9.scm" "use-modules")
-@deffn syntax use-modules spec @dots{}
-Resolve each interface specification @var{spec} into an interface and
-arrange for these to be accessible by the current module. The return
-value is unspecified.
-
-@var{spec} can be a list of symbols, in which case it names a module
-whose public interface is found and used.
-
-@var{spec} can also be of the form:
-
-@smalllisp
- (MODULE-NAME [:select SELECTION] [:renamer RENAMER])
-@end smalllisp
-
-in which case a custom interface is newly created and used.
-@var{module-name} is a list of symbols, as above; @var{selection} is a
-list of selection-specs; and @var{renamer} is a procedure that takes a
-symbol and returns its new name. A selection-spec is either a symbol or
-a pair of symbols @code{(ORIG . SEEN)}, where @var{orig} is the name in
-the used module and @var{seen} is the name in the using module. Note
-that @var{seen} is also passed through @var{renamer}.
-
-The @code{:select} and @code{:renamer} clauses are optional. If both are
-omitted, the returned interface has no bindings. If the @code{:select}
-clause is omitted, @var{renamer} operates on the used module's public
-interface.
-
-Signal error if module name is not resolvable.
-@end deffn
-
-
-@c FIXME::martin: Is this correct, and is there more to say?
-@c FIXME::martin: Define term and concept `system transformer' somewhere.
-
-@deffn syntax use-syntax module-name
-Load the module @code{module-name} and use its system
-transformer as the system transformer for the currently defined module,
-as well as installing it as the current system transformer.
-@end deffn
-
-
-@node Creating Guile Modules
-@subsection Creating Guile Modules
-
-When you want to create your own modules, you have to take the following
-steps:
-
-@itemize @bullet
-@item
-Create a Scheme source file and add all variables and procedures you wish
-to export, or which are required by the exported procedures.
-
-@item
-Add a @code{define-module} form at the beginning.
-
-@item
-Export all bindings which should be in the public interface, either
-by using @code{define-public} or @code{export} (both documented below).
-@end itemize
-
-@c begin (scm-doc-string "boot-9.scm" "define-module")
-@deffn syntax define-module module-name [options @dots{}]
-@var{module-name} is of the form @code{(hierarchy file)}. One
-example of this is
-
-@smalllisp
-(define-module (ice-9 popen))
-@end smalllisp
-
-@code{define-module} makes this module available to Guile programs under
-the given @var{module-name}.
-
-The @var{options} are keyword/value pairs which specify more about the
-defined module. The recognized options and their meaning is shown in
-the following table.
-
-@c fixme: Should we use "#:" or ":"?
-
-@table @code
-@item #:use-module @var{interface-specification}
-Equivalent to a @code{(use-modules @var{interface-specification})}
-(@pxref{Using Guile Modules}).
-
-@item #:use-syntax @var{module}
-Use @var{module} when loading the currently defined module, and install
-it as the syntax transformer.
-
-@item #:autoload @var{module} @var{symbol}
-Load @var{module} whenever @var{symbol} is accessed.
-
-@item #:export @var{list}
-Export all identifiers in @var{list}, which must be a list of symbols.
-This is equivalent to @code{(export @var{list})} in the module body.
-
-@item #:no-backtrace
-Tell Guile not to record information for procedure backtraces when
-executing the procedures in this module.
-
-@item #:pure
-Create a @dfn{pure} module, that is a module which does not contain any
-of the standard procedure bindings except for the syntax forms. This is
-useful if you want to create @dfn{safe} modules, that is modules which
-do not know anything about dangerous procedures.
-@end table
-
-@end deffn
-@c end
-
-@deffn syntax export variable @dots{}
-Add all @var{variable}s (which must be symbols) to the list of exported
-bindings of the current module.
-@end deffn
-
-@c begin (scm-doc-string "boot-9.scm" "define-public")
-@deffn syntax define-public @dots{}
-Equivalent to @code{(begin (define foo ...) (export foo))}.
-@end deffn
-@c end
-
-
-@node More Module Procedures
-@subsection More Module Procedures
-
-@c FIXME::martin: Review me!
-
-@c FIXME::martin: Should this procedure be documented and supported
-@c at all?
-
-The procedures in this section are useful if you want to dig into the
-innards of Guile's module system. If you don't know precisely what you
-do, you should probably avoid using any of them.
-
-@deffn {Scheme Procedure} standard-eval-closure module
-@deffnx {C Function} scm_standard_eval_closure (module)
-Return an eval closure for the module @var{module}.
-@end deffn
-
-
-@node Module System Quirks
-@subsection Module System Quirks
-
-Although the programming interfaces are relatively stable, the Guile
-module system itself is still evolving. Here are some situations where
-usage surpasses design.
-
-@itemize @bullet
-
-@item
-When using a module which exports a macro definition, the other module
-must export all bindings the macro expansion uses, too, because the
-expanded code would otherwise not be able to see these definitions and
-issue a ``variable unbound'' error, or worse, would use another binding
-which might be present in the scope of the expansion.
-
-@item
-When two or more used modules export bindings with the same names, the
-last accessed module wins, and the exported binding of that last module
-will silently be used. This might lead to hard-to-find errors because
-wrong procedures or variables are used. To avoid this kind of
-@dfn{name-clash} situation, use a custom interface specification
-(@pxref{Using Guile Modules}). (We include this entry for the possible
-benefit of users of Guile versions previous to 1.5.0, when custom
-interfaces were added to the module system.)
-
-@item
-[Add other quirks here.]
-
-@end itemize
-
-
-@node Included Guile Modules
-@subsection Included Guile Modules
-
-@c FIXME::martin: Review me!
-
-Some modules are included in the Guile distribution; here are references
-to the entries in this manual which describe them in more detail:
-
-@table @strong
-@item boot-9
-boot-9 is Guile's initialization module, and it is always loaded when
-Guile starts up.
-
-@item (ice-9 debug)
-Mikael Djurfeldt's source-level debugging support for Guile
-(@pxref{Debugging Features}).
-
-@item (ice-9 threads)
-Guile's support for multi threaded execution (@pxref{Scheduling}).
-
-@item (ice-9 rdelim)
-Line- and character-delimited input (@pxref{Line/Delimited}).
-
-@item (ice-9 rw)
-Block string input/output (@pxref{Block Reading and Writing}).
-
-@item (ice-9 documentation)
-Online documentation (REFFIXME).
-
-@item (srfi srfi-1)
-A library providing a lot of useful list and pair processing
-procedures (@pxref{SRFI-1}).
-
-@item (srfi srfi-2)
-Support for @code{and-let*} (@pxref{SRFI-2}).
-
-@item (srfi srfi-4)
-Support for homogeneous numeric vectors (@pxref{SRFI-4}).
-
-@item (srfi srfi-6)
-Support for some additional string port procedures (@pxref{SRFI-6}).
-
-@item (srfi srfi-8)
-Multiple-value handling with @code{receive} (@pxref{SRFI-8}).
-
-@item (srfi srfi-9)
-Record definition with @code{define-record-type} (@pxref{SRFI-9}).
-
-@item (srfi srfi-10)
-Read hash extension @code{#,()} (@pxref{SRFI-10}).
-
-@item (srfi srfi-11)
-Multiple-value handling with @code{let-values} and @code{let-values*}
-(@pxref{SRFI-11}).
-
-@item (srfi srfi-13)
-String library (@pxref{SRFI-13}).
-
-@item (srfi srfi-14)
-Character-set library (@pxref{SRFI-14}).
-
-@item (srfi srfi-17)
-Getter-with-setter support (@pxref{SRFI-17}).
-
-@item (ice-9 slib)
-This module contains hooks for using Aubrey Jaffer's portable Scheme
-library SLIB from Guile (@pxref{SLIB}).
-
-@c FIXME::martin: This module is not in the distribution. Remove it
-@c from here?
-@item (ice-9 jacal)
-This module contains hooks for using Aubrey Jaffer's symbolic math
-package Jacal from Guile (@pxref{JACAL}).
-@end table
-
-
-@node Dynamic Libraries
-@section Dynamic Libraries
-
-Most modern Unices have something called @dfn{shared libraries}. This
-ordinarily means that they have the capability to share the executable
-image of a library between several running programs to save memory and
-disk space. But generally, shared libraries give a lot of additional
-flexibility compared to the traditional static libraries. In fact,
-calling them `dynamic' libraries is as correct as calling them `shared'.
-
-Shared libraries really give you a lot of flexibility in addition to the
-memory and disk space savings. When you link a program against a shared
-library, that library is not closely incorporated into the final
-executable. Instead, the executable of your program only contains
-enough information to find the needed shared libraries when the program
-is actually run. Only then, when the program is starting, is the final
-step of the linking process performed. This means that you need not
-recompile all programs when you install a new, only slightly modified
-version of a shared library. The programs will pick up the changes
-automatically the next time they are run.
-
-Now, when all the necessary machinery is there to perform part of the
-linking at run-time, why not take the next step and allow the programmer
-to explicitly take advantage of it from within his program? Of course,
-many operating systems that support shared libraries do just that, and
-chances are that Guile will allow you to access this feature from within
-your Scheme programs. As you might have guessed already, this feature
-is called @dfn{dynamic linking}@footnote{Some people also refer to the
-final linking stage at program startup as `dynamic linking', so if you
-want to make yourself perfectly clear, it is probably best to use the
-more technical term @dfn{dlopening}, as suggested by Gordon Matzigkeit
-in his libtool documentation.}
-
-As with many aspects of Guile, there is a low-level way to access the
-dynamic linking apparatus, and a more high-level interface that
-integrates dynamically linked libraries into the module system.
-
-@menu
-* Low level dynamic linking::
-* Compiled Code Modules::
-* Dynamic Linking and Compiled Code Modules::
-@end menu
-
-@node Low level dynamic linking
-@subsection Low level dynamic linking
-
-When using the low level procedures to do your dynamic linking, you have
-complete control over which library is loaded when and what gets done
-with it.
-
-@deffn {Scheme Procedure} dynamic-link filename
-@deffnx {C Function} scm_dynamic_link (filename)
-Find the shared object (shared library) denoted by
-@var{filename} and link it into the running Guile
-application. The returned
-scheme object is a ``handle'' for the library which can
-be passed to @code{dynamic-func}, @code{dynamic-call} etc.
-
-Searching for object files is system dependent. Normally,
-if @var{filename} does have an explicit directory it will
-be searched for in locations
-such as @file{/usr/lib} and @file{/usr/local/lib}.
-@end deffn
-
-@deffn {Scheme Procedure} dynamic-object? obj
-@deffnx {C Function} scm_dynamic_object_p (obj)
-Return @code{#t} if @var{obj} is a dynamic object handle,
-or @code{#f} otherwise.
-@end deffn
-
-@deffn {Scheme Procedure} dynamic-unlink dobj
-@deffnx {C Function} scm_dynamic_unlink (dobj)
-Unlink a dynamic object from the application, if possible. The
-object must have been linked by @code{dynamic-link}, with
-@var{dobj} the corresponding handle. After this procedure
-is called, the handle can no longer be used to access the
-object.
-@end deffn
-
-@deffn {Scheme Procedure} dynamic-func name dobj
-@deffnx {C Function} scm_dynamic_func (name, dobj)
-Return a ``handle'' for the function @var{name} in the
-shared object referred to by @var{dobj}. The handle
-can be passed to @code{dynamic-call} to actually
-call the function.
-
-Regardless whether your C compiler prepends an underscore
-@samp{_} to the global names in a program, you should
-@strong{not} include this underscore in @var{name}
-since it will be added automatically when necessary.
-@end deffn
-
-@deffn {Scheme Procedure} dynamic-call func dobj
-@deffnx {C Function} scm_dynamic_call (func, dobj)
-Call a C function in a dynamic object. Two styles of
-invocation are supported:
-
-@itemize @bullet
-@item @var{func} can be a function handle returned by
-@code{dynamic-func}. In this case @var{dobj} is
-ignored
-@item @var{func} can be a string with the name of the
-function to call, with @var{dobj} the handle of the
-dynamic object in which to find the function.
-This is equivalent to
-@smallexample
-
-(dynamic-call (dynamic-func @var{func} @var{dobj}) #f)
-@end smallexample
-@end itemize
-
-In either case, the function is passed no arguments
-and its return value is ignored.
-@end deffn
-
-@deffn {Scheme Procedure} dynamic-args-call func dobj args
-@deffnx {C Function} scm_dynamic_args_call (func, dobj, args)
-Call the C function indicated by @var{func} and @var{dobj},
-just like @code{dynamic-call}, but pass it some arguments and
-return its return value. The C function is expected to take
-two arguments and return an @code{int}, just like @code{main}:
-@smallexample
-int c_func (int argc, char **argv);
-@end smallexample
-
-The parameter @var{args} must be a list of strings and is
-converted into an array of @code{char *}. The array is passed
-in @var{argv} and its size in @var{argc}. The return value is
-converted to a Scheme number and returned from the call to
-@code{dynamic-args-call}.
-@end deffn
-
-Here is a small example that may work on GNU/Linux:
-
-@smallexample
-(define libc-obj (dynamic-link "libc.so"))
-libc-obj
-@result{} #<dynamic-object "libc.so">
-(dynamic-args-call 'rand libc-obj '())
-@result{} 269167349
-(dynamic-unlink libc-obj)
-libc-obj
-@result{} #<dynamic-object "libc.so" (unlinked)>
-@end smallexample
-
-As you can see, after calling @code{dynamic-unlink} on a dynamically
-linked library, it is marked as @samp{(unlinked)} and you are no longer
-able to use it with @code{dynamic-call}, etc. Whether the library is
-really removed from you program is system-dependent and will generally
-not happen when some other parts of your program still use it. In the
-example above, @code{libc} is almost certainly not removed from your
-program because it is badly needed by almost everything.
-
-The functions to call a function from a dynamically linked library,
-@code{dynamic-call} and @code{dynamic-args-call}, are not very powerful.
-They are mostly intended to be used for calling specially written
-initialization functions that will then add new primitives to Guile.
-For example, we do not expect that you will dynamically link
-@file{libX11} with @code{dynamic-link} and then construct a beautiful
-graphical user interface just by using @code{dynamic-call} and
-@code{dynamic-args-call}. Instead, the usual way would be to write a
-special Guile<->X11 glue library that has intimate knowledge about both
-Guile and X11 and does whatever is necessary to make them inter-operate
-smoothly. This glue library could then be dynamically linked into a
-vanilla Guile interpreter and activated by calling its initialization
-function. That function would add all the new types and primitives to
-the Guile interpreter that it has to offer.
-
-From this setup the next logical step is to integrate these glue
-libraries into the module system of Guile so that you can load new
-primitives into a running system just as you can load new Scheme code.
-
-There is, however, another possibility to get a more thorough access to
-the functions contained in a dynamically linked library. Anthony Green
-has written @file{libffi}, a library that implements a @dfn{foreign
-function interface} for a number of different platforms. With it, you
-can extend the Spartan functionality of @code{dynamic-call} and
-@code{dynamic-args-call} considerably. There is glue code available in
-the Guile contrib archive to make @file{libffi} accessible from Guile.
-
-@node Compiled Code Modules
-@subsection Putting Compiled Code into Modules
-
-@c FIXME::martin: Change all gh_ references to their scm_ equivalents.
-
-The new primitives that you add to Guile with @code{gh_new_procedure}
-or with any of the other mechanisms are normally placed into the same
-module as all the other builtin procedures (like @code{display}).
-However, it is also possible to put new primitives into their own
-module.
-
-The mechanism for doing so is not very well thought out and is likely to
-change when the module system of Guile itself is revised, but it is
-simple and useful enough to document it as it stands.
-
-What @code{gh_new_procedure} and the functions used by the snarfer
-really do is to add the new primitives to whatever module is the
-@emph{current module} when they are called. This is analogous to the
-way Scheme code is put into modules: the @code{define-module} expression
-at the top of a Scheme source file creates a new module and makes it the
-current module while the rest of the file is evaluated. The
-@code{define} expressions in that file then add their new definitions to
-this current module.
-
-Therefore, all we need to do is to make sure that the right module is
-current when calling @code{gh_new_procedure} for our new primitives.
-
-@node Dynamic Linking and Compiled Code Modules
-@subsection Dynamic Linking and Compiled Code Modules
-
-The most interesting application of dynamically linked libraries is
-probably to use them for providing @emph{compiled code modules} to
-Scheme programs. As much fun as programming in Scheme is, every now and
-then comes the need to write some low-level C stuff to make Scheme even
-more fun.
-
-Not only can you put these new primitives into their own module (see the
-previous section), you can even put them into a shared library that is
-only then linked to your running Guile image when it is actually
-needed.
-
-An example will hopefully make everything clear. Suppose we want to
-make the Bessel functions of the C library available to Scheme in the
-module @samp{(math bessel)}. First we need to write the appropriate
-glue code to convert the arguments and return values of the functions
-from Scheme to C and back. Additionally, we need a function that will
-add them to the set of Guile primitives. Because this is just an
-example, we will only implement this for the @code{j0} function.
-
-@c FIXME::martin: Change all gh_ references to their scm_ equivalents.
-
-@smallexample
-#include <math.h>
-#include <guile/gh.h>
-
-SCM
-j0_wrapper (SCM x)
-@{
- return gh_double2scm (j0 (gh_scm2double (x)));
-@}
-
-void
-init_math_bessel ()
-@{
- gh_new_procedure1_0 ("j0", j0_wrapper);
-@}
-@end smallexample
-
-We can already try to bring this into action by manually calling the low
-level functions for performing dynamic linking. The C source file needs
-to be compiled into a shared library. Here is how to do it on
-GNU/Linux, please refer to the @code{libtool} documentation for how to
-create dynamically linkable libraries portably.
-
-@smallexample
-gcc -shared -o libbessel.so -fPIC bessel.c
-@end smallexample
-
-Now fire up Guile:
-
-@smalllisp
-(define bessel-lib (dynamic-link "./libbessel.so"))
-(dynamic-call "init_math_bessel" bessel-lib)
-(j0 2)
-@result{} 0.223890779141236
-@end smalllisp
-
-The filename @file{./libbessel.so} should be pointing to the shared
-library produced with the @code{gcc} command above, of course. The
-second line of the Guile interaction will call the
-@code{init_math_bessel} function which in turn will register the C
-function @code{j0_wrapper} with the Guile interpreter under the name
-@code{j0}. This function becomes immediately available and we can call
-it from Scheme.
-
-Fun, isn't it? But we are only half way there. This is what
-@code{apropos} has to say about @code{j0}:
-
-@smallexample
-(apropos 'j0)
-@print{} the-root-module: j0 #<primitive-procedure j0>
-@end smallexample
-
-As you can see, @code{j0} is contained in the root module, where all
-the other Guile primitives like @code{display}, etc live. In general,
-a primitive is put into whatever module is the @dfn{current module} at
-the time @code{gh_new_procedure} is called.
-
-A compiled module should have a specially named @dfn{module init
-function}. Guile knows about this special name and will call that
-function automatically after having linked in the shared library. For
-our example, we add the following code to @file{bessel.c}:
-
-@smallexample
-void scm_init_math_bessel_module ()
-@{
- /* contents currently unavailable. */
-@}
-@end smallexample
-
-The general pattern for the name of a module init function is:
-@samp{scm_init_}, followed by the name of the module where the
-individual hierarchical components are concatenated with underscores,
-followed by @samp{_module}.
-
-After @file{libbessel.so} has been rebuild, we need to place the shared
-library into the right place.
-
-Once the module has been correctly installed, it should be possible to
-use it like this:
-
-@smallexample
-guile> (use-modules (math bessel))
-guile> (j0 2)
-0.223890779141236
-guile> (apropos 'j0)
-@print{} bessel: j0 #<primitive-procedure j0>
-@end smallexample
-
-That's it!
-
-@node Variables
-@section Variables
-@tpindex Variables
-
-Each module has its own hash table, sometimes known as an @dfn{obarray},
-that maps the names defined in that module to their corresponding
-variable objects.
-
-A variable is a box-like object that can hold any Scheme value. It is
-said to be @dfn{undefined} if its box holds a special Scheme value that
-denotes undefined-ness (which is different from all other Scheme values,
-including for example @code{#f}); otherwise the variable is
-@dfn{defined}.
-
-On its own, a variable object is anonymous. A variable is said to be
-@dfn{bound} when it is associated with a name in some way, usually a
-symbol in a module obarray. When this happens, the relationship is
-mutual: the variable is bound to the name (in that module), and the name
-(in that module) is bound to the variable.
-
-(That's the theory, anyway. In practice, defined-ness and bound-ness
-sometimes get confused, because Lisp and Scheme implementations have
-often conflated --- or deliberately drawn no distinction between --- a
-name that is unbound and a name that is bound to a variable whose value
-is undefined. We will try to be clear about the difference and explain
-any confusion where it is unavoidable.)
-
-Variables do not have a read syntax. Most commonly they are created and
-bound implicitly by @code{define} expressions: a top-level @code{define}
-expression of the form
-
-@lisp
-(define @var{name} @var{value})
-@end lisp
-
-@noindent
-creates a variable with initial value @var{value} and binds it to the
-name @var{name} in the current module. But they can also be created
-dynamically by calling one of the constructor procedures
-@code{make-variable} and @code{make-undefined-variable}.
-
-First-class variables are especially useful for interacting with the
-current module system (@pxref{The Guile module system}).
-
-@deffn {Scheme Procedure} make-undefined-variable
-@deffnx {C Function} scm_make_undefined_variable ()
-Return a variable that is initially unbound.
-@end deffn
-
-@deffn {Scheme Procedure} make-variable init
-@deffnx {C Function} scm_make_variable (init)
-Return a variable initialized to value @var{init}.
-@end deffn
-
-@deffn {Scheme Procedure} variable-bound? var
-@deffnx {C Function} scm_variable_bound_p (var)
-Return @code{#t} iff @var{var} is bound to a value.
-Throws an error if @var{var} is not a variable object.
-@end deffn
-
-@deffn {Scheme Procedure} variable-ref var
-@deffnx {C Function} scm_variable_ref (var)
-Dereference @var{var} and return its value.
-@var{var} must be a variable object; see @code{make-variable}
-and @code{make-undefined-variable}.
-@end deffn
-
-@deffn {Scheme Procedure} variable-set! var val
-@deffnx {C Function} scm_variable_set_x (var, val)
-Set the value of the variable @var{var} to @var{val}.
-@var{var} must be a variable object, @var{val} can be any
-value. Return an unspecified value.
-@end deffn
-
-@deffn {Scheme Procedure} variable? obj
-@deffnx {C Function} scm_variable_p (obj)
-Return @code{#t} iff @var{obj} is a variable object, else
-return @code{#f}.
-@end deffn
-
-
-@c Local Variables:
-@c TeX-master: "guile.texi"
-@c End:
diff --git a/doc/ref/scheme-options.texi b/doc/ref/scheme-options.texi
deleted file mode 100644
index 63b7a2c57..000000000
--- a/doc/ref/scheme-options.texi
+++ /dev/null
@@ -1,651 +0,0 @@
-@page
-@node Options and Config
-@chapter Runtime Options and Configuration
-
-Guile's behaviour can be modified by setting options. For example, is
-the language that Guile accepts case sensitive, or should the debugger
-automatically show a backtrace on error?
-
-Guile has two levels of interface for managing options: a low-level
-control interface, and a user-level interface which allows the enabling
-or disabling of options.
-
-Moreover, the options are classified in groups according to whether they
-configure @emph{reading}, @emph{printing}, @emph{debugging} or
-@emph{evaluating}.
-
-@menu
-* General option interface::
-* Reader options::
-* Printing options::
-* Debugger options::
-* Evaluator options::
-* Evaluator trap options::
-* Examples of option use::
-* Install Config:: Installation and configuration data.
-* Feature Tracking:: Available features in the Guile process.
-@end menu
-
-@node General option interface
-@section General option interface
-
-We will use the expression @code{<group>} to represent @code{read},
-@code{print}, @code{debug} or @code{evaluator}.
-
-@subheading Low level
-
-@c NJFIXME
-@deffn {Scheme Procedure} <group>-options-interface
-@deffnx {Scheme Procedure} read-options-interface [SOME-INT]
-@deffnx {Scheme Procedure} print-options-interface [SOME-INT]
-@deffnx {Scheme Procedure} evaluator-traps-interface [SOME-INT]
-@deffnx {Scheme Procedure} read-options-interface [SOME-INT]
-[FIXME: I have just taken the comments for C routine scm_options that
-implements all of these. It needs to be presented better.]
-
-If scm_options is called without arguments, the current option setting
-is returned. If the argument is an option setting, options are altered
-and the old setting is returned. If the argument isn't a list, a list
-of sublists is returned, where each sublist contains option name, value
-and documentation string.
-@end deffn
-
-
-@subheading User level
-
-@c @deftp {Data type} scm_option
-@c @code{scm_option} is used to represent run time options. It can be a
-@c @emph{boolean} type, in which case the option will be set by the strings
-@c @code{"yes"} and @code{"no"}. It can be a
-@c @end deftp
-
-@c NJFIXME
-@deffn {Scheme Procedure} <group>-options [arg]
-@deffnx {Scheme Procedure} read-options [arg]
-@deffnx {Scheme Procedure} print-options [arg]
-@deffnx {Scheme Procedure} debug-options [arg]
-@deffnx {Scheme Procedure} traps [arg]
-These functions list the options in their group. The optional argument
-@var{arg} is a symbol which modifies the form in which the options are
-presented.
-
-With no arguments, @code{<group>-options} returns the values of the
-options in that particular group. If @var{arg} is @code{'help}, a
-description of each option is given. If @var{arg} is @code{'full},
-programmers' options are also shown.
-
-@var{arg} can also be a list representing the state of all options. In
-this case, the list contains single symbols (for enabled boolean
-options) and symbols followed by values.
-@end deffn
-[FIXME: I don't think 'full is ever any different from 'help. What's
-up?]
-
-@c NJFIXME
-@deffn {Scheme Procedure} <group>-enable option-symbol
-@deffnx {Scheme Procedure} read-enable option-symbol
-@deffnx {Scheme Procedure} print-enable option-symbol
-@deffnx {Scheme Procedure} debug-enable option-symbol
-@deffnx {Scheme Procedure} trap-enable option-symbol
-These functions set the specified @var{option-symbol} in their options
-group. They only work if the option is boolean, and throw an error
-otherwise.
-@end deffn
-
-@c NJFIXME
-@deffn {Scheme Procedure} <group>-disable option-symbol
-@deffnx {Scheme Procedure} read-disable option-symbol
-@deffnx {Scheme Procedure} print-disable option-symbol
-@deffnx {Scheme Procedure} debug-disable option-symbol
-@deffnx {Scheme Procedure} trap-disable option-symbol
-These functions turn off the specified @var{option-symbol} in their
-options group. They only work if the option is boolean, and throw an
-error otherwise.
-@end deffn
-
-@c NJFIXME
-@deffn syntax <group>-set! option-symbol value
-@deffnx syntax read-set! option-symbol value
-@deffnx syntax print-set! option-symbol value
-@deffnx syntax debug-set! option-symbol value
-@deffnx syntax trap-set! option-symbol value
-These functions set a non-boolean @var{option-symbol} to the specified
-@var{value}.
-@end deffn
-
-
-@node Reader options
-@section Reader options
-@cindex options - read
-@cindex read options
-
-Here is the list of reader options generated by typing
-@code{(read-options 'full)} in Guile. You can also see the default
-values.
-
-@smalllisp
-keywords #f Style of keyword recognition: #f or 'prefix
-case-insensitive no Convert symbols to lower case.
-positions yes Record positions of source code expressions.
-copy no Copy source code expressions.
-@end smalllisp
-
-Notice that while Standard Scheme is case insensitive, to ease
-translation of other Lisp dialects, notably Emacs Lisp, into Guile,
-Guile is case-sensitive by default.
-
-To make Guile case insensitive, you can type
-
-@smalllisp
-(read-enable 'case-insensitive)
-@end smalllisp
-
-@node Printing options
-@section Printing options
-
-Here is the list of print options generated by typing
-@code{(print-options 'full)} in Guile. You can also see the default
-values.
-
-@smallexample
-source no Print closures with source.
-closure-hook #f Hook for printing closures.
-@end smallexample
-
-
-@node Evaluator options
-@section Evaluator options
-
-These are the evaluator options with their default values, as they are
-printed by typing @code{(eval-options 'full)} in Guile.
-
-@smallexample
-stack 22000 Size of thread stacks (in machine words).
-@end smallexample
-
-@node Evaluator trap options
-@section Evaluator trap options
-[FIXME: These flags, together with their corresponding handlers, are not
-user level options. Probably this entire section should be moved to the
-documentation about the low-level programmer debugging interface.]
-
-Here is the list of evaluator trap options generated by typing
-@code{(traps 'full)} in Guile. You can also see the default values.
-
-@smallexample
-exit-frame no Trap when exiting eval or apply.
-apply-frame no Trap when entering apply.
-enter-frame no Trap when eval enters new frame.
-traps yes Enable evaluator traps.
-@end smallexample
-
-@deffn apply-frame-handler key cont tailp
-Called when a procedure is being applied.
-
-Called if:
-
-@itemize @bullet
-@item
-evaluator traps are enabled [traps interface], and
-@item
-either
-@itemize @minus
-@item
-@code{apply-frame} is enabled [traps interface], or
-@item
-trace mode is on [debug-options interface], and the procedure being
-called has the trace property enabled.
-@end itemize
-@end itemize
-
-If cheap traps are enabled [debug-options interface], @var{cont} is a
-debug object, otherwise it is a restartable continuation.
-
-@var{tailp} is true if this is a tail call
-@end deffn
-
-@deffn exit-frame-handler key cont retval
-Called when a value is returned from a procedure.
-
-Called if:
-
-@itemize @bullet
-@item
-evaluator traps are enabled [traps interface], and
-@item
-either
-@itemize @minus
-@item
- @code{exit-frame} is enabled [traps interface], or
-@item
-trace mode is on [debug-options interface], and the procedure being
-called has the trace property enabled.
-@end itemize
-@end itemize
-
-If cheap traps are enabled [debug-options interface], @var{cont} is a
-debug object, otherwise it is a restartable continuation.
-
-@var{retval} is the return value.
-@end deffn
-
-@node Debugger options
-@section Debugger options
-
-Here is the list of print options generated by typing
-@code{(debug-options 'full)} in Guile. You can also see the default
-values.
-
-@smallexample
-stack 20000 Stack size limit (0 = no check).
-debug yes Use the debugging evaluator.
-backtrace no Show backtrace on error.
-depth 20 Maximal length of printed backtrace.
-maxdepth 1000 Maximal number of stored backtrace frames.
-frames 3 Maximum number of tail-recursive frames in backtrace.
-indent 10 Maximal indentation in backtrace.
-backwards no Display backtrace in anti-chronological order.
-procnames yes Record procedure names at definition.
-trace no *Trace mode.
-breakpoints no *Check for breakpoints.
-cheap yes *Flyweight representation of the stack at traps.
-@end smallexample
-
-@subsection Stack overflow
-
-@cindex overflow, stack
-@cindex stack overflow
-Stack overflow errors are caused by a computation trying to use more
-stack space than has been enabled by the @code{stack} option. They are
-reported like this:
-
-@lisp
-(non-tail-recursive-factorial 500)
-@print{}
-ERROR: Stack overflow
-ABORT: (stack-overflow)
-@end lisp
-
-If you get an error like this, you can either try rewriting your code to
-use less stack space, or increase the maximum stack size. To increase
-the maximum stack size, use @code{debug-set!}, for example:
-
-@lisp
-(debug-set! stack 200000)
-@result{}
-(show-file-name #t stack 200000 debug backtrace depth 20 maxdepth 1000 frames 3 indent 10 width 79 procnames cheap)
-
-(non-tail-recursive-factorial 500)
-@result{}
-122013682599111006870123878542304692625357434@dots{}
-@end lisp
-
-If you prefer to try rewriting your code, you may be able to save stack
-space by making some of your procedures @dfn{tail recursive}. For a
-description of what this means, see @ref{Proper tail
-recursion,,,r5rs,The Revised^5 Report on Scheme}.
-
-
-@node Examples of option use
-@section Examples of option use
-
-Here is an example of a session in which some read and debug option
-handling procedures are used. In this example, the user
-
-@enumerate
-@item
-Notices that the symbols @code{abc} and @code{aBc} are not the same
-@item
-Examines the @code{read-options}, and sees that @code{case-insensitive}
-is set to ``no''.
-@item
-Enables @code{case-insensitive}
-@item
-Verifies that now @code{aBc} and @code{abc} are the same
-@item
-Disables @code{case-insensitive} and enables debugging @code{backtrace}
-@item
-Reproduces the error of displaying @code{aBc} with backtracing enabled
-[FIXME: this last example is lame because there is no depth in the
-backtrace. Need to give a better example, possibly putting debugging
-option examples in a separate session.]
-@end enumerate
-
-
-@smalllisp
-guile> (define abc "hello")
-guile> abc
-"hello"
-guile> aBc
-ERROR: In expression aBc:
-ERROR: Unbound variable: aBc
-ABORT: (misc-error)
-
-Type "(backtrace)" to get more information.
-guile> (read-options 'help)
-keywords #f Style of keyword recognition: #f or 'prefix
-case-insensitive no Convert symbols to lower case.
-positions yes Record positions of source code expressions.
-copy no Copy source code expressions.
-guile> (debug-options 'help)
-stack 20000 Stack size limit (0 = no check).
-debug yes Use the debugging evaluator.
-backtrace no Show backtrace on error.
-depth 20 Maximal length of printed backtrace.
-maxdepth 1000 Maximal number of stored backtrace frames.
-frames 3 Maximum number of tail-recursive frames in backtrace.
-indent 10 Maximal indentation in backtrace.
-backwards no Display backtrace in anti-chronological order.
-procnames yes Record procedure names at definition.
-trace no *Trace mode.
-breakpoints no *Check for breakpoints.
-cheap yes *Flyweight representation of the stack at traps.
-guile> (read-enable 'case-insensitive)
-(keywords #f case-insensitive positions)
-guile> aBc
-"hello"
-guile> (read-disable 'case-insensitive)
-(keywords #f positions)
-guile> (debug-enable 'backtrace)
-(stack 20000 debug backtrace depth 20 maxdepth 1000 frames 3 indent 10 procnames cheap)
-guile> aBc
-
-Backtrace:
-0* aBc
-
-ERROR: In expression aBc:
-ERROR: Unbound variable: aBc
-ABORT: (misc-error)
-guile>
-@end smalllisp
-
-
-@node Install Config
-@section Installation and Configuration Data
-
-It is often useful to have site-specific information about the current
-Guile installation. This chapter describes how to find out about
-Guile's configuration at run time.
-
-@deffn {Scheme Procedure} version
-@deffnx {Scheme Procedure} major-version
-@deffnx {Scheme Procedure} minor-version
-@deffnx {Scheme Procedure} micro-version
-@deffnx {C Function} scm_version ()
-@deffnx {C Function} scm_major_version ()
-@deffnx {C Function} scm_minor_version ()
-@deffnx {C Function} scm_micro_version ()
-Return a string describing Guile's version number, or its major, minor
-or micro version number, respectively.
-
-@lisp
-(version) @result{} "1.6.0"
-(major-version) @result{} "1"
-(minor-version) @result{} "6"
-(micro-version) @result{} "0"
-@end lisp
-@end deffn
-
-@c NJFIXME not in libguile!
-@deffn {Scheme Procedure} libguile-config-stamp
-Return a string describing the date on which @code{libguile} was
-configured. This is used to determine whether the Guile core
-interpreter and the ice-9 runtime have grown out of date with one
-another.
-@end deffn
-
-@deffn {Scheme Procedure} %package-data-dir
-@deffnx {C Function} scm_sys_package_data_dir ()
-Return the name of the directory where Scheme packages, modules and
-libraries are kept. On most Unix systems, this will be
-@samp{/usr/local/share/guile}.
-@end deffn
-
-@deffn {Scheme Procedure} %library-dir
-@deffnx {C Function} scm_sys_library_dir ()
-Return the directory where the Guile Scheme library files are installed.
-E.g., may return "/usr/share/guile/1.3.5".
-@end deffn
-
-@deffn {Scheme Procedure} %site-dir
-@deffnx {C Function} scm_sys_site_dir ()
-Return the directory where the Guile site files are installed.
-E.g., may return "/usr/share/guile/site".
-@end deffn
-
-@deffn {Scheme Procedure} parse-path path [tail]
-@deffnx {C Function} scm_parse_path (path, tail)
-Parse @var{path}, which is expected to be a colon-separated
-string, into a list and return the resulting list with
-@var{tail} appended. If @var{path} is @code{#f}, @var{tail}
-is returned.
-@end deffn
-
-@deffn {Scheme Procedure} search-path path filename [extensions]
-@deffnx {C Function} scm_search_path (path, filename, extensions)
-Search @var{path} for a directory containing a file named
-@var{filename}. The file must be readable, and not a directory.
-If we find one, return its full filename; otherwise, return
-@code{#f}. If @var{filename} is absolute, return it unchanged.
-If given, @var{extensions} is a list of strings; for each
-directory in @var{path}, we search for @var{filename}
-concatenated with each @var{extension}.
-@end deffn
-
-@defvar %load-path
-List of directories which should be searched for Scheme
-modules and libraries.
-@end defvar
-
-@defvar %guile-build-info
-Alist of information collected during the building of a particular
-@code{guile} program. Entries can be grouped into one of several
-categories: directories, env vars, and versioning info.
-
-Briefly, here are the keys in @code{%guile-build-info}, by group:
-@itemize @bullet
-@item directories
-srcdir, top_srcdir, prefix, exec_prefix, bindir, sbindir, libexecdir,
-datadir, sysconfdir, sharedstatedir, localstatedir, libdir, infodir,
-mandir, includedir, pkgdatadir, pkglibdir, pkgincludedir
-@item env vars
-LIBS
-@item versioning info
-guileversion, libguileinterface, buildstamp
-@end itemize
-
-Values are all strings. The value for @code{LIBS} is typically found also as
-a part of "guile-config link" output. The value for @code{guileversion} has
-form X.Y.Z, and should be the same as returned by @code{version}. The value
-for @code{libguileinterface} is libtool compatible and has form
-CURRENT:REVISION:AGE. The value for @code{buildstamp} is the output of the
-date(1) command.
-
-In the source, @code{%guile-build-info} is initialized from
-libguile/libpath.h, which is completely generated, so deleting this file
-before a build guarantees up-to-date values for that build.
-@end defvar
-
-
-@node Feature Tracking
-@section Feature Tracking
-
-Guile has a Scheme level variable @code{*features*} that keeps track to
-some extent of the features that are available in a running Guile.
-@code{*features*} is a list of symbols, for example @code{threads}, each
-of which describes a feature of the running Guile process.
-
-@defvar *features*
-A list of symbols describing available features of the Guile process.
-@end defvar
-
-You shouldn't modify the @code{*features*} variable directly using
-@code{set!}. Instead, see the procedures that are provided for this
-purpose in the following subsection.
-
-@menu
-* Feature Manipulation:: Checking for and advertising features.
-* Common Feature Symbols:: Commonly available features.
-@end menu
-
-
-@node Feature Manipulation
-@subsection Feature Manipulation
-
-To check whether a particular feature is available, use the
-@code{provided?} procedure:
-
-@deffn {Scheme Procedure} provided? feature
-@deffnx {Deprecated Scheme Procedure} feature? feature
-Return @code{#t} if the specified @var{feature} is available, otherwise
-@code{#f}.
-@end deffn
-
-To advertise a feature from your own Scheme code, you can use the
-@code{provide} procedure:
-
-@deffn {Scheme Procedure} provide feature
-Add @var{feature} to the list of available features in this Guile
-process.
-@end deffn
-
-For C code, the equivalent function takes its feature name as a
-@code{char *} argument for convenience:
-
-@deftypefn {C Function} void scm_add_feature (const char *str)
-Add a symbol with name @var{str} to the list of available features in
-this Guile process.
-@end deftypefn
-
-
-@node Common Feature Symbols
-@subsection Common Feature Symbols
-
-In general, a particular feature may be available for one of two
-reasons. Either because the Guile library was configured and compiled
-with that feature enabled --- i.e. the feature is built into the library
-on your system. Or because some C or Scheme code that was dynamically
-loaded by Guile has added that feature to the list.
-
-In the first category, here are the features that the current version of
-Guile may define (depending on how it is built), and what they mean.
-
-@table @code
-@item array
-Indicates support for arrays (@pxref{Arrays}).
-
-@item array-for-each
-Indicates availability of @code{array-for-each} and other array mapping
-procedures (@pxref{Array Mapping}).
-
-@item char-ready?
-Indicates that the @code{char-ready?} function is available
-(@pxref{Reading}).
-
-@item complex
-Indicates support for complex numbers.
-
-@item current-time
-Indicates availability of time-related functions: @code{times},
-@code{get-internal-run-time} and so on (@pxref{Time}).
-
-@item debug-extensions
-Indicates that the debugging evaluator is available, together with the
-options for controlling it.
-
-@item delay
-Indicates support for promises (@pxref{Delayed Evaluation}).
-
-@item EIDs
-Indicates that the @code{geteuid} and @code{getegid} really return
-effective user and group IDs (@pxref{Processes}).
-
-@item inexact
-Indicates support for inexact numbers.
-
-@item i/o-extensions
-Indicates availability of the following extended I/O procedures:
-@code{ftell}, @code{redirect-port}, @code{dup->fdes}, @code{dup2},
-@code{fileno}, @code{isatty?}, @code{fdopen},
-@code{primitive-move->fdes} and @code{fdes->ports} (@pxref{Ports and
-File Descriptors}).
-
-@item net-db
-Indicates availability of network database functions:
-@code{scm_gethost}, @code{scm_getnet}, @code{scm_getproto},
-@code{scm_getserv}, @code{scm_sethost}, @code{scm_setnet}, @code{scm_setproto},
-@code{scm_setserv}, and their `byXXX' variants (@pxref{Network
-Databases}).
-
-@item posix
-Indicates support for POSIX functions: @code{pipe}, @code{getgroups},
-@code{kill}, @code{execl} and so on (@pxref{POSIX}).
-
-@item random
-Indicates availability of random number generation functions:
-@code{random}, @code{copy-random-state}, @code{random-uniform} and so on
-(@pxref{Random}).
-
-@item reckless
-Indicates that Guile was built with important checks omitted --- you
-should never see this!
-
-@item regex
-Indicates support for POSIX regular expressions using
-@code{make-regexp}, @code{regexp-exec} and friends (@pxref{Regexp
-Functions}).
-
-@item socket
-Indicates availability of socket-related functions: @code{socket},
-@code{bind}, @code{connect} and so on (@pxref{Network Sockets and
-Communication}).
-
-@item sort
-Indicates availability of sorting and merging functions
-(@pxref{Sorting}).
-
-@item system
-Indicates that the @code{system} function is available
-(@pxref{Processes}).
-
-@item threads
-Indicates support for multithreading (@pxref{Threads}).
-
-@item values
-Indicates support for multiple return values using @code{values} and
-@code{call-with-values} (@pxref{Multiple Values}).
-@end table
-
-Available features in the second category depend, by definition, on what
-additional code your Guile process has loaded in. The following table
-lists features that you might encounter for this reason.
-
-@table @code
-@item defmacro
-Indicates that the @code{defmacro} macro is available (@pxref{Macros}).
-
-@item describe
-Indicates that the @code{(oop goops describe)} module has been loaded,
-which provides a procedure for describing the contents of GOOPS
-instances.
-
-@item readline
-Indicates that Guile has loaded in Readline support, for command line
-editing (@pxref{Readline Support}).
-
-@item record
-Indicates support for record definition using @code{make-record-type}
-and friends (@pxref{Records}).
-@end table
-
-Although these tables may seem exhaustive, it is probably unwise in
-practice to rely on them, as the correspondences between feature symbols
-and available procedures/behaviour are not strictly defined. If you are
-writing code that needs to check for the existence of some procedure, it
-is probably safer to do so directly using the @code{defined?} procedure
-than to test for the corresponding feature using @code{feature?}.
-
-
-@c Local Variables:
-@c TeX-master: "guile.texi"
-@c End:
diff --git a/doc/ref/scheme-procedures.texi b/doc/ref/scheme-procedures.texi
deleted file mode 100644
index 36f840ecc..000000000
--- a/doc/ref/scheme-procedures.texi
+++ /dev/null
@@ -1,816 +0,0 @@
-@page
-@node Procedures and Macros
-@chapter Procedures and Macros
-
-@menu
-* Lambda:: Basic procedure creation using lambda.
-* Optional Arguments:: Handling keyword, optional and rest arguments.
-* Procedure Properties:: Procedure properties and meta-information.
-* Procedures with Setters:: Procedures with setters.
-* Macros:: Lisp style macro definitions.
-* Syntax Rules:: Support for R5RS @code{syntax-rules}.
-* Syntax Case:: Support for the @code{syntax-case} system.
-* Internal Macros:: Guile's internal representation.
-@end menu
-
-
-@node Lambda
-@section Lambda: Basic Procedure Creation
-
-@c FIXME::martin: Review me!
-
-A @code{lambda} expression evaluates to a procedure. The environment
-which is in effect when a @code{lambda} expression is evaluated is
-enclosed in the newly created procedure, this is referred to as a
-@dfn{closure} (@pxref{About Closure}).
-
-When a procedure created by @code{lambda} is called with some actual
-arguments, the environment enclosed in the procedure is extended by
-binding the variables named in the formal argument list to new locations
-and storing the actual arguments into these locations. Then the body of
-the @code{lambda} expression is evaluation sequentially. The result of
-the last expression in the procedure body is then the result of the
-procedure invocation.
-
-The following examples will show how procedures can be created using
-@code{lambda}, and what you can do with these procedures.
-
-@lisp
-(lambda (x) (+ x x)) @result{} @r{a procedure}
-((lambda (x) (+ x x)) 4) @result{} 8
-@end lisp
-
-The fact that the environment in effect when creating a procedure is
-enclosed in the procedure is shown with this example:
-
-@lisp
-(define add4
- (let ((x 4))
- (lambda (y) (+ x y))))
-(add4 6) @result{} 10
-@end lisp
-
-
-@deffn syntax lambda formals body
-@var{formals} should be a formal argument list as described in the
-following table.
-
-@table @code
-@item (@var{variable1} @dots{})
-The procedure takes a fixed number of arguments; when the procedure is
-called, the arguments will be stored into the newly created location for
-the formal variables.
-@item @var{variable}
-The procedure takes any number of arguments; when the procedure is
-called, the sequence of actual arguments will converted into a list and
-stored into the newly created location for the formal variable.
-@item (@var{variable1} @dots{} @var{variablen} . @var{variablen+1})
-If a space-delimited period precedes the last variable, then the
-procedure takes @var{n} or more variables where @var{n} is the number
-of formal arguments before the period. There must be at least one
-argument before the period. The first @var{n} actual arguments will be
-stored into the newly allocated locations for the first @var{n} formal
-arguments and the sequence of the remaining actual arguments is
-converted into a list and the stored into the location for the last
-formal argument. If there are exactly @var{n} actual arguments, the
-empty list is stored into the location of the last formal argument.
-@end table
-
-@var{body} is a sequence of Scheme expressions which are evaluated in
-order when the procedure is invoked.
-@end deffn
-
-
-@node Optional Arguments
-@section Optional Arguments
-
-@c FIXME::martin: Review me!
-
-Scheme procedures, as defined in R5RS, can either handle a fixed number
-of actual arguments, or a fixed number of actual arguments followed by
-arbitrarily many additional arguments. Writing procedures of variable
-arity can be useful, but unfortunately, the syntactic means for handling
-argument lists of varying length is a bit inconvenient. It is possible
-to give names to the fixed number of argument, but the remaining
-(optional) arguments can be only referenced as a list of values
-(@pxref{Lambda}).
-
-Guile comes with the module @code{(ice-9 optargs)}, which makes using
-optional arguments much more convenient. In addition, this module
-provides syntax for handling keywords in argument lists
-(@pxref{Keywords}).
-
-Before using any of the procedures or macros defined in this section,
-you have to load the module @code{(ice-9 optargs)} with the statement:
-
-@lisp
-(use-modules (ice-9 optargs))
-@end lisp
-
-@menu
-* let-optional Reference:: Locally binding optional arguments.
-* let-keywords Reference:: Locally binding keywords arguments.
-* lambda* Reference:: Creating advanced argument handling procedures.
-* define* Reference:: Defining procedures and macros.
-@end menu
-
-
-@node let-optional Reference
-@subsection let-optional Reference
-
-@c FIXME::martin: Review me!
-
-The syntax @code{let-optional} and @code{let-optional*} are for
-destructuring rest argument lists and giving names to the various list
-elements. @code{let-optional} binds all variables simultaneously, while
-@code{let-optional*} binds them sequentially, consistent with @code{let}
-and @code{let*} (@pxref{Local Bindings}).
-
-@deffn {library syntax} let-optional rest-arg (binding @dots{}) expr @dots{}
-@deffnx {library syntax} let-optional* rest-arg (binding @dots{}) expr @dots{}
-These two macros give you an optional argument interface that is very
-@dfn{Schemey} and introduces no fancy syntax. They are compatible with
-the scsh macros of the same name, but are slightly extended. Each of
-@var{binding} may be of one of the forms @var{var} or @code{(@var{var}
-@var{default-value})}. @var{rest-arg} should be the rest-argument of the
-procedures these are used from. The items in @var{rest-arg} are
-sequentially bound to the variable names are given. When @var{rest-arg}
-runs out, the remaining vars are bound either to the default values or
-left unbound if no default value was specified. @var{rest-arg} remains
-bound to whatever may have been left of @var{rest-arg}.
-
-After binding the variables, the expressions @var{expr} @dots{} are
-evaluated in order.
-@end deffn
-
-
-@node let-keywords Reference
-@subsection let-keywords Reference
-
-@c FIXME::martin: Review me!
-
-@code{let-keywords} and @code{let-keywords*} are used for extracting
-values from argument lists which use keywords instead of argument
-position for binding local variables to argument values.
-
-@code{let-keywords} binds all variables simultaneously, while
-@code{let-keywords*} binds them sequentially, consistent with @code{let}
-and @code{let*} (@pxref{Local Bindings}).
-
-@deffn {library syntax} let-keywords rest-arg allow-other-keys? (binding @dots{}) expr @dots{}
-@deffnx {library syntax} let-keywords rest-arg allow-other-keys? (binding @dots{}) expr @dots{}
-These macros pick out keyword arguments from @var{rest-arg}, but do not
-modify it. This is consistent at least with Common Lisp, which
-duplicates keyword arguments in the rest argument. More explanation of what
-keyword arguments in a lambda list look like can be found below in
-the documentation for @code{lambda*}
- (@pxref{lambda* Reference}). @var{binding}s can have the same form as
-for @code{let-optional}. If @var{allow-other-keys?} is false, an error
-will be thrown if anything that looks like a keyword argument but does
-not match a known keyword parameter will result in an error.
-
-After binding the variables, the expressions @var{expr} @dots{} are
-evaluated in order.
-@end deffn
-
-
-@node lambda* Reference
-@subsection lambda* Reference
-
-@c FIXME::martin: Review me!
-
-When using optional and keyword argument lists, using @code{lambda} for
-creating procedures and using @code{let-optional} or @code{let-keywords}
-is a bit lengthy. Therefore, @code{lambda*} is provided, which combines
-the features of those macros into a single convenient syntax.
-
-For quick reference, here is the syntax of the formal argument list for
-@code{lambda*} (brackets are used to indicate grouping only):
-
-@example
-ext-param-list ::= [identifier]* [#:optional [ext-var-decl]+]?
- [#:key [ext-var-decl]+ [#:allow-other-keys]?]?
- [[#:rest identifier]|[. identifier]]?
-
-ext-var-decl ::= identifier | ( identifier expression )
-@end example
-
-The characters `*', `+' and `?' are not to be taken literally; they mean
-respectively, zero or more occurrences, one or more occurrences, and one
-or zero occurrences.
-
-@deffn {library syntax} lambda* formals body
-@code{lambda*} creates a procedure that takes optional arguments. These
-are specified by putting them inside brackets at the end of the
-parameter list, but before any dotted rest argument. For example,
-
-@lisp
-(lambda* (a b #:optional c d . e) '())
-@end lisp
-
-creates a procedure with fixed arguments @var{a} and @var{b}, optional
-arguments @var{c} and @var{d}, and rest argument @var{e}. If the
-optional arguments are omitted in a call, the variables for them are
-unbound in the procedure. This can be checked with the @code{bound?}
-macro (documented below).
-
-@code{lambda*} can also take keyword arguments. For example, a procedure
-defined like this:
-
-@lisp
-(lambda* (#:key xyzzy larch) '())
-@end lisp
-
-can be called with any of the argument lists @code{(#:xyzzy 11)}
-@code{(#:larch 13)} @code{(#:larch 42 #:xyzzy 19)} @code{()}. Whichever
-arguments are given as keywords are bound to values.
-
-Optional and keyword arguments can also be given default values
-which they take on when they are not present in a call, by giving a
-two-item list in place of an optional argument, for example in:
-
-@lisp
-(lambda* (foo #:optional (bar 42) #:key (baz 73))
- (list foo bar baz))
-@end lisp
-
-@var{foo} is a fixed argument, @var{bar} is an optional argument with
-default value 42, and baz is a keyword argument with default value 73.
-Default value expressions are not evaluated unless they are needed and
-until the procedure is called.
-
-@code{lambda*} also supports two more special parameter list keywords.
-
-@code{lambda*}-defined procedures now throw an error by default if a
-keyword other than one of those specified is found in the actual
-passed arguments. However, specifying @code{#:allow-other-keys}
-immediately after the keyword argument declarations restores the
-previous behavior of ignoring unknown keywords. @code{lambda*} also now
-guarantees that if the same keyword is passed more than once, the
-last one passed is the one that takes effect. For example,
-
-@lisp
-((lambda* (#:key (heads 0) (tails 0)) (display (list heads tails)))
- #:heads 37 #:tails 42 #:heads 99)
-@end lisp
-
-would result in (99 47) being displayed.
-
-@code{#:rest} is also now provided as a synonym for the dotted syntax
-rest argument. The argument lists @code{(a . b)} and @code{(a #:rest b)}
-are equivalent in all respects to @code{lambda*}. This is provided for
-more similarity to DSSSL, MIT-Scheme and Kawa among others, as well as
-for refugees from other Lisp dialects.
-@end deffn
-
-@deffn {library syntax} bound? variable
-Check if a variable is bound in the current environment.
-
-The procedure @code{defined?} doesn't quite cut it as it stands, since
-it only checks bindings in the top-level environment, not those in local
-scope only.
-@end deffn
-
-
-@node define* Reference
-@subsection define* Reference
-
-@c FIXME::martin: Review me!
-
-Just like @code{define} has a shorthand notation for defining procedures
-(@pxref{Lambda Alternatives}), @code{define*} is provided as an
-abbreviation of the combination of @code{define} and @code{lambda*}.
-
-@code{define*-public} is the @code{lambda*} version of
-@code{define-public}; @code{defmacro*} and @code{defmacro*-public} exist
-for defining macros with the improved argument list handling
-possibilities. The @code{-public} versions not only define the
-procedures/macros, but also export them from the current module.
-
-@deffn {library syntax} define* formals body
-@deffnx {library syntax} define*-public formals body
-@code{define*} and @code{define*-public} support optional arguments with
-a similar syntax to @code{lambda*}. They also support arbitrary-depth
-currying, just like Guile's define. Some examples:
-
-@lisp
-(define* (x y #:optional a (z 3) #:key w . u)
- (display (list y z u)))
-@end lisp
-defines a procedure @code{x} with a fixed argument @var{y}, an optional
-argument @var{a}, another optional argument @var{z} with default value 3,
-a keyword argument @var{w}, and a rest argument @var{u}.
-
-@lisp
-(define-public* ((foo #:optional bar) #:optional baz) '())
-@end lisp
-
-This illustrates currying. A procedure @code{foo} is defined, which,
-when called with an optional argument @var{bar}, returns a procedure
-that takes an optional argument @var{baz}.
-
-Of course, @code{define*[-public]} also supports @code{#:rest} and
-@code{#:allow-other-keys} in the same way as @code{lambda*}.
-@end deffn
-
-@deffn {library syntax} defmacro* name formals body
-@deffnx {library syntax} defmacro*-public name formals body
-These are just like @code{defmacro} and @code{defmacro-public} except that they
-take @code{lambda*}-style extended parameter lists, where @code{#:optional},
-@code{#:key}, @code{#:allow-other-keys} and @code{#:rest} are allowed with the usual
-semantics. Here is an example of a macro with an optional argument:
-
-@lisp
-(defmacro* transmorgify (a #:optional b)
- (a 1))
-@end lisp
-@end deffn
-
-
-@node Procedure Properties
-@section Procedure Properties and Meta-information
-
-@c FIXME::martin: Review me!
-
-Procedures always have attached the environment in which they were
-created and information about how to apply them to actual arguments. In
-addition to that, properties and meta-information can be stored with
-procedures. The procedures in this section can be used to test whether
-a given procedure satisfies a condition; and to access and set a
-procedure's property.
-
-The first group of procedures are predicates to test whether a Scheme
-object is a procedure, or a special procedure, respectively.
-@code{procedure?} is the most general predicates, it returns @code{#t}
-for any kind of procedure. @code{closure?} does not return @code{#t}
-for primitive procedures, and @code{thunk?} only returns @code{#t} for
-procedures which do not accept any arguments.
-
-@rnindex procedure?
-@deffn {Scheme Procedure} procedure? obj
-@deffnx {C Function} scm_procedure_p (obj)
-Return @code{#t} if @var{obj} is a procedure.
-@end deffn
-
-@deffn {Scheme Procedure} closure? obj
-@deffnx {C Function} scm_closure_p (obj)
-Return @code{#t} if @var{obj} is a closure.
-@end deffn
-
-@deffn {Scheme Procedure} thunk? obj
-@deffnx {C Function} scm_thunk_p (obj)
-Return @code{#t} if @var{obj} is a thunk.
-@end deffn
-
-@c FIXME::martin: Is that true?
-@cindex procedure properties
-Procedure properties are general properties to be attached to
-procedures. These can be the name of a procedure or other relevant
-information, such as debug hints.
-
-@deffn {Scheme Procedure} procedure-name proc
-@deffnx {C Function} scm_procedure_name (proc)
-Return the name of the procedure @var{proc}
-@end deffn
-
-@deffn {Scheme Procedure} procedure-source proc
-@deffnx {C Function} scm_procedure_source (proc)
-Return the source of the procedure @var{proc}.
-@end deffn
-
-@deffn {Scheme Procedure} procedure-environment proc
-@deffnx {C Function} scm_procedure_environment (proc)
-Return the environment of the procedure @var{proc}.
-@end deffn
-
-@deffn {Scheme Procedure} procedure-properties proc
-@deffnx {C Function} scm_procedure_properties (proc)
-Return @var{obj}'s property list.
-@end deffn
-
-@deffn {Scheme Procedure} procedure-property obj key
-@deffnx {C Function} scm_procedure_property (obj, key)
-Return the property of @var{obj} with name @var{key}.
-@end deffn
-
-@deffn {Scheme Procedure} set-procedure-properties! proc alist
-@deffnx {C Function} scm_set_procedure_properties_x (proc, alist)
-Set @var{obj}'s property list to @var{alist}.
-@end deffn
-
-@deffn {Scheme Procedure} set-procedure-property! obj key value
-@deffnx {C Function} scm_set_procedure_property_x (obj, key, value)
-In @var{obj}'s property list, set the property named @var{key} to
-@var{value}.
-@end deffn
-
-@cindex procedure documentation
-Documentation for a procedure can be accessed with the procedure
-@code{procedure-documentation}.
-
-@deffn {Scheme Procedure} procedure-documentation proc
-@deffnx {C Function} scm_procedure_documentation (proc)
-Return the documentation string associated with @code{proc}. By
-convention, if a procedure contains more than one expression and the
-first expression is a string constant, that string is assumed to contain
-documentation for that procedure.
-@end deffn
-
-@cindex source properties
-@c FIXME::martin: Is the following true?
-Source properties are properties which are related to the source code of
-a procedure, such as the line and column numbers, the file name etc.
-
-@deffn {Scheme Procedure} set-source-properties! obj plist
-@deffnx {C Function} scm_set_source_properties_x (obj, plist)
-Install the association list @var{plist} as the source property
-list for @var{obj}.
-@end deffn
-
-@deffn {Scheme Procedure} set-source-property! obj key datum
-@deffnx {C Function} scm_set_source_property_x (obj, key, datum)
-Set the source property of object @var{obj}, which is specified by
-@var{key} to @var{datum}. Normally, the key will be a symbol.
-@end deffn
-
-@deffn {Scheme Procedure} source-properties obj
-@deffnx {C Function} scm_source_properties (obj)
-Return the source property association list of @var{obj}.
-@end deffn
-
-
-@deffn {Scheme Procedure} source-property obj key
-@deffnx {C Function} scm_source_property (obj, key)
-Return the source property specified by @var{key} from
-@var{obj}'s source property list.
-@end deffn
-
-
-@node Procedures with Setters
-@section Procedures with Setters
-
-@c FIXME::martin: Review me!
-
-@c FIXME::martin: Document `operator struct'.
-
-@cindex procedure with setter
-@cindex setter
-A @dfn{procedure with setter} is a special kind of procedure which
-normally behaves like any accessor procedure, that is a procedure which
-accesses a data structure. The difference is that this kind of
-procedure has a so-called @dfn{setter} attached, which is a procedure
-for storing something into a data structure.
-
-Procedures with setters are treated specially when the procedure appears
-in the special form @code{set!} (REFFIXME). How it works is best shown
-by example.
-
-Suppose we have a procedure called @code{foo-ref}, which accepts two
-arguments, a value of type @code{foo} and an integer. The procedure
-returns the value stored at the given index in the @code{foo} object.
-Let @code{f} be a variable containing such a @code{foo} data
-structure.@footnote{Working definitions would be:
-@lisp
-(define foo-ref vector-ref)
-(define foo-set! vector-set!)
-(define f (make-vector 2 #f))
-@end lisp
-}
-
-@lisp
-(foo-ref f 0) @result{} bar
-(foo-ref f 1) @result{} braz
-@end lisp
-
-Also suppose that a corresponding setter procedure called
-@code{foo-set!} does exist.
-
-@lisp
-(foo-set! f 0 'bla)
-(foo-ref f 0) @result{} bla
-@end lisp
-
-Now we could create a new procedure called @code{foo}, which is a
-procedure with setter, by calling @code{make-procedure-with-setter} with
-the accessor and setter procedures @code{foo-ref} and @code{foo-set!}.
-Let us call this new procedure @code{foo}.
-
-@lisp
-(define foo (make-procedure-with-setter foo-ref foo-set!))
-@end lisp
-
-@code{foo} can from now an be used to either read from the data
-structure stored in @code{f}, or to write into the structure.
-
-@lisp
-(set! (foo f 0) 'dum)
-(foo f 0) @result{} dum
-@end lisp
-
-@deffn {Scheme Procedure} make-procedure-with-setter procedure setter
-@deffnx {C Function} scm_make_procedure_with_setter (procedure, setter)
-Create a new procedure which behaves like @var{procedure}, but
-with the associated setter @var{setter}.
-@end deffn
-
-@deffn {Scheme Procedure} procedure-with-setter? obj
-@deffnx {C Function} scm_procedure_with_setter_p (obj)
-Return @code{#t} if @var{obj} is a procedure with an
-associated setter procedure.
-@end deffn
-
-@deffn {Scheme Procedure} procedure proc
-@deffnx {C Function} scm_procedure (proc)
-Return the procedure of @var{proc}, which must be either a
-procedure with setter, or an operator struct.
-@end deffn
-
-@deffn {Scheme Procedure} setter proc
-Return the setter of @var{proc}, which must be either a procedure with
-setter or an operator struct.
-@end deffn
-
-
-@node Macros
-@section Lisp Style Macro Definitions
-
-@cindex macros
-@cindex transformation
-Macros are objects which cause the expression that they appear in to be
-transformed in some way @emph{before} being evaluated. In expressions
-that are intended for macro transformation, the identifier that names
-the relevant macro must appear as the first element, like this:
-
-@lisp
-(@var{macro-name} @var{macro-args} @dots{})
-@end lisp
-
-In Lisp-like languages, the traditional way to define macros is very
-similar to procedure definitions. The key differences are that the
-macro definition body should return a list that describes the
-transformed expression, and that the definition is marked as a macro
-definition (rather than a procedure definition) by the use of a
-different definition keyword: in Lisp, @code{defmacro} rather than
-@code{defun}, and in Scheme, @code{define-macro} rather than
-@code{define}.
-
-@fnindex defmacro
-@fnindex define-macro
-Guile supports this style of macro definition using both @code{defmacro}
-and @code{define-macro}. The only difference between them is how the
-macro name and arguments are grouped together in the definition:
-
-@lisp
-(defmacro @var{name} (@var{args} @dots{}) @var{body} @dots{})
-@end lisp
-
-@noindent
-is the same as
-
-@lisp
-(define-macro (@var{name} @var{args} @dots{}) @var{body} @dots{})
-@end lisp
-
-@noindent
-The difference is analogous to the corresponding difference between
-Lisp's @code{defun} and Scheme's @code{define}.
-
-@code{false-if-exception}, from the @file{boot-9.scm} file in the Guile
-distribution, is a good example of macro definition using
-@code{defmacro}:
-
-@lisp
-(defmacro false-if-exception (expr)
- `(catch #t
- (lambda () ,expr)
- (lambda args #f)))
-@end lisp
-
-@noindent
-The effect of this definition is that expressions beginning with the
-identifier @code{false-if-exception} are automatically transformed into
-a @code{catch} expression following the macro definition specification.
-For example:
-
-@lisp
-(false-if-exception (open-input-file "may-not-exist"))
-@equiv{}
-(catch #t
- (lambda () (open-input-file "may-not-exist"))
- (lambda args #f))
-@end lisp
-
-
-@node Syntax Rules
-@section The R5RS @code{syntax-rules} System
-@cindex R5RS syntax-rules system
-
-R5RS defines an alternative system for macro and syntax transformations
-using the keywords @code{define-syntax}, @code{let-syntax},
-@code{letrec-syntax} and @code{syntax-rules}.
-
-The main difference between the R5RS system and the traditional macros
-of the previous section is how the transformation is specified. In
-R5RS, rather than permitting a macro definition to return an arbitrary
-expression, the transformation is specified in a pattern language that
-
-@itemize @bullet
-@item
-does not require complicated quoting and extraction of components of the
-source expression using @code{caddr} etc.
-
-@item
-is designed such that the bindings associated with identifiers in the
-transformed expression are well defined, and such that it is impossible
-for the transformed expression to construct new identifiers.
-@end itemize
-
-@noindent
-The last point is commonly referred to as being @dfn{hygienic}: the R5RS
-@code{syntax-case} system provides @dfn{hygienic macros}.
-
-For example, the R5RS pattern language for the @code{false-if-exception}
-example of the previous section looks like this:
-
-@lisp
-(syntax-rules ()
- ((_ expr)
- (catch #t
- (lambda () expr)
- (lambda args #f))))
-@end lisp
-
-In Guile, the @code{syntax-rules} system is provided by the @code{(ice-9
-syncase)} module. To make these facilities available in your code,
-include the expression @code{(use-syntax (ice-9 syncase))} (@pxref{Using
-Guile Modules}) before the first usage of @code{define-syntax} etc. If
-you are writing a Scheme module, you can alternatively include the form
-@code{#:use-syntax (ice-9 syncase)} in your @code{define-module}
-declaration (@pxref{Creating Guile Modules}).
-
-@menu
-* Pattern Language:: The @code{syntax-rules} pattern language.
-* Define-Syntax:: Top level syntax definitions.
-* Let-Syntax:: Local syntax definitions.
-@end menu
-
-
-@node Pattern Language
-@subsection The @code{syntax-rules} Pattern Language
-
-
-@node Define-Syntax
-@subsection Top Level Syntax Definitions
-
-define-syntax: The gist is
-
- (define-syntax <keyword> <transformer-spec>)
-
-makes the <keyword> into a macro so that
-
- (<keyword> ...)
-
-expands at _compile_ or _read_ time (i.e. before any
-evaluation begins) into some expression that is
-given by the <transformer-spec>.
-
-
-@node Let-Syntax
-@subsection Local Syntax Definitions
-
-
-@node Syntax Case
-@section Support for the @code{syntax-case} System
-
-
-
-@node Internal Macros
-@section Internal Representation of Macros and Syntax
-
-Internally, Guile uses three different flavors of macros. The three
-flavors are called @dfn{acro} (or @dfn{syntax}), @dfn{macro} and
-@dfn{mmacro}.
-
-Given the expression
-
-@lisp
-(foo @dots{})
-@end lisp
-
-@noindent
-with @code{foo} being some flavor of macro, one of the following things
-will happen when the expression is evaluated.
-
-@itemize @bullet
-@item
-When @code{foo} has been defined to be an @dfn{acro}, the procedure used
-in the acro definition of @code{foo} is passed the whole expression and
-the current lexical environment, and whatever that procedure returns is
-the value of evaluating the expression. You can think of this a
-procedure that receives its argument as an unevaluated expression.
-
-@item
-When @code{foo} has been defined to be a @dfn{macro}, the procedure used
-in the macro definition of @code{foo} is passed the whole expression and
-the current lexical environment, and whatever that procedure returns is
-evaluated again. That is, the procedure should return a valid Scheme
-expression.
-
-@item
-When @code{foo} has been defined to be a @dfn{mmacro}, the procedure
-used in the mmacro definition of `foo' is passed the whole expression
-and the current lexical environment, and whatever that procedure returns
-replaces the original expression. Evaluation then starts over from the
-new expression that has just been returned.
-@end itemize
-
-The key difference between a @dfn{macro} and a @dfn{mmacro} is that the
-expression returned by a @dfn{mmacro} procedure is remembered (or
-@dfn{memoized}) so that the expansion does not need to be done again
-next time the containing code is evaluated.
-
-The primitives @code{procedure->syntax}, @code{procedure->macro} and
-@code{procedure->memoizing-macro} are used to construct acros, macros
-and mmacros respectively. However, if you do not have a very special
-reason to use one of these primitives, you should avoid them: they are
-very specific to Guile's current implementation and therefore likely to
-change. Use @code{defmacro}, @code{define-macro} (@pxref{Macros}) or
-@code{define-syntax} (@pxref{Syntax Rules}) instead. (In low level
-terms, @code{defmacro}, @code{define-macro} and @code{define-syntax} are
-all implemented as mmacros.)
-
-@deffn {Scheme Procedure} procedure->syntax code
-@deffnx {C Function} scm_makacro (code)
-Return a macro which, when a symbol defined to this value appears as the
-first symbol in an expression, returns the result of applying @var{code}
-to the expression and the environment.
-@end deffn
-
-@deffn {Scheme Procedure} procedure->macro code
-@deffnx {C Function} scm_makmacro (code)
-Return a macro which, when a symbol defined to this value appears as the
-first symbol in an expression, evaluates the result of applying
-@var{code} to the expression and the environment. For example:
-
-@lisp
-(define trace
- (procedure->macro
- (lambda (x env)
- `(set! ,(cadr x) (tracef ,(cadr x) ',(cadr x))))))
-
-(trace @i{foo})
-@equiv{}
-(set! @i{foo} (tracef @i{foo} '@i{foo})).
-@end lisp
-@end deffn
-
-@deffn {Scheme Procedure} procedure->memoizing-macro code
-@deffnx {C Function} scm_makmmacro (code)
-Return a macro which, when a symbol defined to this value appears as the
-first symbol in an expression, evaluates the result of applying
-@var{code} to the expression and the environment.
-@code{procedure->memoizing-macro} is the same as
-@code{procedure->macro}, except that the expression returned by
-@var{code} replaces the original macro expression in the memoized form
-of the containing code.
-@end deffn
-
-In the following primitives, @dfn{acro} flavor macros are referred to
-as @dfn{syntax transformers}.
-
-@deffn {Scheme Procedure} macro? obj
-@deffnx {C Function} scm_macro_p (obj)
-Return @code{#t} if @var{obj} is a regular macro, a memoizing macro or a
-syntax transformer.
-@end deffn
-
-@deffn {Scheme Procedure} macro-type m
-@deffnx {C Function} scm_macro_type (m)
-Return one of the symbols @code{syntax}, @code{macro} or
-@code{macro!}, depending on whether @var{m} is a syntax
-transformer, a regular macro, or a memoizing macro,
-respectively. If @var{m} is not a macro, @code{#f} is
-returned.
-@end deffn
-
-@deffn {Scheme Procedure} macro-name m
-@deffnx {C Function} scm_macro_name (m)
-Return the name of the macro @var{m}.
-@end deffn
-
-@deffn {Scheme Procedure} macro-transformer m
-@deffnx {C Function} scm_macro_transformer (m)
-Return the transformer of the macro @var{m}.
-@end deffn
-
-@deffn {Scheme Procedure} cons-source xorig x y
-@deffnx {C Function} scm_cons_source (xorig, x, y)
-Create and return a new pair whose car and cdr are @var{x} and @var{y}.
-Any source properties associated with @var{xorig} are also associated
-with the new pair.
-@end deffn
-
-
-@c Local Variables:
-@c TeX-master: "guile.texi"
-@c End:
diff --git a/doc/ref/scheme-reading.texi b/doc/ref/scheme-reading.texi
deleted file mode 100644
index eea049d2d..000000000
--- a/doc/ref/scheme-reading.texi
+++ /dev/null
@@ -1,27 +0,0 @@
-@page
-@node Further Reading
-@chapter Further Reading
-
-@itemize @bullet
-@item
-Dorai Sitaram's online Scheme tutorial, @dfn{Teach Yourself Scheme in
-Fixnum Days}, at
-@url{http://www.cs.rice.edu/~dorai/t-y-scheme/t-y-scheme.html}.
-Includes a nice explanation of continuations.
-
-@item
-@url{http://wombat.doc.ic.ac.uk/foldoc/}.
-
-@item
-The complete text of @dfn{Structure and Interpretation of Computer
-Programs}, the classic introduction to computer science and Scheme by
-Hal Abelson, Jerry Sussman and Julie Sussman, is now available online at
-@url{http://mitpress.mit.edu/sicp/sicp.html}. This site also provides
-teaching materials related to the book, and all the source code used in
-the book, in a form suitable for loading and running.
-@end itemize
-
-
-@c Local Variables:
-@c TeX-master: "guile.texi"
-@c End:
diff --git a/doc/ref/scheme-scheduling.texi b/doc/ref/scheme-scheduling.texi
deleted file mode 100644
index 920a73029..000000000
--- a/doc/ref/scheme-scheduling.texi
+++ /dev/null
@@ -1,453 +0,0 @@
-@page
-@node Scheduling
-@chapter Threads, Mutexes, Asyncs and Dynamic Roots
-
-[FIXME: This is pasted in from Tom Lord's original guile.texi chapter
-plus the Cygnus programmer's manual; it should be *very* carefully
-reviewed and largely reorganized.]
-
-@menu
-* Arbiters:: Synchronization primitives.
-* Asyncs:: Asynchronous procedure invocation.
-* Dynamic Roots:: Root frames of execution.
-* Threads:: Multiple threads of execution.
-* Fluids:: Dynamically scoped variables.
-@end menu
-
-
-@node Arbiters
-@section Arbiters
-
-@cindex arbiters
-
-@c FIXME::martin: Review me!
-
-Arbiters are synchronization objects. They are created with
-@code{make-arbiter}. Two or more threads can synchronize on an arbiter
-by trying to lock it using @code{try-arbiter}. This call will succeed
-if no other thread has called @code{try-arbiter} on the arbiter yet,
-otherwise it will fail and return @code{#f}. Once an arbiter is
-successfully locked, it cannot be locked by another thread until the
-thread holding the arbiter calls @code{release-arbiter} to unlock it.
-
-@deffn {Scheme Procedure} make-arbiter name
-@deffnx {C Function} scm_make_arbiter (name)
-Return an object of type arbiter and name @var{name}. Its
-state is initially unlocked. Arbiters are a way to achieve
-process synchronization.
-@end deffn
-
-@deffn {Scheme Procedure} try-arbiter arb
-@deffnx {C Function} scm_try_arbiter (arb)
-Return @code{#t} and lock the arbiter @var{arb} if the arbiter
-was unlocked. Otherwise, return @code{#f}.
-@end deffn
-
-@deffn {Scheme Procedure} release-arbiter arb
-@deffnx {C Function} scm_release_arbiter (arb)
-Return @code{#t} and unlock the arbiter @var{arb} if the
-arbiter was locked. Otherwise, return @code{#f}.
-@end deffn
-
-
-@node Asyncs
-@section Asyncs
-
-@cindex asyncs
-@cindex system asyncs
-
-@c FIXME::martin: Review me!
-
-An async is a pair of one thunk (a parameterless procedure) and a mark.
-Setting the mark on an async guarantees that the thunk will be executed
-somewhen in the future (@dfn{asynchronously}). Setting the mark more
-than once is satisfied by one execution of the thunk.
-
-Guile supports two types of asyncs: Normal asyncs and system asyncs.
-They differ in that marked system asyncs are executed implicitly as soon
-as possible, whereas normal asyncs have to be invoked explicitly.
-System asyncs are held in an internal data structure and are maintained
-by Guile.
-
-Normal asyncs are created with @code{async}, system asyncs with
-@code{system-async}. They are marked with @code{async-mark} or
-@code{system-async-mark}, respectively.
-
-@deffn {Scheme Procedure} async thunk
-@deffnx {C Function} scm_async (thunk)
-Create a new async for the procedure @var{thunk}.
-@end deffn
-
-@deffn {Scheme Procedure} system-async thunk
-@deffnx {C Function} scm_system_async (thunk)
-Create a new async for the procedure @var{thunk}. Also
-add it to the system's list of active async objects.
-@end deffn
-
-@deffn {Scheme Procedure} async-mark a
-@deffnx {C Function} scm_async_mark (a)
-Mark the async @var{a} for future execution.
-@end deffn
-
-@deffn {Scheme Procedure} system-async-mark a
-@deffnx {C Function} scm_system_async_mark (a)
-Mark the async @var{a} for future execution.
-@end deffn
-
-As already mentioned above, system asyncs are executed automatically.
-Normal asyncs have to be explicitly invoked by storing one or more of
-them into a list and passing them to @code{run-asyncs}.
-
-@deffn {Scheme Procedure} run-asyncs list_of_a
-@deffnx {C Function} scm_run_asyncs (list_of_a)
-Execute all thunks from the asyncs of the list @var{list_of_a}.
-@end deffn
-
-Automatic invocation of system asyncs can be temporarily disabled by
-calling @code{mask-signals} and @code{unmask-signals}. Setting the mark
-while async execution is disabled will nevertheless cause the async to
-run once execution is enabled again. Please note that calls to these
-procedures should always be paired, and they must not be nested, e.g. no
-@code{mask-signals} is allowed if another one is still active.
-
-@deffn {Scheme Procedure} mask-signals
-@deffnx {C Function} scm_mask_signals ()
-Mask signals. The returned value is not specified.
-@end deffn
-
-@deffn {Scheme Procedure} unmask-signals
-@deffnx {C Function} scm_unmask_signals ()
-Unmask signals. The returned value is not specified.
-@end deffn
-
-@c FIXME::martin: Find an example for usage of `noop'. What is that
-@c procedure for anyway?
-
-@deffn {Scheme Procedure} noop . args
-@deffnx {C Function} scm_noop (args)
-Do nothing. When called without arguments, return @code{#f},
-otherwise return the first argument.
-@end deffn
-
-
-@node Dynamic Roots
-@section Dynamic Roots
-@cindex dynamic roots
-
-A @dfn{dynamic root} is a root frame of Scheme evaluation.
-The top-level repl, for example, is an instance of a dynamic root.
-
-Each dynamic root has its own chain of dynamic-wind information. Each
-has its own set of continuations, jump-buffers, and pending CATCH
-statements which are inaccessible from the dynamic scope of any
-other dynamic root.
-
-In a thread-based system, each thread has its own dynamic root. Therefore,
-continuations created by one thread may not be invoked by another.
-
-Even in a single-threaded system, it is sometimes useful to create a new
-dynamic root. For example, if you want to apply a procedure, but to
-not allow that procedure to capture the current continuation, calling
-the procedure under a new dynamic root will do the job.
-
-@deffn {Scheme Procedure} call-with-dynamic-root thunk handler
-@deffnx {C Function} scm_call_with_dynamic_root (thunk, handler)
-Evaluate @code{(thunk)} in a new dynamic context, returning its value.
-
-If an error occurs during evaluation, apply @var{handler} to the
-arguments to the throw, just as @code{throw} would. If this happens,
-@var{handler} is called outside the scope of the new root -- it is
-called in the same dynamic context in which
-@code{call-with-dynamic-root} was evaluated.
-
-If @var{thunk} captures a continuation, the continuation is rooted at
-the call to @var{thunk}. In particular, the call to
-@code{call-with-dynamic-root} is not captured. Therefore,
-@code{call-with-dynamic-root} always returns at most one time.
-
-Before calling @var{thunk}, the dynamic-wind chain is un-wound back to
-the root and a new chain started for @var{thunk}. Therefore, this call
-may not do what you expect:
-
-@lisp
-;; Almost certainly a bug:
-(with-output-to-port
- some-port
-
- (lambda ()
- (call-with-dynamic-root
- (lambda ()
- (display 'fnord)
- (newline))
- (lambda (errcode) errcode))))
-@end lisp
-
-The problem is, on what port will @samp{fnord} be displayed? You
-might expect that because of the @code{with-output-to-port} that
-it will be displayed on the port bound to @code{some-port}. But it
-probably won't -- before evaluating the thunk, dynamic winds are
-unwound, including those created by @code{with-output-to-port}.
-So, the standard output port will have been re-set to its default value
-before @code{display} is evaluated.
-
-(This function was added to Guile mostly to help calls to functions in C
-libraries that can not tolerate non-local exits or calls that return
-multiple times. If such functions call back to the interpreter, it should
-be under a new dynamic root.)
-@end deffn
-
-
-@deffn {Scheme Procedure} dynamic-root
-@deffnx {C Function} scm_dynamic_root ()
-Return an object representing the current dynamic root.
-
-These objects are only useful for comparison using @code{eq?}.
-They are currently represented as numbers, but your code should
-in no way depend on this.
-@end deffn
-
-@c begin (scm-doc-string "boot-9.scm" "quit")
-@deffn {Scheme Procedure} quit [exit_val]
-Throw back to the error handler of the current dynamic root.
-
-If integer @var{exit_val} is specified and if Guile is being used
-stand-alone and if quit is called from the initial dynamic-root,
-@var{exit_val} becomes the exit status of the Guile process and the
-process exits.
-@end deffn
-
-When Guile is run interactively, errors are caught from within the
-read-eval-print loop. An error message will be printed and @code{abort}
-called. A default set of signal handlers is installed, e.g., to allow
-user interrupt of the interpreter.
-
-It is possible to switch to a "batch mode", in which the interpreter
-will terminate after an error and in which all signals cause their
-default actions. Switching to batch mode causes any handlers installed
-from Scheme code to be removed. An example of where this is useful is
-after forking a new process intended to run non-interactively.
-
-@c begin (scm-doc-string "boot-9.scm" "batch-mode?")
-@deffn {Scheme Procedure} batch-mode?
-Returns a boolean indicating whether the interpreter is in batch mode.
-@end deffn
-
-@c begin (scm-doc-string "boot-9.scm" "set-batch-mode?!")
-@deffn {Scheme Procedure} set-batch-mode?! arg
-If @var{arg} is true, switches the interpreter to batch mode.
-The @code{#f} case has not been implemented.
-@end deffn
-
-@node Threads
-@section Threads
-@cindex threads
-@cindex Guile threads
-
-@strong{[NOTE: this chapter was written for Cygnus Guile and has not yet
-been updated for the Guile 1.x release.]}
-
-Here is a the reference for Guile's threads. In this chapter I simply
-quote verbatim Tom Lord's description of the low-level primitives
-written in C (basically an interface to the POSIX threads library) and
-Anthony Green's description of the higher-level thread procedures
-written in scheme.
-@cindex posix threads
-@cindex Lord, Tom
-@cindex Green, Anthony
-
-When using Guile threads, keep in mind that each guile thread is
-executed in a new dynamic root.
-
-@menu
-* Low level thread primitives::
-* Higher level thread procedures::
-@end menu
-
-
-@node Low level thread primitives
-@subsection Low level thread primitives
-
-@c NJFIXME no current mechanism for making sure that these docstrings
-@c are in sync.
-
-@c begin (texi-doc-string "guile" "call-with-new-thread")
-@deffn {Scheme Procedure} call-with-new-thread thunk error-handler
-Evaluate @code{(thunk)} in a new thread, and new dynamic context,
-returning a new thread object representing the thread.
-
-If an error occurs during evaluation, call error-handler, passing it an
-error code describing the condition. [Error codes are currently
-meaningless integers. In the future, real values will be specified.]
-If this happens, the error-handler is called outside the scope of the new
-root -- it is called in the same dynamic context in which
-with-new-thread was evaluated, but not in the caller's thread.
-
-All the evaluation rules for dynamic roots apply to threads.
-@end deffn
-
-@c begin (texi-doc-string "guile" "join-thread")
-@deffn {Scheme Procedure} join-thread thread
-Suspend execution of the calling thread until the target @var{thread}
-terminates, unless the target @var{thread} has already terminated.
-@end deffn
-
-@c begin (texi-doc-string "guile" "yield")
-@deffn {Scheme Procedure} yield
-If one or more threads are waiting to execute, calling yield forces an
-immediate context switch to one of them. Otherwise, yield has no effect.
-@end deffn
-
-@c begin (texi-doc-string "guile" "make-mutex")
-@deffn {Scheme Procedure} make-mutex
-Create a new mutex object.
-@end deffn
-
-@c begin (texi-doc-string "guile" "lock-mutex")
-@deffn {Scheme Procedure} lock-mutex mutex
-Lock @var{mutex}. If the mutex is already locked, the calling thread
-blocks until the mutex becomes available. The function returns when
-the calling thread owns the lock on @var{mutex}.
-@end deffn
-
-@c begin (texi-doc-string "guile" "unlock-mutex")
-@deffn {Scheme Procedure} unlock-mutex mutex
-Unlocks @var{mutex} if the calling thread owns the lock on @var{mutex}.
-Calling unlock-mutex on a mutex not owned by the current thread results
-in undefined behaviour. Once a mutex has been unlocked, one thread
-blocked on @var{mutex} is awakened and grabs the mutex lock.
-@end deffn
-
-@c begin (texi-doc-string "guile" "make-condition-variable")
-@deffn {Scheme Procedure} make-condition-variable
-@end deffn
-
-@c begin (texi-doc-string "guile" "wait-condition-variable")
-@deffn {Scheme Procedure} wait-condition-variable cond-var mutex
-@end deffn
-
-@c begin (texi-doc-string "guile" "signal-condition-variable")
-@deffn {Scheme Procedure} signal-condition-variable cond-var
-@end deffn
-
-
-@node Higher level thread procedures
-@subsection Higher level thread procedures
-
-@c new by ttn, needs review
-
-Higher level thread procedures are available by loading the
-@code{(ice-9 threads)} module. These provide standardized
-thread creation and mutex interaction.
-
-@deffn {Scheme Procedure} %thread-handler tag args@dots{}
-
-This procedure is specified as the standard error-handler for
-@code{make-thread} and @code{begin-thread}. If the number of @var{args}
-is three or more, use @code{display-error}, otherwise display a message
-"uncaught throw to @var{tag}". All output is sent to the port specified
-by @code{current-error-port}.
-
-Before display, global var @code{the-last-stack} is set to @code{#f}
-and signals are unmasked with @code{unmask-signals}.
-
-[FIXME: Why distinguish based on number of args?! Cue voodoo music here.]
-@end deffn
-
-@deffn macro make-thread proc [args@dots{}]
-Apply @var{proc} to @var{args} in a new thread formed by
-@code{call-with-new-thread} using @code{%thread-handler} as the error
-handler.
-@end deffn
-
-@deffn macro begin-thread first [rest@dots{}]
-Evaluate forms @var{first} and @var{rest} in a new thread formed by
-@code{call-with-new-thread} using @code{%thread-handler} as the error
-handler.
-@end deffn
-
-@deffn macro with-mutex m [body@dots{}]
-Lock mutex @var{m}, evaluate @var{body}, and then unlock @var{m}.
-These sub-operations form the branches of a @code{dynamic-wind}.
-@end deffn
-
-@deffn macro monitor first [rest@dots{}]
-Evaluate forms @var{first} and @var{rest} under a newly created
-anonymous mutex, using @code{with-mutex}.
-
-[FIXME: Is there any way to access the mutex?]
-@end deffn
-
-
-@node Fluids
-@section Fluids
-
-@cindex fluids
-
-@c FIXME::martin: Review me!
-
-Fluids are objects to store values in. They have a few properties which
-make them useful in certain situations: Fluids can have one value per
-dynamic root (@pxref{Dynamic Roots}), so that changes to the value in a
-fluid are only visible in the same dynamic root. Since threads are
-executed in separate dynamic roots, fluids can be used for thread local
-storage (@pxref{Threads}).
-
-Fluids can be used to simulate dynamically scoped variables. These are
-used in several (especially in older) dialects of lisp, such as in Emacs
-Lisp, and they work a bit like global variables in that they can be
-modified by the caller of a procedure, and the called procedure will see
-the changes. With lexically scoped variables---which are normally used
-in Scheme---this cannot happen. See the description of
-@code{with-fluids*} below for details.
-
-New fluids are created with @code{make-fluid} and @code{fluid?} is used
-for testing whether an object is actually a fluid.
-
-@deffn {Scheme Procedure} make-fluid
-@deffnx {C Function} scm_make_fluid ()
-Return a newly created fluid.
-Fluids are objects of a certain type (a smob) that can hold one SCM
-value per dynamic root. That is, modifications to this value are
-only visible to code that executes within the same dynamic root as
-the modifying code. When a new dynamic root is constructed, it
-inherits the values from its parent. Because each thread executes
-in its own dynamic root, you can use fluids for thread local storage.
-@end deffn
-
-@deffn {Scheme Procedure} fluid? obj
-@deffnx {C Function} scm_fluid_p (obj)
-Return @code{#t} iff @var{obj} is a fluid; otherwise, return
-@code{#f}.
-@end deffn
-
-The values stored in a fluid can be accessed with @code{fluid-ref} and
-@code{fluid-set!}.
-
-@deffn {Scheme Procedure} fluid-ref fluid
-@deffnx {C Function} scm_fluid_ref (fluid)
-Return the value associated with @var{fluid} in the current
-dynamic root. If @var{fluid} has not been set, then return
-@code{#f}.
-@end deffn
-
-@deffn {Scheme Procedure} fluid-set! fluid value
-@deffnx {C Function} scm_fluid_set_x (fluid, value)
-Set the value associated with @var{fluid} in the current dynamic root.
-@end deffn
-
-@code{with-fluids*} temporarily changes the values of one or more fluids,
-so that the given procedure and each procedure called by it access the
-given values. After the procedure returns, the old values are restored.
-
-@deffn {Scheme Procedure} with-fluids* fluids values thunk
-@deffnx {C Function} scm_with_fluids (fluids, values, thunk)
-Set @var{fluids} to @var{values} temporary, and call @var{thunk}.
-@var{fluids} must be a list of fluids and @var{values} must be the same
-number of their values to be applied. Each substitution is done
-one after another. @var{thunk} must be a procedure with no argument.
-@end deffn
-
-
-@c Local Variables:
-@c TeX-master: "guile.texi"
-@c End:
diff --git a/doc/ref/scheme-translation.texi b/doc/ref/scheme-translation.texi
deleted file mode 100644
index 4d398c60f..000000000
--- a/doc/ref/scheme-translation.texi
+++ /dev/null
@@ -1,48 +0,0 @@
-@page
-@node Translation
-@chapter Support for Translating Other Languages
-
-[Describe translation framework.]
-
-@menu
-* Emacs Lisp Support:: Helper primitives for Emacs Lisp.
-@end menu
-
-
-@node Emacs Lisp Support
-@section Emacs Lisp Support
-
-@deffn {Scheme Procedure} nil-car x
-@deffnx {C Function} scm_nil_car (x)
-Return the car of @var{x}, but convert it to LISP nil if it
-is Scheme's end-of-list.
-@end deffn
-
-@deffn {Scheme Procedure} nil-cdr x
-@deffnx {C Function} scm_nil_cdr (x)
-Return the cdr of @var{x}, but convert it to LISP nil if it
-is Scheme's end-of-list.
-@end deffn
-
-@deffn {Scheme Procedure} nil-cons x y
-@deffnx {C Function} scm_nil_cons (x, y)
-Create a new cons cell with @var{x} as the car and @var{y} as
-the cdr, but convert @var{y} to Scheme's end-of-list if it is
-a Lisp nil.
-@end deffn
-
-@deffn {Scheme Procedure} nil-eq x y
-Compare @var{x} and @var{y} and return Lisp's t if they are
-@code{eq?}, return Lisp's nil otherwise.
-@end deffn
-
-@deffn {Scheme Procedure} null x
-@deffnx {C Function} scm_null (x)
-Return Lisp's @code{t} if @var{x} is nil in the LISP sense,
-return Lisp's nil otherwise.
-@end deffn
-
-
-@c Local Variables:
-@c TeX-master: "guile.texi"
-@c End:
diff --git a/doc/ref/scheme-utility.texi b/doc/ref/scheme-utility.texi
deleted file mode 100644
index f544ac0da..000000000
--- a/doc/ref/scheme-utility.texi
+++ /dev/null
@@ -1,731 +0,0 @@
-@page
-@node Utility Functions
-@chapter General Utility Functions
-
-@c FIXME::martin: Review me!
-
-This chapter contains information about procedures which are not cleanly
-tied to a specific data type. Because of their wide range of
-applications, they are collected in a @dfn{utility} chapter.
-
-@menu
-* Equality:: When are two values `the same'?
-* Object Properties:: A modern interface to object properties.
-* Sorting:: Sort utility procedures.
-* Copying:: Copying deep structures.
-* General Conversion:: Converting objects to strings.
-* Hooks:: User-customizable event lists.
-@end menu
-
-
-@node Equality
-@section Equality
-
-@c FIXME::martin: Review me!
-
-@cindex sameness
-@cindex equality
-
-Three different kinds of @dfn{sameness} are defined in Scheme.
-
-@itemize @bullet
-@item
-Two values can refer to exactly the same object.
-
-@item
-Two objects can have the same @dfn{value}.
-
-@item
-Two objects can be structurally equivalent.
-@end itemize
-
-The differentiation between these three kinds is important, because
-determining whether two values are the same objects is very efficient,
-while determining structural equivalence can be quite expensive
-(consider comparing two very long lists). Therefore, three different
-procedures for testing for equality are provided, which correspond to
-the three kinds of @dfn{sameness} defined above.
-
-@rnindex eq?
-@deffn {Scheme Procedure} eq? x y
-Return @code{#t} iff @var{x} references the same object as @var{y}.
-@code{eq?} is similar to @code{eqv?} except that in some cases it is
-capable of discerning distinctions finer than those detectable by
-@code{eqv?}.
-@end deffn
-
-@rnindex eqv?
-@deffn {Scheme Procedure} eqv? x y
-The @code{eqv?} procedure defines a useful equivalence relation on objects.
-Briefly, it returns @code{#t} if @var{x} and @var{y} should normally be
-regarded as the same object. This relation is left slightly open to
-interpretation, but works for comparing immediate integers, characters,
-and inexact numbers.
-@end deffn
-
-@rnindex equal?
-@deffn {Scheme Procedure} equal? x y
-Return @code{#t} iff @var{x} and @var{y} are recursively @code{eqv?} equivalent.
-@code{equal?} recursively compares the contents of pairs,
-vectors, and strings, applying @code{eqv?} on other objects such as
-numbers and symbols. A rule of thumb is that objects are generally
-@code{equal?} if they print the same. @code{equal?} may fail to
-terminate if its arguments are circular data structures.
-@end deffn
-
-
-@node Object Properties
-@section Object Properties
-
-It's often useful to associate a piece of additional information with a
-Scheme object even though that object does not have a dedicated slot
-available in which the additional information could be stored. Object
-properties allow you to do just that.
-
-An object property is most commonly used to associate one kind of
-additional information with each instance of a class of similar Scheme
-objects. For example, all procedures have a `name' property, which
-stores the name of the variable in which the procedure was stored by a
-@code{define} expression, or @code{#f} if the procedure wasn't created
-by that kind of expression.
-
-Guile's representation of an object property is a procedure-with-setter
-(@pxref{Procedures with Setters}) that can be used with the generalized
-form of @code{set!} (REFFIXME) to set and retrieve that property for any
-Scheme object. So, setting a property looks like this:
-
-@lisp
-(set! (my-property obj1) value-for-obj1)
-(set! (my-property obj2) value-for-obj2)
-@end lisp
-
-@noindent
-And retrieving values of the same property looks like this:
-
-@lisp
-(my-property obj1)
-@result{}
-value-for-obj1
-
-(my-property obj2)
-@result{}
-value-for-obj2
-@end lisp
-
-To create an object property in the first place, use the
-@code{make-object-property} procedure:
-
-@lisp
-(define my-property (make-object-property))
-@end lisp
-
-@deffn {Scheme Procedure} make-object-property
-Create and return an object property. An object property is a
-procedure-with-setter that can be called in two ways. @code{(set!
-(@var{property} @var{obj}) @var{val})} sets @var{obj}'s @var{property}
-to @var{val}. @code{(@var{property} @var{obj})} returns the current
-setting of @var{obj}'s @var{property}.
-@end deffn
-
-A single object property created by @code{make-object-property} can
-associate distinct property values with all Scheme values that are
-distinguishable by @code{eq?} (including, for example, integers).
-
-Internally, object properties are implemented using a weak key hash
-table. This means that, as long as a Scheme value with property values
-is protected from garbage collection, its property values are also
-protected. When the Scheme value is collected, its entry in the
-property table is removed and so the (ex-) property values are no longer
-protected by the table.
-
-@menu
-* Property Primitives:: Low level property implementation.
-* Old-fashioned Properties:: An older approach to properties.
-@end menu
-
-
-@node Property Primitives
-@subsection Low Level Property Implementation.
-
-@deffn {Scheme Procedure} primitive-make-property not_found_proc
-@deffnx {C Function} scm_primitive_make_property (not_found_proc)
-Create a @dfn{property token} that can be used with
-@code{primitive-property-ref} and @code{primitive-property-set!}.
-See @code{primitive-property-ref} for the significance of
-@var{not_found_proc}.
-@end deffn
-
-@deffn {Scheme Procedure} primitive-property-ref prop obj
-@deffnx {C Function} scm_primitive_property_ref (prop, obj)
-Return the property @var{prop} of @var{obj}. When no value
-has yet been associated with @var{prop} and @var{obj}, call
-@var{not-found-proc} instead (see @code{primitive-make-property})
-and use its return value. That value is also associated with
-@var{obj} via @code{primitive-property-set!}. When
-@var{not-found-proc} is @code{#f}, use @code{#f} as the
-default value of @var{prop}.
-@end deffn
-
-@deffn {Scheme Procedure} primitive-property-set! prop obj val
-@deffnx {C Function} scm_primitive_property_set_x (prop, obj, val)
-Associate @var{code} with @var{prop} and @var{obj}.
-@end deffn
-
-@deffn {Scheme Procedure} primitive-property-del! prop obj
-@deffnx {C Function} scm_primitive_property_del_x (prop, obj)
-Remove any value associated with @var{prop} and @var{obj}.
-@end deffn
-
-
-@node Old-fashioned Properties
-@subsection An Older Approach to Properties
-
-Traditionally, Lisp systems provide a different object property
-interface to that provided by @code{make-object-property}, in which the
-object property that is being set or retrieved is indicated by a symbol.
-
-Guile includes this older kind of interface as well, but it may well be
-removed in a future release, as it is less powerful than
-@code{make-object-property} and so increases the size of the Guile
-library for no benefit. (And it is trivial to write a compatibility
-layer in Scheme.)
-
-@deffn {Scheme Procedure} object-properties obj
-@deffnx {C Function} scm_object_properties (obj)
-Return @var{obj}'s property list.
-@end deffn
-
-@deffn {Scheme Procedure} set-object-properties! obj alist
-@deffnx {C Function} scm_set_object_properties_x (obj, alist)
-Set @var{obj}'s property list to @var{alist}.
-@end deffn
-
-@deffn {Scheme Procedure} object-property obj key
-@deffnx {C Function} scm_object_property (obj, key)
-Return the property of @var{obj} with name @var{key}.
-@end deffn
-
-@deffn {Scheme Procedure} set-object-property! obj key value
-@deffnx {C Function} scm_set_object_property_x (obj, key, value)
-In @var{obj}'s property list, set the property named @var{key}
-to @var{value}.
-@end deffn
-
-
-@node Sorting
-@section Sorting
-
-@c FIXME::martin: Review me!
-
-@cindex sorting
-@cindex sorting lists
-@cindex sorting vectors
-
-Sorting is very important in computer programs. Therefore, Guile comes
-with several sorting procedures built-in. As always, procedures with
-names ending in @code{!} are side-effecting, that means that they may
-modify their parameters in order to produce their results.
-
-The first group of procedures can be used to merge two lists (which must
-be already sorted on their own) and produce sorted lists containing
-all elements of the input lists.
-
-@deffn {Scheme Procedure} merge alist blist less
-@deffnx {C Function} scm_merge (alist, blist, less)
-Merge two already sorted lists into one.
-Given two lists @var{alist} and @var{blist}, such that
-@code{(sorted? alist less?)} and @code{(sorted? blist less?)},
-return a new list in which the elements of @var{alist} and
-@var{blist} have been stably interleaved so that
-@code{(sorted? (merge alist blist less?) less?)}.
-Note: this does _not_ accept vectors.
-@end deffn
-
-@deffn {Scheme Procedure} merge! alist blist less
-@deffnx {C Function} scm_merge_x (alist, blist, less)
-Takes two lists @var{alist} and @var{blist} such that
-@code{(sorted? alist less?)} and @code{(sorted? blist less?)} and
-returns a new list in which the elements of @var{alist} and
-@var{blist} have been stably interleaved so that
- @code{(sorted? (merge alist blist less?) less?)}.
-This is the destructive variant of @code{merge}
-Note: this does _not_ accept vectors.
-@end deffn
-
-The following procedures can operate on sequences which are either
-vectors or list. According to the given arguments, they return sorted
-vectors or lists, respectively. The first of the following procedures
-determines whether a sequence is already sorted, the other sort a given
-sequence. The variants with names starting with @code{stable-} are
-special in that they maintain a special property of the input sequences:
-If two or more elements are the same according to the comparison
-predicate, they are left in the same order as they appeared in the
-input.
-
-@deffn {Scheme Procedure} sorted? items less
-@deffnx {C Function} scm_sorted_p (items, less)
-Return @code{#t} iff @var{items} is a list or a vector such that
-for all 1 <= i <= m, the predicate @var{less} returns true when
-applied to all elements i - 1 and i
-@end deffn
-
-@deffn {Scheme Procedure} sort items less
-@deffnx {C Function} scm_sort (items, less)
-Sort the sequence @var{items}, which may be a list or a
-vector. @var{less} is used for comparing the sequence
-elements. This is not a stable sort.
-@end deffn
-
-@deffn {Scheme Procedure} sort! items less
-@deffnx {C Function} scm_sort_x (items, less)
-Sort the sequence @var{items}, which may be a list or a
-vector. @var{less} is used for comparing the sequence
-elements. The sorting is destructive, that means that the
-input sequence is modified to produce the sorted result.
-This is not a stable sort.
-@end deffn
-
-@deffn {Scheme Procedure} stable-sort items less
-@deffnx {C Function} scm_stable_sort (items, less)
-Sort the sequence @var{items}, which may be a list or a
-vector. @var{less} is used for comparing the sequence elements.
-This is a stable sort.
-@end deffn
-
-@deffn {Scheme Procedure} stable-sort! items less
-@deffnx {C Function} scm_stable_sort_x (items, less)
-Sort the sequence @var{items}, which may be a list or a
-vector. @var{less} is used for comparing the sequence elements.
-The sorting is destructive, that means that the input sequence
-is modified to produce the sorted result.
-This is a stable sort.
-@end deffn
-
-The procedures in the last group only accept lists or vectors as input,
-as their names indicate.
-
-@deffn {Scheme Procedure} sort-list items less
-@deffnx {C Function} scm_sort_list (items, less)
-Sort the list @var{items}, using @var{less} for comparing the
-list elements. This is a stable sort.
-@end deffn
-
-@deffn {Scheme Procedure} sort-list! items less
-@deffnx {C Function} scm_sort_list_x (items, less)
-Sort the list @var{items}, using @var{less} for comparing the
-list elements. The sorting is destructive, that means that the
-input list is modified to produce the sorted result.
-This is a stable sort.
-@end deffn
-
-@deffn {Scheme Procedure} restricted-vector-sort! vec less startpos endpos
-@deffnx {C Function} scm_restricted_vector_sort_x (vec, less, startpos, endpos)
-Sort the vector @var{vec}, using @var{less} for comparing
-the vector elements. @var{startpos} and @var{endpos} delimit
-the range of the vector which gets sorted. The return value
-is not specified.
-@end deffn
-
-
-@node Copying
-@section Copying Deep Structures
-
-@c FIXME::martin: Review me!
-
-The procedures for copying lists (@pxref{Lists}) only produce a flat
-copy of the input list, and currently Guile does not even contain
-procedures for copying vectors. @code{copy-tree} can be used for these
-application, as it does not only copy the spine of a list, but also
-copies any pairs in the cars of the input lists.
-
-@deffn {Scheme Procedure} copy-tree obj
-@deffnx {C Function} scm_copy_tree (obj)
-Recursively copy the data tree that is bound to @var{obj}, and return a
-pointer to the new data structure. @code{copy-tree} recurses down the
-contents of both pairs and vectors (since both cons cells and vector
-cells may point to arbitrary objects), and stops recursing when it hits
-any other object.
-@end deffn
-
-
-@node General Conversion
-@section General String Conversion
-
-@c FIXME::martin: Review me!
-
-When debugging Scheme programs, but also for providing a human-friendly
-interface, a procedure for converting any Scheme object into string
-format is very useful. Conversion from/to strings can of course be done
-with specialized procedures when the data type of the object to convert
-is known, but with this procedure, it is often more comfortable.
-
-@code{object->string} converts an object by using a print procedure for
-writing to a string port, and then returning the resulting string.
-Converting an object back from the string is only possible if the object
-type has a read syntax and the read syntax is preserved by the printing
-procedure.
-
-@deffn {Scheme Procedure} object->string obj [printer]
-@deffnx {C Function} scm_object_to_string (obj, printer)
-Return a Scheme string obtained by printing @var{obj}.
-Printing function can be specified by the optional second
-argument @var{printer} (default: @code{write}).
-@end deffn
-
-
-@node Hooks
-@section Hooks
-@tpindex Hooks
-
-A hook is a list of procedures to be called at well defined points in
-time. Typically, an application provides a hook @var{h} and promises
-its users that it will call all of the procedures in @var{h} at a
-defined point in the application's processing. By adding its own
-procedure to @var{h}, an application user can tap into or even influence
-the progress of the application.
-
-Guile itself provides several such hooks for debugging and customization
-purposes: these are listed in a subsection below.
-
-When an application first creates a hook, it needs to know how many
-arguments will be passed to the hook's procedures when the hook is run.
-The chosen number of arguments (which may be none) is declared when the
-hook is created, and all the procedures that are added to that hook must
-be capable of accepting that number of arguments.
-
-A hook is created using @code{make-hook}. A procedure can be added to
-or removed from a hook using @code{add-hook!} or @code{remove-hook!},
-and all of a hook's procedures can be removed together using
-@code{reset-hook!}. When an application wants to run a hook, it does so
-using @code{run-hook}.
-
-@menu
-* Hook Example:: Hook usage by example.
-* Hook Reference:: Reference of all hook procedures.
-* C Hooks:: Hooks for use from C code.
-* Guile Hooks:: Hooks provided by Guile.
-@end menu
-
-
-@node Hook Example
-@subsection Hook Usage by Example
-
-Hook usage is shown by some examples in this section. First, we will
-define a hook of arity 2 --- that is, the procedures stored in the hook
-will have to accept two arguments.
-
-@lisp
-(define hook (make-hook 2))
-hook
-@result{} #<hook 2 40286c90>
-@end lisp
-
-Now we are ready to add some procedures to the newly created hook with
-@code{add-hook!}. In the following example, two procedures are added,
-which print different messages and do different things with their
-arguments.
-
-@lisp
-(add-hook! hook (lambda (x y)
- (display "Foo: ")
- (display (+ x y))
- (newline)))
-(add-hook! hook (lambda (x y)
- (display "Bar: ")
- (display (* x y))
- (newline)))
-@end lisp
-
-Once the procedures have been added, we can invoke the hook using
-@code{run-hook}.
-
-@lisp
-(run-hook hook 3 4)
-@print{} Bar: 12
-@print{} Foo: 7
-@end lisp
-
-Note that the procedures are called in the reverse of the order with
-which they were added. This is because the default behaviour of
-@code{add-hook!} is to add its procedure to the @emph{front} of the
-hook's procedure list. You can force @code{add-hook!} to add its
-procedure to the @emph{end} of the list instead by providing a third
-@code{#t} argument on the second call to @code{add-hook!}.
-
-@lisp
-(add-hook! hook (lambda (x y)
- (display "Foo: ")
- (display (+ x y))
- (newline)))
-(add-hook! hook (lambda (x y)
- (display "Bar: ")
- (display (* x y))
- (newline))
- #t) ; @r{<- Change here!}
-
-(run-hook hook 3 4)
-@print{} Foo: 7
-@print{} Bar: 12
-@end lisp
-
-
-@node Hook Reference
-@subsection Hook Reference
-
-When you create a hook with @code{make-hook}, you must specify the arity
-of the procedures which can be added to the hook. If the arity is not
-given explicitly as an argument to @code{make-hook}, it defaults to
-zero. All procedures of a given hook must have the same arity, and when
-the procedures are invoked using @code{run-hook}, the number of
-arguments passed must match the arity specified at hook creation time.
-
-The order in which procedures are added to a hook matters. If the third
-parameter to @code{add-hook!} is omitted or is equal to @code{#f}, the
-procedure is added in front of the procedures which might already be on
-that hook, otherwise the procedure is added at the end. The procedures
-are always called from the front to the end of the list when they are
-invoked via @code{run-hook}.
-
-The ordering of the list of procedures returned by @code{hook->list}
-matches the order in which those procedures would be called if the hook
-was run using @code{run-hook}.
-
-@deffn {Scheme Procedure} make-hook [n_args]
-@deffnx {C Function} scm_make_hook (n_args)
-Create a hook for storing procedure of arity @var{n_args}.
-@var{n_args} defaults to zero. The returned value is a hook
-object to be used with the other hook procedures.
-@end deffn
-
-@deffn {Scheme Procedure} hook? x
-@deffnx {C Function} scm_hook_p (x)
-Return @code{#t} if @var{x} is a hook, @code{#f} otherwise.
-@end deffn
-
-@deffn {Scheme Procedure} hook-empty? hook
-@deffnx {C Function} scm_hook_empty_p (hook)
-Return @code{#t} if @var{hook} is an empty hook, @code{#f}
-otherwise.
-@end deffn
-
-@deffn {Scheme Procedure} add-hook! hook proc [append_p]
-@deffnx {C Function} scm_add_hook_x (hook, proc, append_p)
-Add the procedure @var{proc} to the hook @var{hook}. The
-procedure is added to the end if @var{append_p} is true,
-otherwise it is added to the front. The return value of this
-procedure is not specified.
-@end deffn
-
-@deffn {Scheme Procedure} remove-hook! hook proc
-@deffnx {C Function} scm_remove_hook_x (hook, proc)
-Remove the procedure @var{proc} from the hook @var{hook}. The
-return value of this procedure is not specified.
-@end deffn
-
-@deffn {Scheme Procedure} reset-hook! hook
-@deffnx {C Function} scm_reset_hook_x (hook)
-Remove all procedures from the hook @var{hook}. The return
-value of this procedure is not specified.
-@end deffn
-
-@deffn {Scheme Procedure} hook->list hook
-@deffnx {C Function} scm_hook_to_list (hook)
-Convert the procedure list of @var{hook} to a list.
-@end deffn
-
-@deffn {Scheme Procedure} run-hook hook . args
-@deffnx {C Function} scm_run_hook (hook, args)
-Apply all procedures from the hook @var{hook} to the arguments
-@var{args}. The order of the procedure application is first to
-last. The return value of this procedure is not specified.
-@end deffn
-
-If, in C code, you are certain that you have a hook object and well
-formed argument list for that hook, you can also use
-@code{scm_c_run_hook}, which is identical to @code{scm_run_hook} but
-does no type checking.
-
-@deftypefn {C Function} void scm_c_run_hook (SCM hook, SCM args)
-The same as @code{scm_run_hook} but without any type checking to confirm
-that @var{hook} is actually a hook object and that @var{args} is a
-well-formed list matching the arity of the hook.
-@end deftypefn
-
-
-@node C Hooks
-@subsection Hooks For C Code.
-
-The hooks already described are intended to be populated by Scheme-level
-procedures. In addition to this, the Guile library provides an
-independent set of interfaces for the creation and manipulation of hooks
-that are designed to be populated by functions implemented in C.
-
-The original motivation here was to provide a kind of hook that could
-safely be invoked at various points during garbage collection.
-Scheme-level hooks are unsuitable for this purpose as running them could
-itself require memory allocation, which would then invoke garbage
-collection recursively @dots{} However, it is also the case that these
-hooks are easier to work with than the Scheme-level ones if you only
-want to register C functions with them. So if that is mainly what your
-code needs to do, you may prefer to use this interface.
-
-To create a C hook, you should allocate storage for a structure of type
-@code{scm_t_c_hook} and then initialize it using @code{scm_c_hook_init}.
-
-@deftp {C Type} scm_t_c_hook
-Data type for a C hook. The internals of this type should be treated as
-opaque.
-@end deftp
-
-@deftp {C Enum} scm_t_c_hook_type
-Enumeration of possible hook types, which are:
-
-@table @code
-@item SCM_C_HOOK_NORMAL
-@vindex SCM_C_HOOK_NORMAL
-Type of hook for which all the registered functions will always be called.
-@item SCM_C_HOOK_OR
-@vindex SCM_C_HOOK_OR
-Type of hook for which the sequence of registered functions will be
-called only until one of them returns C true (a non-NULL pointer).
-@item SCM_C_HOOK_AND
-@vindex SCM_C_HOOK_AND
-Type of hook for which the sequence of registered functions will be
-called only until one of them returns C false (a NULL pointer).
-@end table
-@end deftp
-
-@deftypefn {C Function} void scm_c_hook_init (scm_t_c_hook *hook, void *hook_data, scm_t_c_hook_type type)
-Initialize the C hook at memory pointed to by @var{hook}. @var{type}
-should be one of the values of the @code{scm_t_c_hook_type} enumeration,
-and controls how the hook functions will be called. @var{hook_data} is
-a closure parameter that will be passed to all registered hook functions
-when they are called.
-@end deftypefn
-
-To add or remove a C function from a C hook, use @code{scm_c_hook_add}
-or @code{scm_c_hook_remove}. A hook function must expect three
-@code{void *} parameters which are, respectively:
-
-@table @var
-@item hook_data
-The hook closure data that was specified at the time the hook was
-initialized by @code{scm_c_hook_init}.
-
-@item func_data
-The function closure data that was specified at the time that that
-function was registered with the hook by @code{scm_c_hook_add}.
-
-@item data
-The call closure data specified by the @code{scm_c_hook_run} call that
-runs the hook.
-@end table
-
-@deftp {C Type} scm_t_c_hook_function
-Function type for a C hook function: takes three @code{void *}
-parameters and returns a @code{void *} result.
-@end deftp
-
-@deftypefn {C Function} void scm_c_hook_add (scm_t_c_hook *hook, scm_t_c_hook_function func, void *func_data, int appendp)
-Add function @var{func}, with function closure data @var{func_data}, to
-the C hook @var{hook}. The new function is appended to the hook's list
-of functions if @var{appendp} is non-zero, otherwise prepended.
-@end deftypefn
-
-@deftypefn {C Function} void scm_c_hook_remove (scm_t_c_hook *hook, scm_t_c_hook_function func, void *func_data)
-Remove function @var{func}, with function closure data @var{func_data},
-from the C hook @var{hook}. @code{scm_c_hook_remove} checks both
-@var{func} and @var{func_data} so as to allow for the same @var{func}
-being registered multiple times with different closure data.
-@end deftypefn
-
-Finally, to invoke a C hook, call the @code{scm_c_hook_run} function
-specifying the hook and the call closure data for this run:
-
-@deftypefn {C Function} void * scm_c_hook_run (scm_t_c_hook *hook, void *data)
-Run the C hook @var{hook} will call closure data @var{data}. Subject to
-the variations for hook types @code{SCM_C_HOOK_OR} and
-@code{SCM_C_HOOK_AND}, @code{scm_c_hook_run} calls @var{hook}'s
-registered functions in turn, passing them the hook's closure data, each
-function's closure data, and the call closure data.
-
-@code{scm_c_hook_run}'s return value is the return value of the last
-function to be called.
-@end deftypefn
-
-
-@node Guile Hooks
-@subsection Hooks Provided by Guile
-
-@menu
-* GC Hooks:: Garbage collection hooks.
-* REPL Hooks:: Hooks into the Guile REPL.
-@end menu
-
-
-@node GC Hooks
-@subsubsection Hooks for Garbage Collection
-
-Whenever Guile performs a garbage collection, it calls the following
-hooks in the order shown.
-
-@defvr {C Hook} scm_before_gc_c_hook
-C hook called at the very start of a garbage collection, after setting
-@code{scm_gc_running_p} to 1, but before entering the GC critical
-section.
-
-If garbage collection is blocked because @code{scm_block_gc} is
-non-zero, GC exits early soon after calling this hook, and no further
-hooks will be called.
-@end defvr
-
-@defvr {C Hook} scm_before_mark_c_hook
-C hook called before beginning the mark phase of garbage collection,
-after the GC thread has entered a critical section.
-@end defvr
-
-@defvr {C Hook} scm_before_sweep_c_hook
-C hook called before beginning the sweep phase of garbage collection.
-This is the same as at the end of the mark phase, since nothing else
-happens between marking and sweeping.
-@end defvr
-
-@defvr {C Hook} scm_after_sweep_c_hook
-C hook called after the end of the sweep phase of garbage collection,
-but while the GC thread is still inside its critical section.
-@end defvr
-
-@defvr {C Hook} scm_after_gc_c_hook
-C hook called at the very end of a garbage collection, after the GC
-thread has left its critical section.
-@end defvr
-
-@defvr {Scheme Hook} after-gc-hook
-@vindex scm_after_gc_hook
-Scheme hook with arity 0. This hook is run asynchronously
-(@pxref{Asyncs}) soon after the GC has completed and any other events
-that were deferred during garbage collection have been processed. (Also
-accessible from C with the name @code{scm_after_gc_hook}.)
-@end defvr
-
-All the C hooks listed here have type @code{SCM_C_HOOK_NORMAL}, are
-initialized with hook closure data NULL, are are invoked by
-@code{scm_c_hook_run} with call closure data NULL.
-
-@cindex guardians, testing for GC'd objects
-The Scheme hook @code{after-gc-hook} is particularly useful in
-conjunction with guardians (@pxref{Guardians}). Typically, if you are
-using a guardian, you want to call the guardian after garbage collection
-to see if any of the objects added to the guardian have been collected.
-By adding a thunk that performs this call to @code{after-gc-hook}, you
-can ensure that your guardian is tested after every garbage collection
-cycle.
-
-
-@node REPL Hooks
-@subsubsection Hooks into the Guile REPL
-
-
-@c Local Variables:
-@c TeX-master: "guile.texi"
-@c End:
diff --git a/doc/ref/scm.texi b/doc/ref/scm.texi
deleted file mode 100644
index d4a634eb9..000000000
--- a/doc/ref/scm.texi
+++ /dev/null
@@ -1,181 +0,0 @@
-@page
-@node API Overview
-@chapter Overview of the Guile API
-
-Guile's application programming interface (@dfn{API}) makes
-functionality available that an application developer can use in either
-C or Scheme programming. The interface consists of @dfn{elements} that
-may be macros, functions or variables in C, and procedures, variables,
-syntax or other types of object in Scheme. Broadly speaking, the
-interface as a whole can be divided into three groups.
-
-@enumerate
-@item
-Elements that are available equivalently as C functions or Scheme
-procedures.
-
-@item
-Elements that are only available as macros, functions or variables for C
-programming.
-
-@item
-Elements that are only available as procedures or other objects in
-Scheme.
-@end enumerate
-
-Functions/procedures in the first group are often known as
-@dfn{primitives}, @dfn{subrs} or @dfn{builtins}. An example is the
-@code{assq} Scheme procedure, which is also available as @code{scm_assq}
-in C.
-
-Elements in the second and third groups exist because they provide
-additional language-specific benefits in either Scheme or C. Examples
-are the C macro @code{SCM_CONSP}, which is faster and more convenient in
-C programming than the primitive @code{scm_pair_p}, and the
-procedure-with-setter @code{make-object-property}, which provides a
-more convenient property handling interface in Scheme than the
-primitives on which it is based.
-
-@menu
-* Primitives:: Identical function for Scheme and C.
-* C Only:: Elements only available in C.
-* Scheme Only:: Elements only available in Scheme.
-* Reference Layout:: The layout of this part of the manual.
-@end menu
-
-
-@node Primitives
-@section Identical Function in both Scheme and C
-
-They form the majority of the API, and allow both C and Scheme
-programmers to perform identical operations.
-
-@c @node Scheme Primitives
-@c @chapter Writing Scheme primitives in C
-@c - according to the menu in guile.texi - NJ 2001/1/26
-@c @chapter Relationship between Scheme and C functions
-
-@c Chapter contents contributed by Thien-Thi Nguyen <ttn@gnu.org>.
-
-Scheme procedures marked "primitive functions" have a regular interface
-when calling from C, reflected in two areas: the name of a C function, and
-the convention for passing non-required arguments to this function.
-
-@c Although the vast majority of functions support these relationships,
-@c there are some exceptions.
-
-@menu
-* Transforming Scheme name to C name::
-* Structuring argument lists for C functions::
-@c * Exceptions to the regularity::
-@end menu
-
-
-@node Transforming Scheme name to C name
-@subsection Transforming Scheme name to C name
-
-Normally, the name of a C function can be derived given its Scheme name,
-using some simple textual transformations:
-
-@itemize @bullet
-
-@item
-Replace @code{-} (hyphen) with @code{_} (underscore).
-
-@item
-Replace @code{?} (question mark) with "_p".
-
-@item
-Replace @code{!} (exclamation point) with "_x".
-
-@item
-Replace internal @code{->} with "_to_".
-
-@item
-Replace @code{<=} (less than or equal) with "_leq".
-
-@item
-Replace @code{>=} (greater than or equal) with "_geq".
-
-@item
-Replace @code{<} (less than) with "_less".
-
-@item
-Replace @code{>} (greater than) with "_gr".
-
-@item
-Replace @code{@@} with "at". [Omit?]
-
-@item
-Prefix with "gh_" (or "scm_" if you are ignoring the gh interface).
-
-@item
-[Anything else? --ttn, 2000/01/16 15:17:28]
-
-@end itemize
-
-Here is an Emacs Lisp command that prompts for a Scheme function name and
-inserts the corresponding C function name into the buffer.
-
-@example
-(defun insert-scheme-to-C (name &optional use-gh)
- "Transforms Scheme NAME, a string, to its C counterpart, and inserts it.
-Prefix arg non-nil means use \"gh_\" prefix, otherwise use \"scm_\" prefix."
- (interactive "sScheme name: \nP")
- (let ((transforms '(("-" . "_")
- ("?" . "_p")
- ("!" . "_x")
- ("->" . "_to_")
- ("<=" . "_leq")
- (">=" . "_geq")
- ("<" . "_less")
- (">" . "_gr")
- ("@@" . "at"))))
- (while transforms
- (let ((trigger (concat "\\(.*\\)"
- (regexp-quote (caar transforms))
- "\\(.*\\)"))
- (sub (cdar transforms))
- (m nil))
- (while (setq m (string-match trigger name))
- (setq name (concat (match-string 1 name)
- sub
- (match-string 2 name)))))
- (setq transforms (cdr transforms))))
- (insert (if use-gh "gh_" "scm_") name))
-@end example
-
-
-@node Structuring argument lists for C functions
-@subsection Structuring argument lists for C functions
-
-The C function's arguments will be all of the Scheme procedure's
-arguments, both required and optional; if the Scheme procedure takes a
-``rest'' argument, that will be a final argument to the C function. The
-C function's arguments, as well as its return type, will be @code{SCM}.
-
-
-@node C Only
-@section Elements Available Only in C
-
-For C this is usually a matter of better performance (e.g. the
-@code{SCM_CONSP} macro) or of accepting C language types rather than the
-generic @code{SCM}.
-
-
-@node Scheme Only
-@section Elements Available Only in Scheme
-
-
-@node Reference Layout
-@section Reference Material Layout
-
-This part of the reference manual documents all of Guile's core
-Scheme-level language and features in functionally-related groups.
-Where a particular section of the manual includes both R5RS-compliant
-parts and Guile-specific extensions, the text indicates which parts of
-the documentation describe R5RS behaviour and which parts describe Guile
-extensions.
-
-For a quick way of identifying the parts of Guile that implement
-R5RS-compliant features, see the R5RS index: @ref{R5RS Index}.
diff --git a/doc/ref/script-getopt.texi b/doc/ref/script-getopt.texi
deleted file mode 100644
index c71dbd205..000000000
--- a/doc/ref/script-getopt.texi
+++ /dev/null
@@ -1,435 +0,0 @@
-@page
-@node Command Line Handling
-@chapter Handling Command Line Options and Arguments
-
-@c This chapter was written and contributed by Martin Grabmueller.
-
-The ability to accept and handle command line arguments is very
-important when writing Guile scripts to solve particular problems, such
-as extracting information from text files or interfacing with existing
-command line applications. This chapter describes how Guile makes
-command line arguments available to a Guile script, and the utilities
-that Guile provides to help with the processing of command line
-arguments.
-
-@menu
-* Command Line Args:: Using command line arguments.
-* getopt-long:: The (ice-9 getopt-long) module.
-@end menu
-
-
-@node Command Line Args
-@section Using Command Line Arguments
-
-When a Guile script is invoked, Guile makes the command line arguments
-accessible via the procedure @code{command-line}, which returns the
-arguments as a list of strings.
-
-For example, if the script
-
-@example
-#! /usr/local/bin/guile -s
-!#
-(write (command-line))
-(newline)
-@end example
-
-@noindent
-is saved in a file @file{cmdline-test.scm} and invoked using the command
-line @code{./cmdline-test.scm bar.txt -o foo -frumple grob}, the output
-is
-
-@example
-("./cmdline-test.scm" "bar.txt" "-o" "foo" "-frumple" "grob")
-@end example
-
-If the script invocation includes a @code{-e} option, specifying a
-procedure to call after loading the script, Guile will call that
-procedure with @code{(command-line)} as its argument. So a script that
-uses @code{-e} doesn't need to refer explicitly to @code{command-line}
-in its code. For example, the script above would have identical
-behaviour if it was written instead like this:
-
-@example
-#! /usr/local/bin/guile \
--e main -s
-!#
-(define (main args)
- (write args)
- (newline))
-@end example
-
-(Note the use of the meta switch @code{\} so that the script invocation
-can include more than one Guile option: @xref{The Meta Switch}.)
-
-These scripts use the @code{#!} POSIX convention so that they can be
-executed using their own file names directly, as in the example command
-line @code{./cmdline-test.scm bar.txt -o foo -frumple grob}. But they
-can also be executed by typing out the implied Guile command line in
-full, as in:
-
-@example
-$ guile -s ./cmdline-test.scm bar.txt -o foo -frumple grob
-@end example
-
-@noindent
-or
-
-@example
-$ guile -e main -s ./cmdline-test2.scm bar.txt -o foo -frumple grob
-@end example
-
-Even when a script is invoked using this longer form, the arguments that
-the script receives are the same as if it had been invoked using the
-short form. Guile ensures that the @code{(command-line)} or @code{-e}
-arguments are independent of how the script is invoked, by stripping off
-the arguments that Guile itself processes.
-
-
-@node getopt-long
-@section The (ice-9 getopt-long) Module
-
-A script is free to parse and handle its command line arguments in any
-way that it chooses. Where the set of possible options and arguments is
-complex, however, it can get tricky to extract all the options, check
-the validity of given arguments, and so on. This task can be greatly
-simplified by taking advantage of the module @code{(ice-9 getopt-long)},
-which is distributed with Guile.
-
-The @code{(ice-9 getopt-long)} module exports two procedures:
-@code{getopt-long} and @code{option-ref}.
-
-@itemize @bullet
-@item
-@code{getopt-long} takes a list of strings --- the command line
-arguments --- and an @dfn{option specification}. It parses the command
-line arguments according to the option specification and returns a data
-structure that encapsulates the results of the parsing.
-
-@item
-@code{option-ref} then takes the parsed data structure and a specific
-option's name, and returns information about that option in particular.
-@end itemize
-
-To make these procedures available to your Guile script, include the
-expression @code{(use-modules (ice-9 getopt-long))} somewhere near the
-top, before the first usage of @code{getopt-long} or @code{option-ref}.
-
-@menu
-* getopt-long Example:: A short getopt-long example.
-* Option Specification:: How to write an option specification.
-* Command Line Format:: The expected command line format.
-* getopt-long Reference:: Full documentation for @code{getopt-long}.
-* option-ref Reference:: Full documentation for @code{option-ref}.
-@end menu
-
-
-@node getopt-long Example
-@subsection A Short getopt-long Example
-
-This subsection illustrates how @code{getopt-long} is used by presenting
-and dissecting a simple example. The first thing that we need is an
-@dfn{option specification} that tells @code{getopt-long} how to parse
-the command line. This specification is an association list with the
-long option name as the key. Here is how such a specification might
-look:
-
-@lisp
-(define option-spec
- '((version (single-char #\v) (value #f))
- (help (single-char #\h) (value #f))))
-@end lisp
-
-This alist tells @code{getopt-long} that it should accept two long
-options, called @emph{version} and @emph{help}, and that these options
-can also be selected by the single-letter abbreviations @emph{v} and
-@emph{h}, respectively. The @code{(value #f)} clauses indicate that
-neither of the options accepts a value.
-
-With this specification we can use @code{getopt-long} to parse a given
-command line:
-
-@lisp
-(define options (getopt-long (command-line) option-spec))
-@end lisp
-
-After this call, @code{options} contains the parsed command line and is
-ready to be examined by @code{option-ref}. @code{option-ref} is called
-like this:
-
-@lisp
-(option-ref options 'help #f)
-@end lisp
-
-@noindent
-It expects the parsed command line, a symbol indicating the option to
-examine, and a default value. The default value is returned if the
-option was not present in the command line, or if the option was present
-but without a value; otherwise the value from the command line is
-returned. Usually @code{option-ref} is called once for each possible
-option that a script supports.
-
-The following example shows a main program which puts all this together
-to parse its command line and figure out what the user wanted.
-
-@lisp
-(define (main args)
- (let* ((option-spec '((version (single-char #\v) (value #f))
- (help (single-char #\h) (value #f))))
- (options (getopt-long args option-spec))
- (help-wanted (option-ref options 'help #f))
- (version-wanted (option-ref options 'version #f)))
- (if (or version-wanted help-wanted)
- (begin
- (if version-wanted
- (display "getopt-long-example version 0.3\n"))
- (if help-wanted
- (display "\
-getopt-long-example [options]
- -v, --version Display version
- -h, --help Display this help
-")))
- (begin
- (display "Hello, World!") (newline)))))
-@end lisp
-
-
-@node Option Specification
-@subsection How to Write an Option Specification
-
-An option specification is an association list (@pxref{Association
-Lists}) with one list element for each supported option. The key of each
-list element is a symbol that names the option, while the value is a
-list of option properties:
-
-@lisp
-OPTION-SPEC ::= '( (OPT-NAME1 (PROP-NAME PROP-VALUE) @dots{})
- (OPT-NAME2 (PROP-NAME PROP-VALUE) @dots{})
- (OPT-NAME3 (PROP-NAME PROP-VALUE) @dots{})
- @dots{}
- )
-@end lisp
-
-Each @var{opt-name} specifies the long option name for that option. For
-example, a list element with @var{opt-name} @code{background} specifies
-an option that can be specified on the command line using the long
-option @code{--background}. Further information about the option ---
-whether it takes a value, whether it is required to be present in the
-command line, and so on --- is specified by the option properties.
-
-In the example of the preceding subsection, we already saw that a long
-option name can have a equivalent @dfn{short option} character. The
-equivalent short option character can be set for an option by specifying
-a @code{single-char} property in that option's property list. For
-example, a list element like @code{'(output (single-char #\o) @dots{})}
-specifies an option with long name @code{--output} that can also be
-specified by the equivalent short name @code{-o}.
-
-The @code{value} property specifies whether an option requires or
-accepts a value. If the @code{value} property is set to @code{#t}, the
-option requires a value: @code{getopt-long} will signal an error if the
-option name is present without a corresponding value. If set to
-@code{#f}, the option does not take a value; in this case, a non-option
-word that follows the option name in the command line will be treated as
-a non-option argument. If set to the symbol @code{optional}, the option
-accepts a value but does not require one: a non-option word that follows
-the option name in the command line will be interpreted as that option's
-value. If the option name for an option with @code{'(value optional)}
-is immediately followed in the command line by @emph{another} option
-name, the value for the first option is implicitly @code{#t}.
-
-The @code{required?} property indicates whether an option is required to
-be present in the command line. If the @code{required?} property is
-set to @code{#t}, @code{getopt-long} will signal an error if the option
-is not specified.
-
-Finally, the @code{predicate} property can be used to constrain the
-possible values of an option. If used, the @code{predicate} property
-should be set to a procedure that takes one argument --- the proposed
-option value as a string --- and returns either @code{#t} or @code{#f}
-according as the proposed value is or is not acceptable. If the
-predicate procedure returns @code{#f}, @code{getopt-long} will signal an
-error.
-
-By default, options do not have single-character equivalents, are not
-required, and do not take values. Where the list element for an option
-includes a @code{value} property but no @code{predicate} property, the
-option values are unconstrained.
-
-
-@node Command Line Format
-@subsection Expected Command Line Format
-
-In order for @code{getopt-long} to correctly parse a command line, that
-command line must conform to a standard set of rules for how command
-line options are specified. This subsection explains what those rules
-are.
-
-@code{getopt-long} splits a given command line into several pieces. All
-elements of the argument list are classified to be either options or
-normal arguments. Options consist of two dashes and an option name
-(so-called @dfn{long} options), or of one dash followed by a single
-letter (@dfn{short} options).
-
-Options can behave as switches, when they are given without a value, or
-they can be used to pass a value to the program. The value for an
-option may be specified using an equals sign, or else is simply the next
-word in the command line, so the following two invocations are
-equivalent:
-
-@example
-$ ./foo.scm --output=bar.txt
-$ ./foo.scm --output bar.txt
-@end example
-
-Short options can be used instead of their long equivalents and can be
-grouped together after a single dash. For example, the following
-commands are equivalent.
-
-@example
-$ ./foo.scm --version --help
-$ ./foo.scm -v --help
-$ ./foo.scm -vh
-@end example
-
-If an option requires a value, it can only be grouped together with other
-short options if it is the last option in the group; the value is the
-next argument. So, for example, with the following option
-specification ---
-
-@lisp
-((apples (single-char #\a))
- (blimps (single-char #\b) (value #t))
- (catalexis (single-char #\c) (value #t)))
-@end lisp
-
-@noindent
---- the following command lines would all be acceptable:
-
-@example
-$ ./foo.scm -a -b bang -c couth
-$ ./foo.scm -ab bang -c couth
-$ ./foo.scm -ac couth -b bang
-@end example
-
-But the next command line is an error, because @code{-b} is not the last
-option in its combination, and because a group of short options cannot
-include two options that both require values:
-
-@example
-$ ./foo.scm -abc couth bang
-@end example
-
-If an option's value is optional, @code{getopt-long} decides whether the
-option has a value by looking at what follows it in the argument list.
-If the next element is a string, and it does not appear to be an option
-itself, then that string is the option's value.
-
-If the option @code{--} appears in the argument list, argument parsing
-stops there and subsequent arguments are returned as ordinary arguments,
-even if they resemble options. So, with the command line
-
-@example
-$ ./foo.scm --apples "Granny Smith" -- --blimp Goodyear
-@end example
-
-@noindent
-@code{getopt-long} will recognize the @code{--apples} option as having
-the value "Granny Smith", but will not treat @code{--blimp} as an
-option. The strings @code{--blimp} and @code{Goodyear} will be returned
-as ordinary argument strings.
-
-
-@node getopt-long Reference
-@subsection Reference Documentation for @code{getopt-long}
-
-@deffn {Scheme Procedure} getopt-long args grammar
-Parse the command line given in @var{args} (which must be a list of
-strings) according to the option specification @var{grammar}.
-
-The @var{grammar} argument is expected to be a list of this form:
-
-@code{((@var{option} (@var{property} @var{value}) @dots{}) @dots{})}
-
-where each @var{option} is a symbol denoting the long option, but
-without the two leading dashes (e.g. @code{version} if the option is
-called @code{--version}).
-
-For each option, there may be list of arbitrarily many property/value
-pairs. The order of the pairs is not important, but every property may
-only appear once in the property list. The following table lists the
-possible properties:
-
-@table @asis
-@item @code{(single-char @var{char})}
-Accept @code{-@var{char}} as a single-character equivalent to
-@code{--@var{option}}. This is how to specify traditional Unix-style
-flags.
-@item @code{(required? @var{bool})}
-If @var{bool} is true, the option is required. @code{getopt-long} will
-raise an error if it is not found in @var{args}.
-@item @code{(value @var{bool})}
-If @var{bool} is @code{#t}, the option accepts a value; if it is
-@code{#f}, it does not; and if it is the symbol @code{optional}, the
-option may appear in @var{args} with or without a value.
-@item @code{(predicate @var{func})}
-If the option accepts a value (i.e. you specified @code{(value #t)} for
-this option), then @code{getopt-long} will apply @var{func} to the
-value, and throw an exception if it returns @code{#f}. @var{func}
-should be a procedure which accepts a string and returns a boolean
-value; you may need to use quasiquotes to get it into @var{grammar}.
-@end table
-@end deffn
-
-@code{getopt-long}'s @var{args} parameter is expected to be a list of
-strings like the one returned by @code{command-line}, with the first
-element being the name of the command. Therefore @code{getopt-long}
-ignores the first element in @var{args} and starts argument
-interpretation with the second element.
-
-@code{getopt-long} signals an error if any of the following conditions
-hold.
-
-@itemize @bullet
-@item
-The option grammar has an invalid syntax.
-
-@item
-One of the options in the argument list was not specified by the
-grammar.
-
-@item
-A required option is omitted.
-
-@item
-An option which requires an argument did not get one.
-
-@item
-An option that doesn't accept an argument does get one (this can only
-happen using the long option @code{--opt=@var{value}} syntax).
-
-@item
-An option predicate fails.
-@end itemize
-
-
-@node option-ref Reference
-@subsection Reference Documentation for @code{option-ref}
-
-@deffn {Scheme Procedure} option-ref options key default
-Search @var{options} for a command line option named @var{key} and
-return its value, if found. If the option has no value, but was given,
-return @code{#t}. If the option was not given, return @var{default}.
-@var{options} must be the result of a call to @code{getopt-long}.
-@end deffn
-
-@code{option-ref} always succeeds, either by returning the requested
-option value from the command line, or the default value.
-
-The special key @code{'()} can be used to get a list of all
-non-option arguments.
-
-
-@c Local Variables:
-@c TeX-master: "guile.texi"
-@c End:
diff --git a/doc/ref/scripts.texi b/doc/ref/scripts.texi
deleted file mode 100644
index 10549dc12..000000000
--- a/doc/ref/scripts.texi
+++ /dev/null
@@ -1,225 +0,0 @@
-@page
-@node Guile Scripting
-@chapter Guile Scripting
-
-Like AWK, Perl, or any shell, Guile can interpret script files. A Guile
-script is simply a file of Scheme code with some extra information at
-the beginning which tells the operating system how to invoke Guile, and
-then tells Guile how to handle the Scheme code.
-
-@menu
-* Invoking Guile:: How to start a Guile script.
-* The Meta Switch:: Passing complex argument lists to Guile
- from shell scripts.
-@end menu
-
-@node Invoking Guile
-@section Invoking Guile
-
-Here we describe Guile's command-line processing in detail. Guile
-processes its arguments from left to right, recognizing the switches
-described below. For examples, see @ref{Scripting Examples}.
-
-@table @code
-
-@item -s @var{script} @var{arg...}
-Read and evaluate Scheme source code from the file @var{script}, as the
-@code{load} function would. After loading @var{script}, exit. Any
-command-line arguments @var{arg...} following @var{script} become the
-script's arguments; the @code{command-line} function returns a list of
-strings of the form @code{(@var{script} @var{arg...})}.
-
-@item -c @var{expr} @var{arg...}
-Evaluate @var{expr} as Scheme code, and then exit. Any command-line
-arguments @var{arg...} following @var{expr} become command-line arguments; the
-@code{command-line} function returns a list of strings of the form
-@code{(@var{guile} @var{arg...})}, where @var{guile} is the path of the
-Guile executable.
-
-@item -- @var{arg...}
-Run interactively, prompting the user for expressions and evaluating
-them. Any command-line arguments @var{arg...} following the @code{--}
-become command-line arguments for the interactive session; the
-@code{command-line} function returns a list of strings of the form
-@code{(@var{guile} @var{arg...})}, where @var{guile} is the path of the
-Guile executable.
-
-@item -l @var{file}
-Load Scheme source code from @var{file}, and continue processing the
-command line.
-
-@item -e @var{function}
-Make @var{function} the @dfn{entry point} of the script. After loading
-the script file (with @code{-s}) or evaluating the expression (with
-@code{-c}), apply @var{function} to a list containing the program name
-and the command-line arguments --- the list provided by the
-@code{command-line} function.
-
-A @code{-e} switch can appear anywhere in the argument list, but Guile
-always invokes the @var{function} as the @emph{last} action it performs.
-This is weird, but because of the way script invocation works under
-POSIX, the @code{-s} option must always come last in the list.
-
-@xref{Scripting Examples}.
-
-@item -ds
-Treat a final @code{-s} option as if it occurred at this point in the
-command line; load the script here.
-
-This switch is necessary because, although the POSIX script invocation
-mechanism effectively requires the @code{-s} option to appear last, the
-programmer may well want to run the script before other actions
-requested on the command line. For examples, see @ref{Scripting
-Examples}.
-
-@item \
-Read more command-line arguments, starting from the second line of the
-script file. @xref{The Meta Switch}.
-
-@item --emacs
-Assume Guile is running as an inferior process of Emacs, and use a
-special protocol to communicate with Emacs's Guile interaction mode.
-This switch sets the global variable use-emacs-interface to @code{#t}.
-
-This switch is still experimental.
-
-@item --use-srfi=@var{list}
-The option @code{--use-srfi} expects a comma-separated list of numbers,
-each representing a SRFI number to be loaded into the interpreter
-before starting evaluating a script file or the REPL. Additionally,
-the feature identifier for the loaded SRFIs is recognized by
-`cond-expand' when using this option.
-
-@example
-guile --use-srfi=8,13
-@end example
-
-@item --debug
-Start with the debugging evaluator and enable backtraces. Using the
-debugging evaluator will give you better error messages but it will
-slow down execution. By default, the debugging evaluator is only used
-when entering an interactive session. When executing a script with
-@code{-s} or @code{-c}, the normal, faster evaluator is used by default.
-
-@vnew{1.8}
-@item --no-debug
-Do not use the debugging evaluator, even when entering an interactive
-session.
-
-@item -h@r{, }--help
-Display help on invoking Guile, and then exit.
-
-@item -v@r{, }--version
-Display the current version of Guile, and then exit.
-
-@end table
-
-
-@node The Meta Switch
-@section The Meta Switch
-
-Guile's command-line switches allow the programmer to describe
-reasonably complicated actions in scripts. Unfortunately, the POSIX
-script invocation mechanism only allows one argument to appear on the
-@samp{#!} line after the path to the Guile executable, and imposes
-arbitrary limits on that argument's length. Suppose you wrote a script
-starting like this:
-@example
-#!/usr/local/bin/guile -e main -s
-!#
-(define (main args)
- (map (lambda (arg) (display arg) (display " "))
- (cdr args))
- (newline))
-@end example
-The intended meaning is clear: load the file, and then call @code{main}
-on the command-line arguments. However, the system will treat
-everything after the Guile path as a single argument --- the string
-@code{"-e main -s"} --- which is not what we want.
-
-As a workaround, the meta switch @code{\} allows the Guile programmer to
-specify an arbitrary number of options without patching the kernel. If
-the first argument to Guile is @code{\}, Guile will open the script file
-whose name follows the @code{\}, parse arguments starting from the
-file's second line (according to rules described below), and substitute
-them for the @code{\} switch.
-
-Working in concert with the meta switch, Guile treats the characters
-@samp{#!} as the beginning of a comment which extends through the next
-line containing only the characters @samp{!#}. This sort of comment may
-appear anywhere in a Guile program, but it is most useful at the top of
-a file, meshing magically with the POSIX script invocation mechanism.
-
-Thus, consider a script named @file{/u/jimb/ekko} which starts like this:
-@example
-#!/usr/local/bin/guile \
--e main -s
-!#
-(define (main args)
- (map (lambda (arg) (display arg) (display " "))
- (cdr args))
- (newline))
-@end example
-
-Suppose a user invokes this script as follows:
-@example
-$ /u/jimb/ekko a b c
-@end example
-
-Here's what happens:
-@itemize @bullet
-
-@item
-the operating system recognizes the @samp{#!} token at the top of the
-file, and rewrites the command line to:
-@example
-/usr/local/bin/guile \ /u/jimb/ekko a b c
-@end example
-This is the usual behavior, prescribed by POSIX.
-
-@item
-When Guile sees the first two arguments, @code{\ /u/jimb/ekko}, it opens
-@file{/u/jimb/ekko}, parses the three arguments @code{-e}, @code{main},
-and @code{-s} from it, and substitutes them for the @code{\} switch.
-Thus, Guile's command line now reads:
-@example
-/usr/local/bin/guile -e main -s /u/jimb/ekko a b c
-@end example
-
-@item
-Guile then processes these switches: it loads @file{/u/jimb/ekko} as a
-file of Scheme code (treating the first three lines as a comment), and
-then performs the application @code{(main "/u/jimb/ekko" "a" "b" "c")}.
-
-@end itemize
-
-
-When Guile sees the meta switch @code{\}, it parses command-line
-argument from the script file according to the following rules:
-@itemize @bullet
-
-@item
-Each space character terminates an argument. This means that two
-spaces in a row introduce an argument @code{""}.
-
-@item
-The tab character is not permitted (unless you quote it with the
-backslash character, as described below), to avoid confusion.
-
-@item
-The newline character terminates the sequence of arguments, and will
-also terminate a final non-empty argument. (However, a newline
-following a space will not introduce a final empty-string argument;
-it only terminates the argument list.)
-
-@item
-The backslash character is the escape character. It escapes backslash,
-space, tab, and newline. The ANSI C escape sequences like @code{\n} and
-@code{\t} are also supported. These produce argument constituents; the
-two-character combination @code{\n} doesn't act like a terminating
-newline. The escape sequence @code{\@var{NNN}} for exactly three octal
-digits reads as the character whose ASCII code is @var{NNN}. As above,
-characters produced this way are argument constituents. Backslash
-followed by other characters is not allowed.
-
-@end itemize
diff --git a/doc/ref/scsh.texi b/doc/ref/scsh.texi
deleted file mode 100644
index 56177e78f..000000000
--- a/doc/ref/scsh.texi
+++ /dev/null
@@ -1,18 +0,0 @@
-@page
-@node The Scheme shell (scsh)
-@chapter The Scheme shell (scsh)
-
-An incomplete port of the Scheme shell (scsh) is available for Guile
-as a separate package. The current status of guile-scsh can be found at
-@url{http://arglist.com/guile/}.
-
-For information about scsh see
-@url{http://www-swiss.ai.mit.edu/ftpdir/scsh/}.
-
-The closest emulation of scsh can be obtained by running:
-
-@smalllisp
-(load-from-path "scsh/init")
-@end smalllisp
-
-See the USAGE file supplied with guile-scsh for more details.
diff --git a/doc/ref/slib.texi b/doc/ref/slib.texi
deleted file mode 100644
index 4d9e8c14c..000000000
--- a/doc/ref/slib.texi
+++ /dev/null
@@ -1,105 +0,0 @@
-@page
-@node SLIB
-@chapter SLIB
-
-Before the the SLIB facilities can be used, the following Scheme
-expression must be executed:
-
-@smalllisp
-(use-modules (ice-9 slib))
-@end smalllisp
-
-@code{require} can then be used as described in
-@ref{Top, , SLIB, slib, The SLIB Manual}.
-
-For example:
-
-@smalllisp
-guile> (use-modules (ice-9 slib))
-guile> (require 'primes)
-guile> (probably-prime? 13)
-@end smalllisp
-
-@menu
-* SLIB installation::
-* JACAL::
-@end menu
-
-@node SLIB installation
-@section SLIB installation
-
-The following seems to work (e.g., with slib versions 2c7 and 2d2):
-
-@enumerate
-@item
-Unpack slib somewhere, e.g., /usr/local/share/slib.
-
-@item
-Create a symlink in the Guile site directory to slib, e.g.,:
-
-@example
-ln -s /usr/local/share/slib /usr/local/share/guile/site/slib
-@end example
-
-@item
-Use Guile to create the catalog file, e.g.,:
-
-@example
-# guile
-guile> (use-modules (ice-9 slib))
-guile> (load "/usr/local/share/slib/mklibcat.scm")
-guile> (quit)
-@end example
-
-The catalog data should now be in
-@code{/usr/local/share/guile/site/slibcat}.
-
-If instead you get an error such as:
-
-@example
-Unbound variable: scheme-implementation-type
-@end example
-
-then a solution is to get a newer version of Guile,
-or to modify ice-9/slib.scm to use define-public for the
-offending variables.
-
-@item
-Install the documentation:
-
-@example
-cd /usr/local/share/slib
-rm /usr/local/info/slib.info*
-cp slib.info /usr/local/info
-install-info slib.info /usr/local/info/dir
-@end example
-@end enumerate
-
-@node JACAL
-@section JACAL
-
-@cindex Jaffer, Aubrey
-@cindex symbolic math
-@cindex math -- symbolic
-Jacal is a symbolic math package written in Scheme by Aubrey Jaffer. It
-is usually installed as an extra package in SLIB (@pxref{Packages not
-shipped with Guile}).
-
-You can use Guile's interface to SLIB to invoke Jacal:
-
-@smalllisp
-(use-modules (ice-9 slib))
-(slib:load "math")
-(math)
-@end smalllisp
-
-@noindent
-For complete documentation on Jacal, please read the Jacal manual. If
-it has been installed on line, you can look at @ref{Top, , Jacal, jacal,
-The SLIB Manual}. Otherwise you can find it on the web at
-@url{http://www-swiss.ai.mit.edu/~jaffer/JACAL.html}
-
-
-@c Local Variables:
-@c TeX-master: "guile.texi"
-@c End:
diff --git a/doc/ref/srfi-modules.texi b/doc/ref/srfi-modules.texi
deleted file mode 100644
index 32de27a4b..000000000
--- a/doc/ref/srfi-modules.texi
+++ /dev/null
@@ -1,2399 +0,0 @@
-@page
-@node SRFI Support
-@chapter SRFI Support Modules
-
-SRFI is an acronym for Scheme Request For Implementation. The SRFI
-documents define a lot of syntactic and procedure extensions to standard
-Scheme as defined in R5RS.
-
-Guile has support for a number of SRFIs. This chapter gives an overview
-over the available SRFIs and some usage hints. For complete
-documentation, design rationales and further examples, we advise you to
-get the relevant SRFI documents from the SRFI home page
-@url{http://srfi.schemers.org}.
-
-@menu
-* About SRFI Usage:: What to know about Guile's SRFI support.
-* SRFI-0:: cond-expand
-* SRFI-1:: List library.
-* SRFI-2:: and-let*.
-* SRFI-4:: Homogeneous numeric vector datatypes.
-* SRFI-6:: Basic String Ports.
-* SRFI-8:: receive.
-* SRFI-9:: define-record-type.
-* SRFI-10:: Hash-Comma Reader Extension.
-* SRFI-11:: let-values and let-values*.
-* SRFI-13:: String library.
-* SRFI-14:: Character-set library.
-* SRFI-16:: case-lambda
-* SRFI-17:: Generalized set!
-* SRFI-19:: Time/Date library.
-@end menu
-
-
-@node About SRFI Usage
-@section About SRFI Usage
-
-@c FIXME::martin: Review me!
-
-SRFI support in Guile is currently implemented partly in the core
-library, and partly as add-on modules. That means that some SRFIs are
-automatically available when the interpreter is started, whereas the
-other SRFIs require you to use the appropriate support module
-explicitly.
-
-There are several reasons for this inconsistency. First, the feature
-checking syntactic form @code{cond-expand} (@pxref{SRFI-0}) must be
-available immediately, because it must be there when the user wants to
-check for the Scheme implementation, that is, before she can know that
-it is safe to use @code{use-modules} to load SRFI support modules. The
-second reason is that some features defined in SRFIs had been
-implemented in Guile before the developers started to add SRFI
-implementations as modules (for example SRFI-6 (@pxref{SRFI-6})). In
-the future, it is possible that SRFIs in the core library might be
-factored out into separate modules, requiring explicit module loading
-when they are needed. So you should be prepared to have to use
-@code{use-modules} someday in the future to access SRFI-6 bindings. If
-you want, you can do that already. We have included the module
-@code{(srfi srfi-6)} in the distribution, which currently does nothing,
-but ensures that you can write future-safe code.
-
-Generally, support for a specific SRFI is made available by using
-modules named @code{(srfi srfi-@var{number})}, where @var{number} is the
-number of the SRFI needed. Another possibility is to use the command
-line option @code{--use-srfi}, which will load the necessary modules
-automatically (@pxref{Invoking Guile}).
-
-
-@node SRFI-0
-@section SRFI-0 - cond-expand
-
-@c FIXME::martin: Review me!
-
-SRFI-0 defines a means for checking whether a Scheme implementation has
-support for a specified feature. The syntactic form @code{cond-expand},
-which implements this means, has the following syntax.
-
-@example
-@group
-<cond-expand>
- --> (cond-expand <cond-expand-clause>+)
- | (cond-expand <cond-expand-clause>* (else <command-or-definition>))
-<cond-expand-clause>
- --> (<feature-requirement> <command-or-definition>*)
-<feature-requirement>
- --> <feature-identifier>
- | (and <feature-requirement>*)
- | (or <feature-requirement>*)
- | (not <feature-requirement>)
-<feature-identifier>
- --> <a symbol which is the name or alias of a SRFI>
-@end group
-@end example
-
-When evaluated, this form checks all clauses in order, until it finds
-one whose feature requirement is satisfied. Then the form expands into
-the commands or definitions in the clause. A requirement is tested as
-follows:
-
-@itemize @bullet
-@item
-If it is a symbol, it is satisfied if the feature identifier is
-supported.
-
-@item
-If it is an @code{and} form, all requirements must be satisfied. If no
-requirements are given, it is satisfied, too.
-
-@item
-If it is an @code{or} form, at least one of the requirements must be
-satisfied. If no requirements are given, it is not satisfied.
-
-@item
-If it is a @code{not} form, the feature requirement must @emph{not} be
-satisfied.
-
-@item
-If the feature requirement is the keyword @code{else} and it is the last
-clause, it is satisfied if no prior clause matched.
-@end itemize
-
-If no clause is satisfied, an error is signalled.
-
-Since @code{cond-expand} is needed to tell what a Scheme implementation
-provides, it must be accessible without using any
-implementation-dependent operations, such as @code{use-modules} in
-Guile. Thus, it is not necessary to use any module to get access to
-this form.
-
-Currently, the feature identifiers @code{guile}, @code{r5rs} and
-@code{srfi-0} are supported. The other SRFIs are not in that list by
-default, because the SRFI modules must be explicitly used before their
-exported bindings can be used.
-
-So if a Scheme program wishes to use SRFI-8, it has two possibilities:
-First, it can check whether the running Scheme implementation is Guile,
-and if it is, it can use the appropriate module:
-
-@lisp
-(cond-expand
- (guile
- (use-modules (srfi srfi-8)))
- (srfi-8
- #t))
- ;; otherwise fail.
-@end lisp
-
-The other possibility is to use the @code{--use-srfi} command line
-option when invoking Guile (@pxref{Invoking Guile}). When you do that,
-the specified SRFI support modules will be loaded and add their feature
-identifier to the list of symbols checked by @code{cond-expand}.
-
-So, if you invoke Guile like this:
-
-@example
-$ guile --use-srfi=8
-@end example
-
-the following snippet will expand to @code{'hooray}.
-
-@lisp
-(cond-expand (srfi-8 'hooray))
-@end lisp
-
-
-@node SRFI-1
-@section SRFI-1 - List library
-
-@c FIXME::martin: Review me!
-
-The list library defined in SRFI-1 contains a lot of useful list
-processing procedures for construction, examining, destructuring and
-manipulating lists and pairs.
-
-Since SRFI-1 also defines some procedures which are already contained
-in R5RS and thus are supported by the Guile core library, some list
-and pair procedures which appear in the SRFI-1 document may not appear
-in this section. So when looking for a particular list/pair
-processing procedure, you should also have a look at the sections
-@ref{Lists} and @ref{Pairs}.
-
-@menu
-* SRFI-1 Constructors:: Constructing new lists.
-* SRFI-1 Predicates:: Testing list for specific properties.
-* SRFI-1 Selectors:: Selecting elements from lists.
-* SRFI-1 Length Append etc:: Length calculation and list appending.
-* SRFI-1 Fold and Map:: Higher-order list processing.
-* SRFI-1 Filtering and Partitioning:: Filter lists based on predicates.
-* SRFI-1 Searching:: Search for elements.
-* SRFI-1 Deleting:: Delete elements from lists.
-* SRFI-1 Association Lists:: Handle association lists.
-* SRFI-1 Set Operations:: Use lists for representing sets.
-@end menu
-
-@node SRFI-1 Constructors
-@subsection Constructors
-
-@c FIXME::martin: Review me!
-
-New lists can be constructed by calling one of the following
-procedures.
-
-@deffn {Scheme Procedure} xcons d a
-Like @code{cons}, but with interchanged arguments. Useful mostly when
-passed to higher-order procedures.
-@end deffn
-
-@deffn {Scheme Procedure} list-tabulate n init-proc
-Return an @var{n}-element list, where each list element is produced by
-applying the procedure @var{init-proc} to the corresponding list
-index. The order in which @var{init-proc} is applied to the indices
-is not specified.
-@end deffn
-
-@deffn {Scheme Procedure} circular-list elt1 elt2 @dots{}
-Return a circular list containing the given arguments @var{elt1}
-@var{elt2} @dots{}.
-@end deffn
-
-@deffn {Scheme Procedure} iota count [start step]
-Return a list containing @var{count} elements, where each element is
-calculated as follows:
-
-@var{start} + (@var{count} - 1) * @var{step}
-
-@var{start} defaults to 0 and @var{step} defaults to 1.
-@end deffn
-
-
-@node SRFI-1 Predicates
-@subsection Predicates
-
-@c FIXME::martin: Review me!
-
-The procedures in this section test specific properties of lists.
-
-@deffn {Scheme Procedure} proper-list? obj
-Return @code{#t} if @var{obj} is a proper list, that is a finite list,
-terminated with the empty list. Otherwise, return @code{#f}.
-@end deffn
-
-@deffn {Scheme Procedure} circular-list? obj
-Return @code{#t} if @var{obj} is a circular list, otherwise return
-@code{#f}.
-@end deffn
-
-@deffn {Scheme Procedure} dotted-list? obj
-Return @code{#t} if @var{obj} is a dotted list, return @code{#f}
-otherwise. A dotted list is a finite list which is not terminated by
-the empty list, but some other value.
-@end deffn
-
-@deffn {Scheme Procedure} null-list? lst
-Return @code{#t} if @var{lst} is the empty list @code{()}, @code{#f}
-otherwise. If something else than a proper or circular list is passed
-as @var{lst}, an error is signalled. This procedure is recommended
-for checking for the end of a list in contexts where dotted lists are
-not allowed.
-@end deffn
-
-@deffn {Scheme Procedure} not-pair? obj
-Return @code{#t} is @var{obj} is not a pair, @code{#f} otherwise.
-This is shorthand notation @code{(not (pair? @var{obj}))} and is
-supposed to be used for end-of-list checking in contexts where dotted
-lists are allowed.
-@end deffn
-
-@deffn {Scheme Procedure} list= elt= list1 @dots{}
-Return @code{#t} if all argument lists are equal, @code{#f} otherwise.
-List equality is determined by testing whether all lists have the same
-length and the corresponding elements are equal in the sense of the
-equality predicate @var{elt=}. If no or only one list is given,
-@code{#t} is returned.
-@end deffn
-
-
-@node SRFI-1 Selectors
-@subsection Selectors
-
-@c FIXME::martin: Review me!
-
-@deffn {Scheme Procedure} first pair
-@deffnx {Scheme Procedure} second pair
-@deffnx {Scheme Procedure} third pair
-@deffnx {Scheme Procedure} fourth pair
-@deffnx {Scheme Procedure} fifth pair
-@deffnx {Scheme Procedure} sixth pair
-@deffnx {Scheme Procedure} seventh pair
-@deffnx {Scheme Procedure} eighth pair
-@deffnx {Scheme Procedure} ninth pair
-@deffnx {Scheme Procedure} tenth pair
-These are synonyms for @code{car}, @code{cadr}, @code{caddr}, @dots{}.
-@end deffn
-
-@deffn {Scheme Procedure} car+cdr pair
-Return two values, the @sc{car} and the @sc{cdr} of @var{pair}.
-@end deffn
-
-@deffn {Scheme Procedure} take lst i
-@deffnx {Scheme Procedure} take! lst i
-Return a list containing the first @var{i} elements of @var{lst}.
-
-@code{take!} may modify the structure of the argument list @var{lst}
-in order to produce the result.
-@end deffn
-
-@deffn {Scheme Procedure} drop lst i
-Return a list containing all but the first @var{i} elements of
-@var{lst}.
-@end deffn
-
-@deffn {Scheme Procedure} take-right lst i
-Return the a list containing the @var{i} last elements of @var{lst}.
-@end deffn
-
-@deffn {Scheme Procedure} drop-right lst i
-@deffnx {Scheme Procedure} drop-right! lst i
-Return the a list containing all but the @var{i} last elements of
-@var{lst}.
-
-@code{drop-right!} may modify the structure of the argument list
-@var{lst} in order to produce the result.
-@end deffn
-
-@deffn {Scheme Procedure} split-at lst i
-@deffnx {Scheme Procedure} split-at! lst i
-Return two values, a list containing the first @var{i} elements of the
-list @var{lst} and a list containing the remaining elements.
-
-@code{split-at!} may modify the structure of the argument list
-@var{lst} in order to produce the result.
-@end deffn
-
-@deffn {Scheme Procedure} last lst
-Return the last element of the non-empty, finite list @var{lst}.
-@end deffn
-
-
-@node SRFI-1 Length Append etc
-@subsection Length, Append, Concatenate, etc.
-
-@c FIXME::martin: Review me!
-
-@deffn {Scheme Procedure} length+ lst
-Return the length of the argument list @var{lst}. When @var{lst} is a
-circular list, @code{#f} is returned.
-@end deffn
-
-@deffn {Scheme Procedure} concatenate list-of-lists
-@deffnx {Scheme Procedure} concatenate! list-of-lists
-Construct a list by appending all lists in @var{list-of-lists}.
-
-@code{concatenate!} may modify the structure of the given lists in
-order to produce the result.
-@end deffn
-
-@deffn {Scheme Procedure} append-reverse rev-head tail
-@deffnx {Scheme Procedure} append-reverse! rev-head tail
-Reverse @var{rev-head}, append @var{tail} and return the result. This
-is equivalent to @code{(append (reverse @var{rev-head}) @var{tail})},
-but more efficient.
-
-@code{append-reverse!} may modify @var{rev-head} in order to produce
-the result.
-@end deffn
-
-@deffn {Scheme Procedure} zip lst1 lst2 @dots{}
-Return a list as long as the shortest of the argument lists, where
-each element is a list. The first list contains the first elements of
-the argument lists, the second list contains the second elements, and
-so on.
-@end deffn
-
-@deffn {Scheme Procedure} unzip1 lst
-@deffnx {Scheme Procedure} unzip2 lst
-@deffnx {Scheme Procedure} unzip3 lst
-@deffnx {Scheme Procedure} unzip4 lst
-@deffnx {Scheme Procedure} unzip5 lst
-@code{unzip1} takes a list of lists, and returns a list containing the
-first elements of each list, @code{unzip2} returns two lists, the
-first containing the first elements of each lists and the second
-containing the second elements of each lists, and so on.
-@end deffn
-
-
-@node SRFI-1 Fold and Map
-@subsection Fold, Unfold & Map
-
-@c FIXME::martin: Review me!
-
-@deffn {Scheme Procedure} fold kons knil lst1 lst2 @dots{}
-Fold the procedure @var{kons} across all elements of @var{lst1},
-@var{lst2}, @dots{}. Produce the result of
-
-@code{(@var{kons} @var{en1} @var{en2} @dots{} (@var{kons} @var{e21}
-@var{e22} (@var{kons} @var{e11} @var{e12} @var{knil})))},
-
-if @var{enm} are the elements of the lists @var{lst1}, @var{lst2},
-@dots{}.
-@end deffn
-
-@deffn {Scheme Procedure} fold-right kons knil lst1 lst2 @dots{}
-Similar to @code{fold}, but applies @var{kons} in right-to-left order
-to the list elements, that is:
-
-@code{(@var{kons} @var{e11} @var{e12}(@var{kons} @var{e21}
-@var{e22} @dots{} (@var{kons} @var{en1} @var{en2} @var{knil})))},
-@end deffn
-
-@deffn {Scheme Procedure} pair-fold kons knil lst1 lst2 @dots{}
-Like @code{fold}, but apply @var{kons} to the pairs of the list
-instead of the list elements.
-@end deffn
-
-@deffn {Scheme Procedure} pair-fold-right kons knil lst1 lst2 @dots{}
-Like @code{fold-right}, but apply @var{kons} to the pairs of the list
-instead of the list elements.
-@end deffn
-
-@deffn {Scheme Procedure} reduce f ridentity lst
-@code{reduce} is a variant of @code{reduce}. If @var{lst} is
-@code{()}, @var{ridentity} is returned. Otherwise, @code{(fold (car
-@var{lst}) (cdr @var{lst}))} is returned.
-@end deffn
-
-@deffn {Scheme Procedure} reduce-right f ridentity lst
-This is the @code{fold-right} variant of @var{reduce}.
-@end deffn
-
-@deffn {Scheme Procedure} unfold p f g seed [tail-gen]
-@code{unfold} is defined as follows:
-
-@lisp
-(unfold p f g seed) =
- (if (p seed) (tail-gen seed)
- (cons (f seed)
- (unfold p f g (g seed))))
-@end lisp
-
-@table @var
-@item p
-Determines when to stop unfolding.
-
-@item f
-Maps each seed value to the corresponding list element.
-
-@item g
-Maps each seed value to next seed valu.
-
-@item seed
-The state value for the unfold.
-
-@item tail-gen
-Creates the tail of the list; defaults to @code{(lambda (x) '())}.
-@end table
-
-@var{g} produces a series of seed values, which are mapped to list
-elements by @var{f}. These elements are put into a list in
-left-to-right order, and @var{p} tells when to stop unfolding.
-@end deffn
-
-@deffn {Scheme Procedure} unfold-right p f g seed [tail]
-Construct a list with the following loop.
-
-@lisp
-(let lp ((seed seed) (lis tail))
- (if (p seed) lis
- (lp (g seed)
- (cons (f seed) lis))))
-@end lisp
-
-@table @var
-@item p
-Determines when to stop unfolding.
-
-@item f
-Maps each seed value to the corresponding list element.
-
-@item g
-Maps each seed value to next seed valu.
-
-@item seed
-The state value for the unfold.
-
-@item tail-gen
-Creates the tail of the list; defaults to @code{(lambda (x) '())}.
-@end table
-
-@end deffn
-
-@deffn {Scheme Procedure} map f lst1 lst2 @dots{}
-Map the procedure over the list(s) @var{lst1}, @var{lst2}, @dots{} and
-return a list containing the results of the procedure applications.
-This procedure is extended with respect to R5RS, because the argument
-lists may have different lengths. The result list will have the same
-length as the shortest argument lists. The order in which @var{f}
-will be applied to the list element(s) is not specified.
-@end deffn
-
-@deffn {Scheme Procedure} for-each f lst1 lst2 @dots{}
-Apply the procedure @var{f} to each pair of corresponding elements of
-the list(s) @var{lst1}, @var{lst2}, @dots{}. The return value is not
-specified. This procedure is extended with respect to R5RS, because
-the argument lists may have different lengths. The shortest argument
-list determines the number of times @var{f} is called. @var{f} will
-be applied to the list elements in left-to-right order.
-
-@end deffn
-
-@deffn {Scheme Procedure} append-map f lst1 lst2 @dots{}
-@deffnx {Scheme Procedure} append-map! f lst1 lst2 @dots{}
-Equivalent to
-
-@lisp
-(apply append (map f clist1 clist2 ...))
-@end lisp
-
-and
-
-@lisp
-(apply append! (map f clist1 clist2 ...))
-@end lisp
-
-Map @var{f} over the elements of the lists, just as in the @code{map}
-function. However, the results of the applications are appended
-together to make the final result. @code{append-map} uses
-@code{append} to append the results together; @code{append-map!} uses
-@code{append!}.
-
-The dynamic order in which the various applications of @var{f} are
-made is not specified.
-@end deffn
-
-@deffn {Scheme Procedure} map! f lst1 lst2 @dots{}
-Linear-update variant of @code{map} -- @code{map!} is allowed, but not
-required, to alter the cons cells of @var{lst1} to construct the
-result list.
-
-The dynamic order in which the various applications of @var{f} are
-made is not specified. In the n-ary case, @var{lst2}, @var{lst3},
-@dots{} must have at least as many elements as @var{lst1}.
-@end deffn
-
-@deffn {Scheme Procedure} pair-for-each f lst1 lst2 @dots{}
-Like @code{for-each}, but applies the procedure @var{f} to the pairs
-from which the argument lists are constructed, instead of the list
-elements. The return value is not specified.
-@end deffn
-
-@deffn {Scheme Procedure} filter-map f lst1 lst2 @dots{}
-Like @code{map}, but only results from the applications of @var{f}
-which are true are saved in the result list.
-@end deffn
-
-
-@node SRFI-1 Filtering and Partitioning
-@subsection Filtering and Partitioning
-
-@c FIXME::martin: Review me!
-
-Filtering means to collect all elements from a list which satisfy a
-specific condition. Partitioning a list means to make two groups of
-list elements, one which contains the elements satisfying a condition,
-and the other for the elements which don't.
-
-@deffn {Scheme Procedure} filter pred lst
-@deffnx {Scheme Procedure} filter! pred lst
-Return a list containing all elements from @var{lst} which satisfy the
-predicate @var{pred}. The elements in the result list have the same
-order as in @var{lst}. The order in which @var{pred} is applied to
-the list elements is not specified.
-
-@code{filter!} is allowed, but not required to modify the structure of
-@end deffn
-
-@deffn {Scheme Procedure} partition pred lst
-@deffnx {Scheme Procedure} partition! pred lst
-Return two lists, one containing all elements from @var{lst} which
-satisfy the predicate @var{pred}, and one list containing the elements
-which do not satisfy the predicated. The elements in the result lists
-have the same order as in @var{lst}. The order in which @var{pred} is
-applied to the list elements is not specified.
-
-@code{partition!} is allowed, but not required to modify the structure of
-the input list.
-@end deffn
-
-@deffn {Scheme Procedure} remove pred lst
-@deffnx {Scheme Procedure} remove! pred lst
-Return a list containing all elements from @var{lst} which do not
-satisfy the predicate @var{pred}. The elements in the result list
-have the same order as in @var{lst}. The order in which @var{pred} is
-applied to the list elements is not specified.
-
-@code{remove!} is allowed, but not required to modify the structure of
-the input list.
-@end deffn
-
-
-@node SRFI-1 Searching
-@subsection Searching
-
-@c FIXME::martin: Review me!
-
-The procedures for searching elements in lists either accept a
-predicate or a comparison object for determining which elements are to
-be searched.
-
-@deffn {Scheme Procedure} find pred lst
-Return the first element of @var{lst} which satisfies the predicate
-@var{pred} and @code{#f} if no such element is found.
-@end deffn
-
-@deffn {Scheme Procedure} find-tail pred lst
-Return the first pair of @var{lst} whose @sc{car} satisfies the
-predicate @var{pred} and @code{#f} if no such element is found.
-@end deffn
-
-@deffn {Scheme Procedure} take-while pred lst
-@deffnx {Scheme Procedure} take-while! pred lst
-Return the longest initial prefix of @var{lst} whose elements all
-satisfy the predicate @var{pred}.
-
-@code{take-while!} is allowed, but not required to modify the input
-list while producing the result.
-@end deffn
-
-@deffn {Scheme Procedure} drop-while pred lst
-Drop the longest initial prefix of @var{lst} whose elements all
-satisfy the predicate @var{pred}.
-@end deffn
-
-@deffn {Scheme Procedure} span pred lst
-@deffnx {Scheme Procedure} span! pred lst
-@deffnx {Scheme Procedure} break pred lst
-@deffnx {Scheme Procedure} break! pred lst
-@code{span} splits the list @var{lst} into the longest initial prefix
-whose elements all satisfy the predicate @var{pred}, and the remaining
-tail. @code{break} inverts the sense of the predicate.
-
-@code{span!} and @code{break!} are allowed, but not required to modify
-the structure of the input list @var{lst} in order to produce the
-result.
-@end deffn
-
-@deffn {Scheme Procedure} any pred lst1 lst2 @dots{}
-Apply @var{pred} across the lists and return a true value if the
-predicate returns true for any of the list elements(s); return
-@code{#f} otherwise. The true value returned is always the result of
-the first successful application of @var{pred}.
-@end deffn
-
-@deffn {Scheme Procedure} every pred lst1 lst2 @dots{}
-Apply @var{pred} across the lists and return a true value if the
-predicate returns true for every of the list elements(s); return
-@code{#f} otherwise. The true value returned is always the result of
-the final successful application of @var{pred}.
-@end deffn
-
-@deffn {Scheme Procedure} list-index pred lst1 lst2 @dots{}
-Return the index of the leftmost element that satisfies @var{pred}.
-@end deffn
-
-@deffn {Scheme Procedure} member x lst [=]
-Return the first sublist of @var{lst} whose @sc{car} is equal to
-@var{x}. If @var{x} does no appear in @var{lst}, return @code{#f}.
-Equality is determined by the equality predicate @var{=}, or
-@code{equal?} if @var{=} is not given.
-@end deffn
-
-
-@node SRFI-1 Deleting
-@subsection Deleting
-
-@c FIXME::martin: Review me!
-
-The procedures for deleting elements from a list either accept a
-predicate or a comparison object for determining which elements are to
-be removed.
-
-@deffn {Scheme Procedure} delete x lst [=]
-@deffnx {Scheme Procedure} delete! x lst [=]
-Return a list containing all elements from @var{lst}, but without the
-elements equal to @var{x}. Equality is determined by the equality
-predicate @var{=}, which defaults to @code{equal?} if not given.
-
-@code{delete!} is allowed, but not required to modify the structure of
-the argument list in order to produce the result.
-@end deffn
-
-@deffn {Scheme Procedure} delete-duplicates lst [=]
-@deffnx {Scheme Procedure} delete-duplicates! lst [=]
-Return a list containing all elements from @var{lst}, but without
-duplicate elements. Equality of elements is determined by the
-equality predicate @var{=}, which defaults to @code{equal?} if not
-given.
-
-@code{delete-duplicates!} is allowed, but not required to modify the
-structure of the argument list in order to produce the result.
-@end deffn
-
-
-@node SRFI-1 Association Lists
-@subsection Association Lists
-
-@c FIXME::martin: Review me!
-
-Association lists are described in detail in section @ref{Association
-Lists}. The present section only documents the additional procedures
-for dealing with association lists defined by SRFI-1.
-
-@deffn {Scheme Procedure} assoc key alist [=]
-Return the pair from @var{alist} which matches @var{key}. Equality is
-determined by @var{=}, which defaults to @code{equal?} if not given.
-@var{alist} must be an association lists---a list of pairs.
-@end deffn
-
-@deffn {Scheme Procedure} alist-cons key datum alist
-Equivalent to
-
-@lisp
-(cons (cons @var{key} @var{datum}) @var{alist})
-@end lisp
-
-This procedure is used to coons a new pair onto an existing
-association list.
-@end deffn
-
-@deffn {Scheme Procedure} alist-copy alist
-Return a newly allocated copy of @var{alist}, that means that the
-spine of the list as well as the pairs are copied.
-@end deffn
-
-@deffn {Scheme Procedure} alist-delete key alist [=]
-@deffnx {Scheme Procedure} alist-delete! key alist [=]
-Return a list containing the pairs of @var{alist}, but without the
-pairs whose @sc{cars} are equal to @var{key}. Equality is determined
-by @var{=}, which defaults to @code{equal?} if not given.
-
-@code{alist-delete!} is allowed, but not required to modify the
-structure of the list @var{alist} in order to produce the result.
-@end deffn
-
-
-@node SRFI-1 Set Operations
-@subsection Set Operations on Lists
-
-@c FIXME::martin: Review me!
-
-Lists can be used for representing sets of objects. The procedures
-documented in this section can be used for such set representations.
-Man combining several sets or adding elements, they make sure that no
-object is contained more than once in a given list. Please note that
-lists are not a too efficient implementation method for sets, so if
-you need high performance, you should think about implementing a
-custom data structure for representing sets, such as trees, bitsets,
-hash tables or something similar.
-
-All these procedures accept an equality predicate as the first
-argument. This predicate is used for testing the objects in the list
-sets for sameness.
-
-@deffn {Scheme Procedure} lset<= = list1 @dots{}
-Return @code{#t} if every @var{listi} is a subset of @var{listi+1},
-otherwise return @code{#f}. Returns @code{#t} if called with less
-than two arguments. @var{=} is used for testing element equality.
-@end deffn
-
-@deffn {Scheme Procedure} lset= = list1 list2 @dots{}
-Return @code{#t} if all argument lists are equal. @var{=} is used for
-testing element equality.
-@end deffn
-
-@deffn {Scheme Procedure} lset-adjoin = list elt1 @dots{}
-@deffnx {Scheme Procedure} lset-adjoin! = list elt1 @dots{}
-Add all @var{elts} to the list @var{list}, suppressing duplicates and
-return the resulting list. @code{lset-adjoin!} is allowed, but not
-required to modify its first argument. @var{=} is used for testing
-element equality.
-@end deffn
-
-@deffn {Scheme Procedure} lset-union = list1 @dots{}
-@deffnx {Scheme Procedure} lset-union! = list1 @dots{}
-Return the union of all argument list sets. The union is the set of
-all elements which appear in any of the argument sets.
-@code{lset-union!} is allowed, but not required to modify its first
-argument. @var{=} is used for testing element equality.
-@end deffn
-
-@deffn {Scheme Procedure} lset-intersection = list1 list2 @dots{}
-@deffnx {Scheme Procedure} lset-intersection! = list1 list2 @dots{}
-Return the intersection of all argument list sets. The intersection
-is the set containing all elements which appear in all argument sets.
-@code{lset-intersection!} is allowed, but not required to modify its
-first argument. @var{=} is used for testing element equality.
-@end deffn
-
-@deffn {Scheme Procedure} lset-difference = list1 list2 @dots{}
-@deffnx {Scheme Procedure} lset-difference! = list1 list2 @dots{}
-Return the difference of all argument list sets. The difference is
-the the set containing all elements of the first list which do not
-appear in the other lists. @code{lset-difference!} is allowed, but
-not required to modify its first argument. @var{=} is used for testing
-element equality.
-@end deffn
-
-@deffn {Scheme Procedure} lset-xor = list1 @dots{}
-@deffnx {Scheme Procedure} lset-xor! = list1 @dots{}
-Return the set containing all elements which appear in the first
-argument list set, but not in the second; or, more generally: which
-appear in an odd number of sets. @code{lset-xor!} is allowed, but
-not required to modify its first argument. @var{=} is used for testing
-element equality.
-@end deffn
-
-@deffn {Scheme Procedure} lset-diff+intersection = list1 list2 @dots{}
-@deffnx {Scheme Procedure} lset-diff+intersection! = list1 list2 @dots{}
-Return two values, the difference and the intersection of the argument
-list sets. This works like a combination of @code{lset-difference} and
-@code{lset-intersection}, but is more efficient.
-@code{lset-diff+intersection!} is allowed, but not required to modify
-its first argument. @var{=} is used for testing element equality. You
-have to use some means to deal with the multiple values these
-procedures return (@pxref{Multiple Values}).
-@end deffn
-
-
-@node SRFI-2
-@section SRFI-2 - and-let*
-
-@c FIXME::martin: Review me!
-
-The syntactic form @code{and-let*} combines the conditional evaluation
-form @code{and} with the binding form @var{let*}. Each argument
-expression will be evaluated sequentially, bound to a variable (if a
-variable name is given), but only as long as no expression returns
-the false value @code{#f}.
-
-Use @code{(use-modules (srfi srfi-2)} to access this syntax form.
-
-A short example will demonstrate how it works. In the first expression,
-@var{x} will get bound to 1, but the next expression (@code{#f}) is
-false, so evaluation of the form is stopped, and @code{#f} is returned.
-In the next expression, @var{x} is bound to 1, @var{y} is bound to
-@code{#t} and since no expression in the binding section was false, the
-body of the @code{and-let*} expression is evaluated, which in this case
-returns the value of @var{x}.
-
-@lisp
-(and-let* ((x 1) (y #f)) 42)
-@result{}
-#f
-(and-let* ((x 1) (y #t)) x)
-@result{}
-1
-@end lisp
-
-
-@node SRFI-4
-@section SRFI-4 - Homogeneous numeric vector datatypes.
-
-@c FIXME::martin: Review me!
-
-SRFI-4 defines a set of datatypes for vectors whose elements are all
-of the same numeric type. Vectors for signed and unsigned exact
-integer or inexact real numbers in several precisions are available.
-
-Procedures similar to the vector procedures (@pxref{Vectors}) are
-provided for handling these homogeneous vectors, but they are distinct
-datatypes.
-
-The reason for providing this set of datatypes is that with the
-limitation (all elements must have the same type), it is possible to
-implement them much more memory-efficient than normal, heterogenous
-vectors.
-
-If you want to use these datatypes and the corresponding procedures,
-you have to use the module @code{(srfi srfi-4)}.
-
-Ten vector data types are provided: Unsigned and signed integer values
-with 8, 16, 32 and 64 bits and floating point values with 32 and 64
-bits. In the following descriptions, the tags @code{u8}, @code{s8},
-@code{u16}, @code{s16}, @code{u32}, @code{s32}, @code{u64},
-@code{s64}, @code{f32}, @code{f64}, respectively, are used for
-denoting the various types.
-
-@menu
-* SRFI-4 - Read Syntax:: How to write homogeneous vector literals.
-* SRFI-4 - Procedures:: Available homogeneous vector procedures.
-@end menu
-
-
-@node SRFI-4 - Read Syntax
-@subsection SRFI-4 - Read Syntax
-
-Homogeneous numeric vectors have an external representation (read
-syntax) similar to normal Scheme vectors, but with an additional tag
-telling the vector's type.
-
-@lisp
-#u16(1 2 3)
-@end lisp
-
-denotes a homogeneous numeric vector of three elements, which are the
-values 1, 2 and 3, represented as 16-bit unsigned integers.
-Correspondingly,
-
-@lisp
-#f64(3.1415 2.71)
-@end lisp
-
-denotes a vector of two elements, which are the values 3.1415 and
-2.71, represented as floating-point values of 64 bit precision.
-
-Please note that the read syntax for floating-point vectors conflicts
-with Standard Scheme, because there @code{#f} is defined to be the
-literal false value. That means, that with the loaded SRFI-4 module,
-it is not possible to enter some list like
-
-@lisp
-'(1 #f3)
-@end lisp
-
-and hope that it will be parsed as a three-element list with the
-elements 1, @code{#f} and 3. In normal use, this should be no
-problem, because people tend to terminate tokens sensibly when writing
-Scheme expressions.
-
-@node SRFI-4 - Procedures
-@subsection SRFI-4 Procedures
-
-The procedures listed in this section are provided for all homogeneous
-numeric vector datatypes. For brevity, they are not all documented,
-but a summary of the procedures is given. In the following
-descriptions, you can replace @code{TAG} by any of the datatype
-indicators @code{u8}, @code{s8}, @code{u16}, @code{s16}, @code{u32},
-@code{s32}, @code{u64}, @code{s64}, @code{f32} and @code{f64}.
-
-For example, you can use the procedures @code{u8vector?},
-@code{make-s8vector}, @code{u16vector}, @code{u32vector-length},
-@code{s64vector-ref}, @code{f32vector-set!} or @code{f64vector->list}.
-
-@deffn {Scheme Procedure} TAGvector? obj
-Return @code{#t} if @var{obj} is a homogeneous numeric vector of type
-@code{TAG}.
-@end deffn
-
-@deffn {Scheme Procedure} make-TAGvector n [value]
-Create a newly allocated homogeneous numeric vector of type
-@code{TAG}, which can hold @var{n} elements. If @var{value} is given,
-the vector is initialized with the value, otherwise, the contents of
-the returned vector is not specified.
-@end deffn
-
-@deffn {Scheme Procedure} TAGvector value1 @dots{}
-Create a newly allocated homogeneous numeric vector of type
-@code{TAG}. The returned vector is as long as the number of arguments
-given, and is initialized with the argument values.
-@end deffn
-
-@deffn {Scheme Procedure} TAGvector-length TAGvec
-Return the number of elements in @var{TAGvec}.
-@end deffn
-
-@deffn {Scheme Procedure} TAGvector-ref TAGvec i
-Return the element at index @var{i} in @var{TAGvec}.
-@end deffn
-
-@deffn {Scheme Procedure} TAGvector-ref TAGvec i value
-Set the element at index @var{i} in @var{TAGvec} to @var{value}. The
-return value is not specified.
-@end deffn
-
-@deffn {Scheme Procedure} TAGvector->list TAGvec
-Return a newly allocated list holding all elements of @var{TAGvec}.
-@end deffn
-
-@deffn {Scheme Procedure} list->TAGvector lst
-Return a newly allocated homogeneous numeric vector of type @code{TAG},
-initialized with the elements of the list @var{lst}.
-@end deffn
-
-
-@node SRFI-6
-@section SRFI-6 - Basic String Ports
-
-SRFI-6 defines the procedures @code{open-input-string},
-@code{open-output-string} and @code{get-output-string}. These
-procedures are included in the Guile core, so using this module does not
-make any difference at the moment. But it is possible that support for
-SRFI-6 will be factored out of the core library in the future, so using
-this module does not hurt, after all.
-
-@node SRFI-8
-@section SRFI-8 - receive
-
-@code{receive} is a syntax for making the handling of multiple-value
-procedures easier. It is documented in @xref{Multiple Values}.
-
-
-@node SRFI-9
-@section SRFI-9 - define-record-type
-
-This is the SRFI way for defining record types. The Guile
-implementation is a layer above Guile's normal record construction
-procedures (@pxref{Records}). The nice thing about this kind of record
-definition method is that no new names are implicitly created, all
-constructor, accessor and predicates are explicitly given. This reduces
-the risk of variable capture.
-
-The syntax of a record type definition is:
-
-@example
-@group
-<record type definition>
- -> (define-record-type <type name>
- (<constructor name> <field tag> ...)
- <predicate name>
- <field spec> ...)
-<field spec> -> (<field tag> <accessor name>)
- -> (<field tag> <accessor name> <modifier name>)
-<field tag> -> <identifier>
-<... name> -> <identifier>
-@end group
-@end example
-
-Usage example:
-
-@example
-guile> (use-modules (srfi srfi-9))
-guile> (define-record-type :foo (make-foo x) foo?
- (x get-x) (y get-y set-y!))
-guile> (define f (make-foo 1))
-guile> f
-#<:foo x: 1 y: #f>
-guile> (get-x f)
-1
-guile> (set-y! f 2)
-2
-guile> (get-y f)
-2
-guile> f
-#<:foo x: 1 y: 2>
-guile> (foo? f)
-#t
-guile> (foo? 1)
-#f
-@end example
-
-
-@node SRFI-10
-@section SRFI-10 - Hash-Comma Reader Extension
-
-@cindex hash-comma
-@cindex #,()
-The module @code{(srfi srfi-10)} implements the syntax extension
-@code{#,()}, also called hash-comma, which is defined in SRFI-10.
-
-The support for SRFI-10 consists of the procedure
-@code{define-reader-ctor} for defining new reader constructors and the
-read syntax form
-
-@example
-#,(@var{ctor} @var{datum} ...)
-@end example
-
-where @var{ctor} must be a symbol for which a read constructor was
-defined previously, using @code{define-reader-ctor}.
-
-Example:
-
-@lisp
-(define-reader-ctor 'file open-input-file)
-(define f '#,(file "/etc/passwd"))
-(read-line f)
-@result{}
-"root:x:0:0:root:/root:/bin/bash"
-@end lisp
-
-Please note the quote before the @code{#,(file ...)} expression. This
-is necessary because ports are not self-evaluating in Guile.
-
-@deffn {Scheme Procedure} define-reader-ctor symbol proc
-Define @var{proc} as the reader constructor for hash-comma forms with a
-tag @var{symbol}. @var{proc} will be applied to the datum(s) following
-the tag in the hash-comma expression after the complete form has been
-read in. The result of @var{proc} is returned by the Scheme reader.
-@end deffn
-
-
-@node SRFI-11
-@section SRFI-11 - let-values
-
-This module implements the binding forms for multiple values
-@code{let-values} and @code{let-values*}. These forms are similar to
-@code{let} and @code{let*} (@pxref{Local Bindings}), but they support
-binding of the values returned by multiple-valued expressions.
-
-Write @code{(use-modules (srfi srfi-11))} to make the bindings
-available.
-
-@lisp
-(let-values (((x y) (values 1 2))
- ((z f) (values 3 4)))
- (+ x y z f))
-@result{}
-10
-@end lisp
-
-@code{let-values} performs all bindings simultaneously, which means that
-no expression in the binding clauses may refer to variables bound in the
-same clause list. @code{let-values*}, on the other hand, performs the
-bindings sequentially, just like @code{let*} does for single-valued
-expressions.
-
-
-@node SRFI-13
-@section SRFI-13 - String Library
-
-In this section, we will describe all procedures defined in SRFI-13
-(string library) and implemented by the module @code{(srfi srfi-13)}.
-
-Note that only the procedures from SRFI-13 are documented here which are
-not already contained in Guile. For procedures not documented here
-please refer to the relevant chapters in the Guile Reference Manual, for
-example the documentation of strings and string procedures
-(@pxref{Strings}).
-
-All of the procedures defined in SRFI-13, which are not already
-included in the Guile core library, are implemented in the module
-@code{(srfi srfi-13)}. The procedures which are both in Guile and in
-SRFI-13 are slightly extended in this module. Their bindings
-overwrite those in the Guile core.
-
-The procedures which are defined in the section @emph{Low-level
-procedures} of SRFI-13 for parsing optional string indices, substring
-specification checking and Knuth-Morris-Pratt-Searching are not
-implemented.
-
-The procedures @code{string-contains} and @code{string-contains-ci} are
-not implemented very efficiently at the moment. This will be changed as
-soon as possible.
-
-@menu
-* Loading SRFI-13:: How to load SRFI-13 support.
-* SRFI-13 Predicates:: String predicates.
-* SRFI-13 Constructors:: String constructing procedures.
-* SRFI-13 List/String Conversion:: Conversion from/to lists.
-* SRFI-13 Selection:: Selection portions of strings.
-* SRFI-13 Modification:: Modify strings in-place.
-* SRFI-13 Comparison:: Compare strings.
-* SRFI-13 Prefixes/Suffixes:: Detect common pre-/suffixes.
-* SRFI-13 Searching:: Searching for substrings.
-* SRFI-13 Case Mapping:: Mapping to lower-/upper-case.
-* SRFI-13 Reverse/Append:: Reverse and append strings.
-* SRFI-13 Fold/Unfold/Map:: Construct/deconstruct strings.
-* SRFI-13 Replicate/Rotate:: Replicate and rotate portions of strings.
-* SRFI-13 Miscellaneous:: Left-over string procedures.
-* SRFI-13 Filtering/Deleting:: Filter and delete characters from strings.
-@end menu
-
-
-@node Loading SRFI-13
-@subsection Loading SRFI-13
-
-When Guile is properly installed, SRFI-13 support can be loaded into a
-running Guile by using the @code{(srfi srfi-13)} module.
-
-@example
-$ guile
-guile> (use-modules (srfi srfi-13))
-guile>
-@end example
-
-When this step causes any errors, Guile is not properly installed.
-
-One possible reason is that Guile cannot find either the Scheme module
-file @file{srfi-13.scm}, or it cannot find the shared object file
-@file{libguile-srfi-srfi-13-14.so}. Make sure that the former is in the
-Guile load path and that the latter is either installed in some default
-location like @file{/usr/local/lib} or that the directory it was
-installed to is in your @code{LTDL_LIBRARY_PATH}. The same applies to
-@file{srfi-14.scm}.
-
-Now you can test whether the SRFI-13 procedures are working by calling
-the @code{string-concatenate} procedure.
-
-@example
-guile> (string-concatenate '("Hello" " " "World!"))
-"Hello World!"
-@end example
-
-@node SRFI-13 Predicates
-@subsection Predicates
-
-In addition to the primitives @code{string?} and @code{string-null?},
-which are already in the Guile core, the string predicates
-@code{string-any} and @code{string-every} are defined by SRFI-13.
-
-@deffn {Scheme Procedure} string-any pred s [start end]
-Check if the predicate @var{pred} is true for any character in
-the string @var{s}, proceeding from left (index @var{start}) to
-right (index @var{end}). If @code{string-any} returns true,
-the returned true value is the one produced by the first
-successful application of @var{pred}.
-@end deffn
-
-@deffn {Scheme Procedure} string-every pred s [start end]
-Check if the predicate @var{pred} is true for every character
-in the string @var{s}, proceeding from left (index @var{start})
-to right (index @var{end}). If @code{string-every} returns
-true, the returned true value is the one produced by the final
-application of @var{pred} to the last character of @var{s}.
-@end deffn
-
-
-@c ===================================================================
-
-@node SRFI-13 Constructors
-@subsection Constructors
-
-SRFI-13 defines several procedures for constructing new strings. In
-addition to @code{make-string} and @code{string} (available in the Guile
-core library), the procedure @code{string-tabulate} does exist.
-
-@deffn {Scheme Procedure} string-tabulate proc len
-@var{proc} is an integer->char procedure. Construct a string
-of size @var{len} by applying @var{proc} to each index to
-produce the corresponding string element. The order in which
-@var{proc} is applied to the indices is not specified.
-@end deffn
-
-
-@c ===================================================================
-
-@node SRFI-13 List/String Conversion
-@subsection List/String Conversion
-
-The procedure @code{string->list} is extended by SRFI-13, that is why it
-is included in @code{(srfi srfi-13)}. The other procedures are new.
-The Guile core already contains the procedure @code{list->string} for
-converting a list of characters into a string (@pxref{List/String
-Conversion}).
-
-@deffn {Scheme Procedure} string->list str [start end]
-Convert the string @var{str} into a list of characters.
-@end deffn
-
-@deffn {Scheme Procedure} reverse-list->string chrs
-An efficient implementation of @code{(compose string->list
-reverse)}:
-
-@smalllisp
-(reverse-list->string '(#\a #\B #\c)) @result{} "cBa"
-@end smalllisp
-@end deffn
-
-@deffn {Scheme Procedure} string-join ls [delimiter grammar]
-Append the string in the string list @var{ls}, using the string
-@var{delim} as a delimiter between the elements of @var{ls}.
-@var{grammar} is a symbol which specifies how the delimiter is
-placed between the strings, and defaults to the symbol
-@code{infix}.
-
-@table @code
-@item infix
-Insert the separator between list elements. An empty string
-will produce an empty list.
-
-@item string-infix
-Like @code{infix}, but will raise an error if given the empty
-list.
-
-@item suffix
-Insert the separator after every list element.
-
-@item prefix
-Insert the separator before each list element.
-@end table
-@end deffn
-
-
-@c ===================================================================
-
-@node SRFI-13 Selection
-@subsection Selection
-
-These procedures are called @dfn{selectors}, because they access
-information about the string or select pieces of a given string.
-
-Additional selector procedures are documented in the Strings section
-(@pxref{String Selection}), like @code{string-length} or
-@code{string-ref}.
-
-@code{string-copy} is also available in core Guile, but this version
-accepts additional start/end indices.
-
-@deffn {Scheme Procedure} string-copy str [start end]
-Return a freshly allocated copy of the string @var{str}. If
-given, @var{start} and @var{end} delimit the portion of
-@var{str} which is copied.
-@end deffn
-
-@deffn {Scheme Procedure} substring/shared str start [end]
-Like @code{substring}, but the result may share memory with the
-argument @var{str}.
-@end deffn
-
-@deffn {Scheme Procedure} string-copy! target tstart s [start end]
-Copy the sequence of characters from index range [@var{start},
-@var{end}) in string @var{s} to string @var{target}, beginning
-at index @var{tstart}. The characters are copied left-to-right
-or right-to-left as needed - the copy is guaranteed to work,
-even if @var{target} and @var{s} are the same string. It is an
-error if the copy operation runs off the end of the target
-string.
-@end deffn
-
-@deffn {Scheme Procedure} string-take s n
-@deffnx {Scheme Procedure} string-take-right s n
-Return the @var{n} first/last characters of @var{s}.
-@end deffn
-
-@deffn {Scheme Procedure} string-drop s n
-@deffnx {Scheme Procedure} string-drop-right s n
-Return all but the first/last @var{n} characters of @var{s}.
-@end deffn
-
-@deffn {Scheme Procedure} string-pad s len [chr start end]
-@deffnx {Scheme Procedure} string-pad-right s len [chr start end]
-Take that characters from @var{start} to @var{end} from the
-string @var{s} and return a new string, right(left)-padded by the
-character @var{chr} to length @var{len}. If the resulting
-string is longer than @var{len}, it is truncated on the right (left).
-@end deffn
-
-@deffn {Scheme Procedure} string-trim s [char_pred start end]
-@deffnx {Scheme Procedure} string-trim-right s [char_pred start end]
-@deffnx {Scheme Procedure} string-trim-both s [char_pred start end]
-Trim @var{s} by skipping over all characters on the left/right/both
-sides of the string that satisfy the parameter @var{char_pred}:
-
-@itemize @bullet
-@item
-if it is the character @var{ch}, characters equal to
-@var{ch} are trimmed,
-
-@item
-if it is a procedure @var{pred} characters that
-satisfy @var{pred} are trimmed,
-
-@item
-if it is a character set, characters in that set are trimmed.
-@end itemize
-
-If called without a @var{char_pred} argument, all whitespace is
-trimmed.
-@end deffn
-
-
-@c ===================================================================
-
-@node SRFI-13 Modification
-@subsection Modification
-
-The procedure @code{string-fill!} is extended from R5RS because it
-accepts optional start/end indices. This bindings shadows the procedure
-of the same name in the Guile core. The second modification procedure
-@code{string-set!} is documented in the Strings section (@pxref{String
-Modification}).
-
-@deffn {Scheme Procedure} string-fill! str chr [start end]
-Stores @var{chr} in every element of the given @var{str} and
-returns an unspecified value.
-@end deffn
-
-
-@c ===================================================================
-
-@node SRFI-13 Comparison
-@subsection Comparison
-
-The procedures in this section are used for comparing strings in
-different ways. The comparison predicates differ from those in R5RS in
-that they do not only return @code{#t} or @code{#f}, but the mismatch
-index in the case of a true return value.
-
-@code{string-hash} and @code{string-hash-ci} are for calculating hash
-values for strings, useful for implementing fast lookup mechanisms.
-
-@deffn {Scheme Procedure} string-compare s1 s2 proc_lt proc_eq proc_gt [start1 end1 start2 end2]
-@deffnx {Scheme Procedure} string-compare-ci s1 s2 proc_lt proc_eq proc_gt [start1 end1 start2 end2]
-Apply @var{proc_lt}, @var{proc_eq}, @var{proc_gt} to the
-mismatch index, depending upon whether @var{s1} is less than,
-equal to, or greater than @var{s2}. The mismatch index is the
-largest index @var{i} such that for every 0 <= @var{j} <
-@var{i}, @var{s1}[@var{j}] = @var{s2}[@var{j}] - that is,
-@var{i} is the first position that does not match. The
-character comparison is done case-insensitively.
-@end deffn
-
-@deffn {Scheme Procedure} string= s1 s2 [start1 end1 start2 end2]
-@deffnx {Scheme Procedure} string<> s1 s2 [start1 end1 start2 end2]
-@deffnx {Scheme Procedure} string< s1 s2 [start1 end1 start2 end2]
-@deffnx {Scheme Procedure} string> s1 s2 [start1 end1 start2 end2]
-@deffnx {Scheme Procedure} string<= s1 s2 [start1 end1 start2 end2]
-@deffnx {Scheme Procedure} string>= s1 s2 [start1 end1 start2 end2]
-Compare @var{s1} and @var{s2} and return @code{#f} if the predicate
-fails. Otherwise, the mismatch index is returned (or @var{end1} in the
-case of @code{string=}.
-@end deffn
-
-@deffn {Scheme Procedure} string-ci= s1 s2 [start1 end1 start2 end2]
-@deffnx {Scheme Procedure} string-ci<> s1 s2 [start1 end1 start2 end2]
-@deffnx {Scheme Procedure} string-ci< s1 s2 [start1 end1 start2 end2]
-@deffnx {Scheme Procedure} string-ci> s1 s2 [start1 end1 start2 end2]
-@deffnx {Scheme Procedure} string-ci<= s1 s2 [start1 end1 start2 end2]
-@deffnx {Scheme Procedure} string-ci>= s1 s2 [start1 end1 start2 end2]
-Compare @var{s1} and @var{s2} and return @code{#f} if the predicate
-fails. Otherwise, the mismatch index is returned (or @var{end1} in the
-case of @code{string=}. These are the case-insensitive variants.
-@end deffn
-
-@deffn {Scheme Procedure} string-hash s [bound start end]
-@deffnx {Scheme Procedure} string-hash-ci s [bound start end]
-Return a hash value of the string @var{s} in the range 0 @dots{}
-@var{bound} - 1. @code{string-hash-ci} is the case-insensitive variant.
-@end deffn
-
-
-@c ===================================================================
-
-@node SRFI-13 Prefixes/Suffixes
-@subsection Prefixes/Suffixes
-
-Using these procedures you can determine whether a given string is a
-prefix or suffix of another string or how long a common prefix/suffix
-is.
-
-@deffn {Scheme Procedure} string-prefix-length s1 s2 [start1 end1 start2 end2]
-@deffnx {Scheme Procedure} string-prefix-length-ci s1 s2 [start1 end1 start2 end2]
-@deffnx {Scheme Procedure} string-suffix-length s1 s2 [start1 end1 start2 end2]
-@deffnx {Scheme Procedure} string-suffix-length-ci s1 s2 [start1 end1 start2 end2]
-Return the length of the longest common prefix/suffix of the two
-strings. @code{string-prefix-length-ci} and
-@code{string-suffix-length-ci} are the case-insensitive variants.
-@end deffn
-
-@deffn {Scheme Procedure} string-prefix? s1 s2 [start1 end1 start2 end2]
-@deffnx {Scheme Procedure} string-prefix-ci? s1 s2 [start1 end1 start2 end2]
-@deffnx {Scheme Procedure} string-suffix? s1 s2 [start1 end1 start2 end2]
-@deffnx {Scheme Procedure} string-suffix-ci? s1 s2 [start1 end1 start2 end2]
-Is @var{s1} a prefix/suffix of @var{s2}. @code{string-prefix-ci?} and
-@code{string-suffix-ci?} are the case-insensitive variants.
-@end deffn
-
-
-@c ===================================================================
-
-@node SRFI-13 Searching
-@subsection Searching
-
-Use these procedures to find out whether a string contains a given
-character or a given substring, or a character from a set of characters.
-
-@deffn {Scheme Procedure} string-index s char_pred [start end]
-@deffnx {Scheme Procedure} string-index-right s char_pred [start end]
-Search through the string @var{s} from left to right (right to left),
-returning the index of the first (last) occurrence of a character which
-
-@itemize @bullet
-@item
-equals @var{char_pred}, if it is character,
-
-@item
-satisfies the predicate @var{char_pred}, if it is a
-procedure,
-
-@item
-is in the set @var{char_pred}, if it is a character set.
-@end itemize
-@end deffn
-
-@deffn {Scheme Procedure} string-skip s char_pred [start end]
-@deffnx {Scheme Procedure} string-skip-right s char_pred [start end]
-Search through the string @var{s} from left to right (right to left),
-returning the index of the first (last) occurrence of a character which
-
-@itemize @bullet
-@item
-does not equal @var{char_pred}, if it is character,
-
-@item
-does not satisfy the predicate @var{char_pred}, if it is
-a procedure.
-
-@item
-is not in the set if @var{char_pred} is a character set.
-@end itemize
-@end deffn
-
-@deffn {Scheme Procedure} string-count s char_pred [start end]
-Return the count of the number of characters in the string
-@var{s} which
-
-@itemize @bullet
-@item
-equals @var{char_pred}, if it is character,
-
-@item
-satisfies the predicate @var{char_pred}, if it is a procedure.
-
-@item
-is in the set @var{char_pred}, if it is a character set.
-@end itemize
-@end deffn
-
-@deffn {Scheme Procedure} string-contains s1 s2 [start1 end1 start2 end2]
-@deffnx {Scheme Procedure} string-contains-ci s1 s2 [start1 end1 start2 end2]
-Does string @var{s1} contain string @var{s2}? Return the index
-in @var{s1} where @var{s2} occurs as a substring, or false.
-The optional start/end indices restrict the operation to the
-indicated substrings.
-
-@code{string-contains-ci} is the case-insensitive variant.
-@end deffn
-
-
-@c ===================================================================
-
-@node SRFI-13 Case Mapping
-@subsection Alphabetic Case Mapping
-
-These procedures convert the alphabetic case of strings. They are
-similar to the procedures in the Guile core, but are extended to handle
-optional start/end indices.
-
-@deffn {Scheme Procedure} string-upcase s [start end]
-@deffnx {Scheme Procedure} string-upcase! s [start end]
-Upcase every character in @var{s}. @code{string-upcase!} is the
-side-effecting variant.
-@end deffn
-
-@deffn {Scheme Procedure} string-downcase s [start end]
-@deffnx {Scheme Procedure} string-downcase! s [start end]
-Downcase every character in @var{s}. @code{string-downcase!} is the
-side-effecting variant.
-@end deffn
-
-@deffn {Scheme Procedure} string-titlecase s [start end]
-@deffnx {Scheme Procedure} string-titlecase! s [start end]
-Upcase every first character in every word in @var{s}, downcase the
-other characters. @code{string-titlecase!} is the side-effecting
-variant.
-@end deffn
-
-
-@c ===================================================================
-
-@node SRFI-13 Reverse/Append
-@subsection Reverse/Append
-
-One appending procedure, @code{string-append} is the same in R5RS and in
-SRFI-13, so it is not redefined.
-
-@deffn {Scheme Procedure} string-reverse str [start end]
-@deffnx {Scheme Procedure} string-reverse! str [start end]
-Reverse the string @var{str}. The optional arguments
-@var{start} and @var{end} delimit the region of @var{str} to
-operate on.
-
-@code{string-reverse!} modifies the argument string and returns an
-unspecified value.
-@end deffn
-
-@deffn {Scheme Procedure} string-append/shared ls @dots{}
-Like @code{string-append}, but the result may share memory
-with the argument strings.
-@end deffn
-
-@deffn {Scheme Procedure} string-concatenate ls
-Append the elements of @var{ls} (which must be strings)
-together into a single string. Guaranteed to return a freshly
-allocated string.
-@end deffn
-
-@deffn {Scheme Procedure} string-concatenate/shared ls
-Like @code{string-concatenate}, but the result may share memory
-with the strings in the list @var{ls}.
-@end deffn
-
-@deffn {Scheme Procedure} string-concatenate-reverse ls final_string end
-Without optional arguments, this procedure is equivalent to
-
-@smalllisp
-(string-concatenate (reverse ls))
-@end smalllisp
-
-If the optional argument @var{final_string} is specified, it is
-consed onto the beginning to @var{ls} before performing the
-list-reverse and string-concatenate operations. If @var{end}
-is given, only the characters of @var{final_string} up to index
-@var{end} are used.
-
-Guaranteed to return a freshly allocated string.
-@end deffn
-
-@deffn {Scheme Procedure} string-concatenate-reverse/shared ls final_string end
-Like @code{string-concatenate-reverse}, but the result may
-share memory with the the strings in the @var{ls} arguments.
-@end deffn
-
-
-@c ===================================================================
-
-@node SRFI-13 Fold/Unfold/Map
-@subsection Fold/Unfold/Map
-
-@code{string-map}, @code{string-for-each} etc. are for iterating over
-the characters a string is composed of. The fold and unfold procedures
-are list iterators and constructors.
-
-@deffn {Scheme Procedure} string-map proc s [start end]
-@var{proc} is a char->char procedure, it is mapped over
-@var{s}. The order in which the procedure is applied to the
-string elements is not specified.
-@end deffn
-
-@deffn {Scheme Procedure} string-map! proc s [start end]
-@var{proc} is a char->char procedure, it is mapped over
-@var{s}. The order in which the procedure is applied to the
-string elements is not specified. The string @var{s} is
-modified in-place, the return value is not specified.
-@end deffn
-
-@deffn {Scheme Procedure} string-fold kons knil s [start end]
-@deffnx {Scheme Procedure} string-fold-right kons knil s [start end]
-Fold @var{kons} over the characters of @var{s}, with @var{knil} as the
-terminating element, from left to right (or right to left, for
-@code{string-fold-right}). @var{kons} must expect two arguments: The
-actual character and the last result of @var{kons}' application.
-@end deffn
-
-@deffn {Scheme Procedure} string-unfold p f g seed [base make_final]
-@deffnx {Scheme Procedure} string-unfold-right p f g seed [base make_final]
-These are the fundamental string constructors.
-@itemize @bullet
-@item @var{g} is used to generate a series of @emph{seed}
-values from the initial @var{seed}: @var{seed}, (@var{g}
-@var{seed}), (@var{g}^2 @var{seed}), (@var{g}^3 @var{seed}),
-@dots{}
-@item @var{p} tells us when to stop - when it returns true
-when applied to one of these seed values.
-@item @var{f} maps each seed value to the corresponding
-character in the result string. These chars are assembled into the
-string in a left-to-right (right-to-left) order.
-@item @var{base} is the optional initial/leftmost (rightmost)
- portion of the constructed string; it default to the empty string.
-@item @var{make_final} is applied to the terminal seed
-value (on which @var{p} returns true) to produce the final/rightmost
-(leftmost) portion of the constructed string. It defaults to
-@code{(lambda (x) "")}.
-@end itemize
-@end deffn
-
-@deffn {Scheme Procedure} string-for-each proc s [start end]
-@var{proc} is mapped over @var{s} in left-to-right order. The
-return value is not specified.
-@end deffn
-
-
-@c ===================================================================
-
-@node SRFI-13 Replicate/Rotate
-@subsection Replicate/Rotate
-
-These procedures are special substring procedures, which can also be
-used for replicating strings. They are a bit tricky to use, but
-consider this code fragment, which replicates the input string
-@code{"foo"} so often that the resulting string has a length of six.
-
-@lisp
-(xsubstring "foo" 0 6)
-@result{}
-"foofoo"
-@end lisp
-
-@deffn {Scheme Procedure} xsubstring s from [to start end]
-This is the @emph{extended substring} procedure that implements
-replicated copying of a substring of some string.
-
-@var{s} is a string, @var{start} and @var{end} are optional
-arguments that demarcate a substring of @var{s}, defaulting to
-0 and the length of @var{s}. Replicate this substring up and
-down index space, in both the positive and negative directions.
-@code{xsubstring} returns the substring of this string
-beginning at index @var{from}, and ending at @var{to}, which
-defaults to @var{from} + (@var{end} - @var{start}).
-@end deffn
-
-@deffn {Scheme Procedure} string-xcopy! target tstart s sfrom [sto start end]
-Exactly the same as @code{xsubstring}, but the extracted text
-is written into the string @var{target} starting at index
-@var{tstart}. The operation is not defined if @code{(eq?
-@var{target} @var{s})} or these arguments share storage - you
-cannot copy a string on top of itself.
-@end deffn
-
-
-@c ===================================================================
-
-@node SRFI-13 Miscellaneous
-@subsection Miscellaneous
-
-@code{string-replace} is for replacing a portion of a string with
-another string and @code{string-tokenize} splits a string into a list of
-strings, breaking it up at a specified character.
-
-@deffn {Scheme Procedure} string-replace s1 s2 [start1 end1 start2 end2]
-Return the string @var{s1}, but with the characters
-@var{start1} @dots{} @var{end1} replaced by the characters
-@var{start2} @dots{} @var{end2} from @var{s2}.
-@end deffn
-
-@deffn {Scheme Procedure} string-tokenize s [token-set start end]
-Split the string @var{s} into a list of substrings, where each
-substring is a maximal non-empty contiguous sequence of characters
-from the character set @var{token_set}, which defaults to an
-equivalent of @code{char-set:graphic}. If @var{start} or @var{end}
-indices are provided, they restrict @code{string-tokenize} to
-operating on the indicated substring of @var{s}.
-@end deffn
-
-
-@c ===================================================================
-
-@node SRFI-13 Filtering/Deleting
-@subsection Filtering/Deleting
-
-@dfn{Filtering} means to remove all characters from a string which do
-not match a given criteria, @dfn{deleting} means the opposite.
-
-@deffn {Scheme Procedure} string-filter s char_pred [start end]
-Filter the string @var{s}, retaining only those characters that
-satisfy the @var{char_pred} argument. If the argument is a
-procedure, it is applied to each character as a predicate, if
-it is a character, it is tested for equality and if it is a
-character set, it is tested for membership.
-@end deffn
-
-@deffn {Scheme Procedure} string-delete s char_pred [start end]
-Filter the string @var{s}, retaining only those characters that
-do not satisfy the @var{char_pred} argument. If the argument
-is a procedure, it is applied to each character as a predicate,
-if it is a character, it is tested for equality and if it is a
-character set, it is tested for membership.
-@end deffn
-
-
-@node SRFI-14
-@section SRFI-14 - Character-set Library
-
-SRFI-14 defines the data type @dfn{character set}, and also defines a
-lot of procedures for handling this character type, and a few standard
-character sets like whitespace, alphabetic characters and others.
-
-All procedures from SRFI-14 (character-set library) are implemented in
-the module @code{(srfi srfi-14)}, as well as the standard variables
-@code{char-set:letter}, @code{char-set:digit} etc.
-
-@menu
-* Loading SRFI-14:: How to make charsets available.
-* SRFI-14 Character Set Data Type:: Underlying data type for charsets.
-* SRFI-14 Predicates/Comparison:: Charset predicates.
-* SRFI-14 Iterating Over Character Sets:: Enumerate charset elements.
-* SRFI-14 Creating Character Sets:: Making new charsets.
-* SRFI-14 Querying Character Sets:: Test charsets for membership etc.
-* SRFI-14 Character-Set Algebra:: Calculating new charsets.
-* SRFI-14 Standard Character Sets:: Variables containing predefined charsets.
-@end menu
-
-
-@node Loading SRFI-14
-@subsection Loading SRFI-14
-
-When Guile is properly installed, SRFI-14 support can be loaded into a
-running Guile by using the @code{(srfi srfi-14)} module.
-
-@example
-$ guile
-guile> (use-modules (srfi srfi-14))
-guile> (char-set-union (char-set #\f #\o #\o) (string->char-set "bar"))
-#<charset @{#\a #\b #\f #\o #\r@}>
-guile>
-@end example
-
-
-@node SRFI-14 Character Set Data Type
-@subsection Character Set Data Type
-
-The data type @dfn{charset} implements sets of characters
-(@pxref{Characters}). Because the internal representation of character
-sets is not visible to the user, a lot of procedures for handling them
-are provided.
-
-Character sets can be created, extended, tested for the membership of a
-characters and be compared to other character sets.
-
-The Guile implementation of character sets deals with 8-bit characters.
-In the standard variables, only the ASCII part of the character range is
-really used, so that for example @dfn{Umlaute} and other accented
-characters are not considered to be letters. In the future, as Guile
-may get support for international character sets, this will change, so
-don't rely on these ``features''.
-
-
-@c ===================================================================
-
-@node SRFI-14 Predicates/Comparison
-@subsection Predicates/Comparison
-
-Use these procedures for testing whether an object is a character set,
-or whether several character sets are equal or subsets of each other.
-@code{char-set-hash} can be used for calculating a hash value, maybe for
-usage in fast lookup procedures.
-
-@deffn {Scheme Procedure} char-set? obj
-Return @code{#t} if @var{obj} is a character set, @code{#f}
-otherwise.
-@end deffn
-
-@deffn {Scheme Procedure} char-set= cs1 @dots{}
-Return @code{#t} if all given character sets are equal.
-@end deffn
-
-@deffn {Scheme Procedure} char-set<= cs1 @dots{}
-Return @code{#t} if every character set @var{cs}i is a subset
-of character set @var{cs}i+1.
-@end deffn
-
-@deffn {Scheme Procedure} char-set-hash cs [bound]
-Compute a hash value for the character set @var{cs}. If
-@var{bound} is given and not @code{#f}, it restricts the
-returned value to the range 0 @dots{} @var{bound - 1}.
-@end deffn
-
-
-@c ===================================================================
-
-@node SRFI-14 Iterating Over Character Sets
-@subsection Iterating Over Character Sets
-
-Character set cursors are a means for iterating over the members of a
-character sets. After creating a character set cursor with
-@code{char-set-cursor}, a cursor can be dereferenced with
-@code{char-set-ref}, advanced to the next member with
-@code{char-set-cursor-next}. Whether a cursor has passed past the last
-element of the set can be checked with @code{end-of-char-set?}.
-
-Additionally, mapping and (un-)folding procedures for character sets are
-provided.
-
-@deffn {Scheme Procedure} char-set-cursor cs
-Return a cursor into the character set @var{cs}.
-@end deffn
-
-@deffn {Scheme Procedure} char-set-ref cs cursor
-Return the character at the current cursor position
-@var{cursor} in the character set @var{cs}. It is an error to
-pass a cursor for which @code{end-of-char-set?} returns true.
-@end deffn
-
-@deffn {Scheme Procedure} char-set-cursor-next cs cursor
-Advance the character set cursor @var{cursor} to the next
-character in the character set @var{cs}. It is an error if the
-cursor given satisfies @code{end-of-char-set?}.
-@end deffn
-
-@deffn {Scheme Procedure} end-of-char-set? cursor
-Return @code{#t} if @var{cursor} has reached the end of a
-character set, @code{#f} otherwise.
-@end deffn
-
-@deffn {Scheme Procedure} char-set-fold kons knil cs
-Fold the procedure @var{kons} over the character set @var{cs},
-initializing it with @var{knil}.
-@end deffn
-
-@deffn {Scheme Procedure} char-set-unfold p f g seed [base_cs]
-@deffnx {Scheme Procedure} char-set-unfold! p f g seed base_cs
-This is a fundamental constructor for character sets.
-@itemize @bullet
-@item @var{g} is used to generate a series of ``seed'' values
-from the initial seed: @var{seed}, (@var{g} @var{seed}),
-(@var{g}^2 @var{seed}), (@var{g}^3 @var{seed}), @dots{}
-@item @var{p} tells us when to stop -- when it returns true
-when applied to one of the seed values.
-@item @var{f} maps each seed value to a character. These
-characters are added to the base character set @var{base_cs} to
-form the result; @var{base_cs} defaults to the empty set.
-@end itemize
-
-@code{char-set-unfold!} is the side-effecting variant.
-@end deffn
-
-@deffn {Scheme Procedure} char-set-for-each proc cs
-Apply @var{proc} to every character in the character set
-@var{cs}. The return value is not specified.
-@end deffn
-
-@deffn {Scheme Procedure} char-set-map proc cs
-Map the procedure @var{proc} over every character in @var{cs}.
-@var{proc} must be a character -> character procedure.
-@end deffn
-
-
-@c ===================================================================
-
-@node SRFI-14 Creating Character Sets
-@subsection Creating Character Sets
-
-New character sets are produced with these procedures.
-
-@deffn {Scheme Procedure} char-set-copy cs
-Return a newly allocated character set containing all
-characters in @var{cs}.
-@end deffn
-
-@deffn {Scheme Procedure} char-set char1 @dots{}
-Return a character set containing all given characters.
-@end deffn
-
-@deffn {Scheme Procedure} list->char-set char_list [base_cs]
-@deffnx {Scheme Procedure} list->char-set! char_list base_cs
-Convert the character list @var{list} to a character set. If
-the character set @var{base_cs} is given, the character in this
-set are also included in the result.
-
-@code{list->char-set!} is the side-effecting variant.
-@end deffn
-
-@deffn {Scheme Procedure} string->char-set s [base_cs]
-@deffnx {Scheme Procedure} string->char-set! s base_cs
-Convert the string @var{str} to a character set. If the
-character set @var{base_cs} is given, the characters in this
-set are also included in the result.
-
-@code{string->char-set!} is the side-effecting variant.
-@end deffn
-
-@deffn {Scheme Procedure} char-set-filter pred cs [base_cs]
-@deffnx {Scheme Procedure} char-set-filter! pred cs base_cs
-Return a character set containing every character from @var{cs}
-so that it satisfies @var{pred}. If provided, the characters
-from @var{base_cs} are added to the result.
-
-@code{char-set-filter!} is the side-effecting variant.
-@end deffn
-
-@deffn {Scheme Procedure} ucs-range->char-set lower upper [error? base_cs]
-@deffnx {Scheme Procedure} uce-range->char-set! lower upper error? base_cs
-Return a character set containing all characters whose
-character codes lie in the half-open range
-[@var{lower},@var{upper}).
-
-If @var{error} is a true value, an error is signalled if the
-specified range contains characters which are not contained in
-the implemented character range. If @var{error} is @code{#f},
-these characters are silently left out of the resulting
-character set.
-
-The characters in @var{base_cs} are added to the result, if
-given.
-
-@code{ucs-range->char-set!} is the side-effecting variant.
-@end deffn
-
-@deffn {Scheme Procedure} ->char-set x
-Coerce @var{x} into a character set. @var{x} may be a string, a
-character or a character set.
-@end deffn
-
-
-@c ===================================================================
-
-@node SRFI-14 Querying Character Sets
-@subsection Querying Character Sets
-
-Access the elements and other information of a character set with these
-procedures.
-
-@deffn {Scheme Procedure} char-set-size cs
-Return the number of elements in character set @var{cs}.
-@end deffn
-
-@deffn {Scheme Procedure} char-set-count pred cs
-Return the number of the elements int the character set
-@var{cs} which satisfy the predicate @var{pred}.
-@end deffn
-
-@deffn {Scheme Procedure} char-set->list cs
-Return a list containing the elements of the character set
-@var{cs}.
-@end deffn
-
-@deffn {Scheme Procedure} char-set->string cs
-Return a string containing the elements of the character set
-@var{cs}. The order in which the characters are placed in the
-string is not defined.
-@end deffn
-
-@deffn {Scheme Procedure} char-set-contains? cs char
-Return @code{#t} iff the character @var{ch} is contained in the
-character set @var{cs}.
-@end deffn
-
-@deffn {Scheme Procedure} char-set-every pred cs
-Return a true value if every character in the character set
-@var{cs} satisfies the predicate @var{pred}.
-@end deffn
-
-@deffn {Scheme Procedure} char-set-any pred cs
-Return a true value if any character in the character set
-@var{cs} satisfies the predicate @var{pred}.
-@end deffn
-
-
-@c ===================================================================
-
-@node SRFI-14 Character-Set Algebra
-@subsection Character-Set Algebra
-
-Character sets can be manipulated with the common set algebra operation,
-such as union, complement, intersection etc. All of these procedures
-provide side-effecting variants, which modify their character set
-argument(s).
-
-@deffn {Scheme Procedure} char-set-adjoin cs char1 @dots{}
-@deffnx {Scheme Procedure} char-set-adjoin! cs char1 @dots{}
-Add all character arguments to the first argument, which must
-be a character set.
-@end deffn
-
-@deffn {Scheme Procedure} char-set-delete cs char1 @dots{}
-@deffnx {Scheme Procedure} char-set-delete! cs char1 @dots{}
-Delete all character arguments from the first argument, which
-must be a character set.
-@end deffn
-
-@deffn {Scheme Procedure} char-set-complement cs
-@deffnx {Scheme Procedure} char-set-complement! cs
-Return the complement of the character set @var{cs}.
-@end deffn
-
-@deffn {Scheme Procedure} char-set-union cs1 @dots{}
-@deffnx {Scheme Procedure} char-set-union! cs1 @dots{}
-Return the union of all argument character sets.
-@end deffn
-
-@deffn {Scheme Procedure} char-set-intersection cs1 @dots{}
-@deffnx {Scheme Procedure} char-set-intersection! cs1 @dots{}
-Return the intersection of all argument character sets.
-@end deffn
-
-@deffn {Scheme Procedure} char-set-difference cs1 @dots{}
-@deffnx {Scheme Procedure} char-set-difference! cs1 @dots{}
-Return the difference of all argument character sets.
-@end deffn
-
-@deffn {Scheme Procedure} char-set-xor cs1 @dots{}
-@deffnx {Scheme Procedure} char-set-xor! cs1 @dots{}
-Return the exclusive-or of all argument character sets.
-@end deffn
-
-@deffn {Scheme Procedure} char-set-diff+intersection cs1 @dots{}
-@deffnx {Scheme Procedure} char-set-diff+intersection! cs1 @dots{}
-Return the difference and the intersection of all argument
-character sets.
-@end deffn
-
-
-@c ===================================================================
-
-@node SRFI-14 Standard Character Sets
-@subsection Standard Character Sets
-
-In order to make the use of the character set data type and procedures
-useful, several predefined character set variables exist.
-
-@defvar char-set:lower-case
-All lower-case characters.
-@end defvar
-
-@defvar char-set:upper-case
-All upper-case characters.
-@end defvar
-
-@defvar char-set:title-case
-This is empty, because ASCII has no titlecase characters.
-@end defvar
-
-@defvar char-set:letter
-All letters, e.g. the union of @code{char-set:lower-case} and
-@code{char-set:upper-case}.
-@end defvar
-
-@defvar char-set:digit
-All digits.
-@end defvar
-
-@defvar char-set:letter+digit
-The union of @code{char-set:letter} and @code{char-set:digit}.
-@end defvar
-
-@defvar char-set:graphic
-All characters which would put ink on the paper.
-@end defvar
-
-@defvar char-set:printing
-The union of @code{char-set:graphic} and @code{char-set:whitespace}.
-@end defvar
-
-@defvar char-set:whitespace
-All whitespace characters.
-@end defvar
-
-@defvar char-set:blank
-All horizontal whitespace characters, that is @code{#\space} and
-@code{#\tab}.
-@end defvar
-
-@defvar char-set:iso-control
-The ISO control characters with the codes 0--31 and 127.
-@end defvar
-
-@defvar char-set:punctuation
-The characters @code{!"#%&'()*,-./:;?@@[\\]_@{@}}
-@end defvar
-
-@defvar char-set:symbol
-The characters @code{$+<=>^`|~}.
-@end defvar
-
-@defvar char-set:hex-digit
-The hexadecimal digits @code{0123456789abcdefABCDEF}.
-@end defvar
-
-@defvar char-set:ascii
-All ASCII characters.
-@end defvar
-
-@defvar char-set:empty
-The empty character set.
-@end defvar
-
-@defvar char-set:full
-This character set contains all possible characters.
-@end defvar
-
-@node SRFI-16
-@section SRFI-16 - case-lambda
-
-@c FIXME::martin: Review me!
-
-The syntactic form @code{case-lambda} creates procedures, just like
-@code{lambda}, but has syntactic extensions for writing procedures of
-varying arity easier.
-
-The syntax of the @code{case-lambda} form is defined in the following
-EBNF grammar.
-
-@example
-@group
-<case-lambda>
- --> (case-lambda <case-lambda-clause>)
-<case-lambda-clause>
- --> (<formals> <definition-or-command>*)
-<formals>
- --> (<identifier>*)
- | (<identifier>* . <identifier>)
- | <identifier>
-@end group
-@end example
-
-The value returned by a @code{case-lambda} form is a procedure which
-matches the number of actual arguments against the formals in the
-various clauses, in order. @dfn{Formals} means a formal argument list
-just like with @code{lambda} (@pxref{Lambda}). The first matching clause
-is selected, the corresponding values from the actual parameter list are
-bound to the variable names in the clauses and the body of the clause is
-evaluated. If no clause matches, an error is signalled.
-
-The following (silly) definition creates a procedure @var{foo} which
-acts differently, depending on the number of actual arguments. If one
-argument is given, the constant @code{#t} is returned, two arguments are
-added and if more arguments are passed, their product is calculated.
-
-@lisp
-(define foo (case-lambda
- ((x) #t)
- ((x y) (+ x y))
- (z
- (apply * z))))
-(foo 'bar)
-@result{}
-#t
-(foo 2 4)
-@result{}
-6
-(foo 3 3 3)
-@result{}
-27
-(foo)
-@result{}
-1
-@end lisp
-
-The last expression evaluates to 1 because the last clause is matched,
-@var{z} is bound to the empty list and the following multiplication,
-applied to zero arguments, yields 1.
-
-
-@node SRFI-17
-@section SRFI-17 - Generalized set!
-
-This is an implementation of SRFI-17: Generalized set!
-
-It exports the Guile procedure @code{make-procedure-with-setter} under
-the SRFI name @code{getter-with-setter} and exports the standard
-procedures @code{car}, @code{cdr}, @dots{}, @code{cdddr},
-@code{string-ref} and @code{vector-ref} as procedures with setters, as
-required by the SRFI.
-
-SRFI-17 was heavily criticized during its discussion period but it was
-finalized anyway. One issue was its concept of globally associating
-setter @dfn{properties} with (procedure) values, which is non-Schemy.
-For this reason, this implementation chooses not to provide a way to set
-the setter of a procedure. In fact, @code{(set! (setter @var{proc})
-@var{setter})} signals an error. The only way to attach a setter to a
-procedure is to create a new object (a @dfn{procedure with setter}) via
-the @code{getter-with-setter} procedure. This procedure is also
-specified in the SRFI. Using it avoids the described problems.
-
-
-@node SRFI-19
-@section SRFI-19 - Time/Date Library
-
-This is an implementation of SRFI-19: Time/Date Library
-
-It depends on SRFIs: 6 (@pxref{SRFI-6}), 8 (@pxref{SRFI-8}),
-9 (@pxref{SRFI-9}).
-
-This section documents constants and procedure signatures.
-
-@menu
-* SRFI-19 Constants::
-* SRFI-19 Current time and clock resolution::
-* SRFI-19 Time object and accessors::
-* SRFI-19 Time comparison procedures::
-* SRFI-19 Time arithmetic procedures::
-* SRFI-19 Date object and accessors::
-* SRFI-19 Time/Date/Julian Day/Modified Julian Day converters::
-* SRFI-19 Date to string/string to date converters::
-@end menu
-
-@node SRFI-19 Constants
-@subsection SRFI-19 Constants
-
-All these are bound to their symbol names:
-
-@example
- time-duration
- time-monotonic
- time-process
- time-tai
- time-thread
- time-utc
-@end example
-
-@node SRFI-19 Current time and clock resolution
-@subsection SRFI-19 Current time and clock resolution
-
-@example
- (current-date . tz-offset)
- (current-julian-day)
- (current-modified-julian-day)
- (current-time . clock-type)
- (time-resolution . clock-type)
-@end example
-
-@node SRFI-19 Time object and accessors
-@subsection SRFI-19 Time object and accessors
-
-@example
- (make-time type nanosecond second)
- (time? obj)
- (time-type time)
- (time-nanosecond time)
- (time-second time)
- (set-time-type! time type)
- (set-time-nanosecond! time nsec)
- (set-time-second! time sec)
- (copy-time time)
-@end example
-
-@node SRFI-19 Time comparison procedures
-@subsection SRFI-19 Time comparison procedures
-
-Args are all @code{time} values.
-
-@example
- (time<=? t1 t2)
- (time<? t1 t2)
- (time=? t1 t2)
- (time>=? t1 t2)
- (time>? t1 t2)
-@end example
-
-@node SRFI-19 Time arithmetic procedures
-@subsection SRFI-19 Time arithmetic procedures
-
-The @code{foo!} variants modify in place. Time difference
-is expressed in @code{time-duration} values.
-
-@example
- (time-difference t1 t2)
- (time-difference! t1 t2)
- (add-duration time duration)
- (add-duration! time duration)
- (subtract-duration time duration)
- (subtract-duration! time duration)
- @end example
-
-@node SRFI-19 Date object and accessors
-@subsection SRFI-19 Date object and accessors
-
-@example
- (make-date nsecs seconds minutes hours
- date month year offset)
- (date? obj)
- (date-nanosecond date)
- (date-second date)
- (date-minute date)
- (date-hour date)
- (date-day date)
- (date-month date)
- (date-year date)
- (date-zone-offset date)
- (date-year-day date)
- (date-week-day date)
- (date-week-number date day-of-week-starting-week)
-@end example
-
-@node SRFI-19 Time/Date/Julian Day/Modified Julian Day converters
-@subsection SRFI-19 Time/Date/Julian Day/Modified Julian Day converters
-
-@example
- (date->julian-day date)
- (date->modified-julian-day date)
- (date->time-monotonic date)
- (date->time-tai date)
- (date->time-utc date)
- (julian-day->date jdn . tz-offset)
- (julian-day->time-monotonic jdn)
- (julian-day->time-tai jdn)
- (julian-day->time-utc jdn)
- (modified-julian-day->date jdn . tz-offset)
- (modified-julian-day->time-monotonic jdn)
- (modified-julian-day->time-tai jdn)
- (modified-julian-day->time-utc jdn)
- (time-monotonic->date time . tz-offset)
- (time-monotonic->time-tai time-in)
- (time-monotonic->time-tai! time-in)
- (time-monotonic->time-utc time-in)
- (time-monotonic->time-utc! time-in)
- (time-tai->date time . tz-offset)
- (time-tai->julian-day time)
- (time-tai->modified-julian-day time)
- (time-tai->time-monotonic time-in)
- (time-tai->time-monotonic! time-in)
- (time-tai->time-utc time-in)
- (time-tai->time-utc! time-in)
- (time-utc->date time . tz-offset)
- (time-utc->julian-day time)
- (time-utc->modified-julian-day time)
- (time-utc->time-monotonic time-in)
- (time-utc->time-monotonic! time-in)
- (time-utc->time-tai time-in)
- (time-utc->time-tai! time-in)
-@end example
-
-@node SRFI-19 Date to string/string to date converters
-@subsection SRFI-19 Date to string/string to date converters
-
-@example
- (date->string date . format-string)
- (string->date input-string template-string)
-@end example
-
-@c srfi-modules.texi ends here
diff --git a/doc/ref/tcltk.texi b/doc/ref/tcltk.texi
deleted file mode 100644
index efc38ea9d..000000000
--- a/doc/ref/tcltk.texi
+++ /dev/null
@@ -1,3 +0,0 @@
-@page
-@node Tcl/Tk Interface
-@chapter Tcl/Tk Interface
diff --git a/doc/ref/tools.texi b/doc/ref/tools.texi
deleted file mode 100644
index 061e34477..000000000
--- a/doc/ref/tools.texi
+++ /dev/null
@@ -1,386 +0,0 @@
-@page
-@node Miscellaneous Tools
-@chapter Miscellaneous Tools
-
-Programming is more fun with a good tools. This chapter describes snarfing
-tools, and the @code{guile-tools} program which can be used to invoke the rest
-of the tools (which are self-documenting). Some of these are used in Guile
-development, too. Imagine that!
-
-@menu
-* Snarfing:: Grepping the source in various ways.
-* Executable Modules:: Modules callable via guile-tools.
-@end menu
-
-@c ---------------------------------------------------------------------------
-@node Snarfing
-@section Snarfing
-@cindex snarfing
-
-Because it's easier to maintain documentation, code, and other metainfo in one
-source file than in many files, there have evolved many methods for grepping
-source to lift and separate these kinds of info, in the process generating
-docs or fragments of source or what have you. This is known generally as
-@dfn{snarfing}, which comes from the verb ``to snarf'', here meaning ``to
-unceremoniously extract information from a somewhat unwilling source.''
-
-This section documents the installed program @code{guile-snarf} which does
-@dfn{init snarfing}, and also touches upon guile's doc snarfing process which
-is not yet finalized (i.e., doc snarfing programs are not installed at this
-time).
-
-@menu
-* Init Snarfing with guile-snarf:: Exposing C subrs and friends to Scheme.
-* Doc Snarfing:: Generating GDFv2 or texi from source.
-@end menu
-
-@c ---------------------------------------------------------------------------
-@node Init Snarfing with guile-snarf
-@subsection Init Snarfing with guile-snarf
-@c NOTE: This node and two subnodes are adapted from ../sources/snarf.texi.
-@cindex snarfing, init
-@cindex primitive functions
-@cindex subrs, defining
-
-When writing C code for use with Guile, you typically define a set of C
-functions, and then make some of them visible to the Scheme world by
-calling the @code{scm_c_define_gsubr} function; a C function published in
-this way is called a @dfn{subr}. If you have many subrs to publish, it
-can sometimes be annoying to keep the list of calls to
-@code{scm_c_define_gsubr} in sync with the list of function definitions.
-Frequently, a programmer will define a new subr in C, recompile the
-application, and then discover that the Scheme interpreter cannot see
-the subr, because of a missed call to @code{scm_c_define_gsubr}.
-
-Guile provides the @code{guile-snarf} command to manage this problem.
-Using this tool, you can keep all the information needed to define the
-subr alongside the function definition itself; @code{guile-snarf} will
-extract this information from your source code, and automatically
-generate a file of calls to @code{scm_c_define_gsubr} which you can
-@code{#include} into an initialization function.
-
-@menu
-* How guile-snarf works:: Using @code{guile-snarf}, with example.
-* Macros guile-snarf recognizes:: How to mark up code for @code{guile-snarf}.
-@end menu
-
-@c ---------------------------------------------------------------------------
-@node How guile-snarf works
-@subsubsection How guile-snarf works
-@cindex guile-snarf invocation
-@cindex guile-snarf example
-
-Usage: guile-snarf [-d | -D] [-o OUTFILE] INFILE [CPP-OPTIONS ...]
-
-What @code{guile-snarf} does:
-
-Process INFILE using the C pre-processor and some other programs.
-Write output to a file named OUTFILE or to the standard output when no
-OUTFILE has been specified or when OUTFILE is @code{-}. When writing
-to a file, ignore lines from the input matching the following grep(1)
-regular expression:
-
-@example
- ^#include ".*OUTFILE"
-@end example
-
-If there are errors during processing, delete OUTFILE and exit with
-non-zero status.
-
-Optional arg "-d" means grep INFILE for deprecated macros and
-issue a warning if any are found. Alternatively, "-D" means
-do the same thing but signal error and exit with non-zero status.
-
-If env var CPP is set, use its value instead of the C pre-processor
-determined at Guile configure-time.
-
-During snarfing, the pre-processor macro @code{SCM_MAGIC_SNARFER} is
-defined.
-
-@xref{Macros guile-snarf recognizes}, for a list of the special (some would
-say magic) cpp macros you can use, including the list of deprecated macros.
-
-For example, here is how you might define a new subr called
-@code{clear-image}, implemented by the C function @code{clear_image}:
-
-@example
-@group
-#include <libguile.h>
-
-SCM_DEFINE (clear_image, "clear-image", 1, 0, 0,
- (SCM image_smob),
- "Clear the image.")
-#define FUNC_NAME s_clear_image
-@{
- /* C code to clear the image... */
-@}
-#undef FUNC_NAME
-
-void
-init_image_type ()
-@{
-#include "image-type.x"
-@}
-@end group
-@end example
-
-The @code{SCM_DEFINE} declaration says that the C function
-@code{clear_image} implements a Scheme subr called @code{clear-image},
-which takes one required argument (type @code{SCM} named
-@code{image_smob}), no optional arguments, and no tail argument.
-@xref{Doc Snarfing}, for info on the docstring.
-
-This works in concert with @code{FUNC_NAME} to also define a static
-array of characters named @code{s_clear_image}, initialized to the
-string "clear-image". The body of @code{clear_image} may use the array
-in error messages, instead of writing out the literal string; this may
-save string space on some systems.
-
-Assuming the text above lives in a file named @file{image-type.c}, you will
-need to execute the following command to prepare this file for compilation:
-
-@example
-guile-snarf image-type.c
-@end example
-
-This scans @file{image-type.c} for @code{SCM_DEFINE}
-declarations, and writes to @file{image-type.x} the output:
-
-@example
-scm_c_define_gsubr (s_clear_image, 1, 0, 0, (SCM (*)() ) clear_image);
-@end example
-
-When compiled normally, @code{SCM_DEFINE} is a macro which expands to a
-declaration of the @code{s_clear_image} string.
-
-Note that the output file name matches the @code{#include} from the
-input file. Also, you still need to provide all the same information
-you would if you were using @code{scm_c_define_gsubr} yourself, but you
-can place the information near the function definition itself, so it is
-less likely to become incorrect or out-of-date.
-
-If you have many files that @code{guile-snarf} must process, you should
-consider using a fragment like the following in your Makefile:
-
-@example
-snarfcppopts = $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-.SUFFIXES: .x
-.c.x:
- guile-snarf -o $@ $< $(snarfcppopts)
-@end example
-
-This tells make to run @code{guile-snarf} to produce each needed
-@file{.x} file from the corresponding @file{.c} file.
-
-Aside from the required argument INFILE, @code{guile-snarf} passes its
-command-line arguments directly to the C preprocessor, which it uses to
-extract the information it needs from the source code. this means you can pass
-normal compilation flags to @code{guile-snarf} to define preprocessor symbols,
-add header file directories, and so on.
-
-@c ---------------------------------------------------------------------------
-@node Macros guile-snarf recognizes
-@subsubsection Macros guile-snarf recognizes
-@cindex guile-snarf recognized macros
-@cindex guile-snarf deprecated macros
-
-Here are the macros you can use in your source code from which
-@code{guile-snarf} can construct initialization code:
-
-@example
-/* procedures */
-SCM_DEFINE (FNAME, PRIMNAME, REQ, OPT, VAR, ARGLIST, DOCSTRING)
-
-SCM_PROC (RANAME, STR, REQ, OPT, VAR, CFN)
-SCM_REGISTER_PROC (RANAME, STR, REQ, OPT, VAR, CFN)
-
-SCM_GPROC (RANAME, STR, REQ, OPT, VAR, CFN, GF)
-
-/* everything else */
-SCM_SYMBOL (c_name, scheme_name)
-SCM_GLOBAL_SYMBOL (c_name, scheme_name)
-
-SCM_KEYWORD (c_name, scheme_name)
-SCM_GLOBAL_KEYWORD (c_name, scheme_name)
-
-SCM_VARIABLE (c_name, scheme_name)
-SCM_GLOBAL_VARIABLE (c_name, scheme_name)
-
-SCM_VARIABLE_INIT (c_name, scheme_name, init_val)
-SCM_GLOBAL_VARIABLE_INIT (c_name, scheme_name, init_val)
-@end example
-
-@c i like things dense, but maybe someone else will reformat this
-@c into an easier-to-read list. also, all-upcase to me is a form
-@c of quoting, so @var{} is not necessary there. --ttn
-REQ and OPT are numbers indicating required and optional argument
-counts, respectively; VAR is a number that, if non-zero, means the
-function will accept any remaining arguments as a list; DOCSTRING is a
-string (use @code{\n\} at eol for multi-line); FNAME is a C-language
-identifier, CFN and GF and @var{c_name} likewise; PRIMNAME is a string
-denoting the name available to Scheme code, STR and @var{scheme_name}
-likewise; RANAME is the name of the static string (must match that
-declared by the associated definition of cpp macro @var{FUNC_NAME});
-ARGLIST is an argument list (in parentheses); and lastly, @var{init_val}
-is a expression suitable for initializing a new variable.
-
-For procedures, you can use @code{SCM_DEFINE} for most purposes. Use
-@code{SCM_PROC} along with @code{SCM_REGISTER_PROC} when you don't want
-to be bothered with docstrings. Use @code{SCM_GPROC} for generic
-functions (@pxref{GOOPS,,,goops}). All procedures are declared
-@code{static} with return type @code{SCM}.
-
-For everything else, use the appropriate macro (@code{SCM_SYMBOL} for
-symbols, and so on). The "_GLOBAL_" variants omit @code{static}
-declaration.
-
-All these macros should be used at top-level, outside function bodies.
-Also, it's a good idea to define @var{FUNC_NAME} immediately after using
-@code{SCM_DEFINE} (and similar), and then the function body, and then
-@code{#undef FUNC_NAME}.
-
-Here is the list of deprecated macros:
-
-@c reminder: sync w/ libguile/guile-snarf.in var `deprecated_list'
-@example
- SCM_CONST_LONG
- SCM_VCELL
- SCM_VCELL_INIT
- SCM_GLOBAL_VCELL
- SCM_GLOBAL_VCELL_INIT
-@end example
-
-Some versions of guile (and guile-snarf) will continue to recognize them but
-at some point they will no longer work. You can pass either @code{-d} or
-@code{-D} option to have guile-snarf warn or signal error, respectively, if
-any of these are found in the input file.
-
-@xref{How guile-snarf works}, and also libguile source, for examples.
-@xref{Subrs}, for details on argument passing and how to write C
-functions.
-
-@c ---------------------------------------------------------------------------
-@node Doc Snarfing
-@subsection Doc Snarfing
-
-In addition to init snarfing (@pxref{Init Snarfing with guile-snarf}),
-the libguile sources are also subject to doc snarfing, by programs that
-are included in the distribution (but not installed at this time). The
-output is the file @file{guile-procedures.txt} which is installed, and
-subsequently used by module @code{(ice-9 documentation)}.
-
-Here is a list of what does what according to @file{libguile/Makefile.am}:
-
-@itemize
-@item guile-snarf-docs runs cpp defining SCM_MAGIC_SNARF_DOCS
-@item guile_filter_doc_snarfage parses guile-snarf-docs output to produce .doc
-@item ../scripts/snarf-check-and-output-texi makes guile.texi
-@item ../scripts/snarf-check-and-output-texi makes guile-procedures.txt
-@item guile-func-name-check checks source snarf-syntax integrity (optional?)
-@item guile-doc-snarf calls guile-snarf-docs (to make .doc) and guile-snarf
-@end itemize
-
-Note that for guile-1.4, a completely different approach was used! All this
-is rather byzantine, so for now @emph{NO} doc snarfing programs are installed.
-
-[fixme: Document further once doc snarfing is tamed somewhat. --ttn]
-
-@c ---------------------------------------------------------------------------
-@node Executable Modules
-@section Executable Modules
-@cindex guile-tools
-@cindex modules, executable
-@cindex executable modules
-@cindex scripts
-
-When Guile is installed, in addition to the @code{(ice-9 FOO)} modules,
-a set of @dfn{executable modules} @code{(scripts BAR)} is also installed.
-Each is a regular Scheme module that has some additional packaging so
-that it can be called as a program in its own right, from the shell. For this
-reason, we sometimes use the term @dfn{script} in this context to mean the
-same thing.
-
-@c wow look at this hole^! variable-width font users eat your heart out.
-
-As a convenience, the @code{guile-tools} wrapper program is installed along w/
-@code{guile}; it knows where a particular module is installed and calls it
-passing its args to the program. The result is that you need not augment your
-PATH. Usage is straightforward:
-
-@example
-guile-tools --help
-guile-tools --version
-guile-tools [OPTION] PROGRAM [ARGS ...]
-
-If PROGRAM is "list" or omitted, display contents of scripts dir, otherwise
-PROGRAM is run w/ ARGS. Options (only one of which may be used at a time):
- --scriptsdir DIR -- Look in DIR for scripts
- --guileversion VERS -- Look in $pkgdatadir/VERS/scripts for scripts
- --source -- Display PROGRAM source (ignore ARGS) to stdout
-@end example
-
-The modules are self-documenting. For example, to see the documentation for
-@code{lint}, use one (or both) of the shell commands:
-
-@example
-guile-tools display-commentary '(scripts lint)'
-guile-tools --source lint
-@end example
-
-The rest of this section describes the packaging that goes into creating an
-executable module. Feel free to skip to the next chapter.
-
-@subsection Writing Executable Modules
-
-@c adapted from scripts/README
-
-See template file @code{PROGRAM} for a quick start.
-
-Programs must follow the @dfn{executable module} convention, documented here:
-
-@itemize
-
-@item
-The file name must not end in ".scm".
-
-@item
-The file must be executable (chmod +x).
-
-@item
-The module name must be "(scripts PROGRAM)". A procedure named PROGRAM w/
-signature "(PROGRAM . args)" must be exported. Basically, use some variant
-of the form:
-
-@example
-(define-module (scripts PROGRAM)
- :export (PROGRAM))
-@end example
-
-Feel free to export other definitions useful in the module context.
-
-@item
-There must be the alias:
-
-@example
-(define main PROGRAM)
-@end example
-
-However, `main' must NOT be exported.
-
-@item
-The beginning of the file must use the following invocation sequence:
-
-@example
-#!/bin/sh
-main='(module-ref (resolve-module '\''(scripts PROGRAM)) '\'main')'
-exec $@{GUILE-guile@} -l $0 -c "(apply $main (cdr (command-line)))" "$@@"
-!#
-@end example
-
-@end itemize
-
-Following these conventions allows the program file to be used as module
-@code{(scripts PROGRAM)} in addition to as a standalone executable. Please
-also include a helpful Commentary section w/ some usage info.
-
-@c tools.texi ends here
diff --git a/doc/sources/.cvsignore b/doc/sources/.cvsignore
deleted file mode 100644
index 1b583920e..000000000
--- a/doc/sources/.cvsignore
+++ /dev/null
@@ -1,20 +0,0 @@
-Makefile
-Makefile.in
-stamp-vti
-*.log
-*.dvi
-*.aux
-*.toc
-*.cp
-*.fn
-*.vr
-*.tp
-*.ky
-*.pg
-*.cps
-*.fns
-*.tps
-*.vrs
-*.ps
-*.info*
-version.texi
diff --git a/doc/sources/ChangeLog b/doc/sources/ChangeLog
deleted file mode 100644
index 1df00138b..000000000
--- a/doc/sources/ChangeLog
+++ /dev/null
@@ -1,5 +0,0 @@
-2001-08-27 Neil Jerram <neil@ossau.uklinux.net>
-
- The change log for files in this directory continues backwards
- from 2001-08-27 in ../ChangeLog, as all the Guile documentation
- prior to this date was contained in a single directory.
diff --git a/doc/sources/Makefile.am b/doc/sources/Makefile.am
deleted file mode 100644
index d201637e4..000000000
--- a/doc/sources/Makefile.am
+++ /dev/null
@@ -1,7 +0,0 @@
-# -*- Makefile -*-
-
-EXTRA_DIST = libguile-overview.texi snarf.texi contributors.texi \
- libguile-tools.texi strings.texi data-rep.texi new-types.texi tk.texi \
- debug-c.texi old-intro.texi unix-other.texi debug-scheme.texi \
- sample-APIs.texi unix.texi guile-slib.texi scheme-concepts.texi \
- jimb-org.texi scm-ref.texi
diff --git a/doc/sources/contributors.texi b/doc/sources/contributors.texi
deleted file mode 100644
index 578c358f7..000000000
--- a/doc/sources/contributors.texi
+++ /dev/null
@@ -1,80 +0,0 @@
-@node Contributors to Guile
-@appendix Contributors to Guile
-
-This Guile Manual was written by Mark Galassi, Jim Blandy and Gary
-Houston.
-
-Guile was developed over many years by the following people:
-
-@table @strong
-@item George Carrette
-Wrote files present in Siod version 2.3, released in December of 1989.
-
-@item Aubrey Jaffer
-Wrote substantial portions of guile.texi, and surely others.
-Changes to: eval.c, ioext.c, posix.c, gscm.c, scm.h, socket.c,
-gsubr.c, sys.c, test.scm, stime.c, and unif.c.
-
-@item Gary Houston
-changes to many files in libguile.
-
-wrote: libguile/socket.c, ice-9/expect.scm
-
-@item Tom Lord
-Many changes throughout.
-In the subdirectory ctax, wrote:
- Makefile.in configure.in hashtabs.scm macros.scm scm-ops.scm
- c-ops.scm grammar.scm lexer.scm reader.scm
-In the subdirectory gtcltk-lib, wrote:
- Makefile.in guile-tcl.c guile-tk.c
- configure.in guile-tcl.h guile-tk.h
-In the subdirectory guile, wrote:
- Makefile.in getopt.c getopt1.c
- configure.in getopt.h guile.c
-In the subdirectory ice-9, wrote:
- Makefile.in configure.in lineio.scm poe.scm
- boot-9.scm hcons.scm mapping.scm
-In the subdirectory lang, wrote:
- Makefile.in grammar.scm lr0.scm pp.scm
- configure.in lex.scm lr1.scm
-In the subdirectory rx, wrote:
- Makefile.in runtests.c rxbitset.h rxnfa.c rxspencer.c
- TESTS rx.c rxcontext.h rxnfa.h rxspencer.h
- TESTS2C.sed rx.h rxcset.c rxnode.c rxstr.c
- _rx.h rxall.h rxcset.h rxnode.h rxstr.h
- configure.in rxanal.c rxdbug.c rxposix.c rxsuper.c
- hashrexp.c rxanal.h rxgnucomp.c rxposix.h rxsuper.h
- inst-rxposix.h rxbasic.c rxgnucomp.h rxproto.h rxunfa.c
- rgx.c rxbasic.h rxhash.c rxsimp.c rxunfa.h
- rgx.h rxbitset.c rxhash.h rxsimp.h testcases.h
-In the subdirectory doc, wrote:
- ctax.texi gtcltk.texi in.texi lang.texi
-and portions of guile.texi.
-
-@item Anthony Green
-wrote the original code in the 'threads' directory, and
-ice-9/threads.scm.
-
-@item Mikael Djurfeldt
-@example
-In the subdirectory libguile, wrote:
- backtrace.c debug.c options.c root.c srcprop.c stacks.c
- backtrace.h debug.h options.h root.h srcprop.h stacks.h
-In the subdirectory threads, rewrote:
- coop-threads.c coop.c mit-pthreads.c threads.c
- coop-threads.h fsu-pthreads.h mit-pthreads.h threads.h
-Many other changes throughout.
-@end example
-
-@item Mark Galassi
-@example
-Designed and implemented the high-level libguile API (the @code{gh_}
-interface), based largely on the defunct @code{gscm_} interface. In the
-subdirectory gh, wrote:
-gh.c gh_eval.c gh_io.c gh_test_c.c
-gh.h gh_funcs.c gh_list.c gh_test_repl.c
-gh_data.c gh_init.c gh_predicates.c
-@end example
-
-
-@end table
diff --git a/doc/sources/debug-c.texi b/doc/sources/debug-c.texi
deleted file mode 100644
index 77d02f440..000000000
--- a/doc/sources/debug-c.texi
+++ /dev/null
@@ -1,2 +0,0 @@
-@node Debugging libguile
-@chapter Debugging libguile
diff --git a/doc/sources/debug-scheme.texi b/doc/sources/debug-scheme.texi
deleted file mode 100644
index 35340f943..000000000
--- a/doc/sources/debug-scheme.texi
+++ /dev/null
@@ -1,2 +0,0 @@
-@node Debugging Scheme programs
-@chapter Debugging Scheme programs
diff --git a/doc/sources/env.texi b/doc/sources/env.texi
deleted file mode 100644
index dc6bf9a40..000000000
--- a/doc/sources/env.texi
+++ /dev/null
@@ -1,1165 +0,0 @@
-\input texinfo @c -*-texinfo-*-
-@c %**start of header
-@setfilename env.info
-@settitle Top-level Environments in Guile
-@c %**end of header
-
-@setchapternewpage odd
-
-@c Changes since Jost's implementation:
-@c "finite environments" -> "leaf environments"
-@c "scm_foo_internal" -> "scm_c_foo"
-
-@c To do:
-@c add spec for soft environments
-
-@c When merged into the main manual, add cross-references for:
-@c weak references
-@c smobs (esp. module's mark and free functions)
-
-
-[[add refs for all conditions signalled]]
-
-@ifinfo
-Copyright 1999 Free Software Foundation, Inc.
-@end ifinfo
-
-@titlepage
-@sp 10
-@comment The title is printed in a large font.
-@center @titlefont{Top-level Environments in Guile}
-
-@c The following two commands start the copyright page.
-@page
-@vskip 0pt plus 1filll
-Copyright @copyright{} 1999 Free Software Foundation, Inc.
-@end titlepage
-
-@node Top, Motivation, (dir), (dir)
-
-@menu
-* Motivation::
-* Top-Level Environments in Guile::
-* Modules::
-@end menu
-
-@node Motivation, Top-Level Environments in Guile, Top, Top
-@chapter Motivation
-
-@example
-$Id: env.texi,v 1.1 2001-08-24 09:40:29 ossau Exp $
-@end example
-
-This is a draft proposal for a new datatype for representing top-level
-environments in Guile. Upon completion, this proposal will be posted to
-the mailing list @samp{guile@@cygnus.com} for discussion, revised in
-light of whatever insights that may produce, and eventually implemented.
-
-Note that this is @emph{not} a proposal for a module system; rather, it
-is a proposal for a data structure which encapsulates the ideas one
-needs when writing a module system, and, most importantly, a fixed
-interface which insulates the interpreter from the details of the module
-system. Using these environments, one could implement any module system
-one pleased, without changing the interpreter.
-
-I hope this text will eventually become a chapter of the Guile manual;
-thus, the description of environments in written in the present tense,
-as if it were already implemented, not in the future tense. However,
-this text does not actually describe the present state of Guile.
-
-I'm especially interested in improving the vague, rambling presentation
-of environments in the section "Modules and Environments". I'm trying
-to orient the user for the discussion that follows, but I wonder if I'm
-just confusing the issue. I would appreciate suggestions if they are
-concrete --- please provide new wording.
-
-Note also: I'm trying out a convention I'm considering for use in the
-manual. When a Scheme procedure which is directly implemented by a C
-procedure, and both are useful to call from their respective languages,
-we document the Scheme procedure only, and call it a "Primitive". If a
-Scheme function is marked as a primitive, you can derive the name of the
-corresponding C function by changing @code{-} to @code{_}, @code{!} to
-@code{_x}, @code{?} to @code{_p}, and prepending @code{scm_}. The C
-function's arguments will be all of the Scheme procedure's argumements,
-both required and optional; if the Scheme procedure takes a ``rest''
-argument, that will be a final argument to the C function. The C
-function's arguments, as well as its return type, will be @code{SCM}.
-Thus, a procedure documented like this:
-@deffn Primitive set-car! pair value
-@end deffn
-
-has a corresponding C function which would be documented like this:
-@deftypefn {Libguile function} SCM scm_set_car_x (SCM @var{pair}, SCM @var{value})
-@end deftypefn
-
-The hope is that this will be an uncluttered way to document both the C
-and Scheme interfaces, without unduly confusing users interested only in
-the Scheme level.
-
-When there is a C function which provides the same functionality as a
-primitive, but with a different interface tailored for C's needs, it
-usually has the same name as the primitive's C function, but with the
-prefix @code{scm_c_} instead of simply @code{scm_}. Thus,
-@code{scm_c_environment_ref} is almost identical to
-@code{scm_environment_ref}, except that it indicates an unbound variable
-in a manner friendlier to C code.
-
-
-
-@node Top-Level Environments in Guile, Modules, Motivation, Top
-@chapter Top-Level Environments in Guile
-
-In Guile, an environment is a mapping from symbols onto variables, and
-a variable is a location containing a value. Guile uses the datatype
-described here to represent its top-level environments.
-
-
-@menu
-* Modules and Environments:: Modules are environments, with bookkeeping.
-* Common Environment Operations:: Looking up bindings, creating bindings, etc.
-* Standard Environment Types:: Guile has some fundamental environment types.
-* Implementing Environments:: You can extend Guile with new kinds of
- environments.
-* Switching to Environments:: Changes needed to today's Guile to
- implement the features described here.
-@end menu
-
-@node Modules and Environments, Common Environment Operations, Top-Level Environments in Guile, Top-Level Environments in Guile
-@section Modules and Environments
-
-Guile distinguishes between environments and modules. A module is a
-unit of code sharing; it has a name, like @code{(math random)}, an
-implementation (e.g., Scheme source code, a dynamically linked library,
-or a set of primitives built into Guile), and finally, an environment
-containing the definitions which the module exports for its users.
-
-An environment, by contrast, is simply an abstract data type
-representing a mapping from symbols onto variables which the Guile
-interpreter uses to look up top-level definitions. The @code{eval}
-procedure interprets its first argument, an expression, in the context
-of its second argument, an environment.
-
-Guile uses environments to implement its module system. A module
-created by loading Scheme code might be built from several environments.
-In addition to the environment of exported definitions, such a module
-might have an internal top-level environment, containing both exported
-and private definitions, and perhaps environments for imported
-definitions alone and local definitions alone.
-
-The interface described here includes a full set of functions for
-mutating environments, and the system goes to some length to maintain
-its consistency as environments' bindings change. This is necessary
-because Guile is an interactive system. The user may create new
-definitions or modify and reload modules while Guile is running; the
-system should handle these changes in a consistent and predictable way.
-
-A typical Guile system will have several distinct top-level
-environments. (This is why we call them ``top-level'', and not
-``global''.) For example, consider the following fragment of an
-interactive Guile session:
-
-@example
-guile> (use-modules (ice-9 regex))
-guile> (define pattern "^(..+)\\1+$")
-guile> (string-match pattern "xxxx")
-#("xxxx" (0 . 4) (0 . 2))
-guile> (string-match pattern "xxxxx")
-#f
-guile>
-@end example
-@noindent
-Guile evaluates the expressions the user types in a top-level
-environment reserved for that purpose; the definition of @code{pattern}
-goes there. That environment is distinct from the one holding the
-private definitions of the @code{(ice-9 regex)} module. At the Guile
-prompt, the user does not see the module's private definitions, and the
-module is unaffected by definitions the user makes at the prompt. The
-@code{use-modules} form copies the module's public bindings into the
-user's environment.
-
-All Scheme evaluation takes place with respect to some top-level
-environment. Just as the procedure created by a @code{lambda} form
-closes over any local scopes surrounding that form, it also closes over
-the surrounding top-level environment. Thus, since the
-@code{string-match} procedure is defined in the @code{(ice-9 regex)}
-module, it closes over that module's top-level environment. Thus, when
-the user calls @code{string-match} from the Guile prompt, any free
-variables in @code{string-match}'s definition are resolved with respect
-to the module's top-level environment, not the user's.
-
-Although the Guile interaction loop maintains a ``current'' top-level
-environment in which it evaluates the user's input, it would be
-misleading to extend the concept of a ``current top-level environment''
-to the system as a whole. Each procedure closes over its own top-level
-environment, in which that procedure will find bindings for its free
-variables. Thus, the top-level environment in force at any given time
-depends on the procedure Guile happens to be executing. The global
-``current'' environment is a figment of the interaction loop's
-imagination.
-
-Since environments provide all the operations the Guile interpreter
-needs to evaluate code, they effectively insulate the interpreter from
-the details of the module system. Without changing the interpreter, you
-can implement any module system you like, as long as its efforts produce
-an environment object the interpreter can consult.
-
-Finally, environments may prove a convenient way for Guile to access the
-features of other systems. For example, one might export the The GIMP's
-Procedural Database to Guile as a custom environment type; this
-environment could create Scheme procedure objects corresponding to GIMP
-procedures, as the user referenced them.
-
-
-@node Common Environment Operations, Standard Environment Types, Modules and Environments, Top-Level Environments in Guile
-@section Common Environment Operations
-
-This section describes the common set of operations that all environment
-objects support. To create an environment object, or to perform an
-operation specific to a particular kind of environment, see
-@ref{Standard Environment Types}.
-
-In this section, the following names for formal parameters imply that
-the actual parameters must have a certain type:
-
-@table @var
-
-@item env
-an environment
-
-@item symbol
-a symbol
-
-@item proc
-a procedure
-
-@item value
-@itemx object
-an arbitrary Scheme value
-
-@end table
-
-
-@menu
-* Examining Environments::
-* Changing Environments::
-* Caching Environment Lookups::
-* Observing Changes to Environments ::
-* Environment Errors::
-@end menu
-
-@node Examining Environments, Changing Environments, Common Environment Operations, Common Environment Operations
-@subsection Examining Environments
-
-@deffn Primitive environment? object
-Return @code{#t} if @var{object} is an environment, or @code{#f} otherwise.
-@end deffn
-
-@deffn Primitive environment-ref env symbol
-Return the value of the location bound to @var{symbol} in @var{env}.
-If @var{symbol} is unbound in @var{env}, signal an @code{environment:unbound}
-error (@pxref{Environment Errors}).
-@end deffn
-
-@deffn Primitive environment-bound? env symbol
-Return @code{#t} if @var{symbol} is bound in @var{env}, or @code{#f}
-otherwise.
-@end deffn
-
-@deffn Primitive environment-fold env proc init
-Iterate over all the bindings in an environment, accumulating some value.
-
-For each binding in @var{env}, apply @var{proc} to the symbol bound, its
-value, and the result from the previous application of @var{proc}. Use
-@var{init} as @var{proc}'s third argument the first time @var{proc} is
-applied.
-
-If @var{env} contains no bindings, this function simply returns @var{init}.
-
-If @var{env} binds the symbol @var{sym1} to the value @var{val1},
-@var{sym2} to @var{val2}, and so on, then this procedure computes:
-@example
-(@var{proc} @var{sym1} @var{val1}
- (@var{proc} @var{sym2} @var{val2}
- ...
- (@var{proc} @var{symn} @var{valn}
- @var{init})))
-@end example
-
-Each binding in @var{env} is processed at most once.
-@code{environment-fold} makes no guarantees about the order in which the
-bindings are processed.
-
-If @var{env} is not modified while the iteration is taking place,
-@code{environment-fold} will apply @var{proc} to each binding in
-@var{env} exactly once.
-
-If @var{env} is modified while the iteration is taking place, we need to
-be more subtle in describing @code{environment-fold}'s behavior.
-@code{environment-fold} repeatedly applies @var{proc} to a binding which
-was present in @var{env} when @code{environment-fold} was invoked and is
-still present in @var{env}, until there are no such bindings remaining.
-(If no mutations take place, this definition is equivalent to the
-simpler one given above.) By this definition, bindings added during the
-iteration will not be passed to @var{proc}.
-
-Here is a function which, given an environment, constructs an
-association list representing that environment's bindings, using
-@code{environment-fold}:
-@example
-(define (environment->alist env)
- (environment-fold env
- (lambda (sym val tail)
- (cons (cons sym val) tail))
- '()))
-@end example
-@end deffn
-
-@deftypefn {Libguile macro} int SCM_ENVP (@var{object})
-Return non-zero if @var{object} is an environment.
-@end deftypefn
-
-@deftypefn {Libguile function} SCM scm_c_environment_ref (SCM @var{env}, SCM @var{symbol})
-This C function is identical to @code{environment-ref}, except that if
-@var{symbol} is unbound in @var{env}, it returns the value
-@code{SCM_UNDEFINED}, instead of signalling an error.
-@end deftypefn
-
-@deftypefn {Libguile function} SCM scm_c_environment_fold (SCM @var{env}, scm_environment_folder *@var{proc}, SCM @var{data}, SCM @var{init})
-This is the C-level analog of @code{environment-fold}. For each binding in
-@var{env}, make the call:
-@example
-(*@var{proc}) (@var{data}, @var{symbol}, @var{value}, @var{previous})
-@end example
-@noindent
-where @var{previous} is the value returned from the last call to
-@code{*@var{proc}}, or @var{init} for the first call. If @var{env}
-contains no bindings, return @var{init}.
-@end deftypefn
-
-@deftp {Libguile data type} scm_environment_folder SCM (SCM @var{data}, SCM @var{symbol}, SCM @var{value}, SCM @var{tail})
-The type of a folding function to pass to @code{scm_c_environment_fold}.
-@end deftp
-
-
-@node Changing Environments, Caching Environment Lookups, Examining Environments, Common Environment Operations
-@subsection Changing Environments
-
-Here are functions for changing symbols' bindings and values.
-
-Although it is common to say that an environment binds a symbol to a
-value, this is not quite accurate; an environment binds a symbol to a
-location, and the location contains a value. In the descriptions below,
-we will try to make clear how each function affects bindings and
-locations.
-
-Note that some environments may contain some immutable bindings, or may
-bind symbols to immutable locations. If you attempt to change an
-immutable binding or value, these functions will signal an
-@code{environment:immutable-binding} or
-@code{environment:immutable-location} error. However, simply because a
-binding cannot be changed via these functions does @emph{not} imply that
-it is constant. Mechanisms outside the scope of this section (say,
-re-loading a module's source code) may change a binding or value which
-is immutable via these functions.
-
-@deffn Primitive environment-define env symbol value
-Bind @var{symbol} to a new location containing @var{value} in @var{env}.
-If @var{symbol} is already bound to another location in @var{env}, that
-binding is replaced. The new binding and location are both mutable.
-The return value is unspecified.
-
-If @var{symbol} is already bound in @var{env}, and the binding is
-immutable, signal an @code{environment:immutable-binding} error.
-@end deffn
-
-@deffn Primitive environment-undefine env symbol
-Remove any binding for @var{symbol} from @var{env}. If @var{symbol} is
-unbound in @var{env}, do nothing. The return value is unspecified.
-
-If @var{symbol} is already bound in @var{env}, and the binding is
-immutable, signal an @code{environment:immutable-binding} error.
-@end deffn
-
-@deffn Primitive environment-set! env symbol value
-If @var{env} binds @var{symbol} to some location, change that location's
-value to @var{value}. The return value is unspecified.
-
-If @var{symbol} is not bound in @var{env}, signal an
-@code{environment:unbound} error. If @var{env} binds @var{symbol} to an
-immutable location, signal an @code{environment:immutable-location}
-error.
-@end deffn
-
-
-@node Caching Environment Lookups, Observing Changes to Environments , Changing Environments, Common Environment Operations
-@subsection Caching Environment Lookups
-
-Some applications refer to variables' values so frequently that the
-overhead of @code{environment-ref} and @code{environment-set!} is
-unacceptable. For example, variable reference speed is a critical
-factor in the performance of the Guile interpreter itself. If an
-application can tolerate some additional complexity, the
-@code{environment-cell} function described here can provide very
-efficient access to variable values.
-
-In the Guile interpreter, most variables are represented by pairs; the
-@sc{cdr} of the pair holds the variable's value. Thus, a variable
-reference corresponds to taking the @sc{cdr} of one of these pairs, and
-setting a variable corresponds to a @code{set-cdr!} operation. A pair
-used to represent a variable's value in this manner is called a
-@dfn{value cell}. Value cells represent the ``locations'' to which
-environments bind symbols.
-
-The @code{environment-cell} function returns the value cell bound to a
-symbol. For example, an interpreter might make the call
-@code{(environment-cell @var{env} @var{symbol} #t)} to find the value
-cell which @var{env} binds to @var{symbol}, and then use @code{cdr} and
-@code{set-cdr!} to reference and assign to that variable, instead of
-calling @code{environment-ref} or @var{environment-set!} for each
-variable reference.
-
-There are a few caveats that apply here:
-
-@itemize @bullet
-
-@item
-Environments are not required to represent variables' values using value
-cells. An environment is free to return @code{#f} in response to a
-request for a symbol's value cell; in this case, the caller must use
-@code{environment-ref} and @code{environment-set!} to manipulate the
-variable.
-
-@item
-An environment's binding for a symbol may change. For example, the user
-could override an imported variable with a local definition, associating
-a new value cell with that symbol. If an interpreter has used
-@code{environment-cell} to obtain the variable's value cell, it no
-longer needs to use @code{environment-ref} and @code{environment-set!}
-to access the variable, and it may not see the new binding.
-
-Thus, code which uses @code{environment-cell} should almost always use
-@code{environment-observe} to track changes to the symbol's binding;
-this is the additional complexity hinted at above. @xref{Observing
-Changes to Environments}.
-
-@item
-Some variables should be immutable. If a program uses
-@code{environment-cell} to obtain the value cell of such a variable,
-then it is impossible for the environment to prevent the program from
-changing the variable's value, using @code{set-cdr!}. However, this is
-discouraged; it is probably better to redesign the interface than to
-disregard such a request. To make it easy for programs to honor the
-immutability of a variable, @code{environment-cell} takes an argument
-indicating whether the caller intends to mutate the cell's value; if
-this argument is true, then @code{environment-cell} signals an
-@code{environment:immutable-location} error.
-
-Programs should therefore make separate calls to @code{environment-cell}
-to obtain value cells for reference and for assignment. It is incorrect
-for a program to call @code{environment-cell} once to obtain a value
-cell, and then use that cell for both reference and mutation.
-
-@end itemize
-
-@deffn Primitive environment-cell env symbol for-write
-Return the value cell which @var{env} binds to @var{symbol}, or
-@code{#f} if the binding does not live in a value cell.
-
-The argument @var{for-write} indicates whether the caller intends to
-modify the variable's value by mutating the value cell. If the variable
-is immutable, then @code{environment-cell} signals an
-@code{environment:immutable-location} error.
-
-If @var{symbol} is unbound in @var{env}, signal an @code{environment:unbound}
-error.
-
-If you use this function, you should consider using
-@code{environment-observe}, to be notified when @code{symbol} gets
-re-bound to a new value cell, or becomes undefined.
-@end deffn
-
-@deftypefn {Libguile function} SCM scm_c_environment_cell (SCM @var{env}, SCM @var{symbol}, int for_write)
-This C function is identical to @code{environment-cell}, except that if
-@var{symbol} is unbound in @var{env}, it returns the value
-@code{SCM_UNDEFINED}, instead of signalling an error.
-@end deftypefn
-
-[[After we have some experience using this, we may find that we want to
-be able to explicitly ask questions like, "Is this variable mutable?"
-without the annoyance of error handling. But maybe this is fine.]]
-
-
-@node Observing Changes to Environments , Environment Errors, Caching Environment Lookups, Common Environment Operations
-@subsection Observing Changes to Environments
-
-The procedures described here allow you to add and remove @dfn{observing
-procedures} for an environment.
-
-
-@menu
-* Registering Observing Procedures::
-* Observations and Garbage Collection::
-* Observing Environments from C Code::
-@end menu
-
-@node Registering Observing Procedures, Observations and Garbage Collection, Observing Changes to Environments , Observing Changes to Environments
-@subsubsection Registering Observing Procedures
-
-A program may register an @dfn{observing procedure} for an environment,
-which will be called whenever a binding in a particular environment
-changes. For example, if the user changes a module's source code and
-re-loads the module, other parts of the system may want to throw away
-information they have cached about the bindings of the older version of
-the module. To support this, each environment retains a set of
-observing procedures which it will invoke whenever its bindings change.
-We say that these procedures @dfn{observe} the environment's bindings.
-You can register new observing procedures for an environment using
-@code{environment-observe}.
-
-@deffn Primitive environment-observe env proc
-Whenever @var{env}'s bindings change, apply @var{proc} to @var{env}.
-
-This function returns an object, @var{token}, which you can pass to
-@code{environment-unobserve} to remove @var{proc} from the set of
-procedures observing @var{env}. The type and value of @var{token} is
-unspecified.
-@end deffn
-
-@deffn Primitive environment-unobserve token
-Cancel the observation request which returned the value @var{token}.
-The return value is unspecified.
-
-If a call @code{(environment-observe @var{env} @var{proc})} returns
-@var{token}, then the call @code{(environment-unobserve @var{token})}
-will cause @var{proc} to no longer be called when @var{env}'s bindings
-change.
-@end deffn
-
-There are some limitations on observation:
-@itemize @bullet
-@item
-These procedures do not allow you to observe specific bindings; you
-can only observe an entire environment.
-@item
-These procedures observe bindings, not locations. There is no way
-to receive notification when a location's value changes, using these
-procedures.
-@item
-These procedures do not promise to call the observing procedure for each
-individual binding change. However, if multiple bindings do change
-between calls to the observing procedure, those changes will appear
-atomic to the entire system, not just to a few observing procedures.
-@item
-Since a single environment may have several procedures observing it, a
-correct design obviously may not assume that nothing else in the system
-has yet observed a given change.
-@end itemize
-
-(One weakness of this observation architecture is that observing
-procedures make no promises to the observer. That's fine if you're just
-trying to implement an accurate cache, but too weak to implement things
-that walk the environment tree.)
-
-@node Observations and Garbage Collection, Observing Environments from C Code, Registering Observing Procedures, Observing Changes to Environments
-@subsubsection Observations and Garbage Collection
-
-When writing observing procedures, pay close attention to garbage
-collection issues. If you use @code{environment-observe} to register
-observing procedures for an environment, the environment will hold a
-reference to those procedures; while that environment is alive, its
-observing procedures will live, as will any data they close over. If
-this is not appropriate, you can use the @code{environment-observe-weak}
-procedure to create a weak reference from the environment to the
-observing procedure.
-
-For example, suppose an interpreter uses @code{environment-cell} to
-reference variables efficiently, as described above in @ref{Caching
-Environment Lookups}. That interpreter must register observing
-procedures to track changes to the environment. If those procedures
-retain any reference to the data structure representing the program
-being interpreted, then that structure cannot be collected as long as
-the observed environment lives. This is almost certainly incorrect ---
-if there are no other references to the structure, it can never be
-invoked, so it should be collected. In this case, the interpreter
-should register its observing procedure using
-@code{environment-observe-weak}, and retain a pointer to it from the
-code it updates. Thus, when the code is no longer referenced elsewhere
-in the system, the weak link will be broken, and Guile will collect the
-code (and its observing procedure).
-
-@deffn Primitive environment-observe-weak env proc
-This function is the same as @code{environment-observe}, except that the
-reference @var{env} retains to @var{proc} is a weak reference. This
-means that, if there are no other live, non-weak references to
-@var{proc}, it will be garbage-collected, and dropped from @var{env}'s
-list of observing procedures.
-@end deffn
-
-
-@node Observing Environments from C Code, , Observations and Garbage Collection, Observing Changes to Environments
-@subsubsection Observing Environments from C Code
-
-It is also possible to write code that observes an environment in C.
-The @code{scm_c_environment_observe} function registers a C
-function to observe an environment. The typedef
-@code{scm_environment_observer} is the type a C observer function must
-have.
-
-@deftypefn {Libguile function} SCM scm_c_environment_observe (SCM @var{env}, scm_environment_observer *proc, SCM @var{data}, int weak_p)
-This is the C-level analog of the Scheme function
-@code{environment-observe}. Whenever @var{env}'s bindings change, call
-the function @var{proc}, passing it @var{env} and @var{data}. If
-@var{weak_p} is non-zero, @var{env} will retain only a weak reference to
-@var{data}, and if @var{data} is garbage collected, the entire
-observation will be dropped.
-
-This function returns a token, with the same meaning as those returned
-by @code{environment-observe}.
-@end deftypefn
-
-@deftp {Libguile data type} scm_environment_observer void (SCM @var{env}, SCM @var{data})
-The type for observing functions written in C. A function meant to be
-passed to @code{scm_c_environment_observe} should have the type
-@code{scm_environment_observer}.
-@end deftp
-
-Note that, like all other primitives, @code{environment-observe} is also
-available from C, under the name @code{scm_environment_observe}.
-
-
-@node Environment Errors, , Observing Changes to Environments , Common Environment Operations
-@subsection Environment Errors
-
-Here are the error conditions signalled by the environment routines
-described above. In these conditions, @var{func} is a string naming a
-particular procedure.
-
-@deffn Condition environment:unbound func message args env symbol
-By calling @var{func}, the program attempted to retrieve the value of
-@var{symbol} in @var{env}, but @var{symbol} is unbound in @var{env}.
-@end deffn
-
-@deffn Condition environment:immutable-binding func message args env symbol
-By calling @var{func}, the program attempted to change the binding of
-@var{symbol} in @var{env}, but that binding is immutable.
-@end deffn
-
-@deffn Condition environment:immutable-location func message args env symbol
-By calling @var{func}, the program attempted to change the value of
-the location to which @var{symbol} is bound in @var{env}, but that
-location is immutable.
-@end deffn
-
-
-@node Standard Environment Types, Implementing Environments, Common Environment Operations, Top-Level Environments in Guile
-@section Standard Environment Types
-
-Guile supports several different kinds of environments. The operations
-described above are actually only the common functionality provided by
-all the members of a family of environment types, each designed for a
-separate purpose.
-
-Each environment type has a constructor procedure for building elements
-of that type, and extends the set of common operations with its own
-procedures, providing specialized functions. For an example of how
-these environment types work together, see @ref{Modules of Interpreted
-Scheme Code}.
-
-Guile allows users to define their own environment types. Given a set
-of procedures that implement the common environment operations, Guile
-will construct a new environment object based on those procedures.
-
-@menu
-* Leaf Environments:: A simple set of bindings.
-* Eval Environments:: Local definitions, shadowing
- imported definitions.
-* Import Environments:: The union of a list of environments.
-* Export Environments:: A selected subset of an environment.
-* General Environments:: Environments implemented by user
- functions.
-@end menu
-
-@node Leaf Environments, Eval Environments, Standard Environment Types, Standard Environment Types
-@subsection Leaf Environments
-
-A @dfn{leaf} environment is simply a mutable set of definitions. A mutable
-environment supports no operations beyond the common set.
-
-@deffn Primitive make-leaf-environment
-Create a new leaf environment, containing no bindings. All bindings
-and locations in the new environment are mutable.
-@end deffn
-
-@deffn Primitive leaf-environment? object
-Return @code{#t} if @var{object} is a leaf environment, or @var{#f}
-otherwise.
-@end deffn
-
-
-In Guile, each module of interpreted Scheme code uses a leaf
-environment to hold the definitions made in that module.
-
-Leaf environments are so named because their bindings are not computed
-from the contents of other environments. Most other environment types
-have no bindings of their own, but compute their binding sets based on
-those of their operand environments. Thus, the environments in a
-running Guile system form a tree, with interior nodes computing their
-contents from their child nodes. Leaf environments are the leaves of
-such trees.
-
-
-@node Eval Environments, Import Environments, Leaf Environments, Standard Environment Types
-@subsection Eval Environments
-
-A module's source code refers to definitions imported from other
-modules, and definitions made within itself. An @dfn{eval} environment
-combines two environments --- a @dfn{local} environment and an
-@dfn{imported} environment --- to produce a new environment in which
-both sorts of references can be resolved.
-
-@deffn Primitive make-eval-environment local imported
-Return a new environment object @var{eval} whose bindings are the union
-of the bindings in the environments @var{local} and @var{imported}, with
-bindings from @var{local} taking precedence. Definitions made in
-@var{eval} are placed in @var{local}.
-
-Applying @code{environment-define} or @code{environment-undefine} to
-@var{eval} has the same effect as applying the procedure to @var{local}.
-This means that applying @code{environment-undefine} to a symbol bound
-in @var{imported} and free in @var{local} has no effect on the bindings
-visible in @var{eval}, which may be surprising.
-
-Note that @var{eval} incorporates @var{local} and @var{imported}
-@emph{by reference} --- if, after creating @var{eval}, the program
-changes the bindings of @var{local} or @var{imported}, those changes
-will be visible in @var{eval}.
-
-Since most Scheme evaluation takes place in @var{eval} environments,
-they transparenty cache the bindings received from @var{local} and
-@var{imported}. Thus, the first time the program looks up a symbol in
-@var{eval}, @var{eval} may make calls to @var{local} or @var{imported}
-to find their bindings, but subsequent references to that symbol will be
-as fast as references to bindings in leaf environments.
-
-In typical use, @var{local} will be a leaf environment, and
-@var{imported} will be an import environment, described below.
-@end deffn
-
-@deffn Primitive eval-environment? object
-Return @code{#t} if @var{object} is an eval environment, or @code{#f}
-otherwise.
-@end deffn
-
-@deffn Primitive eval-environment-local env
-@deffnx Primitive eval-environment-imported env
-Return the @var{local} or @var{imported} environment of @var{env};
-@var{env} must be an eval environment.
-@end deffn
-
-
-@node Import Environments, Export Environments, Eval Environments, Standard Environment Types
-@subsection Import Environments
-
-An @dfn{import} environment combines the bindings of a set of
-argument environments, and checks for naming clashes.
-
-@deffn Primitive make-import-environment imports conflict-proc
-Return a new environment @var{imp} whose bindings are the union of the
-bindings from the environments in @var{imports}; @var{imports} must be a
-list of environments. That is, @var{imp} binds @var{symbol} to
-@var{location} when some element of @var{imports} does.
-
-If two different elements of @var{imports} have a binding for the same
-symbol, apply @var{conflict-proc} to the two environments. If the bindings
-of any of the @var{imports} ever changes, check for conflicts again.
-
-All bindings in @var{imp} are immutable. If you apply
-@code{environment-define} or @code{environment-undefine} to @var{imp},
-Guile will signal an @code{environment:immutable-binding} error.
-However, notice that the set of bindings in @var{imp} may still change,
-if one of its imported environments changes.
-@end deffn
-
-@deffn Primitive import-environment? object
-Return @code{#t} if @var{object} is an import environment, or @code{#f}
-otherwise.
-@end deffn
-
-@deffn Primitive import-environment-imports env
-Return the list of @var{env}'s imported environments; @var{env} must be
-an import env.
-@end deffn
-
-@deffn Primitive import-environment-set-imports! env imports
-Change @var{env}'s list of imported environments to @var{imports}, and
-check for conflicts.
-@end deffn
-
-I'm not at all sure about the way @var{conflict-proc} works. I think
-module systems should warn you if it seems you're likely to get the
-wrong binding, but exactly how and when those warnings should be
-generated, I don't know.
-
-
-@node Export Environments, General Environments, Import Environments, Standard Environment Types
-@subsection Export Environments
-
-An export environment restricts an environment a specified set of
-bindings.
-
-@deffn Primitive make-export-environment private signature
-Return a new environment @var{exp} containing only those bindings in
-@var{private} whose symbols are present in @var{signature}. The
-@var{private} argument must be an environment.
-
-The environment @var{exp} binds @var{symbol} to @var{location} when
-@var{env} does, and @var{symbol} is exported by @var{signature}.
-
-@var{Signature} is a list specifying which of the bindings in
-@var{private} should be visible in @var{exp}. Each element of
-@var{signature} should be a list of the form:
-@example
-(@var{symbol} @var{attribute} ...)
-@end example
-@noindent
-where each @var{attribute} is one of the following:
-@table @asis
-@item the symbol @code{mutable-location}
-@var{exp} should treat the location bound to @var{symbol} as mutable.
-That is, @var{exp} will pass calls to @var{env-set!} or
-@code{environment-cell} directly through to @var{private}.
-
-@item the symbol @code{immutable-location}
-@var{exp} should treat the location bound to @var{symbol} as immutable.
-If the program applies @code{environment-set!} to @var{exp} and
-@var{symbol}, or calls @code{environment-cell} to obtain a writable
-value cell, @code{environment-set!} will signal an
-@code{environment:immutable-location} error.
-
-Note that, even if an export environment treats a location as immutable,
-the underlying environment may treat it as mutable, so its value may
-change.
-@end table
-
-It is an error for an element of @var{signature} to specify both
-@code{mutable-location} and @code{immutable-location}. If neither is
-specified, @code{immutable-location} is assumed.
-
-As a special case, if an element of @var{signature} is a lone symbol
-@var{sym}, it is equivalent to an element of the form
-@code{(@var{sym})}.
-
-All bindings in @var{exp} are immutable. If you apply
-@code{environment-define} or @code{environment-undefine} to @var{exp},
-Guile will signal an @code{environment:immutable-binding} error.
-However, notice that the set of bindings in @var{exp} may still change,
-if the bindings in @var{private} change.
-@end deffn
-
-@deffn Primitive export-environment? object
-Return @code{#t} if @var{object} is an export environment, or @code{#f}
-otherwise.
-@end deffn
-
-@deffn Primitive export-environment-private env
-@deffnx Primitive export-environment-set-private! env
-@deffnx Primitive export-environment-signature env
-@deffnx Primitive export-environment-set-signature! env
-Accessors and mutators for the private environment and signature of
-@var{env}; @var{env} must be an export environment.
-@end deffn
-
-
-@node General Environments, , Export Environments, Standard Environment Types
-@subsection General Environments
-
-[[user provides the procedures]]
-[[A observers B and C; B observes C; C changes; A should only be
-notified once, right?]]
-[[observation loops?]]
-
-@node Implementing Environments, Switching to Environments, Standard Environment Types, Top-Level Environments in Guile
-@section Implementing Environments
-
-This section describes how to implement new environment types in Guile.
-
-Guile's internal representation of environments allows you to extend
-Guile with new kinds of environments without modifying Guile itself.
-Every environment object carries a pointer to a structure of pointers to
-functions implementing the common operations for that environment. The
-procedures @code{environment-ref}, @code{environment-set!}, etc. simply
-find this structure and invoke the appropriate function.
-
-[[It would be nice to have an example around here. How about a
-persistent environment, bound to a directory, where ref and set actually
-access files? Ref on a directory would return another
-environment... Hey, let's import my home directory!]]
-
-
-@menu
-* Environment Function Tables::
-* Environment Data::
-* Environment Example::
-@end menu
-
-
-@node Environment Function Tables, Environment Data, Implementing Environments, Implementing Environments
-@subsection Environment Function Tables
-
-An environment object is a smob whose @sc{cdr} is a pointer to a pointer
-to a @code{struct environment_funcs}:
-@example
-struct environment_funcs @{
- SCM (*ref) (SCM self, SCM symbol);
- SCM (*fold) (SCM self, scm_environment_folder *proc, SCM data, SCM init);
- void (*define) (SCM self, SCM symbol, SCM value);
- void (*undefine) (SCM self, SCM symbol);
- void (*set) (SCM self, SCM symbol, SCM value);
- SCM (*cell) (SCM self, SCM symbol, int for_write);
- SCM (*observe) (SCM self, scm_environment_observer *proc, SCM data, int weak_p);
- void (*unobserve) (SCM self, SCM token);
- SCM (*mark) (SCM self);
- scm_sizet (*free) (SCM self);
- int (*print) (SCM self, SCM port, scm_print_state *pstate);
-@};
-@end example
-
-You can use the following macro to access an environment's function table:
-
-@deftypefn {Libguile macro} struct environment_funcs *SCM_ENVIRONMENT_FUNCS (@var{env})
-Return a pointer to the @code{struct environment_func} for the environment
-@var{env}. If @var{env} is not an environment object, the behavior of
-this macro is undefined.
-@end deftypefn
-
-Here is what each element of @var{env_funcs} must do to correctly
-implement an environment. In all of these calls, @var{self} is the
-environment whose function is being invoked.
-
-@table @code
-
-@item SCM ref (SCM @var{self}, SCM @var{symbol});
-This function must have the effect described above for the C call:
-@example
-scm_c_environment_ref (@var{self}, @var{symbol})
-@end example
-@xref{Examining Environments}.
-
-Note that the @code{ref} element of a @code{struct environment_funcs}
-may be zero if a @code{cell} function is provided.
-
-@item SCM fold (SCM self, scm_environment_folder *proc, SCM data, SCM init);
-This function must have the effect described above for the C call:
-@example
-scm_c_environment_fold (@var{self}, @var{proc}, @var{data}, @var{init})
-@end example
-@xref{Examining Environments}.
-
-@item void define (SCM self, SCM symbol, SCM value);
-This function must have the effect described above for the Scheme call:
-@example
-(environment-define @var{self} @var{symbol} @var{value})
-@end example
-@xref{Changing Environments}.
-
-@item void undefine (SCM self, SCM symbol);
-This function must have the effect described above for the Scheme call:
-@example
-(environment-undefine @var{self} @var{symbol})
-@end example
-@xref{Changing Environments}.
-
-@item void set (SCM self, SCM symbol, SCM value);
-This function must have the effect described above for the Scheme call:
-@example
-(environment-set! @var{self} @var{symbol} @var{value})
-@end example
-@xref{Changing Environments}.
-
-Note that the @code{set} element of a @code{struct environment_funcs}
-may be zero if a @code{cell} function is provided.
-
-@item SCM cell (SCM self, SCM symbol, int for_write);
-This function must have the effect described above for the C call:
-@example
-scm_c_environment_cell (@var{self}, @var{symbol})
-@end example
-@xref{Caching Environment Lookups}.
-
-@item SCM observe (SCM self, scm_environment_observer *proc, SCM data, int weak_p);
-This function must have the effect described above for the C call:
-@example
-scm_c_environment_observe (@var{env}, @var{proc}, @var{data}, @var{weak_p})
-@end example
-@xref{Observing Changes to Environments}.
-
-@item void unobserve (SCM self, SCM token);
-Cancel the request to observe @var{self} that returned @var{token}.
-@xref{Observing Changes to Environments}.
-
-@item SCM mark (SCM self);
-Set the garbage collection mark all Scheme cells referred to by
-@var{self}. Assume that @var{self} itself is already marked. Return a
-final object to be marked recursively.
-
-@item scm_sizet free (SCM self);
-Free all non-cell storage associated with @var{self}; return the number
-of bytes freed that were obtained using @code{scm_must_malloc} or
-@code{scm_must_realloc}.
-
-@item SCM print (SCM self, SCM port, scm_print_state *pstate);
-Print an external representation of @var{self} on @var{port}, passing
-@var{pstate} to any recursive calls to the object printer.
-
-@end table
-
-
-@node Environment Data, Environment Example, Environment Function Tables, Implementing Environments
-@subsection Environment Data
-
-When you implement a new environment type, you will likely want to
-associate some data of your own design with each environment object.
-Since ANSI C promises that casts will safely convert between a pointer
-to a structure and a pointer to its first element, you can have the
-@sc{cdr} of an environment smob point to your structure, as long as your
-structure's first element is a pointer to a @code{struct
-environment_funcs}. Then, your code can use the macro below to retrieve
-a pointer to the structure, and cast it to the appropriate type.
-
-@deftypefn {Libguile macro} struct environment_funcs **SCM_ENVIRONMENT_DATA (@var{env})
-Return the @sc{cdr} of @var{env}, as a pointer to a pointer to an
-@code{environment_funcs} structure.
-@end deftypefn
-
-@node Environment Example, , Environment Data, Implementing Environments
-@subsection Environment Example
-
-[[perhaps a simple environment based on association lists]]
-
-
-@node Switching to Environments, , Implementing Environments, Top-Level Environments in Guile
-@section Switching to Environments
-
-Here's what we'd need to do to today's Guile to install the system
-described above. This work would probably be done on a branch, because
-it involves crippling Guile while a lot of work gets done. Also, it
-could change the default set of bindings available pretty drastically,
-so the next minor release should not contain these changes.
-
-After each step here, we should have a Guile that we can at least
-interact with, perhaps with some limitations.
-
-@itemize @bullet
-
-@item
-For testing purposes, make an utterly minimal version of
-@file{boot-9.scm}: no module system, no R5RS, nothing. I think a simple
-REPL is all we need.
-
-@item
-Implement the environment datatypes in libguile, and test them using
-this utterly minimal system.
-
-@item
-Change the interpreter to use the @code{environment-cell} and
-@code{environment-observe} instead of the symbol value slots,
-first-class variables, etc. Modify the rest of libguile as necessary to
-register all the primitives in a single environment. We'll segregate
-them into modules later.
-
-@item
-Reimplement the current module system in terms of environments. It
-should still be in Scheme.
-
-@item
-Reintegrate the rest of @file{boot-9.scm}. This might be a good point
-to move it into modules.
-
-@item
-Do some profiling and optimization.
-
-@end itemize
-
-Once this is done, we can make the following simplifications to Guile:
-
-@itemize @bullet
-
-@item
-A good portion of symbols.c can go away. Symbols no longer need value
-slots. The mismash of @code{scm_sym2ovcell},
-@code{scm_intern_obarray_soft}, etc. can go away. @code{intern} becomes
-simpler.
-
-@item
-Remove first-class variables: @file{variables.c} and @file{variables.h}.
-
-@item
-Organize the primitives into environments.
-
-@item
-The family of environment types is clearly an abstract class/concrete
-subclass arrangement. We should provide GOOPS classes/metaclasses that
-make defining new environment types easy and consistent.
-
-@end itemize
-
-
-
-@node Modules, , Top-Level Environments in Guile, Top
-@chapter Modules
-
-The material here is just a sketch. Don't take it too seriously. The
-point is that environments allow us to experiment without getting
-tangled up with the interpreter.
-
-@menu
-* Modules of Guile Primitives::
-* Modules of Interpreted Scheme Code::
-@end menu
-
-@node Modules of Guile Primitives, Modules of Interpreted Scheme Code, Modules, Modules
-@section Modules of Guile Primitives
-
-@node Modules of Interpreted Scheme Code, , Modules of Guile Primitives, Modules
-@section Modules of Interpreted Scheme Code
-
-If a module is implemented by interpreted Scheme code, Guile represents
-it using several environments:
-
-@table @asis
-
-@item the @dfn{local} environment
-This environment holds all the definitions made locally by the module,
-both public and private.
-
-@item the @dfn{import} environment
-This environment holds all the definitions this module imports from
-other modules.
-
-@item the @dfn{evaluation} environment
-This is the environment in which the module's code is actually
-evaluated, and the one closed over by the module's procedures, both
-public and private. Its bindings are the union of the @var{local} and
-@var{import} environments, with local bindings taking precedence.
-
-@item the @dfn{exported} environment
-This environment holds the module's public definitions. This is the
-only environment that the module's users have access to. It is the
-@var{evaluation} environment, restricted to the set of exported
-definitions.
-
-@end table
-
-Each of these environments is implemented using a separate environment
-type. Some of these types, like the evaluation and import environments,
-actually just compute their bindings by consulting other environments;
-they have no bindings in their own right. They implement operations
-like @code{environment-ref} and @code{environment-define} by passing
-them through to the environments from which they are derived. For
-example, the evaluation environment will pass definitions through to the
-local environment, and search for references and assignments first in
-the local environment, and then in the import environment.
-
-
-
-@bye
diff --git a/doc/sources/format.texi b/doc/sources/format.texi
deleted file mode 100644
index 122e0453d..000000000
--- a/doc/sources/format.texi
+++ /dev/null
@@ -1,434 +0,0 @@
-
-@menu
-* Format Interface::
-* Format Specification::
-@end menu
-
-@node Format Interface, Format Specification, Format, Format
-@subsection Format Interface
-
-@defun format destination format-string . arguments
-An almost complete implementation of Common LISP format description
-according to the CL reference book @cite{Common LISP} from Guy L.
-Steele, Digital Press. Backward compatible to most of the available
-Scheme format implementations.
-
-Returns @code{#t}, @code{#f} or a string; has side effect of printing
-according to @var{format-string}. If @var{destination} is @code{#t},
-the output is to the current output port and @code{#t} is returned. If
-@var{destination} is @code{#f}, a formatted string is returned as the
-result of the call. NEW: If @var{destination} is a string,
-@var{destination} is regarded as the format string; @var{format-string} is
-then the first argument and the output is returned as a string. If
-@var{destination} is a number, the output is to the current error port
-if available by the implementation. Otherwise @var{destination} must be
-an output port and @code{#t} is returned.@refill
-
-@var{format-string} must be a string. In case of a formatting error
-format returns @code{#f} and prints a message on the current output or
-error port. Characters are output as if the string were output by the
-@code{display} function with the exception of those prefixed by a tilde
-(~). For a detailed description of the @var{format-string} syntax
-please consult a Common LISP format reference manual. For a test suite
-to verify this format implementation load @file{formatst.scm}. Please
-send bug reports to @code{lutzeb@@cs.tu-berlin.de}.
-
-Note: @code{format} is not reentrant, i.e. only one @code{format}-call
-may be executed at a time.
-
-@end defun
-
-@node Format Specification, , Format Interface, Format
-@subsection Format Specification (Format version 3.0)
-
-Please consult a Common LISP format reference manual for a detailed
-description of the format string syntax. For a demonstration of the
-implemented directives see @file{formatst.scm}.@refill
-
-This implementation supports directive parameters and modifiers
-(@code{:} and @code{@@} characters). Multiple parameters must be
-separated by a comma (@code{,}). Parameters can be numerical parameters
-(positive or negative), character parameters (prefixed by a quote
-character (@code{'}), variable parameters (@code{v}), number of rest
-arguments parameter (@code{#}), empty and default parameters. Directive
-characters are case independent. The general form of a directive
-is:@refill
-
-@noindent
-@var{directive} ::= ~@{@var{directive-parameter},@}[:][@@]@var{directive-character}
-
-@noindent
-@var{directive-parameter} ::= [ [-|+]@{0-9@}+ | '@var{character} | v | # ]
-
-
-@subsubsection Implemented CL Format Control Directives
-
-Documentation syntax: Uppercase characters represent the corresponding
-control directive characters. Lowercase characters represent control
-directive parameter descriptions.
-
-@table @asis
-@item @code{~A}
-Any (print as @code{display} does).
-@table @asis
-@item @code{~@@A}
-left pad.
-@item @code{~@var{mincol},@var{colinc},@var{minpad},@var{padchar}A}
-full padding.
-@end table
-@item @code{~S}
-S-expression (print as @code{write} does).
-@table @asis
-@item @code{~@@S}
-left pad.
-@item @code{~@var{mincol},@var{colinc},@var{minpad},@var{padchar}S}
-full padding.
-@end table
-@item @code{~D}
-Decimal.
-@table @asis
-@item @code{~@@D}
-print number sign always.
-@item @code{~:D}
-print comma separated.
-@item @code{~@var{mincol},@var{padchar},@var{commachar}D}
-padding.
-@end table
-@item @code{~X}
-Hexadecimal.
-@table @asis
-@item @code{~@@X}
-print number sign always.
-@item @code{~:X}
-print comma separated.
-@item @code{~@var{mincol},@var{padchar},@var{commachar}X}
-padding.
-@end table
-@item @code{~O}
-Octal.
-@table @asis
-@item @code{~@@O}
-print number sign always.
-@item @code{~:O}
-print comma separated.
-@item @code{~@var{mincol},@var{padchar},@var{commachar}O}
-padding.
-@end table
-@item @code{~B}
-Binary.
-@table @asis
-@item @code{~@@B}
-print number sign always.
-@item @code{~:B}
-print comma separated.
-@item @code{~@var{mincol},@var{padchar},@var{commachar}B}
-padding.
-@end table
-@item @code{~@var{n}R}
-Radix @var{n}.
-@table @asis
-@item @code{~@var{n},@var{mincol},@var{padchar},@var{commachar}R}
-padding.
-@end table
-@item @code{~@@R}
-print a number as a Roman numeral.
-@item @code{~:@@R}
-print a number as an ``old fashioned'' Roman numeral.
-@item @code{~:R}
-print a number as an ordinal English number.
-@item @code{~:@@R}
-print a number as a cardinal English number.
-@item @code{~P}
-Plural.
-@table @asis
-@item @code{~@@P}
-prints @code{y} and @code{ies}.
-@item @code{~:P}
-as @code{~P but jumps 1 argument backward.}
-@item @code{~:@@P}
-as @code{~@@P but jumps 1 argument backward.}
-@end table
-@item @code{~C}
-Character.
-@table @asis
-@item @code{~@@C}
-prints a character as the reader can understand it (i.e. @code{#\} prefixing).
-@item @code{~:C}
-prints a character as emacs does (eg. @code{^C} for ASCII 03).
-@end table
-@item @code{~F}
-Fixed-format floating-point (prints a flonum like @var{mmm.nnn}).
-@table @asis
-@item @code{~@var{width},@var{digits},@var{scale},@var{overflowchar},@var{padchar}F}
-@item @code{~@@F}
-If the number is positive a plus sign is printed.
-@end table
-@item @code{~E}
-Exponential floating-point (prints a flonum like @var{mmm.nnn}@code{E}@var{ee}).
-@table @asis
-@item @code{~@var{width},@var{digits},@var{exponentdigits},@var{scale},@var{overflowchar},@var{padchar},@var{exponentchar}E}
-@item @code{~@@E}
-If the number is positive a plus sign is printed.
-@end table
-@item @code{~G}
-General floating-point (prints a flonum either fixed or exponential).
-@table @asis
-@item @code{~@var{width},@var{digits},@var{exponentdigits},@var{scale},@var{overflowchar},@var{padchar},@var{exponentchar}G}
-@item @code{~@@G}
-If the number is positive a plus sign is printed.
-@end table
-@item @code{~$}
-Dollars floating-point (prints a flonum in fixed with signs separated).
-@table @asis
-@item @code{~@var{digits},@var{scale},@var{width},@var{padchar}$}
-@item @code{~@@$}
-If the number is positive a plus sign is printed.
-@item @code{~:@@$}
-A sign is always printed and appears before the padding.
-@item @code{~:$}
-The sign appears before the padding.
-@end table
-@item @code{~%}
-Newline.
-@table @asis
-@item @code{~@var{n}%}
-print @var{n} newlines.
-@end table
-@item @code{~&}
-print newline if not at the beginning of the output line.
-@table @asis
-@item @code{~@var{n}&}
-prints @code{~&} and then @var{n-1} newlines.
-@end table
-@item @code{~|}
-Page Separator.
-@table @asis
-@item @code{~@var{n}|}
-print @var{n} page separators.
-@end table
-@item @code{~~}
-Tilde.
-@table @asis
-@item @code{~@var{n}~}
-print @var{n} tildes.
-@end table
-@item @code{~}<newline>
-Continuation Line.
-@table @asis
-@item @code{~:}<newline>
-newline is ignored, white space left.
-@item @code{~@@}<newline>
-newline is left, white space ignored.
-@end table
-@item @code{~T}
-Tabulation.
-@table @asis
-@item @code{~@@T}
-relative tabulation.
-@item @code{~@var{colnum,colinc}T}
-full tabulation.
-@end table
-@item @code{~?}
-Indirection (expects indirect arguments as a list).
-@table @asis
-@item @code{~@@?}
-extracts indirect arguments from format arguments.
-@end table
-@item @code{~(@var{str}~)}
-Case conversion (converts by @code{string-downcase}).
-@table @asis
-@item @code{~:(@var{str}~)}
-converts by @code{string-capitalize}.
-@item @code{~@@(@var{str}~)}
-converts by @code{string-capitalize-first}.
-@item @code{~:@@(@var{str}~)}
-converts by @code{string-upcase}.
-@end table
-@item @code{~*}
-Argument Jumping (jumps 1 argument forward).
-@table @asis
-@item @code{~@var{n}*}
-jumps @var{n} arguments forward.
-@item @code{~:*}
-jumps 1 argument backward.
-@item @code{~@var{n}:*}
-jumps @var{n} arguments backward.
-@item @code{~@@*}
-jumps to the 0th argument.
-@item @code{~@var{n}@@*}
-jumps to the @var{n}th argument (beginning from 0)
-@end table
-@item @code{~[@var{str0}~;@var{str1}~;...~;@var{strn}~]}
-Conditional Expression (numerical clause conditional).
-@table @asis
-@item @code{~@var{n}[}
-take argument from @var{n}.
-@item @code{~@@[}
-true test conditional.
-@item @code{~:[}
-if-else-then conditional.
-@item @code{~;}
-clause separator.
-@item @code{~:;}
-default clause follows.
-@end table
-@item @code{~@{@var{str}~@}}
-Iteration (args come from the next argument (a list)).
-@table @asis
-@item @code{~@var{n}@{}
-at most @var{n} iterations.
-@item @code{~:@{}
-args from next arg (a list of lists).
-@item @code{~@@@{}
-args from the rest of arguments.
-@item @code{~:@@@{}
-args from the rest args (lists).
-@end table
-@item @code{~^}
-Up and out.
-@table @asis
-@item @code{~@var{n}^}
-aborts if @var{n} = 0
-@item @code{~@var{n},@var{m}^}
-aborts if @var{n} = @var{m}
-@item @code{~@var{n},@var{m},@var{k}^}
-aborts if @var{n} <= @var{m} <= @var{k}
-@end table
-@end table
-
-
-@subsubsection Not Implemented CL Format Control Directives
-
-@table @asis
-@item @code{~:A}
-print @code{#f} as an empty list (see below).
-@item @code{~:S}
-print @code{#f} as an empty list (see below).
-@item @code{~<~>}
-Justification.
-@item @code{~:^}
-(sorry I don't understand its semantics completely)
-@end table
-
-
-@subsubsection Extended, Replaced and Additional Control Directives
-
-@table @asis
-@item @code{~@var{mincol},@var{padchar},@var{commachar},@var{commawidth}D}
-@item @code{~@var{mincol},@var{padchar},@var{commachar},@var{commawidth}X}
-@item @code{~@var{mincol},@var{padchar},@var{commachar},@var{commawidth}O}
-@item @code{~@var{mincol},@var{padchar},@var{commachar},@var{commawidth}B}
-@item @code{~@var{n},@var{mincol},@var{padchar},@var{commachar},@var{commawidth}R}
-@var{commawidth} is the number of characters between two comma characters.
-@end table
-
-@table @asis
-@item @code{~I}
-print an R5RS complex number as @code{~F~@@Fi} with passed parameters for
-@code{~F}.
-@item @code{~Y}
-Pretty print formatting of an argument for scheme code lists.
-@item @code{~K}
-Same as @code{~?.}
-@item @code{~!}
-Flushes the output if format @var{destination} is a port.
-@item @code{~_}
-Print a @code{#\space} character
-@table @asis
-@item @code{~@var{n}_}
-print @var{n} @code{#\space} characters.
-@end table
-@item @code{~/}
-Print a @code{#\tab} character
-@table @asis
-@item @code{~@var{n}/}
-print @var{n} @code{#\tab} characters.
-@end table
-@item @code{~@var{n}C}
-Takes @var{n} as an integer representation for a character. No arguments
-are consumed. @var{n} is converted to a character by
-@code{integer->char}. @var{n} must be a positive decimal number.@refill
-@item @code{~:S}
-Print out readproof. Prints out internal objects represented as
-@code{#<...>} as strings @code{"#<...>"} so that the format output can always
-be processed by @code{read}.
-@refill
-@item @code{~:A}
-Print out readproof. Prints out internal objects represented as
-@code{#<...>} as strings @code{"#<...>"} so that the format output can always
-be processed by @code{read}.
-@item @code{~Q}
-Prints information and a copyright notice on the format implementation.
-@table @asis
-@item @code{~:Q}
-prints format version.
-@end table
-@refill
-@item @code{~F, ~E, ~G, ~$}
-may also print number strings, i.e. passing a number as a string and
-format it accordingly.
-@end table
-
-@subsubsection Configuration Variables
-
-Format has some configuration variables at the beginning of
-@file{format.scm} to suit the systems and users needs. There should be
-no modification necessary for the configuration that comes with SLIB.
-If modification is desired the variable should be set after the format
-code is loaded. Format detects automatically if the running scheme
-system implements floating point numbers and complex numbers.
-
-@table @asis
-
-@item @var{format:symbol-case-conv}
-Symbols are converted by @code{symbol->string} so the case type of the
-printed symbols is implementation dependent.
-@code{format:symbol-case-conv} is a one arg closure which is either
-@code{#f} (no conversion), @code{string-upcase}, @code{string-downcase}
-or @code{string-capitalize}. (default @code{#f})
-
-@item @var{format:iobj-case-conv}
-As @var{format:symbol-case-conv} but applies for the representation of
-implementation internal objects. (default @code{#f})
-
-@item @var{format:expch}
-The character prefixing the exponent value in @code{~E} printing. (default
-@code{#\E})
-
-@end table
-
-@subsubsection Compatibility With Other Format Implementations
-
-@table @asis
-@item SLIB format 2.x:
-See @file{format.doc}.
-
-@item SLIB format 1.4:
-Downward compatible except for padding support and @code{~A}, @code{~S},
-@code{~P}, @code{~X} uppercase printing. SLIB format 1.4 uses C-style
-@code{printf} padding support which is completely replaced by the CL
-@code{format} padding style.
-
-@item MIT C-Scheme 7.1:
-Downward compatible except for @code{~}, which is not documented
-(ignores all characters inside the format string up to a newline
-character). (7.1 implements @code{~a}, @code{~s},
-~@var{newline}, @code{~~}, @code{~%}, numerical and variable
-parameters and @code{:/@@} modifiers in the CL sense).@refill
-
-@item Elk 1.5/2.0:
-Downward compatible except for @code{~A} and @code{~S} which print in
-uppercase. (Elk implements @code{~a}, @code{~s}, @code{~~}, and
-@code{~%} (no directive parameters or modifiers)).@refill
-
-@item Scheme->C 01nov91:
-Downward compatible except for an optional destination parameter: S2C
-accepts a format call without a destination which returns a formatted
-string. This is equivalent to a #f destination in S2C. (S2C implements
-@code{~a}, @code{~s}, @code{~c}, @code{~%}, and @code{~~} (no directive
-parameters or modifiers)).@refill
-
-@end table
-
-This implementation of format is solely useful in the SLIB context
-because it requires other components provided by SLIB.@refill
diff --git a/doc/sources/guile-slib.texi b/doc/sources/guile-slib.texi
deleted file mode 100644
index c8f07d1b2..000000000
--- a/doc/sources/guile-slib.texi
+++ /dev/null
@@ -1,2 +0,0 @@
-@node Guile and SLIB
-@chapter Guile and SLIB
diff --git a/doc/sources/jimb-org.texi b/doc/sources/jimb-org.texi
deleted file mode 100644
index 5ec4216db..000000000
--- a/doc/sources/jimb-org.texi
+++ /dev/null
@@ -1,131 +0,0 @@
-@menu
-Preliminary
-
-* Introduction::
-* Using Guile::
-
-
-
-@bye
-
->You can actually put any English text to break up the menu, so you
->could put the "Part n" headings in it.
-
-
-
-Introduction
- --- Explains Guile's goals, and gives brief examples of how to use
- Guile interactively (show off repl), as a script interpreter,
- and as an embedded interpreter.
-
-Part I: Guile Scheme
- R4RS Scheme as a Starting Point
- --- Here we refer to R4RS, and explain that we're only
- describing differences.
- Block comments and interpreter triggers
- Symbol case
- Keywords
- Exceptions
- Modules
- --- the preceeding three come first, because we need them
- in order to explain the behavior of some things later
- Exception Handling
- --- mention that repls usually establish default exception handlers
- Dynamic Wind
- Records
- Structures
- Arrays
- Binary Numeric Operations
- Shared and Read-Only Strings
- Object Properties
- Association Lists and Hash Tables
- (Dictionaries In General)
- association lists
- hash tables (Hash Values)
- Input/Output ports
- file ports
- soft ports
- string ports
- extended I/O (fseek; line read/write)
- Garbage Collection
- Threads and Dynamic Roots
- Reflection
- eval
- Tag Values
- Weak references
- Regular Expressions
- SLIB
- POSIX system calls and networking
- --- I think people will generally know whether they're looking
- for a system call or not, so this should be an okay category.
- conventions (includes error handling)
- ports vs. file descriptors
- file system (mknod goes here, no?)
- user database
- time (includes gettimeofday or whatever, strftime, strptime)
- processes
- terminals and pseudo-terminals
- pipes
- networking (includes databases, address conversion, and sockets)
- system identification (uname)
- locales (setlocale)
- --- Note that there is no more 'misc'. It's better to have
- small sections than unhelpful names.
- SCSH
- --- includes info on how to get SCSH features (open this
- module), but mostly just a pointer to the SCSH manual.
- This should not be under POSIX. SCSH includes plenty of
- high-level stuff for starting processes and string
- processing. SCSH is not a subset of POSIX, nor the
- reverse.
- Tcl/Tk interface
- Module internals
- first-class variables
- first-class modules
- internal debugging interface
- --- The name of this chapter needs to clearly distinguish it
- from the appendix describing the debugger UI. The intro
- should have a pointer to the UI appendix.
-
-Part II: Using Scheme with C --- a Portable Interface
- --- We cover gh in a completely separate section. Why? I admit
- I'm on shaky ground, but here's my reasoning: People who want
- to write portable C code need to restrict themselves to only
- using GH, and GH's semantics are (necessarily) well-defined
- without reference to Guile's particulars. This makes life
- more difficult for folks who just prefer to use the GH
- interface when they can, but I really think the SCM interface
- is not so bad, once you're used to it. A *lot* of GH
- functions are just wrappers for SCM functions.
- --- We cover repls here too, since GH has repl functions.
-
-Part III: Using Scheme with C --- Guile's Interface
- Scheme data representation
- Relationship between Scheme and C functions
- --- this is where we explain that all the functions marked as
- "Primitive Functions" are also accessible from C, and how
- to derive the C interface given the Scheme interface, when
- we don't spell it out.
- ... I think there's other stuff needed here ...
- I/O internals
- linking Guile with your code
- --- Mark's "Tools to automate adding libraries" is not a
- well-defined concept. I think this is closer to what we
- want to cover for now.
- snarfing
-
-Appendices:
- Obtaining and Installing Guile
- Invoking Guile
- --- mentions read-eval-print loops
- --- both the SCSH and GAWK manuals relegate invocation details
- to an appendix. We can give examples in the introduction.
- debugger user interface
- --- The title and introduction of this appendix need to
- distinguish this clearly from the chapter on the internal
- debugging interface.
-
-Indices:
- --- At the top of the function/variable index, remind people
- to look for functions under their Scheme names as well as
- their C names.
diff --git a/doc/sources/libguile-overview.texi b/doc/sources/libguile-overview.texi
deleted file mode 100644
index 96a4a76ce..000000000
--- a/doc/sources/libguile-overview.texi
+++ /dev/null
@@ -1,30 +0,0 @@
-@node Libguile overview
-@chapter Libguile overview
-@cindex libguile - overview
-
-Extension languages, like Guile, Python and Tcl, can be embedded into a
-C program, @footnote{Or a C++ or Fortran or Pascal program if you want.}
-and thus allow the user to @emph{extend} the C program.
-
-The way this is done is by providing a C language library with a well
-defined interface. The interface consists of a set of public and
-documented C-callable routines that offer the full interpreter
-functionality, and allow the conversion of data between C and the
-extension language.
-
-@menu
-* An example of libguile functionality::
-* What can be done with libguile::
-* Schizofrenia -- two APIs::
-@end menu
-
-@node An example of libguile functionality
-@section An example of libguile functionality
-
-[Two examples: using strings and using data conversion.]
-
-@node What can be done with libguile
-@section What can be done with libguile
-
-@node Schizofrenia -- two APIs
-@section Schizofrenia -- two APIs
diff --git a/doc/sources/libguile-tools.texi b/doc/sources/libguile-tools.texi
deleted file mode 100644
index d434406e9..000000000
--- a/doc/sources/libguile-tools.texi
+++ /dev/null
@@ -1,191 +0,0 @@
-@node Tools to automate adding libraries
-@chapter Tools to automate adding libraries
-
-You want to ...
-
-The chapters @ref{Libguile -- high level interface} and @ref{Libguile --
-SCM interface} showed how to make C libraries available from Scheme.
-Here I will describe some automated tools that the Guile team has made
-available. Some have been written especially for Guile (the Guile Magic
-Snarfer), and some are also in use with other languages (Python, Perl,
-...)
-
-@menu
-* By hand with gh_::
-* By hand with Guile Magic Snarfer::
-* Automatically using libtool::
-* Automatically using SWIG::
-@end menu
-
-@node By hand with gh_
-@section By hand with gh_
-
-@node By hand with Guile Magic Snarfer
-@section By hand with Guile Magic Snarfer
-
-When writing C code for use with Guile, you typically define a set of C
-functions, and then make some of them visible to the Scheme world by
-calling the @code{scm_make_gsubr} function; a C functions published in
-this way is called a @dfn{subr}. If you have many subrs to publish, it
-can sometimes be annoying to keep the list of calls to
-@code{scm_make_gsubr} in sync with the list of function definitions.
-Frequently, a programmer will define a new subr in C, recompile his
-application, and then discover that the Scheme interpreter cannot see
-the subr, because he forgot to call @code{scm_make_gsubr}.
-
-Guile provides the @code{guile-snarf} command to manage this problem.
-Using this tool, you can keep all the information needed to define the
-subr alongside the function definition itself; @code{guile-snarf} will
-extract this information from your source code, and automatically
-generate a file of calls to @code{scm_make_gsubr} which you can
-@code{#include} into an initialization function. (The command name
-comes from the verb ``to snarf'', here meaning ``to unceremoniously
-extract information from a somewhat unwilling source.'')
-
-@menu
-* How guile-snarf works:: Using the @code{guile-snarf} command.
-* Macros guile-snarf recognizes:: How to mark up code for @code{guile-snarf}.
-@end menu
-
-@node How guile-snarf works
-@subsection How @code{guile-snarf} works
-
-For example, here is how you might define a new subr called
-@code{clear-image}, implemented by the C function @code{clear_image}:
-
-@example
-@group
-#include <libguile.h>
-
-@dots{}
-
-SCM_PROC (s_clear_image, "clear-image", 1, 0, 0, clear_image);
-
-SCM
-clear_image (SCM image_smob)
-@{
- @dots{}
-@}
-
-@dots{}
-
-void
-init_image_type ()
-@{
-#include "image-type.x"
-@}
-@end group
-@end example
-
-The @code{SCM_PROC} declaration says that the C function
-@code{clear_image} implements a Scheme subr called @code{clear-image},
-which takes one required argument, no optional arguments, and no tail
-argument. @code{SCM_PROC} also declares a static array of characters
-named @code{s_clear_image}, initialized to the string
-@code{"clear-image"}. The body of @code{clear_image} may use the array
-in error messages, instead of writing out the literal string; this may
-save string space on some systems.
-
-Assuming the text above lives in a file named @file{image-type.c}, you will
-need to execute the following command to compile this file:
-@example
-guile-snarf image-type.c > image-type.x
-@end example
-@noindent This scans @file{image-type.c} for @code{SCM_PROC}
-declarations, and sends the following output to the file
-@file{image-type.x}:
-@example
-scm_make_gsubr (s_clear_image, 1, 0, 0, clear_image);
-@end example
-When compiled normally, @code{SCM_PROC} is a macro which expands to a
-declaration of the @code{s_clear_image} string.
-
-In other words, @code{guile-snarf} scans source code looking for uses of
-the @code{SCM_PROC} macro, and generates C code to define the
-appropriate subrs. You need to provide all the same information you
-would if you were using @code{scm_make_gsubr} yourself, but you can
-place the information near the function definition itself, so it is less
-likely to become incorrect or out-of-date.
-
-If you have many files that @code{guile-snarf} must process, you should
-consider using a rule like the following in your Makefile:
-@example
-.SUFFIXES: .x
-.c.x:
- ./guile-snarf $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< > $@
-@end example
-This tells make to run @code{guile-snarf} to produce each needed
-@file{.x} file from the corresponding @file{.c} file.
-
-@code{guile-snarf} passes all its command-line arguments directly to the
-C preprocessor, which it uses to extract the information it needs from
-the source code. this means you can pass normal compilation flags to
-@code{guile-snarf} to define preprocessor symbols, add header file
-directories, and so on.
-
-
-
-@node Macros guile-snarf recognizes
-@subsection Macros @code{guile-snarf} recognizes
-
-Here are the macros you can use in your source code from which
-@code{guile-snarf} can construct initialization code:
-
-
-@defmac SCM_PROC (@var{namestr}, @var{name}, @var{req}, @var{opt}, @var{tail}, @var{c_func})
-Declare a new Scheme primitive function, or @dfn{subr}. The new subr
-will be named @var{name} in Scheme code, and be implemented by the C
-function @var{c_func}. The subr will take @var{req} required arguments
-and @var{opt} optional arguments. If @var{tail} is non-zero, the
-function will accept any remaining arguments as a list.
-
-Use this macro outside all function bodies, preferably above the
-definition of @var{c_func} itself. When compiled, the @code{SCM_PROC}
-declaration will expand to a definition for the @var{namestr} array,
-initialized to @var{name}. The @code{guile-snarf} command uses this
-declaration to automatically generate initialization code to create the
-subr and bind it in the top-level environment. @xref{How guile-snarf
-works}, for more info.
-
-@xref{Subrs}, for details on argument passing and how to write
-@var{c_func}.
-@end defmac
-
-
-@defmac SCM_GLOBAL (@var{var}, @var{scheme_name})
-Declare a global Scheme variable named @var{scheme_name}, and a static C
-variable named @var{var} to point to it. The value of the Scheme
-variable lives in the @sc{cdr} of the cell @var{var} points to.
-Initialize the variable to @code{#f}.
-
-Use this macro outside all function bodies. When compiled, the
-@code{SCM_GLOBAL} macro will expand to a definition for the variable
-@var{var}, initialized to an innocuous value. The @code{guile-snarf}
-command will use this declaration to automatically generate code to
-create a global variable named @var{scheme_name}, and store a pointer to
-its cell in @var{var}.
-@end defmac
-
-
-@defmac SCM_CONST_LONG (@var{var}, @var{scheme_name}, @var{value})
-Like @code{SCM_GLOBAL}, but initialize the variable to @var{value},
-which must be an integer.
-@end defmac
-
-
-@defmac SCM_SYMBOL (@var{var}, @var{name})
-Declare a C variable of type @code{SCM} named @var{var}, and initialize
-it to the Scheme symbol object whose name is @var{name}.
-
-Use this macro outside all function bodies. When compiled, the
-@code{SCM_SYMBOL} macro will expand to a definition for the variable
-@var{var}, initialized to an innocuous value. The @code{guile-snarf}
-command will use this declaration to automatically generate code to
-create a symbol named @var{name}, and store it in @var{var}.
-@end defmac
-
-@node Automatically using libtool
-@section Automatically using libtool
-
-@node Automatically using SWIG
-@section Automatically using SWIG
diff --git a/doc/sources/new-types.texi b/doc/sources/new-types.texi
deleted file mode 100644
index 1840b214f..000000000
--- a/doc/sources/new-types.texi
+++ /dev/null
@@ -1,2 +0,0 @@
-@node Adding types to Guile
-@chapter Adding types to Guile
diff --git a/doc/sources/old-intro.texi b/doc/sources/old-intro.texi
deleted file mode 100644
index 0774f64d4..000000000
--- a/doc/sources/old-intro.texi
+++ /dev/null
@@ -1,290 +0,0 @@
-@node Introduction
-@chapter Introduction
-
-Guile is an interpreter for Scheme, a clean, economical programming
-language in the Lisp family. You can invoke Guile from the shell to
-evaluate Scheme expressions interactively, or use it as an interpreter
-for script files. However, Guile is also packaged as a library, to be
-embedded as an extension language into other applications. The
-application can supplement the base language with special-purpose
-functions and datatypes, allowing the user to customize and extend it by
-writing Scheme code.
-
-In its simplest form, Guile is an ordinary interpreter. The
-@code{guile} program can read and evaluate Scheme expressions entered
-from the terminal. Here is a sample interaction between Guile and a
-user; the user's input appears after the @code{$} and @code{guile>}
-prompts:
-
-@example
-$ guile
-guile> (+ 1 2 3) ; add some numbers
-6
-guile> (define (factorial n) ; define a function
- (if (zero? n) 1 (* n (factorial (- n 1)))))
-guile> (factorial 20)
-2432902008176640000
-guile> (getpwnam "jimb") ; find my entry in /etc/passwd
-#("jimb" ".0krIpK2VqNbU" 4008 10 "Jim Blandy" "/u/jimb"
- "/usr/local/bin/bash")
-guile> @kbd{C-d}
-$
-@end example
-
-Guile can also interpret script files. For example, here is a Guile script
-containing a script which displays the
-
-
-application can
-supplement the base language with its own functions, datatypes and
-syntax, allowing the user to extend and
-
-
- Guile interpret
-
-. An
-application the Guile interpreter to allow
-
-
-, allowing
-applications to incorporate the Scheme interpreter for customization
-
-[[interactive]]
-[[script interpreter]]
-[[embedded]]
-
-[[other languages]]
-The concept of an extension language library does not originate with
-Guile. However, Guile is the first to offer users a choice of languages
-to program in.
-
-
-Guile currently supports Scheme and Ctax , and we expect to support Emacs Lisp in the near future.
-
-
-Scheme is powerful enough that other languages can be
-conveniently translated into it,
-
-However, unlike other extension packages, Guile gives users a choice of
-languages to program in. Guile can
-
-
-In this sense, Guile resembles the Tcl and Python packages, providing
-both an ordinary interpreter and an extension language library.
-However, unlike those packages, Guile supports more than one programming
-language.
-
-; users can
-write Scheme code to control and customize applications which
-incorporate Guile
-
-, adding their own functions,
-datatypes, and syntax, to allow the user to programm
-
-
-link it into your own programs to make them
-
-
-
-Guile is a library containing an interpreter for Scheme, a complete but
-economical programming language, which the developer can customize to
-suit the application at hand by adding new functions, data types, and
-control structures. These may be implemented in C, and then
-``exported'' for use by the interpreted code. Because Guile already
-provides a full-featured interpreter, the developer need not neglect the
-language's design in order to concentrate on code relevant to the task.
-In this way, Guile provides a framework for the construction of
-domain-specific languages.
-
-Guile provides first-class functions, a rich set of data types,
-exception handling, a module system, and a powerful macro facility.
-Guile also supports dynamic linking and direct access to Unix system
-calls. Releases in the near future will support a source-level
-debugger and bindings for the Tk user interface toolkit.
-
-
-
-Guile is a framework for writing applications controlled by specialized
-languages. In its simplest form, Guile is an interpreter for Scheme, a
-clean, economical programming language in the Lisp family. However,
-Guile is packaged as a library, allowing applications to link against it
-and use Scheme as their extension language. The application can add
-primitive functions to the language, implement new data types, and even
-adjust the language's syntax.
-
-
-
-[the introduction is probably not what Jim has in mind; I just took the
-one I had in earlier, since the file had the same name intro.texi]
-
-Guile is an implementation of the Scheme programming language, but, like
-other modern implementations of Scheme, it adds many features that the
-community of Scheme programmers considers necessary for an ``industrial
-strength'' language.
-
-Examples of extensions to Scheme are the module system
-(@pxref{Modules}), the Unix system programming tools (@pxref{POSIX
-system calls and networking} and @pxref{The Scheme shell (scsh)}), an
-interface to @emph{libtool} to make it easier to add C libraries as
-primitives (@pxref{Linking Guile with your code}), and (FIXME add more).
-
-On top of these extensions, which many other Scheme implementations
-provide, Guile also offers the possibility of writing routines in other
-languages and running them simultaneously with Scheme. The desire to
-implement other languages (in particular Emacs Lisp) on top of Scheme is
-responsible for Guile's only deviation from the R4RS @footnote{R4RS is
-the Revised^4 Report on the Algorithmic Language Scheme, the closest
-thing to a standard Scheme specification today} Scheme standard
-(@cite{r4rs}): Guile is case sensitive, whereas ``standard'' Scheme is
-not.
-
-But even more fundamentally, Guile is meant to be an @emph{embeddable}
-Scheme interpreter. This means that a lot of work has gone into
-packaging the interpreter as a C library (@pxref{A Portable C to Scheme Interface} and @pxref{Scheme data representation}).
-
-This reference manual is mainly driven by the need to document all the
-features that go beyond standard Scheme.
-
-@menu
-* Getting started::
-* Guile feature list::
-* What you need to use Guile::
-* Roadmap to the Manual::
-* Motivation for Guile::
-* History of Guile::
-@end menu
-
-@node Getting started
-@section Getting started
-
-We assume that you know how to program in Scheme, although we do not
-assume advanced knowledge. If you don't know Scheme, there are many
-good books on Scheme at all levels, and the Guile Tutorial might give
-you a good enough feel for the language. We also assume that you know
-how to program in C, since there will be many examples of how to program
-in C using Guile as a library.
-
-Many diverse topics from the world of Unix hacking will be covered here,
-such as shared libraries, socket programming, garbage collection, and so
-forth. If at any time you feel you don't have enough background on a
-given topic, just go up a level or two in the manual, and you will find
-that the chapter begins with a few paragraphs that introduce the topic.
-If you are still lost, read through the Guile tutorial and then come
-back to this reference manual.
-
-To run the core Guile interpreter and extension library you need no more
-than a basically configured GNU/Unix system and the Guile sources. You
-should download and install the Guile sources (@pxref{Obtaining and
-Installing Guile}).
-
-
-@node Guile feature list
-@section Guile feature list
-
-In a reductionist view, Guile could be regarded as:
-@itemize @bullet
-@item
-An R4RS-compliant Scheme interpreter.
-
-@item
-Some Scheme features that go beyond the R4RS standard, notably a module
-system, exception handling primitives and an interface to Aubrey
-Jaffer's SLIB.
-
-@item
-A symbolic debugger for Scheme, and gdb extensions to facilitate
-debugging libguile programs.
-
-@item
-An embeddable version of the same interpreter, called @emph{libguile}.
-
-@item
-A portable high level API on top of libguile (the @code{gh_} interface).
-
-@item
-A collection of bundled C libraries with a Guile API. As we write, this
-list includes:
-
-@table @strong
-@item Rx
-a regular expression library.
-
-@item Unix
-a low-level interface to the POSIX system calls, socket library
-and other Unix system services.
-
-@item Tk
-an interface to John Ousterhout's Tk toolkit.
-
-@end table
-
-@item
-A set of tools for implementing other languages @emph{on top of Scheme},
-and an example implementation of a language called @emph{Ctax}.
-
-
-@end itemize
-
-
-@node What you need to use Guile
-@section What you need to use Guile
-
-
-@node Roadmap to the Manual
-@section Roadmap to the Manual
-
-@node Motivation for Guile
-@section Motivation for Guile
-
-@node History of Guile
-@section History of Guile
-
-@page
-@node Using Guile
-@chapter Using Guile
-
-[I think that this might go in the appendix in Jim's view of the manual]
-
-@page
-@node Invoking Guile
-@appendix Invoking Guile
- --- mentions read-eval-print loops
- --- both the SCSH and GAWK manuals relegate invocation details
- to an appendix. We can give examples in the introduction.
-
-@table @samp
-@item -h
-@itemx --help
-Display a helpful message.
-@item -v
-@item --version
-Display the current version.
-@item --emacs
-To be used for emacs editing support.
-@item -s @var{file}
-Process @var{file} as a script then quit. This is a terminating option:
-any further command line arguments can be accessed by the script using
-the @code{(program-arguments)} procedure.
-
-An executable script can start with the following:
-
-@smallexample
-#!/usr/bin/guile -s
-!#
-@end smallexample
-
-Note the @code{!#} token on the second line. It is very important
-to include this token when writing Guile scripts. Guile and SCSH,
-the Scheme shell, share the convention that @code{#!} and
-@code{!#} may be used to mark block comments (@pxref{Block
-comments and interpreter triggers}). If the closing @code{!#}
-token is not included, then Guile will consider the block comment
-to be unclosed, and the script will probably not compile
-correctly.
-
-It is also important to include the @samp{-s} option at the
-beginning of the Guile script, so that Guile knows not to behave
-in an interactive fashion.
-
-@end table
-
diff --git a/doc/sources/sample-APIs.texi b/doc/sources/sample-APIs.texi
deleted file mode 100644
index c8c4b8e72..000000000
--- a/doc/sources/sample-APIs.texi
+++ /dev/null
@@ -1,6 +0,0 @@
-@node Examples of adding libraries
-@chapter Examples of adding libraries
-
-Should contain examples of brute-force gh_, Guile magic snarfer,
-libtool, SWIG on a dummy API, followed by some real examples of how
-libraries are added.
diff --git a/doc/sources/scheme-concepts.texi b/doc/sources/scheme-concepts.texi
deleted file mode 100644
index e8e78f14d..000000000
--- a/doc/sources/scheme-concepts.texi
+++ /dev/null
@@ -1,249 +0,0 @@
-@node Guile Scheme concepts
-@chapter Guile Scheme concepts
-
-Most Scheme implementations go beyond what is specified in the R4RS
-document @footnote{Remember? R4RS is the Revised^4 report on the
-Algorithmic Language Scheme}, mostly because R4RS does not give
-specifications (or even recommendations) regarding some issues that are
-quite important in practical programming.
-
-Here is a list of how Guile implements some of these much-needed Scheme
-extensions; other Scheme implementations do so quite similarly.
-
-@menu
-* Scheme slang::
-* Read-eval-print loops::
-* Extra data types::
-* Miscellaneous features::
-@end menu
-
-@node Scheme slang
-@section Scheme slang
-@cindex slang
-
-Even if you read some of the nice books on Scheme, or the R4RS report,
-you might not find some of the terms frequently used by Scheme hackers,
-both in the manual and in the @url{news:comp.lang.scheme} newsgroup.
-
-Here is a glossary of some of the terms that make Scheme beginners and
-intermediate users say ``huh?''
-
-@table @strong
-@item thunk
-@cindex thunk
-A Scheme procedure that takes no arguments. In this example,
-@code{thunk} and @code{another-thunk} are both thunks:
-@lisp
-(define (thunk)
- (display "Dude, I'm a thunk!")
- (newline))
-(define another-thunk
- (lambda ()
- (display "Me too!\n")
- (newline)))
-@end lisp
-
-@item closure
-@cindex closure
-A closure is a procedure. However, the term emphasizes the fact that a
-Scheme procedure remembers (or @dfn{closes over}) the variables that
-were visible when the @code{lambda} expression was
-evaluated.
-
-In the example below, we might refer to @code{q} as a closure, because
-it has closed over the value of @code{x}:
-@lisp
-(define p
- (lambda (x)
- (lambda (y)
- (+ x y))))
-(define q (p 5.7))
-
-(q 10)
-@result{} 15.7
-@end lisp
-
-However, strictly speaking, every Scheme procedure is really a closure,
-since it closes over the top-level environment.
-
-@item alist
-@itemx association list
-
-@item plist
-@itemx property list
-
-@end table
-
-
-@node Read-eval-print loops
-@section Read-eval-print loops
-@cindex Read-eval-print loop
-@cindex REPL
-
-To explicitly mention the Scheme read-eval-print loop (REPL) seems weird
-because we are all accustomed to firing up an interpreter and having it
-read and execute commands.
-
-But the REPL is not specified in R4RS; rather, it is proposed by the
-Scheme Bible @cite{Structure and Interpretation of Computer Programs}
-(also known as @emph{SICP}), and implemented in some form in all Scheme
-interpreters.
-@cindex Structure and Interpretation of Computer Programs
-@cindex SICP
-
-[FIXME: Someone needs to tell me what needs to be said about Guile's
-REPL.]
-
-@node Extra data types
-@section Extra data types
-
-The fundamental Scheme data types specified in R4RS are @emph{numbers}
-(both exact and inexact), @emph{characters}, @emph{strings},
-@emph{symbols}, @emph{vectors}, @emph{pairs} and @emph{lists} [FIXME: is
-this complete?].
-
-Many Scheme interpreters offer more types, and Guile is no exception.
-Guile is based on Aubrey Jaffer's SCM interpreter, and thus inherits
-@emph{uniform arrays}, [FIXME: any others? How about records?].
-
-On top of that, Guile allows you to add extra types, but that is covered
-in @ref{Adding types to Guile}. Here I will simply document all the
-extra Scheme types shipped with Guile.
-
-@menu
-* Conventional arrays::
-* Uniform arrays::
-* Bit vectors::
-* Complex numbers::
-@end menu
-
-@node Conventional arrays
-@subsection Conventional arrays
-
-@node Uniform arrays
-@subsection Uniform arrays
-@cindex arrays - uniform
-
-The motivation for uniform arrays in Scheme is performance. A vector
-provides a performance increase over lists when you want a fixed-size
-indexable list. But the elements in a vector can be of different types,
-and this makes for larger storage requirements and slightly lower
-performance.
-
-A uniform array is similar to a vector, but all elements have to be of
-the same type.
-
-arrays, uniform arrays, bit vectors:
-
-@deffn procedure array-fill ra fill
-@end deffn
-@deffn procedure serial-array-copy! src dst
-@end deffn
-@deffn procedure serial-array-map ra0 proc [lra]
-@end deffn
-@deffn procedure array-map ra0 proc [lra]
-@end deffn
-@deffn procedure array-for-each proc ra0 [lra]
-@end deffn
-@deffn procedure array-index-map! ra proc
-@end deffn
-@deffn procedure array-copy! src dst
-@end deffn
-@deffn procedure array-copy! src dst
-@end deffn
-@deffn procedure array-copy! src dst
-@end deffn
-@deffn procedure array-copy! src dst
-@end deffn
-@deffn procedure array-copy! src dst
-@end deffn
-@deffn procedure array? ra [prot]
-@end deffn
-@deffn procedure array-rank ra
-@end deffn
-@deffn procedure array-dimensions ra
-@end deffn
-@deffn procedure dimensions->uniform-array dims prot fill ...
-@end deffn
-@deffn procedure make-shared-array ra mapfunc dims ...
-@end deffn
-@deffn procedure transpose-array arg ...
-@end deffn
-@deffn procedure enclose-array axes ...
-@end deffn
-@deffn procedure array-in-bounds? arg ...
-@end deffn
-@deffn procedure array-ref ra arg ..
-@end deffn
-@deffn procedure uniform-vector-ref vec pos
-@end deffn
-@deffn procedure array-set! ra obj arg ...
-@end deffn
-@deffn procedure uniform-array-set1! ua obj arg
-@end deffn
-@deffn procedure array-contents ra [strict]
-@end deffn
-@deffn procedure uniform-array-read! ra [port-or-fd] [start] [end]
-@end deffn
-@deffn procedure uniform-array-write! ra [port-or-fd] [start] [end]
-@end deffn
-@deffn procedure bit-count item seq
-@end deffn
-@deffn procedure bit-position item v k
-@end deffn
-@deffn procedure bit-set! v kv obj
-@end deffn
-@deffn procedure bit-count* v kv obj
-@end deffn
-@deffn procedure bit-invert v
-@end deffn
-@deffn procedure array->list ra
-@end deffn
-@deffn procedure list->uniform-array ndim prot list
-@end deffn
-@deffn procedure array-prototype ra
-@end deffn
-
-Unform arrays can be written and read, but @code{read} won't recognize
-them unless the optional @code{read-sharp} parameter is supplied,
-e.g,
-@smalllisp
-(read port #t read-sharp)
-@end smalllisp
-
-where @code{read-sharp} is the default procedure for parsing extended
-sharp notations.
-
-Reading an array is not very efficient at present, since it's implemented
-by reading a list and converting the list to an array.
-
-@c FIXME: must use @deftp, but its generation of TeX code is buggy.
-@c Must fix it when TeXinfo gets fixed.
-@deftp {Scheme type} {uniform array}
-
-@end deftp
-
-@node Bit vectors
-@subsection Bit vectors
-
-@node Complex numbers
-@subsection Complex numbers
-
-@c FIXME: must use @deftp, but its generation of TeX code is buggy.
-@c Must fix it when TeXinfo gets fixed.
-@deftp {Scheme type} complex
-Standard complex numbers.
-@end deftp
-
-@node Miscellaneous features
-@section Miscellaneous features
-
-@defun defined? symbol
-Returns @code{#t} if a symbol is bound to a value, @code{#f} otherwise.
-This kind of procedure is not specified in R4RS because @c FIXME: finish
-this thought
-@end defun
-
-@defun object-properties OBJ
-and so forth
-@end defun
diff --git a/doc/sources/scm-ref.texi b/doc/sources/scm-ref.texi
deleted file mode 100644
index eca672580..000000000
--- a/doc/sources/scm-ref.texi
+++ /dev/null
@@ -1,4 +0,0 @@
-@node Libguile -- SCM interface
-@chapter Libguile -- SCM interface
-
-
diff --git a/doc/sources/strings.texi b/doc/sources/strings.texi
deleted file mode 100644
index 9a1ddc952..000000000
--- a/doc/sources/strings.texi
+++ /dev/null
@@ -1,45 +0,0 @@
-@node Strings
-@chapter Facilities for string manipulation
-
-@deffn procedure string? string
-@end deffn
-@deffn procedure read-only-string? string
-@end deffn
-@deffn procedure list->string list
-@end deffn
-@deffn procedure make-string length [char]
-@end deffn
-@deffn procedure string-length string
-@end deffn
-@deffn procedure string-ref string [index]
-@end deffn
-@deffn procedure string-set! string index char
-@end deffn
-@deffn procedure substring string start [end]
-@end deffn
-@deffn procedure string-append arg ...
-@end deffn
-@deffn procedure make-shared-substring string [from] [to]
-@end deffn
-@deffn procedure string-set! string index char
-@end deffn
-@deffn procedure string-index string char [from] [to]
-@end deffn
-@deffn procedure string-rindex string char [from] [to]
-@end deffn
-@deffn procedure substring-move-left! string1 start1 [end1] [string2] [start2]
-@end deffn
-@deffn procedure substring-move-right! string1 start1 [end1] [string2] [start2]
-@end deffn
-@deffn procedure substring-fill! string start [end] [fill]
-@end deffn
-@deffn procedure string-null? string
-@end deffn
-@deffn procedure string->list string
-@end deffn
-@deffn procedure string-copy string
-@end deffn
-@deffn procedure string-upcase! string
-@end deffn
-@deffn procedure string-downcase! string
-@end deffn
diff --git a/doc/sources/tk.texi b/doc/sources/tk.texi
deleted file mode 100644
index 176c8c7b8..000000000
--- a/doc/sources/tk.texi
+++ /dev/null
@@ -1,5 +0,0 @@
-@node Tk interface
-@chapter Tk interface
-
-For now Guile has no well-specified Tk interface. It is an important part
-of Guile, though, and will be documented here when it is written.
diff --git a/doc/sources/unix-other.texi b/doc/sources/unix-other.texi
deleted file mode 100644
index 7b810d5d6..000000000
--- a/doc/sources/unix-other.texi
+++ /dev/null
@@ -1,132 +0,0 @@
-@node Other Unix
-@chapter Other Unix-specific facilities
-
-@menu
-* Expect:: Expect, for pattern matching from a port.
-@end menu
-
-@node Expect
-@section Expect: Pattern Matching from a Port
-
-@code{expect} is a macro for selecting actions based on the output from
-a port. The name comes from a tool of similar functionality by Don Libes.
-Actions can be taken when a particular string is matched, when a timeout
-occurs, or when end-of-file is seen on the port. The @code{expect} macro
-is described below; @code{expect-strings} is a front-end to @code{expect}
-based on regexec @xref{Regular expressions}.
-
-Using these macros requires for now:
-@smalllisp
-(load-from-path "ice-9/expect")
-@end smalllisp
-
-@defun expect-strings clause @dots{}
-By default, @code{expect-strings} will read from the current input port.
-The first term in each clause consists of an expression evaluating to
-a string pattern (regular expression). As characters
-are read one-by-one from the port, they are accumulated in a buffer string
-which is matched against each of the patterns. When a
-pattern matches, the remaining expression(s) in
-the clause are evaluated and the value of the last is returned. For example:
-
-@smalllisp
-(with-input-from-file "/etc/passwd"
- (lambda ()
- (expect-strings
- ("^nobody" (display "Got a nobody user.\n")
- (display "That's no problem.\n"))
- ("^daemon" (display "Got a daemon user.\n")))))
-@end smalllisp
-
-The regular expression is compiled with the @code{REG_NEWLINE} flag, so
-that the @code{^} and @code{$} anchors will match at any newline, not
-just at the start
-and end of the string.
-
-There are two other ways to write a clause:
-
-The expression(s) to evaluate on a match
-can be omitted, in which case the result of the match
-(converted to strings, as obtained from regexec with @var{match-pick}
-set to @code{""}) will be returned if the pattern matches.
-
-The symbol @code{=>} can be used to indicate that there is a single
-expression to evaluate on a match, which must be a
-procedure which will accept the result of a successful match (converted
-to strings, as obtained from regexec with @var{match-pick} set to
-@code{""}). E.g.,
-
-@smalllisp
-("^daemon" => write)
-("^d\\(aemon\\)" => (lambda args (map write args)))
-("^da\\(em\\)on" => (lambda (all sub)
- (write all)
- (write sub)))
-@end smalllisp
-
-The order of the substrings corresponds to the order in which the
-opening brackets occur in the regular expression.
-
-A number of variables can be used to control the behaviour
-of @code{expect} (and @code{expect-strings}).
-By default they are all bound at the top level to
-the value @code{#f}, which produces the default behaviour.
-They can be redefined at the
-top level or locally bound in a form enclosing the @code{expect} expression.
-
-@table @code
-@item expect-port
-A port to read characters from, instead of the current input port.
-@item expect-timeout
-@code{expect} will terminate after this number of
-seconds, returning @code{#f} or the value returned by
-@code{expect-timeout-proc}.
-@item expect-timeout-proc
-A procedure called if timeout occurs. The procedure takes a single argument:
-the accumulated string.
-@item expect-eof-proc
-A procedure called if end-of-file is detected on the input port. The
-procedure takes a single argument: the accumulated string.
-@item expect-char-proc
-A procedure to be called every time a character is read from the
-port. The procedure takes a single argument: the character which was read.
-@end table
-
-Here's an example using all of the variables:
-
-@smalllisp
-(let ((expect-port (open-input-file "/etc/passwd"))
- (expect-timeout 1)
- (expect-timeout-proc
- (lambda (s) (display "Times up!\n")))
- (expect-eof-proc
- (lambda (s) (display "Reached the end of the file!\n")))
- (expect-char-proc display))
- (expect-strings
- ("^nobody" (display "Got a nobody user\n"))))
-@end smalllisp
-@end defun
-
-@defun expect clause @dots{}
-@code{expect} is used in the same way as @code{expect-strings},
-but tests are specified not as patterns, but as procedures. The
-procedures are called in turn after each character is read from the
-port, with the value of the accumulated string as the argument. The
-test is successful if the procedure returns a non-false value.
-
-If the @code{=>} syntax is used, then if the test succeeds it must return
-a list containing the arguments to be provided to the corresponding
-expression.
-
-In the following example, a string will only be matched at the beginning
-of the file:
-@smalllisp
-(let ((expect-port (open-input-file "/etc/passwd")))
- (expect
- ((lambda (s) (string=? s "fnord!"))
- (display "Got a nobody user!\n"))))
-@end smalllisp
-
-The control variables described for @code{expect-strings} can also
-be used with @code{expect}.
-@end defun
diff --git a/doc/sources/unix.texi b/doc/sources/unix.texi
deleted file mode 100644
index e8a189c5b..000000000
--- a/doc/sources/unix.texi
+++ /dev/null
@@ -1,622 +0,0 @@
-@node Low level Unix
-@chapter Low level Unix interfaces
-
-The low level Unix interfaces are currently available by
-default in the Guile top level. However in the future they will probably
-be placed in a module and @code{use-modules} or something similar will
-be required to make them available.
-
-@menu
-* Unix conventions:: Conventions followed by the low level Unix
- interfaces.
-* Ports and descriptors:: Ports, file descriptors and how they
- interact.
-* Extended I/O:: Reading and writing to ports.
-* File system:: Working in a hierarchical filesystem.
-* User database:: Information about users from system databases.
-* Processes:: Information and control of Unix processes.
-* Terminals:: Terminals and pseudo-terminals.
-* Network databases:: Network address conversion and information
- from system databases.
-* Network sockets:: An interface to the BSD socket library.
-* Miscellaneous Unix:: Miscellaneous Unix interfaces.
-@end menu
-
-@node Unix conventions
-@section Low level Unix conventions
-
-The low-level interfaces are designed to give Scheme programs
-access to as much functionality as possible from the underlying
-Unix system. They can be used to implement higher level
-intefaces such as the Scheme shell @ref{scsh}.
-
-Generally there is a single procedure for each corresponding Unix
-facility. However some of the procedures are implemented for
-speed and convenience in Scheme and have no Unix equivalent
-(e.g., @code{read-delimited}, @code{copy-file}.)
-
-This interface is intended as far as possible to be portable across
-different versions of Unix, so that Scheme programmers don't need to be
-concerned with implementation differences. In some cases procedures
-which can't be implemented (or reimplemented) on particular systems may
-become no-ops, or perform limited actions. In other cases they may
-throw errors. It should be possible to use the feature system to
-determine what functionality is available.
-
-General naming conventions are as follows:
-
-@itemize @bullet
-@item
-The Scheme name is often identical to the name of the underlying Unix
-facility.
-@item
-Underscores in Unix names are converted to hyphens.
-@item
-Procedures which destructively modify Scheme data gain postpended
-exclaimation marks, e.g., @code{recv!}.
-@item
-Predicates are postpended with question marks, e.g., @code{access?}.
-@item
-Some names are changed to avoid conflict with dissimilar interfaces
-defined by scsh.
-@item
-Unix preprocessor names such as @code{EPERM} or @code{R_OK} are converted
-to Scheme variables of the same name (underscores are not replaced
-with hyphens)
-@end itemize
-
-Most of the Unix interface procedures can be relied on to return a
-well-specified value. Unexpected conditions are handled by raising
-exceptions.
-
-There are a few procedures which return a special
-value if they don't succeed, e.g., @code{getenv} returns @code{#f}
-if it the requested string is not found in the environment. These
-cases will be noted in the documentation.
-
-For ways to deal with exceptions, @ref{Exceptions}.
-
-Errors which the C-library would report by returning a NULL
-pointer or through some other means cause a @code{system-error} exception
-to be raised. The value of the Unix @code{errno} variable is available
-in the data passed by the exception, so there is no need to access the
-global errno value (doing so would be unreliable in the presence of
-continuations or multiple threads).
-
-@deffn procedure errno [n]
-@end deffn
-@deffn procedure perror string
-@end deffn
-
-@node Ports and descriptors
-@section Ports and file descriptors
-
-@deffn procedure move->fdes port fd
-@end deffn
-@deffn procedure release-port-handle port
-@end deffn
-@deffn procedure set-port-revealed! @var{port} count
-@end deffn
-@deffn procedure fdes->ports fdes
-@end deffn
-@deffn procedure fileno port
-@end deffn
-@deffn procedure fdopen fdes modes
-@end deffn
-@deffn procedure duplicate-port port modes
-@end deffn
-@deffn procedure redirect-port into-port from-port
-@end deffn
-@deffn procedure freopen filename modes port
-@end deffn
-
-@node Extended I/O
-@section Extended I/O
-
-Extended I/O procedures are available which read or write lines of text,
-read text delimited by a specified set of characters, or report or
-set the current position of a port.
-
-@findex fwrite
-@findex fread
-Interfaces to @code{read}/@code{fread} and @code{write}/@code{fwrite} are
-also available, as @code{uniform-array-read!} and @code{uniform-array-write!},
-@ref{Uniform arrays}.
-
-@deffn procedure read-line [port] [handle-delim]
-Return a line of text from @var{port} if specified, otherwise from the
-value returned by @code{(current-input-port)}. Under Unix, a line of text
-is terminated by the first end-of-line character or by end-of-file.
-
-If @var{handle-delim} is specified, it should be one of the following
-symbols:
-@table @code
-@item trim
-Discard the terminating delimiter. This is the default, but it will
-be impossible to tell whether the read terminated with a delimiter or
-end-of-file.
-@item concat
-Append the terminating delimiter (if any) to the returned string.
-@item peek
-Push the terminating delimiter (if any) back on to the port.
-@item split
-Return a pair containing the string read from the port and the
-terminating delimiter or end-of-file object.
-
-NOTE: if the scsh module is loaded then
-multiple values are returned instead of a pair.
-@end table
-@end deffn
-@deffn procedure read-line! buf [port]
-Read a line of text into the supplied string @var{buf} and return the
-number of characters added to @var{buf}. If @var{buf} is filled, then
-@code{#f} is returned.
-Read from @var{port} if
-specified, otherwise from the value returned by @code{(current-input-port)}.
-@end deffn
-@deffn procedure read-delimited delims [port] [handle-delim]
-Read text until one of the characters in the string @var{delims} is found
-or end-of-file is reached. Read from @var{port} if supplied, otherwise
-from the value returned by @code{(current-input-port)}.
-@var{handle-delim} takes the same values as described for @code{read-line}.
-
-NOTE: if the scsh module is loaded then @var{delims} must be an scsh
-char-set, not a string.
-@end deffn
-@deffn procedure read-delimited! delims buf [port] [handle-delim] [start] [end]
-Read text into the supplied string @var{buf} and return the number of
-characters added to @var{buf} (subject to @var{handle-delim}, which takes
-the same values specified for @code{read-line}. If @var{buf} is filled,
-@code{#f} is returned for both the number of characters read and the
-delimiter. Also terminates if one of the characters in the string
-@var{delims} is found
-or end-of-file is reached. Read from @var{port} if supplied, otherwise
-from the value returned by @code{(current-input-port)}.
-
-NOTE: if the scsh module is loaded then @var{delims} must be an scsh
-char-set, not a string.
-@end deffn
-@deffn procedure write-line obj [port]
-Display @var{obj} and a new-line character to @var{port} if specified,
-otherwise to the
-value returned by @code{(current-output-port)}; equivalent to:
-
-@smalllisp
-(display obj [port])
-(newline [port])
-@end smalllisp
-@end deffn
-@deffn procedure ftell port
-Returns an integer representing the current position of @var{port},
-measured from the beginning.
-@end deffn
-@deffn procedure fseek port offset whence
-Sets the current position of @var{port} to the integer @var{offset},
-which is interpreted according to the value of @var{whence}.
-
-One of the following variables should be supplied
-for @var{whence}:
-@defvar SEEK_SET
-Seek from the beginning of the file.
-@end defvar
-@defvar SEEK_CUR
-Seek from the current position.
-@end defvar
-@defvar SEEK_END
-Seek from the end of the file.
-@end defvar
-@end deffn
-
-@node File system
-@section File system
-
-These procedures query and set file system attributes (such as owner,
-permissions, sizes and types of files); deleting, copying, renaming and
-linking files; creating and removing directories and querying their
-contents; and the @code{sync} interface.
-
-@deffn procedure access? path how
-Evaluates to @code{#t} if @var{path} corresponds to an existing
-file and the current process
-has the type of access specified by @var{how}, otherwise
-@code{#f}.
-@var{how} should be specified
-using the values of the variables listed below. Multiple values can
-be combined using a bitwise or, in which case @code{#t} will only
-be returned if all accesses are granted.
-
-Permissions are checked using the real id of the current process,
-not the effective id, although it's the effective id which determines
-whether the access would actually be granted.
-
-@defvar R_OK
-test for read permission.
-@end defvar
-@defvar W_OK
-test for write permission.
-@end defvar
-@defvar X_OK
-test for execute permission.
-@end defvar
-@defvar F_OK
-test for existence of the file.
-@end defvar
-@end deffn
-@findex fstat
-@deffn procedure stat obj
-Evaluates to an object containing various information
-about the file determined by @var{obj}.
-@var{obj} can be a string containing a file name or a port or file
-descriptor which is open on a file (in which case @code{fstat} is used
-as the underlying system call).
-
-The object returned by @code{stat} can be passed as a single parameter
-to the following procedures, all of which return integers:
-
-@table @r
-@item stat:dev
-The device containing the file.
-@item stat:ino
-The file serial number, which distinguishes this file from all other
-files on the same device.
-@item stat:mode
-The mode of the file. This includes file type information
-and the file permission bits. See @code{stat:type} and @code{stat:perms}
-below.
-@item stat:nlink
-The number of hard links to the file.
-@item stat:uid
-The user ID of the file's owner.
-@item stat:gid
-The group ID of the file.
-@item stat:rdev
-Device ID; this entry is defined only for character or block
-special files.
-@item stat:size
-The size of a regular file in bytes.
-@item stat:atime
-The last access time for the file.
-@item stat:mtime
-The last modification time for the file.
-@item stat:ctime
-The last modification time for the attributes of the file.
-@item stat:blksize
-The optimal block size for reading or writing the file, in bytes.
-@item stat:blocks
-The amount of disk space that the file occupies measured in units of
-512 byte blocks.
-@end table
-
-In addition, the following procedures return the information
-from stat:mode in a more convenient form:
-
-@table @r
-@item stat:type
-A symbol representing the type of file. Possible values are
-currently: regular, directory, symlink, block-special, char-special,
-fifo, socket, unknown
-@item stat:perms
-An integer representing the access permission bits.
-@end table
-@end deffn
-@deffn procedure lstat path
-Similar to @code{stat}, but does not follow symbolic links, i.e.,
-it will return information about a symbolic link itself, not the
-file it points to. @var{path} must be a string.
-@end deffn
-@deffn procedure readlink path
-@end deffn
-@deffn procedure chown path owner group
-@end deffn
-@deffn procedure chmod port-or-path mode
-@end deffn
-@deffn procedure utime path [actime] [modtime]
-@end deffn
-@deffn procedure delete-file path
-@end deffn
-@deffn procedure copy-file path-from path-to
-@end deffn
-@deffn procedure rename-file path-from path-to
-@end deffn
-@deffn procedure link path-from path-to
-@end deffn
-@deffn procedure symlink path-from path-to
-@end deffn
-@deffn procedure mkdir path [mode]
-@end deffn
-@deffn procedure rmdir path
-@end deffn
-@deffn procedure opendir path
-@end deffn
-@deffn procedure readdir port
-@end deffn
-@deffn procedure rewinddir port
-@end deffn
-@deffn procedure closedir port
-@end deffn
-@deffn procedure sync
-@end deffn
-
-@node User database
-@section User database
-
-@deffn procedure getpwuid uid
-@end deffn
-@deffn procedure getpwnam name
-@end deffn
-@deffn procedure getpwent
-@end deffn
-@deffn procedure setpwent port
-@end deffn
-@deffn procedure endpwent
-@end deffn
-@deffn procedure getgrgid uid
-@end deffn
-@deffn procedure getgrnam name
-@end deffn
-@deffn procedure getgrent
-@end deffn
-@deffn procedure setgrent port
-@end deffn
-@deffn procedure endgrent
-@end deffn
-
-@node Processes
-@section Processes
-
-@deffn procedure chdir path
-@end deffn
-@deffn procedure getcwd
-@end deffn
-@deffn procedure umask [mode]
-@end deffn
-@deffn procedure getpid
-@end deffn
-@deffn procedure getgroups
-@end deffn
-@deffn procedure kill pid sig
-
-@var{sig} should be specified using a variable corresponding to
-the Unix symbolic name, e.g,
-@defvar SIGHUP
-Hang-up signal.
-@end defvar
-@defvar SIGINT
-Interrupt signal.
-@end defvar
-@end deffn
-@deffn procedure waitpid pid options
-@defvar WAIT_ANY
-@end defvar
-@defvar WAIT_MYPGRP
-@end defvar
-@defvar WNOHANG
-@end defvar
-@defvar WUNTRACED
-@end defvar
-@end deffn
-@deffn procedure getppid
-@end deffn
-@deffn procedure getuid
-@end deffn
-@deffn procedure getgid
-@end deffn
-@deffn procedure geteuid
-@end deffn
-@deffn procedure getegid
-@end deffn
-@deffn procedure setuid id
-@end deffn
-@deffn procedure setgid id
-@end deffn
-@deffn procedure seteuid id
-@end deffn
-@deffn procedure setegid id
-@end deffn
-@deffn procedure getpgrp
-@end deffn
-@deffn procedure setpgid pid pgid
-@end deffn
-@deffn procedure setsid
-@end deffn
-@deffn procedure execl arg ...
-@end deffn
-@deffn procedure execlp arg ...
-@end deffn
-@deffn procedure primitive-fork
-@end deffn
-@deffn procedure environ [env]
-@end deffn
-@deffn procedure putenv string
-@end deffn
-@deffn procedure nice incr
-@end deffn
-
-@node Terminals
-@section Terminals and pseudo-terminals
-
-@deffn procedure isatty? port
-@end deffn
-@deffn procedure ttyname port
-@end deffn
-@deffn procedure ctermid
-@end deffn
-@deffn procedure tcgetpgrp port
-@end deffn
-@deffn procedure tcsetpgrp port pgid
-@end deffn
-
-@node Network databases
-@section Network address conversion and system databases
-
-@deffn procedure inet-aton address
-@end deffn
-@deffn procedure inet-ntoa number
-@end deffn
-@deffn procedure inet-netof address
-@end deffn
-@deffn procedure inet-lnaof address
-@end deffn
-@deffn procedure inet-makeaddr net lna
-@end deffn
-@deffn procedure gethostbyname name
-@end deffn
-@deffn procedure gethostbyaddr address
-@end deffn
-@deffn procedure gethostent
-@end deffn
-@deffn procedure sethostent port
-@end deffn
-@deffn procedure endhostent
-@end deffn
-@deffn procedure getnetbyname name
-@end deffn
-@deffn procedure getnetbyaddr address
-@end deffn
-@deffn procedure getnetent
-@end deffn
-@deffn procedure setnetent port
-@end deffn
-@deffn procedure endnetent
-@end deffn
-@deffn procedure getprotobyname name
-@end deffn
-@deffn procedure getprotobynumber number
-@end deffn
-@deffn procedure getprotoent
-@end deffn
-@deffn procedure setprotoent port
-@end deffn
-@deffn procedure endprotoent
-@end deffn
-@deffn procedure getservbyname name protocol
-@end deffn
-@deffn procedure getservbyport port protocol
-@end deffn
-@deffn procedure getservent
-@end deffn
-@deffn procedure setservent port
-@end deffn
-@deffn procedure endservent
-@end deffn
-
-@node Network sockets
-@section BSD socket library interface
-
-@deffn procedure socket family style protocol
-@end deffn
-@deffn procedure socketpair family style protocol
-@end deffn
-@deffn procedure getsockopt socket level optname
-@end deffn
-@deffn procedure setsockopt socket level optname value
-@end deffn
-@deffn procedure shutdown socket how
-@end deffn
-@deffn procedure connect socket family address arg ...
-@end deffn
-@deffn procedure bind socket family address arg ...
-@end deffn
-@deffn procedure listen socket backlog
-@end deffn
-@deffn procedure accept socket
-@end deffn
-@deffn procedure getsockname socket
-@end deffn
-@deffn procedure getpeername socket
-@end deffn
-@deffn procedure recv! socket buf [flags]
-@end deffn
-@deffn procedure send socket message [flags]
-@end deffn
-@deffn procedure recvfrom! socket buf [flags] [start] [end]
-@end deffn
-@deffn procedure sendto socket message family address args ... [flags]
-@end deffn
-
-@node Miscellaneous Unix
-@section Miscellaneous Unix interfaces
-
-Things which haven't been classified elsewhere (yet?).
-
-@deffn procedure open path flags [mode]
-@defvar O_RDONLY
-@end defvar
-@defvar O_WRONLY
-@end defvar
-@defvar O_RDWR
-@end defvar
-@defvar O_CREAT
-@end defvar
-@defvar O_EXCL
-@end defvar
-@defvar O_NOCTTY
-@end defvar
-@defvar O_TRUNC
-@end defvar
-@defvar O_APPEND
-@end defvar
-@defvar O_NONBLOCK
-@end defvar
-@defvar O_NDELAY
-@end defvar
-@defvar O_SYNC
-@end defvar
-@end deffn
-@deffn procedure select reads writes excepts secs msecs
-@end deffn
-@deffn procedure uname
-@end deffn
-@deffn procedure pipe
-@end deffn
-@deffn procedure open-pipe command modes
-@end deffn
-@deffn procedure open-input-pipe command
-@end deffn
-@deffn procedure open-output-pipe command
-@end deffn
-@deffn procedure setlocale category [locale]
-@defvar LC_COLLATE
-@end defvar
-@defvar LC_CTYPE
-@end defvar
-@defvar LC_MONETARY
-@end defvar
-@defvar LC_NUMERIC
-@end defvar
-@defvar LC_TIME
-@end defvar
-@defvar LC_MESSAGES
-@end defvar
-@defvar LC_ALL
-@end defvar
-@end deffn
-@deffn procedure strftime format stime
-@end deffn
-@deffn procedure strptime format string
-@end deffn
-@deffn procedure mknod
-@end deffn
-
-@node scsh
-@chapter The Scheme shell (scsh)
-
-Guile includes an incomplete port of the Scheme shell (scsh) 0.4.4.
-
-For information about scsh on the Web see
-@url{http://www-swiss.ai.mit.edu/scsh/scsh.html}.
-The original scsh is available by ftp from
-@url{ftp://swiss-ftp.ai.mit.edu:/pub/su}.
-
-This port of scsh does not currently use the Guile module system, but
-can be initialized using:
-@smalllisp
-(load-from-path "scsh/init")
-@end smalllisp
-
-Note that SLIB must be installed before scsh can be initialized, see
-@ref{SLIB} for details.
-
-@node Threads
-@chapter Programming Threads.
-
diff --git a/doc/tutorial/.cvsignore b/doc/tutorial/.cvsignore
deleted file mode 100644
index cda758436..000000000
--- a/doc/tutorial/.cvsignore
+++ /dev/null
@@ -1,22 +0,0 @@
-Makefile
-Makefile.in
-stamp-vti
-stamp-vti.1
-*.log
-*.dvi
-*.aux
-*.toc
-*.cp
-*.fn
-*.vr
-*.tp
-*.ky
-*.pg
-*.cps
-*.fns
-*.tps
-*.vrs
-*.ps
-*.info*
-*.html
-version.texi
diff --git a/doc/tutorial/ChangeLog b/doc/tutorial/ChangeLog
deleted file mode 100644
index b24d6004f..000000000
--- a/doc/tutorial/ChangeLog
+++ /dev/null
@@ -1,34 +0,0 @@
-2002-07-16 Neil Jerram <neil@ossau.uklinux.net>
-
- * guile-tut.texi (Jump Start): Apply patch from M. Luedde on use
- of tail recursion to avoid stack overflow (with minor editing).
-
-2002-07-14 Neil Jerram <neil@ossau.uklinux.net>
-
- * guile-tut.texi (Jump Start):
- (Jump Start):
-
-2001-11-18 Neil Jerram <neil@ossau.uklinux.net>
-
- * guile-tut.texi (History of Guile and its motivations): Update
- Tcl war URLs.
-
-2001-09-19 Thien-Thi Nguyen <ttn@glug.org>
-
- * guile-tut.texi: Fix improper `@result' usage.
- Fix number typo in "Jump Start" section.
-
-2001-08-27 Neil Jerram <neil@ossau.uklinux.net>
-
- * Makefile.am (guile_tut_TEXINFOS): Removed.
- (TEXINFO_TEX): Added; avoids shipping multiple copies of
- texinfo.tex in a single distribution.
-
- * guile-tut.texi: Incorporate text previously in separate AUTHORS
- file.
-
-2001-08-27 Neil Jerram <neil@ossau.uklinux.net>
-
- The change log for files in this directory continues backwards
- from 2001-08-27 in ../ChangeLog, as all the Guile documentation
- prior to this date was contained in a single directory.
diff --git a/doc/tutorial/ChangeLog-guile-doc-tutorial b/doc/tutorial/ChangeLog-guile-doc-tutorial
deleted file mode 100644
index 9d7233a31..000000000
--- a/doc/tutorial/ChangeLog-guile-doc-tutorial
+++ /dev/null
@@ -1,16 +0,0 @@
-2001-01-27 Neil Jerram <neil@ossau.uklinux.net>
-
- * texinfo.tex: Replaced by latest version from ftp.gnu.org.
-
-1999-12-06 Gary Houston <ghouston@freewire.co.uk>
-
- * guile-tut.texi: tweaked the dircategory.
-
-1998-01-28 Mark Galassi <rosalia@nis.lanl.gov>
-
- * guile-tut.texi: set @dircategory to "Scheme Programming".
-
-Mon Aug 18 16:11:43 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- * texinfo.tex: Installed from texinfo release 3.11.
-
diff --git a/doc/tutorial/Makefile.am b/doc/tutorial/Makefile.am
deleted file mode 100644
index 4f9a6658f..000000000
--- a/doc/tutorial/Makefile.am
+++ /dev/null
@@ -1,39 +0,0 @@
-## Process this file with Automake to create Makefile.in
-##
-## Copyright (C) 1998 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-AUTOMAKE_OPTIONS = gnu
-
-info_TEXINFOS = guile-tut.texi
-
-TEXINFO_TEX = ../ref/texinfo.tex
-
-# Optionally support building an HTML version of the reference manual.
-
-if HTMLDOC
-
-htmldir = $(prefix)/html/guile-$(VERSION)
-
-html_DATA = guile-tut_toc.html $(shell ls guile-tut_*.html 2>/dev/null)
-
-guile-tut_toc.html: guile-tut.texi
- $(TEXI2HTML) -split_chapter guile-tut.texi
-
-endif
diff --git a/doc/tutorial/guile-tut.texi b/doc/tutorial/guile-tut.texi
deleted file mode 100644
index e73f9b248..000000000
--- a/doc/tutorial/guile-tut.texi
+++ /dev/null
@@ -1,1373 +0,0 @@
-\input texinfo @c -*-texinfo-*-
-@c %**start of header
-@setfilename guile-tut.info
-@settitle Guile Tutorial
-@set guile-tut
-
-@include version.texi
-
-@dircategory The Algorithmic Language Scheme
-@direntry
-* Guile Tutorial: (guile-tut). The Guile tutorial.
-@end direntry
-
-@setchapternewpage off
-@c Choices for setchapternewpage are {on,off,odd}.
-@paragraphindent 2
-@c %**end of header
-
-@iftex
-@finalout
-@c DL: lose the egregious vertical whitespace, esp. around examples
-@c but paras in @defun-like things don't have parindent
-@parskip 4pt plus 1pt
-@end iftex
-
-@titlepage
-@title Guile Tutorial
-@subtitle For use with Guile @value{VERSION}
-@subtitle Last updated @value{UPDATED}
-
-@author Mark Galassi
-@author Cygnus Solutions and Los Alamos National Laboratory
-@author @email{rosalia@@nis.lanl.gov}
-
-@page
-@vskip 0pt plus 1filll
-Copyright @copyright{} 1997, 1998 Free Software Foundation
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the entire
-resulting derived work is distributed under the terms of a permission
-notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that this permission notice may be stated in a translation approved
-by the author.
-@end titlepage
-
-
-@ifinfo
-@node Top
-@top Guile Tutorial
-@end ifinfo
-
-@ifinfo
-This file gives a tutorial introductionto Guile.
-
-Copyright (C) 1997 Free Software Foundation
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@ignore
-Permission is granted to process this file through TeX and print the
-results, provided the printed document carries copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-
-@end ignore
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the entire
-resulting derived work is distributed under the terms of a permission
-notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that this permission notice may be stated in a translation approved
-by the author.
-@end ifinfo
-
-
-@menu
-* Jump Start::
-* Introduction::
-* Using Guile to program in Scheme::
-* Guile in a Library::
-* Regular Expression Support::
-* UNIX System Programming::
-* Where to find more Guile/Scheme resources::
-* Concept Index::
-* Procedure and Macro Index::
-* Variable Index::
-* Type Index::
-@end menu
-
-
-@node Jump Start
-@chapter Jump Start
-
-@noindent
-Before giving an overview of Guile, I present some simple commands and
-programs that you can type to get going immediately.
-
-Start by invoking the Guile interpreter. Usually you do this by just
-typing @code{guile}. Then type (or paste) the following expressions at
-the prompt; the interpreter's response is preceded (in this manual) by
-@result{}.
-
-@example
-<shell-prompt> guile
-@end example
-@lisp
-(+ 20 35)
-@result{} 55
-(define (recursive-factorial n)
- (if (zero? n)
- 1
- (* n (recursive-factorial (- n 1)))))
-(recursive-factorial 5)
-@result{} 120
-(quit)
-@end lisp
-
-In this example we did some simple arithmetic @code{(+ 20 35)} and got
-the answer @code{55}. Then we coded the classic (and rather wasteful)
-factorial algorithm and computed the factorial of @code{55}. Finally we
-quit with @code{(quit)}.
-
-@cindex bignumbers
-We can find out about some of Scheme's nice features by asking for the
-factorial of some big number, say @code{500}. On some systems the
-correct answer will be returned (I do not indicate calling and leaving
-the guile session anymore).
-
-@lisp
-(recursive-factorial 500)
-@result{} 1220136825991110068701238785423046926253574342803192842192413588
- 3858453731538819976054964475022032818630136164771482035841633787
- 2207817720048078520515932928547790757193933060377296085908627042
- 9174547882424912726344305670173270769461062802310452644218878789
- 4657547771498634943677810376442740338273653974713864778784954384
- 8959553753799042324106127132698432774571554630997720278101456108
- 1188373709531016356324432987029563896628911658974769572087926928
- 8712817800702651745077684107196243903943225364226052349458501299
- 1857150124870696156814162535905669342381300885624924689156412677
- 5654481886506593847951775360894005745238940335798476363944905313
- 0623237490664450488246650759467358620746379251842004593696929810
- 2226397195259719094521782333175693458150855233282076282002340262
- 6907898342451712006207714640979456116127629145951237229913340169
- 5523638509428855920187274337951730145863575708283557801587354327
- 6888868012039988238470215146760544540766353598417443048012893831
- 3896881639487469658817504506926365338175055478128640000000000000
- 0000000000000000000000000000000000000000000000000000000000000000
- 00000000000000000000000000000000000000000000000
-@end lisp
-
-The result is an example of Scheme's @emph{bignumbers}. However, there
-are operating environments that provide (by default) too little stack
-space. They will instead produce an error message like this:
-
-@lisp
-(recursive-factorial 500)
-@print{}
-ERROR: Stack overflow
-ABORT: (stack-overflow)
-@end lisp
-
-Rather than enlarging the system's stack, we can implement the algorithm
-such that it does not consume increasing stack space. This is called a
-@emph{tail recursive} implementation. The following definition is tail
-recursive and so should work on all systems.
-
-@lisp
-(define (tail-recursive-factorial n)
- (define (loop k l)
- (if (zero? k) l
- (loop (- k 1) (* k l))))
- (loop n 1))
-
-(tail-recursive-factorial 500)
-@result{} 1220136825991110068701238785423046926253574342803192842192413588
- ;; ... skipped
-@end lisp
-
-This is the most basic use of Guile: a simple Scheme interpreter. In
-the rest of this tutorial I will show you how Guile has many facets: it
-is also an @emph{extensible} interpreter (to which many features can be
-easilly added) and an @emph{embeddable} interpreter (which can be
-invoked from your C programs).
-
-
-@node Introduction
-@chapter Introduction
-
-@noindent
-@dfn{Guile} (which can stand for @emph{GNU Ubiquitous Intelligent
-Language Extension}) is the GNU extension language. It started out as
-an embeddable Scheme interpreter, and has rapidly evolved into a
-kitchen-sink package including a standalone Scheme interpreter, an
-embeddable Scheme interpreter, several graphics options, other languages
-that can be used along with Scheme (for now just @emph{ctax} and
-@emph{Tcl}), and hooks for much more.
-
-
-@menu
-* What are scripting and extension languages::
-* History of Guile and its motivations::
-* How to characterize Guile::
-@end menu
-
-@node What are scripting and extension languages
-@section What are scripting and extension languages
-@cindex scripting languages
-@cindex extension languages
-
-A @dfn{scripting language} is a programming language which serves as
-glue between other system programs. In the UNIX world, the traditional
-scripting language is the @emph{Bourne shell}, which allows many UNIX
-commands to be executed in sequence, or in a pipeline. Traditional UNIX
-commands are cleverly written to work well when put together in a
-script.
-
-Other examples of UNIX scripting languages are AWK, Perl, Scsh (the
-Scheme Shell: a Scheme interpreter enhanced to do good scripting),
-Python, Tcl, Java @dots{}
-@cindex scripting languages - examples
-
-UNIX programmers noticed, more than 25 years ago, that scripting
-languages can do serious work, so the Bourne shell was written to have
-variables, operators and control structures, just like a full-featured
-programming language.
-@cindex Bourne shell
-
-What scripting languages have, that traditional programming languages do
-not, is the ability to easily run an external program (or a pipeline of
-external programs) and use the returned values and output from that
-program in useful ways.
-
-An @dfn{extension language} is a programming language interpreter
-offered by an application program, so that users can write macros or
-even full-fledged programs to extend the original application.
-Extension languages have a C interface (it is usually C, but it could be
-any other compiled language), and can be given access to the C data
-structures. Likewise, there are C routines to access the extension
-language data structures.
-
-Extension languages abound in the software world, even though the name
-@emph{extension language} is seldom used. Examples are:
-@cindex extension languages - examples
-
-@itemize @bullet
-@item
-Emacs Lisp, the language used to program and customize GNU Emacs.
-@cindex Emacs Lisp
-
-@item
-Tcl, John Ousterhout's general-purpose scripting and extension language.
-@cindex Tcl
-
-@item
-The Lotus 1-2-3 macro language (any spreadsheet macro language,
-really). I mention this one first because it is a classic, even though
-it is seldom used any more.
-@cindex Lotus 1-2-3
-
-@item
-Other spreadsheet and database macro languages.
-
-@item
-The Dominion empire-style game's @emph{exec} files.
-@cindex Dominion
-
-@item
-Any syntax for a ".*rc" file you might have used. Almost all programs
-end up parsing some kind of startup or configuration file. The syntax
-for those can get pretty involved, thus justifying calling them
-"extension languages". The @emph{fvwm} window manager, for example,
-parses a rather elaborate @file{.fvwmrc} file.
-
-@item
-Brent Benson's libscheme.a, an embeddable Scheme interpreter.
-@cindex Benson, Brent
-@cindex libscheme
-
-@item
-Guile, the GNU extension language, which is the subject of this
-tutorial.
-
-@end itemize
-
-One lesson we can learn from looking at classical large software
-applications is that "writers of large programs" always end up throwing
-in some kind of parser for configuration or scripting.
-
-Of the examples listed above, Emacs Lisp, Tcl, Libscheme and Guile have
-an important property: they are not added as an afterthought for a
-specific application. They are general-purpose languages which a user
-can learn (even in college courses) and then use to customize the
-application program.
-
-This is a recent and (in my opinion) very exciting direction in
-large-program software engineering: program designers can link in the
-Guile or Tcl library from the very beginning, and tell their users "You
-want to customize this program? Just use Scheme (or Tcl, or whatever
-language), which you already know!"
-@cindex large programs
-
-
-@node History of Guile and its motivations
-@section History of Guile and its motivations
-
-A few separate threads of events led to the development of Guile.
-
-In the fall of 1994, Richard Stallman, director of the GNU project,
-posted an article with the subject "Why you should not use Tcl", in
-which he argued that Tcl is inadequate as an extension language. This
-generated a flurry of flames (available in the hypermail archive
-(@url{http://www.vanderburg.org/Tcl/war/}) @strong{The Tcl War}).
-@cindex Stallman, Richard
-@cindex GNU project
-@cindex Tcl
-
-The result was that Stallman then proposed his design for the GNU
-Extension Language, first called GEL and then renamed Guile. The
-discussion triggered by that article is also available in a hypermail
-archive, @url{http://www.vanderburg.org/Tcl/war2/}.
-
-One interesting feature of this GNU Extension Language plan was that
-users should have a @emph{choice} of languages to use in extending their
-program. The basic language would be a slightly modified Scheme, and
-translators would be written to convert other languages (like Tcl,
-Python, Perl, C-like languages @dots{}) into Scheme.
-
-Tom Lord started working on this project immediately, taking Aubrey
-Jaffer's small and portable implementation of Scheme, SCM, and making it
-into an embeddable interpreter: callable from C and allowing new Scheme
-procedures to be written in C.
-@cindex Lord, Tom
-@cindex Jaffer, Aubrey
-
-In the spring of 1995, the guile-ii snapshot was released. This made it
-possible to start writing code in C and Scheme using the guile
-facilities.
-
-The guile-iii snapshot was released the summer of 1995, and it had fixed
-enough problems so that the access to Scheme data structures from C was
-almost complete.
-
-After this, Cygnus Support added many features to Guile and finished
-implementing others, so that Guile acquired thread support, a regular
-expression matcher, a Tk interface, an interface to the SGI OpenGL
-graphics system, an @emph{applet} formalism, and some other packages.
-This was all in the Cygnus Guile r0.3 and r0.4 releases.
-@cindex Cygnus Support
-
-Meanwhile, Tom Lord left the project after having produced a divergent
-version of Guile: 1.0b2. The Free Software Foundation hired Jim Blandy
-to coordinate Guile development. The FSF released its first version of
-Guile in January 1997. In the future, many of the Cygnus packages will
-be re-integrated into Guile.
-@cindex Blandy, Jim
-@cindex Free Software Foundation
-
-
-
-@node How to characterize Guile
-@section How to characterize Guile
-
-I have already mentioned that Guile has become a kitchen sink package;
-here you can see how Guile freely takes new commands and constructs from
-the portable Scheme library @emph{slib}, the @emph{Tk} widget set, a
-posix library (useful for UNIX systems programming), the regular
-expression library @emph{rx}, and many more @dots{}
-@cindex slib
-@cindex Tk
-@cindex POSIX
-@c @cindex OpenGL
-@cindex rx
-
-So Guile has many more primitive procedures available to it than those
-specified in @ref{Standard Procedures, Revised(5) Report on the
-Algorithmic Language Scheme, , r5rs, Revised(5) Report on the
-Algorithmic Language Scheme}. On top of that, Guile will interpret
-almost all standard Scheme programs. The only incompatible difference
-between the basic Guile language and R5RS Scheme is that Guile is case
-sensitive, whereas R5RS is case insensitive. We hope that few people
-have written Scheme programs that depend on case insensitivity.
-@cindex case sensitivity
-@cindex Revised(5) Report on the Algorithmic Language Scheme
-@cindex report on Scheme
-@cindex Scheme language - report
-@cindex Scheme language - definition
-
-Here is a possible view of the @emph{sum of the parts} in Guile:
-@cindex extensions to standard Scheme
-@cindex extensions to R5RS
-@cindex Scheme extensions
-@example
-guile = standard Scheme (R5RS)
- PLUS extensions to R5RS offered by SCM
- PLUS some extra primitives offered by Guile (catch/throw)
- PLUS portable Scheme library (SLIB)
- PLUS embeddable Scheme interpreter library (libguile)
- PLUS Tk toolkit
- PLUS threads
- PLUS Posix library
-@c PLUS OpenGL library (mesa)
-@c PLUS OpenGL toolkit (glut)
- PLUS Regular expression library (rx)
-@c PLUS Applet formalism
- PLUS Tcl library
-@end example
-
-
-@node Using Guile to program in Scheme
-@chapter Using Guile to program in Scheme
-@cindex Scheme programming tutorial
-@cindex tutorial on Scheme programming
-
-In this section I give a tutorial introduction to programming in Scheme,
-with a slant toward the interesting things that can be done in Guile.
-
-@c Applets are so @emph{chic} that they get their own section, but this
-This section will try to touch on many of the interesting and cool
-aspects of Guile, showing you how new types of problems can be solved
-with Guile. Note that using Guile as a library with @code{libguile.a}
-is described in its own chapter (@pxref{Guile in a Library}). Also note
-that some small examples are given in @ref{Jump Start}.
-
-To get started you need to know how to program in @dfn{Scheme} (a
-dialect of LISP). Fortunately Scheme is a small, clean language and is
-not hard to learn. It is also used in many undergraduate courses to
-introduce computer programming.
-@cindex lisp dialects
-
-I will not try to teach you Scheme here (although you might end up
-learning by example), since there are many good books on the subject,
-listed in @ref{Where to find more Guile/Scheme resources}. @footnote{To
-get started, look at the books @cite{Simply Scheme} and @cite{The Little
-Schemer} from that list.}
-
-
-@subsection Hello World
-@cindex hello world
-
-Our first program is the typical Scheme "hello world" program. Put the
-following code in a file called @code{hello.scm} (this can be find in
-@file{examples/scheme/hello.scm}).
-
-@smalllisp
-#!/usr/local/bin/guile -s
-!#
-
-(display "hello world")
-(newline)
-@end smalllisp
-
-Then run guile on it. One way to do so is to start up guile and load
-this file:
-
-@smallexample
-<shell-prompt> @kbd{guile}
-guile> @kbd{(load "hello")}
-@end smallexample
-
-Another way is to make the file executable and execute it directly.
-Notice how Guile recognizes a @code{-s} option which tells it to run a
-script and then exit. Guile also has a new type of block comment
-enclosed by @code{#!} and @code{!#}, so that you can make executable
-Scheme scripts with the standard UNIX @code{#!} mechanism.
-
-In the given example, the first line is used to invoke the Guile
-interpreter (make sure you correct the path if you installed Guile in
-something other than /usr/local/bin). Once Guile is invoked on this
-file, it will understand that the first line is a comment. The comment
-is then terminated with @code{!#} on the second line so as to not
-interfere with the execution mechanism.
-
-
-@subsection A bunch of operations in Scheme
-
-Here is some code you can type at the @code{guile>} prompt to see some
-of the Scheme data types at work (mostly lists and vectors). I have
-inserted brief comments @emph{before} each line of code explaining what
-happens.
-
-@smalllisp
-;; @r{make a list and bind it to the symbol @code{ls}}
-guile> @kbd{(define ls (list 1 2 3 4 5 6 7))}
- @result{}
-;; @r{display the list}
-guile> @kbd{ls}
- @result{} (1 2 3 4 5 6 7)
-;; @r{ask if @code{ls} is a vector; @code{#f} means it is not}
-guile> @kbd{(vector? ls)}
- @result{} #f
-;; @r{ask if @code{ls} is a list; @code{#t} means it is}
-guile> @kbd{(list? ls)}
- @result{} #t
-;; @r{ask for the length of @code{ls}}
-guile> @kbd{(length ls)}
- @result{} 7
-;; @r{pick out the first element of the list}
-guile> @kbd{(car ls)}
- @result{} 1
-;; @r{pick the rest of the list without the first element}
-guile> @kbd{(cdr ls)}
- @result{} (2 3 4 5 6 7)
-;; @r{this should pick out the 3rd element of the list}
-guile> @kbd{(car (cdr (cdr ls)))}
- @result{} 3
-;; @r{a shorthand for doing the same thing}
-guile> @kbd{(caddr ls)}
- @result{} 3
-;; @r{append the given list onto @code{ls}, print the result}
-;; @r{@strong{NOTE:} the original list @code{ls} is @emph{not} modified}
-guile> @kbd{(append ls (list 8 9 10))}
- @result{} (1 2 3 4 5 6 7 8 9 10)
-guile> @kbd{(reverse ls)}
- @result{} (10 9 8 7 6 5 4 3 2 1)
-;; @r{ask if 12 is in the list --- it obviously is not}
-guile> @kbd{(memq 12 ls)}
- @result{} #f
-;; @r{ask if 4 is in the list --- returns the list from 4 on.}
-;; @r{Notice that the result will behave as true in conditionals}
-guile> @kbd{(memq 4 ls)}
- @result{} (4 5 6 7)
-;; @r{an @code{if} statement using the aforementioned result}
-guile> @kbd{(if (memq 4 ls)
- (display "hey, it's true!\n")
- (display "dude, it's false\n"))}
- @print{hey, it's true!}
- @result{}
-guile> @kbd{(if (memq 12 ls)
- (display "hey, it's true!\n")
- (display "dude, it's false\n"))}
- @print{dude, it's false}
- @result{}
-guile> @kbd{(memq 4 (reverse ls))}
- @result{} (4 3 2 1)
-;; @r{make a smaller list @code{ls2} to work with}
-guile> @kbd{(define ls2 (list 2 3 4))}
-;; @r{make a list in which the function @code{sin} has been}
-;; @r{applied to all elements of @code{ls2}}
-guile> @kbd{(map sin ls2)}
- @result{} (0.909297426825682 0.141120008059867 -0.756802495307928)
-;; @r{make a list in which the squaring function has been}
-;; @r{applied to all elements of @code{ls}}
-guile> @kbd{(map (lambda (n) (expt n n)) ls)}
- @result{} (1 4 27 256 3125 46656 823543)
-@end smalllisp
-
-@smalllisp
-;; @r{make a vector and bind it to the symbol @code{v}}
-guile> @kbd{(define v #(1 2 3 4 5 6 7))}
-guile> @kbd{v}
- @result{} #(1 2 3 4 5 6 7)
-guile> @kbd{(vector? v)}
- @result{} #t
-guile> @kbd{(list? v)}
- @result{} #f
-guile> @kbd{(vector-length v)}
- @result{} 7
-;; @r{vector-ref allows you to pick out elements by index}
-guile> @kbd{(vector-ref v 2)}
- @result{} 3
-;; @r{play around with the vector: make it into a list, reverse}
-;; @r{the list, go back to a vector and take the second element}
-guile> @kbd{(vector-ref (list->vector (reverse (vector->list v))) 2)}
- @result{} 5
-;; @r{this demonstrates that the entries in a vector do not have}
-;; @r{to be of uniform type}
-guile> @kbd{(vector-set! v 4 "hi there")}
- @result{} "hi there"
-guile> @kbd{v}
- @result{} #(1 2 3 4 "hi there" 6 7)
-@end smalllisp
-
-
-@subsection Using recursion to process lists
-@cindex recursion
-@cindex list processing
-
-Here are some typical examples of using recursion to process a list.
-
-@smalllisp
-;; @r{this is a rather trivial way of reversing a list}
-(define (my-reverse l)
- (if (null? l)
- l
- (append (my-reverse (cdr l)) (list (car l)))))
-(my-reverse '(27 32 33 40))
-@result{} (40 33 32 27)
-@end smalllisp
-
-
-@subsection Processing matrices
-
-Suppose you have a matrix represented as a list of lists:
-
-@smalllisp
-(define m
- (list
- (list 7 2 1 3 2 8 5 3 6)
- (list 4 1 1 1 3 8 9 8 1)
- (list 5 5 4 8 1 8 2 2 4)))
-@end smalllisp
-
-Then you could apply a certain function to each element of the matrix in
-the following manner:
-@smalllisp
-;; @r{apply the function func to the matrix m element-by-element;}
-;; @r{return a matrix with the result.}
-(define (process-matrix m func)
- (map (lambda (l)
- (map func l))
- m))
-@end smalllisp
-Notice that I have used the Scheme @code{map} procedure because I am
-interested in the matrix that results from the application of
-@code{func}, rather than in the side effects associated with applying
-@code{func}.
-
-This could be invoked with @code{(process-matrix m sin)} or
-@code{(process-matrix m (lambda (x) (* x x)))}; for example:
-
-@smalllisp
-(process-matrix m (lambda (x) (* x x)))
-@result{} ((49 4 1 9 4 64 25 9 36) (16 1 1 1 9 64 81 64 1) (25 25 16 64 1 64 4 4 16))
-@end smalllisp
-
-To print a representation of the matrix, we could define a generalized
-routine:
-@smalllisp
-;; @r{proc is a procedure to represent the single element,}
-;; @r{row-proc is a procedure that is invoked after each row.}
-;; @r{Example: proc could be (lambda (x) (begin (display x) (display " ")))}
-;; @r{and row-proc could be (lambda (l) (display "\n"))}
-(define (represent-matrix m proc row-proc)
- (for-each (lambda (l)
- (begin
- (for-each proc l)
- (row-proc l)))
- m))
-@end smalllisp
-@findex represent-matrix
-
-And then invoke it with
-@smalllisp
-(represent-matrix m
- (lambda (x) (begin (display x) (display " ")))
- (lambda (l) (begin (display "\n"))))
-@print{7 2 1 3 2 8 5 3 6}
-@print{4 1 1 1 3 8 9 8 1}
-@print{5 5 4 8 1 8 2 2 4}
-@end smalllisp
-
-@cindex objects
-
-Now we write a helper routine that uses Scheme @dfn{closures} to make
-objects with state that then receive messages to draw little squares.
-@cindex closures
-@cindex syntactic closures
-
-But let us take it one step at a time. I will start by showing you a
-simple example of object in Scheme. The object I make here represents a
-cell, which could be a cell in a matrix. The cell responds to commands
-to draw itself, to return the next cell, and so forth. @emph{Guile does
-not currently have a Tk interface, so I will leave the hooks for
-graphical rendering. In a future release of Guile I will add graphical
-rendering messages to the cell object.}
-
-@smallexample
-;; @r{cell-object.scm: routines for creating and manipulating cell objects}
-
-;; @r{(the-x, the-y) is the initial position of the cell.}
-;; @r{the-color is a string representing a color; must be something Tk can grok.}
-;; @r{square-size is the size of the square that gets drawn.}
-;; @r{(sizex, sizey) is the size of the matrix.}
-(define (MAKE-CELL the-x the-y the-color square-size sizex sizey)
- (define (get-x) the-x)
- (define (get-y) the-y)
-
- (define (set-x! new-x)
- (set! the-x new-x)
- the-x)
- (define (set-y! new-y)
- (set! the-y new-y)
- the-y)
- (define (get-color) the-color)
- (define (set-color! new-color)
- (set! the-color new-color)
- the-color)
- (define (next!)
- (set! the-x (+ the-x 1))
- (if (>= the-x sizex)
- (begin
- (set! the-x 0)
- (set! the-y (+ the-y 1))))
- (if (>= the-y sizey)
- (begin
- (display "CELL next!: value of y is too big; not changing it\n")
- (set! the-y (- the-y 1))))
- (cons the-x the-y))
- (define (draw)
- (let* ((x0 (* the-x square-size))
- (y0 (* the-y square-size))
- (x1 (+ x0 square-size))
- (y1 (+ y0 square-size)))
- (display "I should draw a ")
- (display the-color)
- (display " rectangle with corners at ")
- (display x0) (display y0) (display x1) (display y1)
- ))
-
- ;; self is the dispatch procedure
- (define (self message)
- (case message
- ((x) get-x)
- ((y) get-y)
- ((set-x!) set-x!)
- ((set-y!) set-y!)
- ((color) get-color)
- ((set-color!) set-color!)
- ((next!) next!)
- ((draw) draw)
- (else (error "CELL: Unknown message -> " message))))
- ;; and now return the dispatch procedure
- self
- )
-@end smallexample
-@cindex cell-object
-@findex MAKE-CELL
-
-What does this procedure do? It returns another procedure
-(@code{self}) which receives a message (x, y, set-x!, set-y!, @dots{})
-and takes an action to return or modify its state. The state consists
-of the values of variables @code{the-x}, @code{the-y}, @code{the-color}
-and so forth.
-
-Here are some examples of how to use MAKE-CELL and the cell object it
-creates:
-@smallexample
-(define c (MAKE-CELL 0 0 "red" 10 7 9))
-
-;; @r{retrieve the x and y coordinates}
-((c 'x))
-@result{} 0
-((c 'y))
-@result{} 0
-;; @r{change the x coordinate}
-((c 'set-x!) 5)
-@result{} 5
-((c 'x))
-@result{} 5
-;; @r{change the color}
-((c 'color))
-@result{} "red"
-((c 'set-color!) "green")
-@result{} "green"
-((c 'color))
-@result{} "green"
-;; @r{now use the next! message to move to the next cell}
-((c 'next!))
-@result{} (6 . 0)
-((c 'x))
-@result{} 6
-((c 'y))
-@result{} 0
-;; @r{now make things wrap around}
-((c 'next!))
-@result{} (0 . 1)
-((c 'next!))
-@result{} (1 . 1)
-((c 'next!))
-@result{} (2 . 1)
-((c 'x))
-@result{} 2
-((c 'y))
-@result{} 1
-@end smallexample
-
-You will notice that expressions like @code{(c 'next)} return procedures
-that do the job, so we have to use extra parentheses to make the job
-happen. This syntax is rather awkward; one way around it is to define a
-@code{send} procedure:
-
-@smallexample
-;; @r{send makes object syntax a bit easier; instead of saying}
-;; @r{ ((my-cell 'set-x!) 4)}
-;; @r{you can say}
-;; @r{ (send my-cell 'set-x! 4)}
-(define (send obj . args)
- (let ((first-eval (apply obj (list (car args)))))
- (if (null? (cdr args))
- (first-eval)
- (apply first-eval (cdr args)))))
-@end smallexample
-@findex send
-
-You can see that @code{send} passes the message to the object, making
-sure that things are evaluated the proper number of times. You can now
-type:
-
-@smallexample
-(define c2 (MAKE-CELL 0 0 "red" 10 7 9))
-(send c2 'x)
-@result{} 0
-(send c2 'set-x! 5)
-@result{} 5
-(send c2 'color)
-@result{} "red"
-(send c2 'set-color! "green")
-@result{} "green"
-(send c2 'next!)
-@result{} (1 . 0)
-(send c2 'x)
-@result{} 1
-(send c2 'y)
-@result{} 0
-@end smallexample
-
-@cindex object-based programming
-@cindex object-oriented programming
-
-This is the simplest way of implementing objects in Scheme, but it does
-not really allow for full @emph{object-oriented programming} (for
-example, there is no inheritance). But it is useful for
-@emph{object-based programming}.
-
-Guile comes with a couple more complete object-oriented extensions to
-Scheme: these are part of slib (@pxref{Object, , , slib, SLIB: the
-portable Scheme library} and @pxref{Yasos, , , slib, SLIB: the portable
-Scheme library}).
-
-@node Guile in a Library
-@chapter Guile in a Library
-
-@iftex
-@nobreak
-@end iftex
-In the previous chapters Guile was used to write programs entirely in
-Scheme, and no C code was seen; but I have been claiming @emph{ad
-nauseam} that Guile is an @emph{extension} language. Here we see how
-that is done, and how that can be useful.
-@cindex libguile
-@cindex extending C programs
-
-
-@menu
-* Two world views::
-* What is libguile::
-* How to get started with libguile::
-* More interesting programming with libguile::
-* Further examples::
-@end menu
-
-@node Two world views
-@section Two world views
-@cindex master world
-
-In this manual, I usually jump into examples and explain them as you
-type in the code; here I will digress and ramble for a few paragraphs to
-set some concepts straight, and then let you type (or paste) in fun
-examples.
-
-In 1995, I implemented a large program, @dfn{Gnudl}, using Guile quite
-extensively. In the design phase of Gnudl, I found I had to make a
-choice: should the fundamental data structures be C or Scheme data
-structures?
-@cindex gnudl
-@cindex GNU Data Language
-@cindex Galassi, Mark
-
-Guile allows C to see its data structures (scalar types, lists, vectors,
-strings @dots{}). C also allows Guile to see its data structures. As a
-large program designer, you have to decide which of those capabilities
-to use. You have two main choices:
-
-@enumerate 1
-@item
-You can write your software mostly in Scheme. In this case, your C
-software will mostly parse the Scheme code with Guile calls, and provide
-some new primitive procedures to be used by Scheme. This is what Gnudl
-does.
-
-@item
-You can write your software mostly in C, occasionally allowing Scheme
-code to be parsed by Guile, either to allow the user to modify data
-structures, or to parse a configuration file, @dots{}
-@end enumerate
-
-Mixing the two approaches seems unwise: the overall layout would be
-confusing. But who knows? There might be problems that are best solved
-by a hybrid approach. Please let me know if you think of such a
-problem.
-
-If you use the former approach, we will say that the @dfn{master world}
-is Scheme, and the C routines serve Scheme and access Scheme data
-structures. In the latter case, the master world is C, and Scheme
-routines serve the C code and access C data structures.
-
-In both approaches the @code{libguile.a} library is the same, but a
-predominantly different set of routines will be used. When we go
-through examples of libguile use, we will point out which is the master
-world in order to clarify these two approaches.
-
-
-@node What is libguile
-@section What is libguile
-@cindex libguile
-@cindex gh interface
-@cindex scm interface
-
-@dfn{Libguile} is the library which allows C programs to start a Scheme
-interpreter and execute Scheme code. There are also facilities in
-libguile to make C data structures available to Scheme, and vice versa.
-
-The interface provided by the libguile C library is somewhat specific to
-the implementation of the Scheme interpreter. This low-level libguile
-interface is usually referred to as the @code{scm_} interface, since its
-public calls (API) all have the @code{scm_} prefix.
-
-There is also a higher-level libguile interface, which is usually
-referred to as the @code{gh_} interface (libGuile High). Its public
-calls all have the @code{gh_} prefix. The @code{gh_} library interface
-is designed to hide the implementation details, thus making it easier to
-assimilate and portable to other underlying Scheme implementations.
-
-People extending Guile by adding bindings to C libraries (like OpenGL or
-Rx) are encouraged to use the @code{gh_} interface, so their work will
-be portable to other Scheme systems. The @code{gh_} interface should be
-more stable, because it is simpler.
-
-The @code{scm_} interface is necessary if you want to poke into the
-innards of Scheme data structures, or do anything else that is not
-offered by the @code{gh_} interface. It is not covered in this
-tutorial, but is covered extensively in @ref{Scheme data representation,
-Guile Reference Manual, guile-ref, Guile Reference Manual}.
-
-This chapter gives a gentle introduction to the @code{gh_} interface,
-presenting some @emph{hello world}-style programs which I wrote while
-teaching myself to use libguile.
-@cindex hello world
-
-The @cite{Guile Programmer's Manual} gives more examples of programs
-written using libguile, illustrating diverse applications. You can also
-consult my @emph{Gnudl} documentation at
-@url{http://nis-www.lanl.gov/~rosalia/mydocs/} to see a large scale
-project that uses C and Scheme code together.
-
-
-@node How to get started with libguile
-@section How to get started with libguile
-@cindex learn0
-
-Here is an elementary first program, @code{learn0}, to get going with
-libguile. The program (which uses Scheme as a master world) is in a
-single source file, @code{learn0.c}:
-
-@smallexample
-/* @r{test the new libgh.a (Guile High-level library) with a trivial
- program} */
-
-#include <stdio.h>
-
-#include <guile/gh.h>
-
-void main_prog(int argc, char *argv[]);
-
-main(int argc, char *argv[])
-@{
- gh_enter(argc, argv, main_prog);
-@}
-
-void main_prog(int argc, char *argv[])
-@{
- int done;
- char input_str[200];
-
- gh_eval_str("(display \"hello Guile\")");
- gh_eval_str("(newline)");
-
- /* @r{for fun, evaluate some simple Scheme expressions here} */
- gh_eval_str("(define (square x) (* x x))");
- gh_eval_str("(define (fact n) (if (= n 1) 1 (* n (fact (- n 1)))))");
- gh_eval_str("(square 9)");
-
- /* @r{now sit in a Scheme eval loop: I input the expressions, have
- Guile evaluate them, and then get another expression.} */
- done = 0;
- fputs("learn0> ", stdout);
- while (fgets(input_str, 199, stdin) != NULL) @{
- gh_eval_str(input_str);
- fputs("\nlearn0> ", stdout);
- @}
-
- exit(0);
-@}
-@end smallexample
-
-If you name this program @code{learn0.c}, it can now be compiled with:
-@smallexample
-gcc -g -c learn0.c -o learn0.o
-gcc -o learn0 learn0.o -lguile -lm
-@end smallexample
-
-@c @emph{NOTE: If you are in the Guile development tree, you can simply do
-@c ``cd doc/examples/c; make; ./learn0''.}
-
-The program is simple: it creates a Scheme interpreter, passes a couple
-of strings to it that define new Scheme functions @code{square} and
-@code{factorial}, and then a couple of strings that invoke those
-functions.
-
-It then goes into a read-eval-print-loop (REPL), so you could type
-one-line Scheme expressions to it and have them evaluated. For example:
-@smallexample
-<shell-prompt> ./learn0
-hello Guile
-learn0> (display (sin 1.3))
-963.558185417193e-3
-learn0> (display (fact 10))
-3628800
-learn0> (quit)
-<shell-prompt>
-@end smallexample
-
-You should notice the key steps involved in this @code{learn0} program:
-
-@cartouche
-@enumerate
-@item
-@code{#include <guile/gh.h>}
-@item
-You need to invoke the initialization routine @code{gh_enter()}. This
-starts up a Scheme interpreter, handling many implementation-specific
-details.
-@item
-Your main() function should be almost empty: the real main program goes
-in a separate function main_prog() which is passed to gh_enter(). This
-rather arcane convention is due to the way Guile's garbage collector
-works: the whole program has to run in the dynamic context of
-@code{gh_enter()}.
-@item
-You pass strings to the Scheme interpreter with the @code{gh_eval_str()}
-routine.
-@item
-You link your program with @code{-lguile}.
-@end enumerate
-@end cartouche
-
-
-@node More interesting programming with libguile
-@section More interesting programming with libguile
-@cindex learn1
-@cindex callback
-@cindex builtin functions
-
-The @code{learn0} program shows how you can invoke Scheme commands from
-a C program. This is not such a great achievement: the same could have
-been done by opening a pipe to SCM or any other Scheme interpreter.
-
-A true extension language must allow @dfn{callbacks}. Callbacks allow
-you to write C routines that can be invoked as Scheme procedures, thus
-adding new primitive procedures to Scheme. This also means that a
-Scheme procedure can modify a C data structure.
-
-Guile allows you to define new Scheme procedures in C, and provides a
-mechanism to go back and forth between C and Scheme data types.
-
-Here is a second program, @code{learn1}, which demonstrates these
-features. It is split into three source files: @code{learn1.c},
-@code{c_builtins.h} and @code{c_builtins.c}. I am including the code
-here.
-@c , but you might just want to look at the online source code and the
-@c Makefile.am that come with Guile in the
-@c @file{doc/examples/c} directory.
-
-Notice that @code{learn1} uses a Scheme master world, and the C routines
-in @code{c_builtins.c} are simply adding new primitives to Scheme.
-
-@menu
-* learn1.c::
-* c_builtins.h::
-* c_builtins.c::
-* What learn1 is doing::
-* Compiling and running learn1::
-@end menu
-
-@node learn1.c
-@subsection learn1.c
-
-Here is @file{learn1.c}:
-@smallexample
-#include <stdio.h>
-
-#include <guile/gh.h>
-
-#include "c_builtins.h"
-
-void main_prog(int argc, char *argv[]);
-
-main(int argc, char *argv[])
-@{
- gh_enter(argc, argv, main_prog);
-@}
-
-void main_prog(int argc, char *argv[])
-@{
- char input_str[200]; /* @r{ugly hack: assume strlen(line) < 200} */
- int done;
-
- /* @r{for fun, evaluate some simple Scheme expressions here} */
- gh_eval_str("(define (square x) (* x x))");
- gh_eval_str("(define (fact n) (if (= n 1) 1 (* n (fact (- n 1)))))");
- gh_eval_str("(square 9)");
- gh_eval_str("(fact 100)");
-
- /* @r{now try to define some new builtins, coded in C, so that they are
- available in Scheme.} */
- gh_new_procedure1_0("c-factorial", c_factorial);
- gh_new_procedure1_0("c-sin", c_sin);
- gh_new_procedure1_0("v-t", vector_test);
-
- /* @r{now sit in a Scheme eval loop: I input the expressions, have
- Guile evaluate them, and then get another expression.} */
- done = 0;
- fputs("learn1> ", stdout);
- while (!done) @{
- if (gets(input_str) == NULL) @{
- done = 1;
- @} else @{
- gh_eval_str(input_str);
- fputs("learn1> ", stdout);
- @}
- @}
-
- exit(0);
-@}
-@end smallexample
-
-@node c_builtins.h
-@subsection c_builtins.h
-
-Here is @file{c_builtins.h}:
-@smallexample
-/* @r{builtin function prototypes} */
-
-#include <guile/gh.h>
-
-SCM c_factorial(SCM n);
-SCM c_sin(SCM n);
-SCM vector_test(SCM s_length);
-@end smallexample
-
-@node c_builtins.c
-@subsection c_builtins.c
-
-Here is @file{c_builtins.c}:
-@smallexample
-#include <stdio.h>
-#include <math.h>
-
-#include <guile/gh.h>
-
-#include "c_builtins.h"
-
-/* @r{this is a factorial routine in C, made to be callable by Scheme} */
-SCM c_factorial(SCM s_n)
-@{
- int i;
- unsigned long result = 1, n;
-
- n = gh_scm2ulong(s_n);
-
- gh_defer_ints();
- for (i = 1; i <= n; ++i) @{
- result = result*i;
- @}
- gh_allow_ints();
- return gh_ulong2scm(result);
-@}
-
-/* @r{a sin routine in C, callable from Scheme. it is named c_sin() to
- distinguish it from the default Scheme sin function} */
-SCM c_sin(SCM s_x)
-@{
- double x = gh_scm2double(s_x);
-
- return gh_double2scm(sin(x));
-@}
-
-/* @r{play around with vectors in Guile: this routine creates a vector of
- the given length, initializes it all to zero except element 2 which
- is set to 1.9.} */
-SCM vector_test(SCM s_length)
-@{
- SCM xvec;
-
- c_length = gh_scm2ulong(s_length);
- printf("requested length for vector: %ld\n", gh_scm2ulong(s_length));
-
- /* create a vector */
- xvec = gh_make_vector(s_length, gh_double2scm(0.0));
- /* set the second element in it */
- gh_vector_set_x(xvec, gh_int2scm(2), gh_double2scm(1.9));
-
- return xvec;
-@}
-@end smallexample
-
-@node What learn1 is doing
-@subsection What learn1 is doing
-@cindex registering callbacks
-@cindex registering C functions
-@cindex primitive procedures
-
-If you compare learn1 to learn0, you will find that learn1 uses a new
-Guile construct: the function @code{gh_new_procedure()}, and its
-siblings:
-
-@smallexample
- /* @r{now try to define some new builtins, coded in C, so that they are
- available in Scheme.} */
- gh_new_procedure1_0("c-factorial", c_factorial);
- gh_new_procedure1_0("c-sin", c_sin);
- gh_new_procedure1_0("v-t", vector_test);
-@end smallexample
-
-It is clear that @code{gh_new_procedure()} adds a new builtin
-routine written in C which can be invoked from Scheme. We can now
-revise our checklist for programming with libguile, so it includes
-adding callbacks.
-@cindex libguile - step by step
-
-@cartouche
-@enumerate
-@item
-@code{#include <guile/gh.h>}
-@item
-You need to invoke the initialization routine @code{gh_enter()}. This
-starts up a Scheme interpreter, handling many details.
-@item
-Your main() function should be almost empty: the real main program goes
-in a separate function main_prog() which is passed to gh_enter(). This
-rather arcane convention is due to the way Guile's garbage collector
-works: the whole program has to run in the dynamic context of
-@code{gh_enter()}.
-@item
-You pass strings to the Scheme interpreter with the @code{gh_eval_str()}
-routine.
-@item
-@strong{[new]} You can now define new builtin Scheme functions;
-i.e. define new builtin Scheme functions, with the
-@code{gh_new_procedure()} routine.
-@item
-You pass strings to the Scheme interpreter with the
-@code{gh_eval_str()} routine.
-@item
-You link your program with @code{-lguile}.
-@end enumerate
-@end cartouche
-
-I breezed by the issue of how to write your C routines that are
-registered to be called from Scheme. This is non-trivial, and is
-discussed at length in the @cite{Guile Programmer's Manual}.
-
-
-@node Compiling and running learn1
-@subsection Compiling and running learn1
-
-@smallexample
-gcc -g -c learn1.c -o learn1.o
-gcc -g -c c_builtins.c -o c_builtins.o
-gcc -o learn1 learn1.o c_builtins.o -lguile -lm
-@end smallexample
-
-If you run @code{learn1}, it will prompt you for a one-line Scheme
-expression, just as @code{learn0} did. The difference is that you can
-use the new C builtin procedures (@code{c-factorial}, @code{c-sin},
-@code{v-t}).
-
-@smallexample
-<shell-prompt> ./learn1
-welcome to Guile
-hello Guile
-learn1> (display (c-factorial 6))
-720
-learn1> (display (c-factorial 20))
-2192834560
-learn1> (display (c-factorial 100))
-0
-learn1> (display (c-sin 1.5))
-0.997494986604054
-learn1> (display (v-t 10))
-requested length for vector: 10
-#(0.0 0.0 1.9 0.0 0.0 0.0 0.0 0.0 0.0 0.0)
-learn1> (display (v-t 15))
-requested length for vector: 15
-#(0.0 0.0 1.9 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0)
-learn1> (quit)
-<shell-prompt>
-@end smallexample
-
-As you see, taking @code{(c-factorial 100)} does not use bignumbers and
-returns a bogus answer.
-
-@node Further examples
-@section Further examples
-
-Further ``idealized'' examples are included in the @code{doc/examples/c}
-distribution. They include programs to:
-
-@c [FIXME: still have to write some of these; then I will revise the list.]
-
-@itemize @bullet
-@item
-Parse a startup file (C is the master world).
-@item
-Set up initial conditions for an n-body simulation (C is the master
-world).
-@item
-Implement a Scheme interpreter with all of Guile's goodies, @emph{plus}
-the readline library @emph{and} a fast Fourier transform routine
-provided in C (Scheme is the master world).
-@end itemize
-
-@node Regular Expression Support
-@chapter Regular Expression Support
-
-@node UNIX System Programming
-@chapter UNIX System Programming
-
-@node Where to find more Guile/Scheme resources
-@chapter Where to find more Guile/Scheme resources
-
-
-@node Concept Index
-@unnumbered Concept Index
-
-@printindex cp
-
-@node Procedure and Macro Index
-@unnumbered Procedure and Macro Index
-
-This is an alphabetical list of all the procedures and macros in Dominion.
-
-@printindex fn
-
-@node Variable Index
-@unnumbered Variable Index
-
-This is an alphabetical list of the major global variables in Dominion.
-
-@printindex vr
-
-@node Type Index
-@unnumbered Type Index
-
-This is an alphabetical list of the major data structures in Dominion.
-
-@printindex tp
-
-@contents
-
-@bye
diff --git a/doc/use-cases.fig b/doc/use-cases.fig
deleted file mode 100644
index 24118ff31..000000000
--- a/doc/use-cases.fig
+++ /dev/null
@@ -1,199 +0,0 @@
-#FIG 3.2
-Portrait
-Center
-Metric
-A4
-100.00
-Single
--2
-1200 2
-0 32 #424242
-0 33 #848484
-0 34 #c6c6c6
-0 35 #8c8c8c
-0 36 #c6c6c6
-0 37 #848484
-0 38 #8c8c8c
-0 39 #424242
-0 40 #848484
-0 41 #c6c6c6
-0 42 #e7e7e7
-0 43 #c6b594
-0 44 #efffff
-0 45 #decea5
-0 46 #adadad
-0 47 #525252
-0 48 #8c8c8c
-0 49 #424242
-0 50 #848484
-0 51 #c6c6c6
-0 52 #e7e7e7
-0 53 #424242
-0 54 #848484
-0 55 #c6c6c6
-0 56 #e7e7e7
-0 57 #424242
-0 58 #848484
-0 59 #c6c6c6
-0 60 #e7e7e7
-0 61 #424242
-0 62 #848484
-0 63 #c6c6c6
-0 64 #e7e7e7
-0 65 #424242
-0 66 #848484
-0 67 #c6c6c6
-0 68 #e7e7e7
-0 69 #8c8c8c
-0 70 #424242
-0 71 #848484
-0 72 #c6c6c6
-0 73 #424242
-0 74 #c6c6c6
-0 75 #e7e7e7
-0 76 #424242
-0 77 #848484
-0 78 #c6c6c6
-0 79 #848484
-0 80 #c6c6c6
-0 81 #e7e7e7
-0 82 #424242
-0 83 #8c8c8c
-0 84 #424242
-0 85 #8c8c8c
-0 86 #424242
-0 87 #8c8c8c
-0 88 #424242
-0 89 #8c8c8c
-0 90 #424242
-0 91 #8c8c8c
-0 92 #424242
-0 93 #8c8c8c
-0 94 #424242
-0 95 #8c8c8c
-0 96 #424242
-0 97 #8c8c8c
-0 98 #c6c6c6
-0 99 #e7e7e7
-0 100 #848484
-0 101 #c6c6c6
-0 102 #e7e7e7
-0 103 #8c8c8c
-0 104 #424242
-0 105 #8c8c8c
-0 106 #424242
-0 107 #848484
-0 108 #c6c6c6
-0 109 #e7e7e7
-0 110 #8c8c8c
-0 111 #424242
-0 112 #8c8c8c
-0 113 #8c8c8c
-0 114 #8c8c8c
-0 115 #424242
-0 116 #adadad
-6 450 225 1350 1710
-1 4 0 1 0 7 100 0 -1 4.000 1 0.0000 900 406 176 176 765 294 1035 519
-2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 3
- 450 1710 900 1260 1350 1710
-2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 16
- 900 1260 900 1215 900 1170 900 1125 900 1080 900 1035
- 900 990 900 945 900 900 900 855 900 810 900 765
- 900 720 900 675 900 630 900 585
-2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2
- 450 810 1350 810
--6
-6 450 2250 1350 3735
-1 4 0 1 0 7 100 0 -1 4.000 1 0.0000 900 2431 176 176 765 2319 1035 2544
-2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 3
- 450 3735 900 3285 1350 3735
-2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 16
- 900 3285 900 3240 900 3195 900 3150 900 3105 900 3060
- 900 3015 900 2970 900 2925 900 2880 900 2835 900 2790
- 900 2745 900 2700 900 2655 900 2610
-2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2
- 450 2835 1350 2835
--6
-6 450 4275 1350 5760
-1 4 0 1 0 7 100 0 -1 4.000 1 0.0000 900 4456 176 176 765 4344 1035 4569
-2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 3
- 450 5760 900 5310 1350 5760
-2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 16
- 900 5310 900 5265 900 5220 900 5175 900 5130 900 5085
- 900 5040 900 4995 900 4950 900 4905 900 4860 900 4815
- 900 4770 900 4725 900 4680 900 4635
-2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2
- 450 4860 1350 4860
--6
-6 2250 540 3645 1305
-1 2 0 1 0 7 100 0 20 4.000 1 0.0000 2947 922 697 382 2250 540 3645 1305
-4 0 0 100 0 16 12 0.0000 4 135 1245 2340 990 Hack On Guile\001
--6
-6 2250 2745 3645 3510
-1 2 0 1 0 7 100 0 20 4.000 1 0.0000 2947 3127 697 382 2250 2745 3645 3510
-4 0 0 100 0 16 12 0.0000 4 135 915 2520 3060 Write Guile\001
-4 0 0 50 0 16 12 0.0000 4 135 900 2520 3285 Extensions\001
--6
-6 2250 4770 3645 5535
-1 2 0 1 0 7 100 0 20 4.000 1 0.0000 2947 5152 697 382 2250 4770 3645 5535
-4 0 0 100 0 16 12 0.0000 4 135 1065 2430 5220 Embed Guile\001
--6
-6 2250 3690 3645 4455
-1 2 0 1 0 7 100 0 20 4.000 1 0.0000 2947 4072 697 382 2250 3690 3645 4455
-4 0 0 100 0 16 12 0.0000 4 180 1215 2385 4140 Use Guile App\001
--6
-6 2250 1620 3645 2385
-1 2 0 1 0 7 100 0 20 4.000 1 0.0000 2947 2002 697 382 2250 1620 3645 2385
-4 0 0 100 0 16 12 0.0000 4 180 1050 2430 2070 Write Scripts\001
--6
-6 4635 1350 5535 2835
-1 4 0 1 0 7 100 0 -1 4.000 1 0.0000 5085 1531 176 176 4950 1419 5220 1644
-2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 3
- 4635 2835 5085 2385 5535 2835
-2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 16
- 5085 2385 5085 2340 5085 2295 5085 2250 5085 2205 5085 2160
- 5085 2115 5085 2070 5085 2025 5085 1980 5085 1935 5085 1890
- 5085 1845 5085 1800 5085 1755 5085 1710
-2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2
- 4635 1935 5535 1935
--6
-6 4635 3375 5535 4860
-1 4 0 1 0 7 100 0 -1 4.000 1 0.0000 5085 3556 176 176 4950 3444 5220 3669
-2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 3
- 4635 4860 5085 4410 5535 4860
-2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 16
- 5085 4410 5085 4365 5085 4320 5085 4275 5085 4230 5085 4185
- 5085 4140 5085 4095 5085 4050 5085 4005 5085 3960 5085 3915
- 5085 3870 5085 3825 5085 3780 5085 3735
-2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2
- 4635 3960 5535 3960
--6
-2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
- 1 0 1.00 314.32 228.60
- 1395 945 2272 945
-2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
- 1 0 1.00 314.32 228.60
- 1395 3150 2272 3150
-2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
- 1 0 1.00 314.32 228.60
- 1395 5130 2272 5130
-2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
- 1 0 1.00 314.32 228.60
- 1395 4860 2295 3330
-2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
- 1 0 1.00 314.32 228.60
- 1395 1215 2385 2880
-2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
- 1 0 1.00 314.32 228.60
- 4545 1980 3668 1980
-2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
- 1 0 1.00 314.32 228.60
- 4545 4050 3668 4050
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 1980 135 3960 135 3960 6075 1980 6075 1980 135
-4 0 0 50 0 16 12 0.0000 4 180 1365 225 1935 Guile Developer\001
-4 0 0 50 0 16 12 0.0000 4 180 1740 90 3960 Extension Developer\001
-4 0 0 50 0 16 12 0.0000 4 180 1875 45 5985 Application Developer\001
-4 0 0 50 0 16 12 0.0000 4 135 435 2790 360 Guile\001
-4 0 0 50 0 16 12 0.0000 4 180 1725 4230 3060 Scheme Programmer\001
-4 0 0 50 0 16 12 0.0000 4 180 1380 4410 5085 Application User\001
diff --git a/doc/use-cases.txt b/doc/use-cases.txt
deleted file mode 100644
index e455fd1b8..000000000
--- a/doc/use-cases.txt
+++ /dev/null
@@ -1,22 +0,0 @@
- +-------------------+
- | Guile |
- O | |
- -+- | .---------------. |
- | -------->| Hack On Guile | |
- / \ \ | `---------------' | O
-Guile Developer | .---------------. | -+-
- \ | | Write Scripts |<------ |
- O \ | `---------------' | / \
- -+- `--->.---------------. | Scheme Programmer
- | -------->| Write Guile | |
- / \ .-->| Extensions | |
- Extension / | `---------------' | O
- Developer / | .---------------. | -+-
- / | | Use Guile App |<------ |
- O / | `---------------' | / \
- -+- / | .---------------. | Application User
- | -------->| Embed Guile | |
- / \ | `---------------' |
- Application | |
- Developer | |
- +-------------------+
diff --git a/emacs/ChangeLog b/emacs/ChangeLog
deleted file mode 100644
index 5189f107f..000000000
--- a/emacs/ChangeLog
+++ /dev/null
@@ -1,89 +0,0 @@
-2001-11-19 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * README: Use less forking for indexing command.
- Update index.
-
- * gud-guile.el: New file.
-
- * update-changelog.el:
- When run as a batch program, invoke `(ucl-update "ChangeLog")'
- instead of `(ucl-update-all)'.
-
- (ucl-outdir): Delete this var.
- (ucl-update): Arg now specifies change log file
- instead of cvs module directory.
- Make interactive.
- (ucl-update-all): Delete this func.
-
- * update-changelog.el: New file.
-
- * patch.el (patch-send):
- Renamed from `patch-submit'.
- Gadzooks what kind of world is this?
-
-2001-10-25 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * README, patch.el:
- New file.
-
-2001-10-25 Thien-Thi Nguyen <ttn@glug.org>
-
- * patch.el, README: New files.
-
-2001-06-21 Neil Jerram <neil@ossau.uklinux.net>
-
- * guile.el (guile-channel-file): Signal an error if unable to find
- channel.scm.
- Change "gulie" typos to "guile".
-
-2001-05-06 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * guile.el (guile:eval): Propagate user interrupt.
- (keywordp): Define it if not defined yet.
- (guile-use-module): New macro.
- (guile-process-import-module): Renamed from guile-process-use-module.
-
- * guile-emacs.scm (guile-emacs-apropos, guile-emacs-describe):
- New procedures.
-
- * guile-scheme.el (guile-scheme-mode-map): Use
- `shared-lisp-mode-map' as the parent keymap if
- `lisp-mode-shared-map' is not defined.
- (guile-scheme-module): New variable.
- (guile-scheme-set-module): Set module only when necessary.
- (guile-scheme-eval-print-last-sexp): Insert newline after eval.
- (guile-scheme-complete-table): New variable.
- (guile-scheme-input-symbol): New function.
- (guile-scheme-apropos, guile-scheme-describe,
- guile-scheme-kill-process): New commands.
-
-2001-04-25 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * guile.el, guile-scheme.el, guile-emacs.scm: New files.
-
-2001-03-13 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * guile-c.el (guile-c-edit-docstring): Set fill-column to 63, so
- that fill-paragraph'ed docstrings fit nicely when indented.
-
-2001-03-13 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * guile-c.el (guile-c-window-configuration): New variable.
- (guile-c-edit-docstring, guile-c-edit-finish):
- Save/restore window-configuration.
-
-2001-03-12 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * guile-c.el (guile-c-deprecate-region): New command.
-
-2001-03-11 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * guile-c.el: New file.
-
-2000-05-28 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * ppexpand.el: New file.
-
-2000-01-18 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * multistring.el: New file.
diff --git a/emacs/README b/emacs/README
deleted file mode 100644
index 73e021581..000000000
--- a/emacs/README
+++ /dev/null
@@ -1,13 +0,0 @@
-Index
-
-gud-guile.el --- Support for debugging guile internals
-guile-c.el --- Guile C editing commands
-guile-scheme.el --- Guile Scheme editing mode
-guile.el --- Emacs Guile interface
-multistring.el --- editing multiline strings.
-patch.el --- mail/apply a patch
-ppexpand.el --- temporarily expanding macros in a pretty way.
-update-changelog.el --- stitch rcs2log output to ChangeLog
-
-
-Generated using: for f in *.el ; do sed -e 's/^....//g' -e '1q' $f ; done
diff --git a/emacs/gud-guile.el b/emacs/gud-guile.el
deleted file mode 100644
index a0a70fabe..000000000
--- a/emacs/gud-guile.el
+++ /dev/null
@@ -1,81 +0,0 @@
-;;; gud-guile.el --- Support for debugging guile internals
-
-;; Copyright (C) 2001 Free Software Foundation, Inc.
-
-;; GNU Emacs 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.
-
-;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
-
-;;; Author: Thien-Thi Nguyen <ttn@gnu.org>
-;;; Version: 1
-;;; Favorite-Favorite: Favorite-Favorite
-
-;;; Commentary:
-
-;; This is a grab bag of stuff for doing "gdb guile" in Emacs.
-;; The var `gdb-guile-suggested-gdbinit' has a string that is
-;; snarfed from ../HACKING. (todo: Write `gdb-guile-init' to
-;; send it to gdb...)
-
-;;; Code:
-
-(require 'cl)
-
-(defun gdb-guile-display-scm ()
- (interactive)
- (save-excursion
- (let ((sym (thing-at-point 'symbol))
- (proc (get-buffer-process
- (find-if (lambda (buf)
- (string-match "^.gud-." (buffer-name buf)))
- (buffer-list)))))
- (mapc (lambda (template)
- (process-send-string proc (format template sym)))
- (list
- "set gdb_print(%s)\n"
- "printf \"%s: %%s\\n\", gdb_output\n")))))
-
-(defvar gdb-guile-suggested-gdbinit "
-define gp
-set gdb_print($arg0)
-print gdb_output
-end
-document gp
-Executes (object->string arg)
-end
-
-define ge
-call gdb_read($arg0)
-call gdb_eval(gdb_result)
-set gdb_print(gdb_result)
-print gdb_output
-end
-document ge
-Executes (print (eval (read arg))): ge \"(+ 1 2)\" => 3
-end
-
-define gh
-call g_help(scm_str2symbol($arg0), 20)
-set gdb_print($1)
-print gdb_output
-end
-document gh
-Prints help string for arg: gh \"enved-target\"
-end
-"
- "A useful .gdbinit")
-
-(provide 'gud-guile)
-
-;;; gud-guile.el ends here
diff --git a/emacs/guile-c.el b/emacs/guile-c.el
deleted file mode 100644
index fe05159ec..000000000
--- a/emacs/guile-c.el
+++ /dev/null
@@ -1,178 +0,0 @@
-;;; guile-c.el --- Guile C editing commands
-
-;; Copyright (C) 2001 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 program; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
-
-;;; Commentary:
-
-;; (add-hook 'c-mode-hook
-;; (lambda ()
-;; (require 'guile-c)
-;; (define-key c-mode-map "\C-c\C-g\C-p" 'guile-c-insert-define)
-;; (define-key c-mode-map "\C-c\C-g\C-e" 'guile-c-edit-docstring)
-;; (define-key c-mode-map "\C-c\C-g\C-d" 'guile-c-deprecate-region)
-;; ))
-
-;;; Code:
-
-(require 'cc-mode)
-
-(defvar guile-c-prefix "scm_")
-
-
-;;;
-;;; Insert templates
-;;;
-
-(defun guile-c-insert-define ()
- "Insert a template of a Scheme procedure.
-
- M-x guile-c-insert-define RET foo arg , opt . rest =>
-
- SCM_DEFINE (scm_foo, \"foo\", 1, 1, 1,
- (SCM arg, SCM opt, SCM rest),
- \"\")
- #define FUNC_NAME s_scm_foo
- {
-
- }
- #undef FUNC_NAME"
- (interactive)
- (let ((tokens (split-string (read-string "Procedure: ")))
- name args opts rest)
- ;; Get procedure name
- (if (not tokens) (error "No procedure name"))
- (setq name (car tokens) tokens (cdr tokens))
- ;; Get requisite arguments
- (while (and tokens (not (member (car tokens) '("," "."))))
- (setq args (cons (car tokens) args) tokens (cdr tokens)))
- (setq args (nreverse args))
- ;; Get optional arguments
- (when (string= (car tokens) ",")
- (setq tokens (cdr tokens))
- (while (and tokens (not (string= (car tokens) ".")))
- (setq opts (cons (car tokens) opts) tokens (cdr tokens)))
- (setq opts (nreverse opts)))
- ;; Get rest argument
- (when (string= (car tokens) ".")
- (setq rest (list (cadr tokens))))
- ;; Insert template
- (let ((c-name (guile-c-name-from-scheme-name name)))
- (insert (format "SCM_DEFINE (%s, \"%s\", %d, %d, %d,\n"
- c-name name (length args) (length opts) (length rest))
- "\t ("
- (mapconcat (lambda (a) (concat "SCM " a))
- (append args opts rest) ", ")
- "),\n"
- "\t \"\")\n"
- "#define FUNC_NAME s_" c-name "\n"
- "{\n\n}\n"
- "#undef FUNC_NAME\n\n")
- (previous-line 4)
- (indent-for-tab-command))))
-
-(defun guile-c-name-from-scheme-name (name)
- (while (string-match "\\?$" name) (setq name (replace-match "_p" t t name)))
- (while (string-match "!$" name) (setq name (replace-match "_x" t t name)))
- (while (string-match "^%" name) (setq name (replace-match "sys_" t t name)))
- (while (string-match "->" name) (setq name (replace-match "_to_" t t name)))
- (while (string-match "[-:]" name) (setq name (replace-match "_" t t name)))
- (concat guile-c-prefix name))
-
-
-;;;
-;;; Edit docstrings
-;;;
-
-(defvar guile-c-window-configuration nil)
-
-(defun guile-c-edit-docstring ()
- (interactive)
- (let* ((region (guile-c-find-docstring))
- (doc (if region (buffer-substring (car region) (cdr region)))))
- (if (not doc)
- (error "No docstring!")
- (setq guile-c-window-configuration (current-window-configuration))
- (with-current-buffer (get-buffer-create "*Guile Docstring*")
- (erase-buffer)
- (insert doc)
- (goto-char (point-min))
- (while (not (eobp))
- (if (looking-at "[ \t]*\"")
- (delete-region (match-beginning 0) (match-end 0)))
- (end-of-line)
- (if (eq (char-before (point)) ?\")
- (delete-backward-char 1))
- (if (and (eq (char-before (point)) ?n)
- (eq (char-before (1- (point))) ?\\))
- (delete-backward-char 2))
- (forward-line))
- (goto-char (point-min))
- (texinfo-mode)
- (if global-font-lock-mode
- (font-lock-fontify-buffer))
- (local-set-key "\C-c\C-c" 'guile-c-edit-finish)
- (setq fill-column 63)
- (switch-to-buffer-other-window (current-buffer))
- (message "Type `C-c C-c' to finish")))))
-
-(defun guile-c-edit-finish ()
- (interactive)
- (goto-char (point-max))
- (while (eq (char-before) ?\n) (backward-delete-char 1))
- (goto-char (point-min))
- (if (eobp)
- (insert "\"\"")
- (while (not (eobp))
- (insert "\t \"")
- (end-of-line)
- (insert (if (eobp) "\"" "\\n\""))
- (forward-line 1)))
- (let ((doc (buffer-string)))
- (kill-buffer (current-buffer))
- (set-window-configuration guile-c-window-configuration)
- (let ((region (guile-c-find-docstring)))
- (goto-char (car region))
- (delete-region (car region) (cdr region)))
- (insert doc)))
-
-(defun guile-c-find-docstring ()
- (save-excursion
- (if (re-search-backward "^SCM_DEFINE" nil t)
- (let ((start (progn (forward-line 2) (point))))
- (while (looking-at "[ \t]*\"")
- (forward-line 1))
- (cons start (- (point) 2))))))
-
-
-;;;
-;;; Others
-;;;
-
-(defun guile-c-deprecate-region (start end)
- (interactive "r")
- (save-excursion
- (let ((marker (make-marker)))
- (set-marker marker end)
- (goto-char start)
- (insert "#if (SCM_DEBUG_DEPRECATED == 0)\n\n")
- (goto-char marker)
- (insert "\n#endif /* (SCM_DEBUG_DEPRECATED == 0) */\n"))))
-
-(provide 'guile-c)
-
-;; guile-c.el ends here
diff --git a/emacs/guile-emacs.scm b/emacs/guile-emacs.scm
deleted file mode 100644
index 78b897e31..000000000
--- a/emacs/guile-emacs.scm
+++ /dev/null
@@ -1,154 +0,0 @@
-;;; guile-emacs.scm --- Guile Emacs interface
-
-;; Copyright (C) 2001 Keisuke Nishida <kxn30@po.cwru.edu>
-
-;; GNU Emacs 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.
-
-;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
-
-;;; Code:
-
-(use-modules (ice-9 regex))
-(use-modules (ice-9 channel))
-(use-modules (ice-9 session))
-(use-modules (ice-9 documentation))
-
-
-;;;
-;;; Emacs Lisp channel
-;;;
-
-(define (emacs-lisp-channel)
-
- (define (native-type? x)
- (or (integer? x) (symbol? x) (string? x) (pair? x) (vector? x)))
-
- (define (emacs-lisp-print ch val)
- (cond
- ((unspecified? val))
- ((eq? val #t) (channel-print-value ch 't))
- ((or (eq? val #f) (null? val)) (channel-print-value ch 'nil))
- ((native-type? val) (channel-print-value ch val))
- (else (channel-print-token ch val))))
-
- (channel-open (make-object-channel emacs-lisp-print)))
-
-
-;;;
-;;; Scheme channel
-;;;
-
-(define (emacs-scheme-channel)
- (define (print ch val) (channel-print-value ch (object->string val)))
- (channel-open (make-object-channel print)))
-
-
-;;;
-;;; for guile-import and guile-import-module
-;;;
-
-(define (guile-emacs-export-procedure name proc docs)
- (define (procedure-arity proc)
- (assq-ref (procedure-properties proc) 'arity))
-
- (define (procedure-args proc)
- (let ((source (procedure-source proc)))
- (if source
- ;; formals -> emacs args
- (let loop ((formals (cadr source)))
- (cond
- ((null? formals) '())
- ((symbol? formals) `(&rest ,formals))
- (else (cons (car formals) (loop (cdr formals))))))
- ;; arity -> emacs args
- (let* ((arity (procedure-arity proc))
- (nreqs (car arity))
- (nopts (cadr arity))
- (restp (caddr arity)))
- (define (nsyms n)
- (if (= n 0) '() (cons (gensym "a") (nsyms (1- n)))))
- (append! (nsyms nreqs)
- (if (> nopts 0) (cons '&optional (nsyms nopts)) '())
- (if restp (cons '&rest (nsyms 1)) '()))))))
-
- (define (procedure-call name args)
- (let ((restp (memq '&rest args))
- (args (delq '&rest (delq '&optional args))))
- (if restp
- `('apply ',name ,@args)
- `(',name ,@args))))
-
- (let ((args (procedure-args proc))
- (docs (and docs (object-documentation proc))))
- `(defun ,name ,args
- ,@(if docs (list docs) '())
- (guile-lisp-flat-eval ,@(procedure-call (procedure-name proc) args)))))
-
-(define (guile-emacs-export proc-name func-name docs)
- (let ((proc (module-ref (current-module) proc-name)))
- (guile-emacs-export-procedure func-name proc docs)))
-
-(define (guile-emacs-export-procedures module-name docs)
- (define (module-public-procedures name)
- (hash-fold (lambda (s v d)
- (let ((val (variable-ref v)))
- (if (procedure? val) (acons s val d) d)))
- '() (module-obarray (resolve-interface name))))
- `(progn ,@(map (lambda (n+p)
- (guile-emacs-export-procedure (car n+p) (cdr n+p) docs))
- (module-public-procedures module-name))))
-
-
-;;;
-;;; for guile-scheme-complete-symbol
-;;;
-
-(define (guile-emacs-complete-alist str)
- (sort! (apropos-fold (lambda (module name val data)
- (cons (list (symbol->string name)
- (cond ((procedure? val) " <p>")
- ((macro? val) " <m>")
- (else "")))
- data))
- '() (string-append "^" (regexp-quote str))
- apropos-fold-all)
- (lambda (p1 p2) (string<? (car p1) (car p2)))))
-
-
-;;;
-;;; for guile-scheme-apropos
-;;;
-
-(define (guile-emacs-apropos regexp)
- (with-output-to-string (lambda () (apropos regexp))))
-
-
-;;;
-;;; for guile-scheme-describe
-;;;
-
-(define (guile-emacs-describe sym)
- (object-documentation (eval sym (current-module))))
-
-
-;;;
-;;; Guile 1.4 compatibility
-;;;
-
-(define object->string
- (if (defined? 'object->string)
- object->string
- (lambda (x) (format #f "~S" x))))
-
-;;; guile-emacs.scm ends here
diff --git a/emacs/guile-scheme.el b/emacs/guile-scheme.el
deleted file mode 100644
index 10ea10db7..000000000
--- a/emacs/guile-scheme.el
+++ /dev/null
@@ -1,346 +0,0 @@
-;;; guile-scheme.el --- Guile Scheme editing mode
-
-;; Copyright (C) 2001 Free Software Foundation, Inc.
-
-;; GNU Emacs 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.
-
-;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
-
-;;; Commentary:
-
-;; Put the following lines in your ~/.emacs:
-;;
-;; (require 'guile-scheme)
-;; (setq initial-major-mode 'scheme-interaction-mode)
-
-;;; Code:
-
-(require 'guile)
-(require 'scheme)
-
-(defgroup guile-scheme nil
- "Editing Guile-Scheme code"
- :group 'lisp)
-
-(defvar guile-scheme-syntax-keywords
- '((begin 0) (if 1) (cond 0) (case 1) (do 2)
- quote syntax lambda and or else delay receive use-modules
- (match 1) (match-lambda 0) (match-lambda* 0)
- (let scheme-let-indent) (let* 1) (letrec 1) (and-let* 1)
- (let-syntax 1) (letrec-syntax 1) (syntax-rules 1) (syntax-case 2)))
-
-(defvar guile-scheme-special-procedures
- '((catch 1) (lazy-catch 1) (stack-catch 1)
- map for-each (dynamic-wind 3)))
-
-;; set indent functions
-(dolist (x (append guile-scheme-syntax-keywords
- guile-scheme-special-procedures))
- (when (consp x)
- (put (car x) 'scheme-indent-function (cadr x))))
-
-(defconst guile-scheme-font-lock-keywords
- (eval-when-compile
- (list
- (list (concat "(\\(define\\*?\\("
- ;; Function names.
- "\\(\\|-public\\|-method\\|-generic\\)\\|"
- ;; Macro names, as variable names.
- "\\(-syntax\\|-macro\\)\\|"
- ;; Others
- "-\\sw+\\)\\)\\>"
- ;; Any whitespace and declared object.
- "\\s *(?\\(\\sw+\\)?")
- '(1 font-lock-keyword-face)
- '(5 (cond ((match-beginning 3) font-lock-function-name-face)
- ((match-beginning 4) font-lock-variable-name-face)
- (t font-lock-type-face)) nil t))
- (list (concat
- "(" (regexp-opt
- (mapcar (lambda (e)
- (prin1-to-string (if (consp e) (car e) e)))
- (append guile-scheme-syntax-keywords
- guile-scheme-special-procedures)) 'words))
- '(1 font-lock-keyword-face))
- '("<\\sw+>" . font-lock-type-face)
- '("\\<:\\sw+\\>" . font-lock-builtin-face)
- ))
- "Expressions to highlight in Guile Scheme mode.")
-
-
-;;;
-;;; Guile Scheme mode
-;;;
-
-(defvar guile-scheme-mode-map nil
- "Keymap for Guile Scheme mode.
-All commands in `lisp-mode-shared-map' are inherited by this map.")
-
-(unless guile-scheme-mode-map
- (let ((map (make-sparse-keymap "Guile-Scheme")))
- (setq guile-scheme-mode-map map)
- (cond ((boundp 'lisp-mode-shared-map)
- (set-keymap-parent map lisp-mode-shared-map))
- ((boundp 'shared-lisp-mode-map)
- (set-keymap-parent map shared-lisp-mode-map)))
- (define-key map [menu-bar] (make-sparse-keymap))
- (define-key map [menu-bar guile-scheme] (cons "Guile-Scheme" map))
- (define-key map [uncomment-region]
- '("Uncomment Out Region" . (lambda (beg end)
- (interactive "r")
- (comment-region beg end '(4)))))
- (define-key map [comment-region] '("Comment Out Region" . comment-region))
- (define-key map [indent-region] '("Indent Region" . indent-region))
- (define-key map [indent-line] '("Indent Line" . lisp-indent-line))
- (define-key map "\e\C-i" 'guile-scheme-complete-symbol)
- (define-key map "\e\C-x" 'guile-scheme-eval-define)
- (define-key map "\C-x\C-e" 'guile-scheme-eval-last-sexp)
- (define-key map "\C-c\C-b" 'guile-scheme-eval-buffer)
- (define-key map "\C-c\C-r" 'guile-scheme-eval-region)
- (define-key map "\C-c:" 'guile-scheme-eval-expression)
- (define-key map "\C-c\C-a" 'guile-scheme-apropos)
- (define-key map "\C-c\C-d" 'guile-scheme-describe)
- (define-key map "\C-c\C-k" 'guile-scheme-kill-process)
-
- (put 'comment-region 'menu-enable 'mark-active)
- (put 'uncomment-region 'menu-enable 'mark-active)
- (put 'indent-region 'menu-enable 'mark-active)))
-
-(defcustom guile-scheme-mode-hook nil
- "Normal hook run when entering `guile-scheme-mode'."
- :type 'hook
- :group 'guile-scheme)
-
-;;;###autoload
-(defun guile-scheme-mode ()
- "Major mode for editing Guile Scheme code.
-Editing commands are similar to those of `scheme-mode'.
-
-\\{scheme-mode-map}
-Entry to this mode calls the value of `scheme-mode-hook'
-if that value is non-nil."
- (interactive)
- (kill-all-local-variables)
- (setq mode-name "Guile Scheme")
- (setq major-mode 'guile-scheme-mode)
- (use-local-map guile-scheme-mode-map)
- (scheme-mode-variables)
- (setq mode-line-process
- '(:eval (if (processp guile-scheme-adapter)
- (format " [%s]" guile-scheme-command)
- "")))
- (setq font-lock-defaults
- '((guile-scheme-font-lock-keywords)
- nil t (("+-*/.<>=!?$%_&~^:@" . "w")) beginning-of-defun
- (font-lock-mark-block-function . mark-defun)))
- (run-hooks 'guile-scheme-mode-hook))
-
-
-;;;
-;;; Scheme interaction mode
-;;;
-
-(defvar scheme-interaction-mode-map ()
- "Keymap for Scheme Interaction mode.
-All commands in `guile-scheme-mode-map' are inherited by this map.")
-
-(unless scheme-interaction-mode-map
- (let ((map (make-sparse-keymap)))
- (setq scheme-interaction-mode-map map)
- (set-keymap-parent map guile-scheme-mode-map)
- (define-key map "\C-j" 'guile-scheme-eval-print-last-sexp)
- ))
-
-(defvar scheme-interaction-mode-hook nil
- "Normal hook run when entering `scheme-interaction-mode'.")
-
-(defun scheme-interaction-mode ()
- "Major mode for evaluating Scheme expressions with Guile.
-
-\\{scheme-interaction-mode-map}"
- (interactive)
- (guile-scheme-mode)
- (use-local-map scheme-interaction-mode-map)
- (setq major-mode 'scheme-interaction-mode)
- (setq mode-name "Scheme Interaction")
- (run-hooks 'scheme-interaction-mode-hook))
-
-
-;;;
-;;; Guile Scheme adapter
-;;;
-
-(defvar guile-scheme-command "guile")
-(defvar guile-scheme-adapter nil)
-(defvar guile-scheme-module nil)
-
-(defun guile-scheme-adapter ()
- (if (and (processp guile-scheme-adapter)
- (eq (process-status guile-scheme-adapter) 'run))
- guile-scheme-adapter
- (setq guile-scheme-module nil)
- (setq guile-scheme-adapter
- (guile:make-adapter guile-scheme-command 'emacs-scheme-channel))))
-
-(defun guile-scheme-set-module ()
- "Set the current module based on buffer contents.
-If there is a (define-module ...) form, evaluate it.
-Otherwise, choose module (guile-user)."
- (save-excursion
- (let ((module (if (re-search-backward "^(define-module " nil t)
- (let ((start (match-beginning 0)))
- (goto-char start)
- (forward-sexp)
- (buffer-substring-no-properties start (point)))
- "(define-module (emacs-user))")))
- (unless (string= guile-scheme-module module)
- (prog1 (guile:eval module (guile-scheme-adapter))
- (setq guile-scheme-module module))))))
-
-(defun guile-scheme-eval-string (string)
- (guile-scheme-set-module)
- (guile:eval string (guile-scheme-adapter)))
-
-(defun guile-scheme-display-result (value flag)
- (if (string= value "#<unspecified>")
- (setq value "done"))
- (if flag
- (insert value)
- (message "%s" value)))
-
-
-;;;
-;;; Interactive commands
-;;;
-
-(defun guile-scheme-eval-expression (string)
- "Evaluate the expression in STRING and show value in echo area."
- (interactive "SGuile Scheme Eval: ")
- (guile-scheme-display-result (guile-scheme-eval-string string) nil))
-
-(defun guile-scheme-eval-region (start end)
- "Evaluate the region as Guile Scheme code."
- (interactive "r")
- (guile-scheme-eval-expression (buffer-substring-no-properties start end)))
-
-(defun guile-scheme-eval-buffer ()
- "Evaluate the current buffer as Guile Scheme code."
- (interactive)
- (guile-scheme-eval-expression (buffer-string)))
-
-(defun guile-scheme-eval-last-sexp (arg)
- "Evaluate sexp before point; show value in echo area.
-With argument, print output into current buffer."
- (interactive "P")
- (guile-scheme-display-result
- (guile-scheme-eval-string
- (buffer-substring-no-properties
- (point) (save-excursion (backward-sexp) (point)))) arg))
-
-(defun guile-scheme-eval-print-last-sexp ()
- "Evaluate sexp before point; print value into current buffer."
- (interactive)
- (let ((start (point)))
- (guile-scheme-eval-last-sexp t)
- (insert "\n")
- (save-excursion (goto-char start) (insert "\n"))))
-
-(defun guile-scheme-eval-define ()
- (interactive)
- (guile-scheme-eval-region (save-excursion (end-of-defun) (point))
- (save-excursion (beginning-of-defun) (point))))
-
-(defun guile-scheme-load-file (file)
- "Load a Guile Scheme file."
- (interactive "fGuile Scheme load file: ")
- (guile-scheme-eval-string (format "(load %s)" (expand-file-name file)))
- (message "done"))
-
-(guile-import guile-emacs-complete-alist)
-
-(defun guile-scheme-complete-symbol ()
- (interactive)
- (let* ((end (point))
- (start (save-excursion (skip-syntax-backward "w_") (point)))
- (pattern (buffer-substring-no-properties start end))
- (alist (guile-emacs-complete-alist pattern)))
- (goto-char end)
- (let ((completion (try-completion pattern alist)))
- (cond ((eq completion t))
- ((not completion)
- (message "Can't find completion for \"%s\"" pattern)
- (ding))
- ((not (string= pattern completion))
- (delete-region start end)
- (insert completion))
- (t
- (message "Making completion list...")
- (with-output-to-temp-buffer "*Completions*"
- (display-completion-list alist))
- (message "Making completion list...done"))))))
-
-(guile-import guile-emacs-apropos)
-
-(defun guile-scheme-apropos (regexp)
- (interactive "sGuile Scheme apropos (regexp): ")
- (guile-scheme-set-module)
- (with-output-to-temp-buffer "*Help*"
- (princ (guile-emacs-apropos regexp))))
-
-(guile-import guile-emacs-describe)
-
-(defun guile-scheme-describe (symbol)
- (interactive (list (guile-scheme-input-symbol "Describe Guile variable")))
- (guile-scheme-set-module)
- (with-output-to-temp-buffer "*Help*"
- (princ (guile-emacs-describe symbol))))
-
-(defun guile-scheme-kill-process ()
- (interactive)
- (if guile-scheme-adapter
- (guile-process-kill guile-scheme-adapter))
- (setq guile-scheme-adapter nil))
-
-
-;;;
-;;; Internal functions
-;;;
-
-(guile-import apropos-internal guile-apropos-internal)
-
-(defvar guile-scheme-complete-table (make-vector 151 nil))
-
-(defun guile-scheme-input-symbol (prompt)
- (mapc (lambda (sym)
- (if (symbolp sym)
- (intern (symbol-name sym) guile-scheme-complete-table)))
- (guile-apropos-internal ""))
- (let* ((str (thing-at-point 'symbol))
- (default (if (intern-soft str guile-scheme-complete-table)
- (concat " (default " str ")")
- "")))
- (intern (completing-read (concat prompt default ": ")
- guile-scheme-complete-table nil t nil nil str))))
-
-
-;;;
-;;; Turn on guile-scheme-mode for .scm files by default.
-;;;
-
-(setq auto-mode-alist
- (cons '("\\.scm\\'" . guile-scheme-mode) auto-mode-alist))
-
-(provide 'guile-scheme)
-
-;;; guile-scheme.el ends here
diff --git a/emacs/guile.el b/emacs/guile.el
deleted file mode 100644
index 15f866fbb..000000000
--- a/emacs/guile.el
+++ /dev/null
@@ -1,215 +0,0 @@
-;;; guile.el --- Emacs Guile interface
-
-;; Copyright (C) 2001 Keisuke Nishida <kxn30@po.cwru.edu>
-
-;; GNU Emacs 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.
-
-;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
-
-;;; Code:
-
-(require 'cl)
-
-;;;
-;;; Low level interface
-;;;
-
-(defvar guile-emacs-file
- (catch 'return
- (mapc (lambda (dir)
- (let ((file (expand-file-name "guile-emacs.scm" dir)))
- (if (file-exists-p file) (throw 'return file))))
- load-path)
- (error "Cannot find guile-emacs.scm")))
-
-(defvar guile-channel-file
- (catch 'return
- (mapc (lambda (dir)
- (let ((file (expand-file-name "channel.scm" dir)))
- (if (file-exists-p file) (throw 'return file))))
- load-path)
- (error "Cannot find channel.scm")))
-
-(defvar guile-libs
- (nconc (if guile-channel-file (list "-l" guile-channel-file) '())
- (list "-l" guile-emacs-file)))
-
-;;;###autoload
-(defun guile:make-adapter (command channel)
- (let* ((buff (generate-new-buffer " *guile object channel*"))
- (libs (if guile-channel-file (list "-l" guile-channel-file) nil))
- (proc (apply 'start-process "guile-oa" buff command "-q" guile-libs)))
- (process-kill-without-query proc)
- (accept-process-output proc)
- (guile-process-require proc (format "(%s)\n" channel) "channel> ")
- proc))
-
-(put 'guile-error 'error-conditions '(guile-error error))
-(put 'guile-error 'error-message "Guile error")
-
-(defvar guile-token-tag "<guile>")
-
-(defun guile-tokenp (x) (and (consp x) (eq (car x) guile-token-tag)))
-
-;;;###autoload
-(defun guile:eval (string adapter)
- (condition-case error
- (let ((output (guile-process-require adapter (concat "eval " string "\n")
- "channel> ")))
- (cond
- ((string= output "") nil)
- ((string-match "^\\(\\(value\\)\\|\\(token\\)\\|\\(exception\\)\\) = "
- output)
- (cond
- ;; value
- ((match-beginning 2)
- (car (read-from-string (substring output (match-end 0)))))
- ;; token
- ((match-beginning 3)
- (cons guile-token-tag
- (car (read-from-string (substring output (match-end 0))))))
- ;; exception
- ((match-beginning 4)
- (signal 'guile-error
- (car (read-from-string (substring output (match-end 0))))))))
- (t
- (error "Unsupported result" output))))
- (quit
- (signal-process (process-id adapter) 'SIGINT)
- (signal 'quit nil))))
-
-
-;;;
-;;; Guile Lisp adapter
-;;;
-
-(defvar guile-lisp-command "guile")
-(defvar guile-lisp-adapter nil)
-
-(defvar true "#t")
-(defvar false "#f")
-
-(unless (boundp 'keywordp)
- (defun keywordp (x) (and (symbolp x) (eq (aref (symbol-name x) 0) ?:))))
-
-(defun guile-lisp-adapter ()
- (if (and (processp guile-lisp-adapter)
- (eq (process-status guile-lisp-adapter) 'run))
- guile-lisp-adapter
- (setq guile-lisp-adapter
- (guile:make-adapter guile-lisp-command 'emacs-lisp-channel))))
-
-(defun guile-lisp-convert (x)
- (cond
- ((or (eq x true) (eq x false)) x)
- ((null x) "'()")
- ((keywordp x) (concat "#" (prin1-to-string x)))
- ((stringp x) (prin1-to-string x))
- ((guile-tokenp x) (cadr x))
- ((consp x)
- (if (null (cdr x))
- (list (guile-lisp-convert (car x)))
- (cons (guile-lisp-convert (car x)) (guile-lisp-convert (cdr x)))))
- (t x)))
-
-;;;###autoload
-(defun guile-lisp-eval (form)
- (guile:eval (format "%s" (guile-lisp-convert form)) (guile-lisp-adapter)))
-
-(defun guile-lisp-flat-eval (&rest form)
- (let ((args (mapcar (lambda (x)
- (if (guile-tokenp x) (cadr x) (list 'quote x)))
- (cdr form))))
- (guile-lisp-eval (cons (car form) args))))
-
-;;;###autoload
-(defmacro guile-import (name &optional new-name &rest opts)
- `(guile-process-import ',name ',new-name ',opts))
-
-(defun guile-process-import (name new-name opts)
- (let ((real (or new-name name))
- (docs (if (memq :with-docs opts) true false)))
- (eval (guile-lisp-eval `(guile-emacs-export ',name ',real ,docs)))))
-
-;;;###autoload
-(defmacro guile-use-module (name)
- `(guile-lisp-eval '(use-modules ,name)))
-
-;;;###autoload
-(defmacro guile-import-module (name &rest opts)
- `(guile-process-import-module ',name ',opts))
-
-(defun guile-process-import-module (name opts)
- (unless (boundp 'guile-emacs-export-procedures)
- (guile-import guile-emacs-export-procedures))
- (let ((docs (if (memq :with-docs opts) true false)))
- (guile-lisp-eval `(use-modules ,name))
- (eval (guile-emacs-export-procedures name docs))
- name))
-
-
-;;;
-;;; Process handling
-;;;
-
-(defvar guile-process-output-start nil)
-(defvar guile-process-output-value nil)
-(defvar guile-process-output-finished nil)
-(defvar guile-process-output-separator nil)
-
-(defun guile-process-require (process string separator)
- (setq guile-process-output-value nil)
- (setq guile-process-output-finished nil)
- (setq guile-process-output-separator separator)
- (let (temp-buffer)
- (unless (process-buffer process)
- (setq temp-buffer (guile-temp-buffer))
- (set-process-buffer process temp-buffer))
- (with-current-buffer (process-buffer process)
- (goto-char (point-max))
- (insert string)
- (setq guile-process-output-start (point))
- (set-process-filter process 'guile-process-filter)
- (process-send-string process string)
- (while (not guile-process-output-finished)
- (unless (accept-process-output process 3)
- (when (> (point) guile-process-output-start)
- (display-buffer (current-buffer))
- (error "BUG in Guile object channel!!")))))
- (when temp-buffer
- (set-process-buffer process nil)
- (kill-buffer temp-buffer)))
- guile-process-output-value)
-
-(defun guile-process-filter (process string)
- (with-current-buffer (process-buffer process)
- (insert string)
- (forward-line -1)
- (if (< (point) guile-process-output-start)
- (goto-char guile-process-output-start))
- (when (re-search-forward guile-process-output-separator nil 0)
- (goto-char (match-beginning 0))
- (setq guile-process-output-value
- (buffer-substring guile-process-output-start (point)))
- (setq guile-process-output-finished t))))
-
-(defun guile-process-kill (process)
- (set-process-filter process nil)
- (delete-process process)
- (if (process-buffer process)
- (kill-buffer (process-buffer process))))
-
-(provide 'guile)
-
-;;; guile.el ends here
diff --git a/emacs/multistring.el b/emacs/multistring.el
deleted file mode 100644
index 7b0ef30c1..000000000
--- a/emacs/multistring.el
+++ /dev/null
@@ -1,222 +0,0 @@
-;;; multistring.el --- editing multiline strings.
-
-;; Copyright (C) 2000 Free Software Foundation, Inc.
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs 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.
-
-;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
-
-;;; Author: Mikael Djurfeldt <djurfeldt@nada.kth.se>
-
-;;; Commentary:
-
-;; Commands for editing multiline ANSI C compatible string literals.
-
-;;; Code:
-
-(defun ms-ansify-string (arg)
- "Convert a string literal spanning multiple lines into multiple literals.
-With no argument, convert the single string at point to multiple strings.
-With an argument, convert multiple strings to a single one.
-
-ANSI C doesn't allow a string literal to span multiple lines. This
-function makes editing of multiline strings easier.
-
-The programmer can edit a string spanning multiple lines and then use
-this function to convert it into multiple literals representing the
-original string through the ANSI C string concatenation feature:
-
- \"A string consisting of
- multiple
- lines.\"
-
-is converted into
-
- \"A string consisting of\n\"
- \"multiple\n\"
- \"lines\""
- (interactive "*P")
- (save-excursion
- (let (beg end)
- (save-restriction
- (ms-narrow-canonicalize-ansi-c-string)
- (if (not arg)
- (ms-break-string))
- (setq beg (point-min))
- (setq end (point-max)))
- (if (not arg)
- (c-indent-region beg end)))))
-
-(defun ms-pack-region (from to &optional unpack-flag)
- "Pack paragraphs into single lines and remove one newline after paragraphs.
-With no argument, do the conversion.
-With an argument, do the reverse.
-
-When doing the reverse conversion, \\[fill-region] is used to break up
-the text into multiple lines."
- (interactive "*r\nP")
- (save-excursion
- (save-restriction
- (narrow-to-region from to)
- (if (not unpack-flag)
- (ms-pack-buffer)
- (ms-unpack-buffer)))))
-
-(defun ms-pack-ansify-string (arg)
- "Pack text in a string literal and convert into multiple literals.
-With no argument, do the conversion.
-With an argument, do the reverse.
-
-This command has the combined effect of \\[ms-pack-region] and
-\\[ms-ansify-string]. It is typically used if you want to store
-entire paragraphs without newlines in an ANSI C literal, but want to
-split it into multiple literals in order for the program text to look
-sensible. Using the reverse command, you can \"unpack\" the text,
-edit it and repack the text using the forward conversion."
- (interactive "*P")
- (save-excursion
- (let (beg end)
- (save-restriction
- (ms-narrow-canonicalize-ansi-c-string)
- (if (not arg)
- (ms-break-string " " "" "\\n")
- (ms-unpack-buffer))
- (setq beg (point-min))
- (setq end (point-max)))
- (if (not arg)
- (c-indent-region beg end)))))
-
-(defun ms-pack-buffer ()
- "Pack paragraphs into single lines and remove one newline after paragraphs."
- (interactive "*")
- (goto-char (point-min))
- (skip-chars-forward "^\n")
- (while (not (eobp))
- (delete-char 1)
- (skip-chars-forward "\n")
- (skip-chars-forward "^\n")))
-
-(defun ms-unpack-buffer ()
- "Break single lines into paragraphs and add an extra newline between each."
- (interactive "*")
- (goto-char (point-min))
- (skip-chars-forward "^\n")
- (while (not (eobp))
- (insert ?\n)
- (skip-chars-forward "\n")
- (skip-chars-forward "^\n"))
- (fill-region (point-min) (point-max) nil t))
-
-(defconst ms-whitespace " \t\n")
-(defconst ms-string-beginning "\"")
-(defconst ms-string-end "\\(\\\\*\\)\"")
-(defconst ms-quoted-newline "\\(\\\\*\\)\\(\\\\n\\)")
-
-(defun ms-in-string-p ()
- (eq (c-in-literal) 'string))
-
-(defun ms-narrow-canonicalize-ansi-c-string ()
- ;; Find and check reference point
- (cond ((ms-in-string-p))
- ((eq (char-after) ?\") (forward-char))
- (t (error "Not in string.")))
- (set-mark (point))
- ;; Find beginning
- (ms-beginning-of-string)
- (let ((beg (point)))
- ;; Extend string backwards
- (while (ms-extend-backwards)
- (setq beg (point)))
- (goto-char (mark))
- ;; Find end
- (ms-end-of-string)
- (let ((end (point)))
- ;; Extend string forwards
- (while (ms-extend-forwards)
- (setq end (point)))
- ;; Narrow
- (narrow-to-region beg end)
- ;; Convert \n into explicit newlines
- (ms-convert-quoted-newlines))))
-
-(defun ms-beginning-of-string ()
- (let ((pos (search-backward ms-string-beginning nil t)))
- (while (and pos
- (char-before)
- (eq (char-before) ?\\))
- (setq pos (search-backward ms-string-beginning nil t)))
- (if pos
- (progn
- (forward-char)
- (1+ pos)))))
-
-(defun ms-extend-backwards ()
- (let ((end (point)))
- (backward-char)
- (skip-chars-backward ms-whitespace)
- (if (eq (char-before) ?\")
- (progn
- (backward-char)
- (delete-region (point) end)
- (ms-beginning-of-string)))))
-
-(defun ms-end-of-string ()
- (let ((pos (search-forward-regexp ms-string-end nil t)))
- (while (and pos (= (logand (- (match-end 1) (match-beginning 1)) 1) 1))
- (setq pos (search-forward-regexp ms-string-end nil t)))
- (if pos
- (progn
- (backward-char)
- (match-end 1)))))
-
-(defun ms-extend-forwards ()
- (let ((start (point)))
- (forward-char)
- (skip-chars-forward ms-whitespace)
- (if (eq (char-after) ?\")
- (progn
- (forward-char)
- (delete-region start (point))
- (ms-end-of-string)))))
-
-(defun ms-convert-quoted-newlines ()
- (goto-char (point-min))
- (while (search-forward-regexp ms-quoted-newline nil t)
- (if (= (logand (- (match-end 1) (match-beginning 1)) 1) 0)
- (replace-match "\n" nil t nil 2))))
-
-(defun ms-break-string (&optional single-term multi-term-1 multi-term-n)
- (let ((single-term (or single-term "\\n"))
- (multi-term-1 (or multi-term-1 "\\n"))
- (multi-term-n (or multi-term-n "\\n")))
- (goto-char (point-min))
- (skip-chars-forward "^\n")
- (while (not (eobp))
- (delete-char 1)
- (if (not (eq (char-after) ?\n))
- (insert single-term)
- (insert multi-term-1)
- (while (eq (char-after) ?\n)
- (delete-char 1)
- (insert multi-term-n)))
- (insert "\"\n\"")
- (skip-chars-forward "^\n"))))
-
-(eval-after-load "cc-mode"
- (progn
- (define-key c-mode-base-map "\C-ca" 'ms-ansify-string)
- (define-key c-mode-base-map "\C-cd" 'ms-pack-ansify-string)
- ))
diff --git a/emacs/patch.el b/emacs/patch.el
deleted file mode 100644
index 868310a80..000000000
--- a/emacs/patch.el
+++ /dev/null
@@ -1,106 +0,0 @@
-;;; patch.el --- mail/apply a patch
-
-;; Copyright (C) 2001 Free Software Foundation, Inc.
-
-;; GNU Emacs 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.
-
-;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
-
-;;; Author: Thien-Thi Nguyen <ttn@gnu.org>
-;;; Version: 1
-;;; Favorite-Favorite: Favorite-Favorite
-
-;;; Commentary:
-
-;; This file has two symmetrical usage modes, for patch creation and
-;; application, respectively. The details are somewhat tuned for Guile
-;; maintenance; probably we should generalize it a bit and add it to
-;; Emacs proper at some point in the future. Long live free software!
-;;
-;; On the patch creation side of things, there are various version
-;; control systems that are happy to write a diff to stdout (and
-;; numerous Emacs interfaces to them all). Thus, we provide only a
-;; simple `patch-send' that composes mail from the current buffer;
-;; the contents of that buffer are left as an exercise for the patch
-;; creator. When preparing the mail, `patch-send' scans the patch
-;; for standard filename headers and sets up a skeleton change log --
-;; filling this in is a good way to earn respect from maintainers (hint
-;; hint). Type `C-c C-c' to send the mail when you are done. (See
-;; `compose-mail' for more info.)
-;;
-;; TODO: Write/document patch-apply side of things.
-;; TODO: Integrate w/ `ediff-patch-buffer' et al.
-
-;;; Code:
-
-(require 'cl)
-(require 'update-changelog) ; for stitching
-
-;; outgoing
-
-(defvar patch-greeting "hello guile maintainers,\n\n"
- "*String to insert at beginning of patch mail.")
-
-(defun patch-scan-files ()
- (let (files)
- (save-excursion
- (while (re-search-forward "^[+][+][+] \\(\\S-+\\)" (point-max) t)
- (setq files (cons (cons (match-string 1)
- (match-beginning 0))
- files))))
- (reverse files)))
-
-(defun patch-common-prefix (filenames)
- (let* ((first-file (car filenames))
- (prefix (and first-file (file-name-directory first-file))))
- (while (and prefix
- (not (string= "" prefix))
- (not (every (lambda (filename)
- (string-match (concat "^" prefix) filename))
- filenames)))
- (setq prefix (file-name-directory (substring prefix 0 -1))))
- prefix))
-
-(defun patch-changelog-skeleton ()
- (let* ((file-info (patch-scan-files))
- (fullpath-files (mapcar 'car file-info))
- (cut (length (patch-common-prefix fullpath-files)))
- (files (mapcar (lambda (fullpath-file)
- (substring fullpath-file cut))
- fullpath-files)))
- (mapconcat
- (lambda (file)
- (concat (make-string (length file) ?_) "\n" file "\n[writeme]"))
- files
- "\n")))
-
-(defun patch-send (buffer subject)
- (interactive "bBuffer: \nsSubject: ")
- (when (string= "" subject)
- (error "(empty subject)"))
- (compose-mail "bug-guile@gnu.org" subject)
- (insert (with-current-buffer buffer (buffer-string)))
- (mail-text)
- (insert patch-greeting)
- (save-excursion
- (insert "here is a patch ... [overview/observations/etc]\n\n"
- (patch-changelog-skeleton) "\n\n\n"
- (make-string 72 ?_) "\n")))
-
-;; incoming
-
-
-
-
-;;; patch.el ends here
diff --git a/emacs/ppexpand.el b/emacs/ppexpand.el
deleted file mode 100644
index 39e113fba..000000000
--- a/emacs/ppexpand.el
+++ /dev/null
@@ -1,94 +0,0 @@
-;;; ppexpand.el --- temporarily expanding macros in a pretty way.
-
-;; Copyright (C) 2000 Free Software Foundation, Inc.
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs 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.
-
-;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
-
-;;; Author: Mikael Djurfeldt <djurfeldt@nada.kth.se>
-
-;;; Commentary:
-
-;; Commands for editing multiline ANSI C compatible string literals.
-
-;;; Code:
-(require 'cmacexp)
-
-(defvar if-mark "#if 0 /* PPEXPAND */")
-(defvar else-mark "#else /* PPEXPAND */")
-(defvar endif-mark "#endif /* PPEXPAND */")
-
-(define-key c-mode-map "\C-ce" 'ppexpand)
-
-(defun ppexpand (start end &optional undo)
- "Expand C macros in the region, using the C preprocessor.
-The expanded code is run through the `indent' command and inserted
-into the program next to the original code, using an #if/#else/#endif
-construct.
-
-Given a prefix argument, it reverts the change, removing the
-#if/#else/#endif construct and the expanded code.
-
-`c-macro-preprocessor' specifies the preprocessor to use.
-Prompt for arguments to the preprocessor \(e.g. `-DDEBUG -I ./include')
-if the user option `c-macro-prompt-flag' is non-nil.
-
-Noninteractive args are START, END, UNDO.
-For use inside Lisp programs, see also `c-macro-expansion'."
-
- (interactive (if current-prefix-arg
- (list nil nil t)
- (let ((pos1 (point))
- (pos2 (mark)))
- (if (< pos1 pos2)
- (list pos1 pos2 nil)
- (list pos2 pos1 nil)))))
- (let ((inbuf (current-buffer)))
- ;; Build the command string.
- (if c-macro-prompt-flag
- (setq c-macro-cppflags
- (read-string "Preprocessor arguments: "
- c-macro-cppflags)))
- (if undo
- (let ((pos (point)) if-pos else-pos endif-pos)
- (save-excursion
- (end-of-line)
- (if (not (and (setq if-pos (search-backward if-mark nil t))
- (setq else-pos (search-forward else-mark nil t))
- (setq endif-pos (search-forward endif-mark nil t))
- (<= if-pos pos)
- (< pos endif-pos)))
- (error "Not in ppexpanded region"))
- (let ((orig (buffer-substring (+ if-pos (length if-mark) 1)
- (- else-pos (length else-mark)))))
- (delete-region if-pos (+ endif-pos 1))
- (insert orig))))
- ;; Expand the macro.
- (let* ((expansion (c-macro-expansion start end
- (concat c-macro-preprocessor " "
- c-macro-cppflags) t))
- (orig (buffer-substring start end)))
- (setq expansion
- (with-temp-buffer
- (insert expansion)
- (call-process-region (point-min) (point-max) "indent"
- t ;delete the text
- t ;output --> current buffer
- )
- (buffer-string)))
- (delete-region start end)
- (insert if-mark ?\n orig else-mark ?\n expansion endif-mark ?\n)))))
diff --git a/emacs/update-changelog.el b/emacs/update-changelog.el
deleted file mode 100644
index f9e4ff2ac..000000000
--- a/emacs/update-changelog.el
+++ /dev/null
@@ -1,145 +0,0 @@
-;;; update-changelog.el --- stitch rcs2log output to ChangeLog
-
-;;; Copyright (C) 2001 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 program; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
-
-;;; Commentary:
-
-;; Usage: emacs -batch -l update-changelog.el
-;;
-;; This program is basically a wrapper around rcs2log, and inherits rcs2log's
-;; weaknesses, namely, the requirement that there be a checked out (working
-;; directory) copy. It would be nice if rcs2log grokked with the repository
-;; directly, but until then, we work around it by requiring the environment
-;; var `LOCAL_WORK_ROOT' to be defined. This should be a directory under
-;; which cvs modules are checked out.
-;;
-;; Flash! Newer versions of rcs2log do indeed understand the repository,
-;; and can be invoked with "-R" therein. We infer this if `LOCAL_WORK_ROOT'
-;; is not set, and use instead `CVSROOT'. At least one of these must be set.
-;;
-;; You can pass additional options to rcs2log using env var `RCS2LOG_OPTS'.
-;;
-;; Usage from a Lisp program:
-;; (ucl-update filename) -- Update FILENAME, a Change Log file
-
-;;; Code:
-
-;;;---------------------------------------------------------------------------
-;;; Variables
-
-(defvar ucl-o (or (getenv "RCS2LOG_OPTS") "")
- "Additional options to pass to rcs2log.")
-
-;;;---------------------------------------------------------------------------
-;;; Cleanup functions
-
-(defun ucl-stitch-new-old (new-old &rest ignore)
- "In a changelog buffer, remove redundancy around NEW-OLD point.
-The new text is before NEW-OLD point, and the old after."
- (goto-char new-old)
- (or (= new-old (point-max)) ; no old
- (let ((last-new
- (save-excursion
- (buffer-substring (re-search-backward "^[0-9]+") new-old))))
- (let ((has-diff (string-match "\n\tdiff.*-r" last-new))) ; ugh
- (and has-diff (setq last-new (substring last-new 0 has-diff))))
- (let ((overlap (search-forward last-new (point-max) t)))
- (and overlap (delete-region new-old overlap))))))
-
-;; Sometimes wannabe developers append diffs to their log entries.
-(defun ucl-omit-diffs (&rest ignore)
- "In a changelog buffer, delete diffs (assumed at end of entry)."
- (goto-char (point-min))
- (while (re-search-forward "^\tdiff .*-r" (point-max) t)
- (beginning-of-line)
- (delete-region (point)
- (save-excursion
- (if (re-search-forward "^[0-9]+" (point-max))
- (- (point) 4)
- (point-max))))))
-
-(defun ucl-space-out-entries (&rest ignore)
- "In a changelog buffer, ensure proper spacing between entries."
- (goto-char (point-max))
- (while (re-search-backward "^[0-9]+" (point-min) t)
- (unless (= (point) (point-min))
- (open-line 3) ; yuk
- (delete-blank-lines))))
-
-(defun ucl-kill-eol-white-space (&rest ignore)
- "In a changelog buffer, delete end-of-line white space."
- (goto-char (point-min))
- (while (re-search-forward "[ \t]+$" (point-max) t)
- (delete-region
- (match-beginning 0) (match-end 0))))
-
-(defvar ucl-cleanup-hook '(ucl-stitch-new-old
- ucl-omit-diffs
- ucl-space-out-entries
- ucl-kill-eol-white-space)
- "Hook run after combining the new fragment with the old changelog. These
-are called with the argument NEW-OLD, which is the buffer position at the
-boundary of the two pieces of text. This is suboptimal; we should use a
-marker so that munges on the text do not lose this position. The result is
-that currently, `ucl-stitch-new-old' must be called first because it depends
-on NEW-OLD, while the other cleanup funcs ignore it. (Sigh.)")
-
-;;;---------------------------------------------------------------------------
-;;; Update functions
-
-(defun ucl-root ()
- (let ((lwr (getenv "LOCAL_WORK_ROOT"))
- (cr (getenv "CVSROOT")))
- (concat (or lwr
- (and cr (progn
- (setq ucl-o (concat "-R " ucl-o)) ; hmm
- cr))
- (error "Must set env var LOCAL_WORK_ROOT or CVSROOT"))
- "/")))
-
-(defun ucl-update (filename)
- (interactive "fChangeLog: ")
- (let* ((ofile (expand-file-name filename))
- (cmd (concat "rcs2log " ucl-o " -c " ofile))
- (obuf "*ucl-work*"))
- (when (and (file-exists-p ofile)
- (progn
- (shell-command cmd obuf)
- (get-buffer obuf)))
- (save-excursion ; prevent default-directory hosing
- (set-buffer obuf)
- (unless (= 0 (buffer-size))
- (let ((new-old-boundary (point-max)))
- (goto-char new-old-boundary)
- (insert-file ofile)
- (run-hook-with-args 'ucl-cleanup-hook new-old-boundary))
- (or (= (buffer-size) (nth 7 (file-attributes ofile)))
- (let (make-backup-files) ; less clutter
- (write-file ofile))))
- (kill-buffer (current-buffer))))))
-
-;;;---------------------------------------------------------------------------
-;;; Load-time actions
-
-(when noninteractive ; only when `-batch'
- (or (ucl-update "ChangeLog")
- (message "Sorry, could not update ChangeLog in %s" default-directory)))
-
-(provide 'update-changelog)
-
-;;; update-changelog.el ends here
diff --git a/examples/.cvsignore b/examples/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/examples/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/examples/ChangeLog b/examples/ChangeLog
deleted file mode 100644
index f70742449..000000000
--- a/examples/ChangeLog
+++ /dev/null
@@ -1,144 +0,0 @@
-2001-07-24 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- All examples are now built and tested on `make installcheck'
- rather than `make check'.
-
-2001-07-19 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * box-dynamic-module/Makefile.am, box-dynamic/Makefile.am,
- box-module/Makefile.am, box/Makefile.am: Use $(top_srcdir) to get
- at GUILE_LOAD_PATH, and $(top_builddir) for the guile and
- guile-config programs and for the link paths. Add check.test to
- EXTRA_DIST.
-
- * box-dynamic-module/Makefile.am, box-dynamic/Makefile.am,
- box-module/Makefile.am, box/Makefile.am: Add -L../../qt to LIBS.
-
-2001-07-19 Rob Browning <rlb@defaultvalue.org>
-
- * box-module/.cvsignore: add .deps
-
- * box/.cvsignore: add .deps.
-
-2001-07-17 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * box-module/Makefile.am (TESTS): New variable.
- Create `box' on `make all'.
-
- * box-module/check.test, box-dynamic-module/check.test,
- * box-dynamic/check.test: New files.
-
- * box-dynamic/Makefile.am (libbox): Create box library on `make
- all'.
- (TESTS): New variable.
-
- * box/Makefile.am (TESTS): New variable.
- Create `box' program on `make all', use freshly built Guile for
- building.
-
- * box/check.test: New file.
-
- * modules/check.test, safe/check.test, scripts/check.test: Set
- GUILE_LOAD_PATH to make the tests run without installed Guile.
-
-2001-07-16 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * scripts/check.test: Add check for guile interpreter.
- Fix bug: Use `$guile' everywhere. Thanks to Martin Grabmueller.
-
-2001-07-16 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * modules/check.test, safe/check.test: New files.
-
- * modules/Makefile.am (TESTS), safe/Makefile.am (TESTS): New
- variables.
-
-2001-07-14 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * scripts/check.test: New file.
-
- * Makefile.am (TESTS): New var.
-
-2001-07-14 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * modules/main: Use :renamer for specifying renaming procedure.
-
-2001-07-10 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * scripts/hello (display-version, display-help): Fix comment; nfc.
-
-2001-07-09 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * box-dynamic/README: Corrected sample session.
-
- * box-module/box.c, box-dynamic-module/box.c, box-dynamic/box.c
- * box/box.c: scm_bits_t -> scm_t_bits.
-
-2001-06-18 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * box-dynamic-module/README: Use a better example for box-map, as
- suggested by Thomas Wawrzinek.
-
-2001-06-14 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * scripts/README, scripts/hello.scm, safe/untrusted.scm,
- safe/evil.scm, safe/README, modules/README, modules/main,
- modules/module-0.scm, modules/module-1.scm, modules/module-2.scm:
- Minor cleanup.
-
- * README: Added intro stuff, restructured a bit.
-
- * box-dynamic/README, box-module/README, box/README: Cleanup and
- restructuring.
-
- * box-dynamic-module/box-mixed.scm: New file, demonstrating usage
- of extension library functionality, but without exporting
- procedures from the library.
-
- Thanks to Thomas Wawrzinek for the idea and example code!
-
- * box-dynamic-module/box-module.scm: Add comments, export
- make-box, box-ref, box-set!.
-
- * box-dynamic-module/README: Integrate new module (box-mixed),
- restructure and cleanup a bit.
-
-2001-06-06 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * box-dynamic-module/box-module.scm: New file.
-
-2001-06-05 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * box-dynamic-module: New directory, implements the box type in a
- shared library and places the definitions in a C-only module.
-
- Thanks to Thomas Wawrzinek for this, too!
-
- * box-dynamic/box.c, box/box.c, box-dynamic-module/box.c,
- box-module/box.c (mark_box): Fixed typo in comment.
-
-2001-06-01 Rob Browning <rlb@cs.utexas.edu>
-
- * .cvsignore: here and in all subdirectories listing Makefile and
- Makefile.in.
-
-2001-05-31 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * box-dynamic: New directory, implements the box type in a shared
- library (aka extension)
-
- Thanks to Thomas Wawrzinek for patching box.c into an extension!
-
-2001-05-30 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * box-module: New directory, similar to box, but defines the
- primitives in a module (box-module) instead of defining them
- globally.
-
- * safe: New directory, explaining some aspects of using safe
- environments for evaluation.
-
-2001-05-29 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * New directory for Guile example code.
-
diff --git a/examples/Makefile.am b/examples/Makefile.am
deleted file mode 100644
index 504ba06ff..000000000
--- a/examples/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-## Process this file with Automake to create Makefile.in
-##
-## Copyright (C) 2001 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-SUBDIRS = scripts box box-module box-dynamic box-dynamic-module\
- modules safe
-
-EXTRA_DIST = README
diff --git a/examples/README b/examples/README
deleted file mode 100644
index 793d131c8..000000000
--- a/examples/README
+++ /dev/null
@@ -1,36 +0,0 @@
- -*- outline -*-
-
-* Overview
-
-This directory contains examples illustrating various aspects of Guile
-programming.
-
-If you plan writing Scheme programs, have a look at the `scripts'
-directory. To learn more about Guile modules, check out the `modules'
-directory, and maybe the `box-module' and `box-dynamic-module'
-directories, if you are into C programming or shared libraries,
-respectively. The `safe' directory contains examples for evaluation
-Scheme code in controlled environments (sandboxing). The directories
-`box', `box-module', `box-dynamic' and `box-dynamic-module' are
-interesting if you plan writing Guile extensions.
-
-See the README files in the subdirectories for details.
-
-
-* Included Examples
-
-scripts Examples for writing simple scripts in Guile Scheme.
-
-box Example for extending Guile with a new data type.
-
-box-module Similar to `box', but defines new procedures in a
- named module.
-box-dynamic Implements the box type in a dynamically loadable
- library.
-box-dynamic-module Combination of `box-module' and `box-dynamic':
- Implements the `box' type in a shared library and
- defines the procedures in a Guile module.
-
-modules Examples for writing and using Guile modules.
-
-safe Examples for creating and using safe environments.
diff --git a/examples/box-dynamic-module/.cvsignore b/examples/box-dynamic-module/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/examples/box-dynamic-module/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/examples/box-dynamic-module/Makefile.am b/examples/box-dynamic-module/Makefile.am
deleted file mode 100644
index 665a7de54..000000000
--- a/examples/box-dynamic-module/Makefile.am
+++ /dev/null
@@ -1,36 +0,0 @@
-## Process this file with Automake to create Makefile.in
-##
-## Copyright (C) 2001 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-EXTRA_DIST = README box.c box-module.scm box-mixed.scm check.test
-
-CFLAGS=`$(bindir)/guile-config compile`
-LIBS=`$(bindir)/guile-config link`
-
-libbox-module: box.lo
- sh ../../libtool --mode=link $(CC) $< $(LIBS) -rpath $(libdir) -o libbox-module.la
-
-box.lo: box.c
- sh ../../libtool --mode=compile $(CC) $(CFLAGS) -c $<
-
-installcheck: libbox-module
- LTDL_LIBRARY_PATH=.libs GUILE_LOAD_PATH=$(top_srcdir):$(srcdir) $(srcdir)/check.test
-
-CLEANFILES=libbox-module.la box.lo box.o
diff --git a/examples/box-dynamic-module/README b/examples/box-dynamic-module/README
deleted file mode 100644
index 9f285c6ca..000000000
--- a/examples/box-dynamic-module/README
+++ /dev/null
@@ -1,77 +0,0 @@
- -*- outline -*-
-
-* Overview
-
-This directory includes an example program for extending Guile with a
-new (and even useful) data type, putting it into a shared library, so it
-can be called from an unmodified guile interpreter. Further, the shared
-library defines a new guile module.
-
-
-* Build Instructions
-
-To build the example, simply type
-
- make libbox-module
-
-in this directory.
-
-
-* The Box Data Type
-
-A box is simply an object for storing one other object in. It can be
-used for passing parameters by reference, for example. You simply
-store an object into a box, pass it to another procedure which can
-store a new object into it and thus return a value via the box.
-
-
-** Usage
-
-Box objects are created with `make-box', set with `box-set!' and
-examined with `box-ref'. Note that these procedures are placed in a
-module called (box-module) and can thus only be accessed after using
-this module. See the following example session for usage details.
-
-
-** The Module (box-module)
-
-Extend your LD_LIBRARY_PATH variable (or equivalent) to include . and
-.libs and make sure that your current working directory is the one
-this file is contained in.
-
-$ guile
-guile> (use-modules (box-module))
-guile> (define b (make-box))
-guile> b
-#<box #f>
-guile> (box-set! b '(list of values))
-guile> b
-#<box (list of values)>
-guile> (box-ref b)
-(list of values)
-guile> (quit)
-$
-
-
-** The Module (box-mixed)
-
-The following example uses the module (box-mixed), also included in
-this directory. It uses the shared library libbox-module like the
-module (box-module) above, but does not export the procedures from
-that module. It only implements some procedures for dealing with box
-objects.
-
-$ guile
-guile> (use-modules (box-mixed))
-guile> (define bl (make-box-list 1 2 3))
-guile> bl
-(#<box 1> #<box 2> #<box 3>)
-guile> (box-map 1+ bl)
-(#<box 2> #<box 3> #<box 4>)
-guile> (quit)
-$
-
-If you like this example so much that you want to have it available
-for normal usage, install the dynamic libraries in the .libs directory
-to the directory $(prefix)/lib and the scheme file `box-module.scm' in
-a directory in your GUILE_LOAD_PATH.
diff --git a/examples/box-dynamic-module/box-mixed.scm b/examples/box-dynamic-module/box-mixed.scm
deleted file mode 100644
index 9e6135291..000000000
--- a/examples/box-dynamic-module/box-mixed.scm
+++ /dev/null
@@ -1,44 +0,0 @@
-;;; examples/box-dynamic-module/box-mixed.scm -- Scheme module using some
-;;; functionality from the shared library libbox-module, but do not
-;;; export procedures from the module.
-
-;;; Commentary:
-
-;;; This is the Scheme module box-mixed. It uses some functionality
-;;; from the shared library libbox-module, but does not export it.
-
-;;; Code:
-
-;;; Author: Thomas Wawrzinek
-;;; Date: 2001-06-08
-;;; Changed: 2001-06-14 by martin, some commenting, cleanup and integration.
-
-(define-module (box-mixed))
-
-;; First, load the library.
-;;
-(load-extension "libbox-module" "scm_init_box")
-
-;; Create a list of boxes, each containing one element from ARGS.
-;;
-(define (make-box-list . args)
- (map (lambda (el)
- (let ((b (make-box)))
- (box-set! b el) b))
- args))
-
-;; Map the procedure FUNC over all elements of LST, which must be a
-;; list of boxes. The result is a list of freshly allocated boxes,
-;; each containing the result of an application of FUNC.
-(define (box-map func lst)
- (map (lambda (el)
- (let ((b (make-box)))
- (box-set! b (func (box-ref el)))
- b))
- lst))
-
-;; Export the procedures, so that they can be used by others.
-;;
-(export make-box-list box-map)
-
-;;; End of file.
diff --git a/examples/box-dynamic-module/box-module.scm b/examples/box-dynamic-module/box-module.scm
deleted file mode 100644
index ab589ba1b..000000000
--- a/examples/box-dynamic-module/box-module.scm
+++ /dev/null
@@ -1,25 +0,0 @@
-;;; examples/box-dynamic-module/box-module.scm -- Scheme module exporting
-;;; some functionality from the shared library libbox-module.
-
-;;; Commentary:
-
-;;; This is the Scheme part of the dynamic library module (box-module).
-;;; When you do a (use-modules (box-module)) in this directory,
-;;; this file gets loaded and will load the compiled extension.
-
-;;; Code:
-
-;;; Author: Martin Grabmueller
-;;; Date: 2001-06-06
-
-(define-module (box-module))
-
-;; First, load the library.
-;;
-(load-extension "libbox-module" "scm_init_box")
-
-;; Then export the procedures which should be visible to module users.
-;;
-(export make-box box-ref box-set!)
-
-;;; End of file.
diff --git a/examples/box-dynamic-module/box.c b/examples/box-dynamic-module/box.c
deleted file mode 100644
index 180190e9e..000000000
--- a/examples/box-dynamic-module/box.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/* examples/box-dynamic-module/box.c
- *
- * Copyright (C) 1998,2001 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, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307 USA
- */
-
-/* Include all needed declarations. */
-#include <libguile.h>
-
-
-/* The type code for the newly created smob type will be stored into
- this variable. It has the prefix `scm_tc16_' to make it usable
- with the SCM_VALIDATE_SMOB macro below. */
-static scm_t_bits scm_tc16_box;
-
-
-/* This function is responsible for marking all SCM objects included
- in the smob. */
-static SCM
-mark_box (SCM b)
-{
- /* Since we have only one SCM object to protect, we simply return it
- and the caller will mark it. */
- return SCM_CELL_OBJECT_1 (b);
-}
-
-
-/* Print a textual represenation of the smob to a given port. */
-static int
-print_box (SCM b, SCM port, scm_print_state *pstate)
-{
- SCM value = SCM_CELL_OBJECT_1 (b);
-
- scm_puts ("#<box ", port);
- scm_write (value, port);
- scm_puts (">", port);
-
- /* Non-zero means success. */
- return 1;
-}
-
-
-/* This defines the primitve `make-box', which returns a new smob of
- type `box', initialized to `#f'. */
-static SCM
-#define FUNC_NAME "make-box"
-make_box (void)
-{
- /* This macro creates the new objects, stores the value `#f' into it
- and returns it to the caller. */
- SCM_RETURN_NEWSMOB (scm_tc16_box, SCM_BOOL_F);
-}
-#undef FUNC_NAME
-
-
-/* This is the primitive `box-ref' which returns the object stored in
- the box. */
-static SCM
-box_ref (SCM b)
-#define FUNC_NAME "box-ref"
-{
- /* First, we have to ensure that the user really gave us a box
- objects. The macro SCM_VALIDATE_SMOB will do all what is needed.
- The parameters are interpreted as follows:
-
- 1: The position of the checked variable in the parameter list.
- b: The passed parameter.
- box: Concatenated with the fixed prefix scm_tc16_, names the type
- code for the expected smob type. */
- SCM_VALIDATE_SMOB (1, b, box);
-
- /* Fetch the object from the box and return it. */
- return SCM_CELL_OBJECT_1 (b);
-}
-#undef FUNC_NAME
-
-
-/* Primitive which stores an arbitrary value into a box. */
-static SCM
-box_set_x (SCM b, SCM value)
-#define FUNC_NAME "box-set!"
-{
- SCM_VALIDATE_SMOB (1, b, box);
-
- /* Set the cell number 1 of the smob to the given value. */
- SCM_SET_CELL_OBJECT_1 (b, value);
-
- /* When this constant is returned, the REPL will not print the
- returned value. All procedures in Guile which are documented as
- returning `and unspecified value' actually return this value. */
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
-
-/* This is the function which must be given to `load-extension' as the
- second argument. In this example, the Scheme file box-module.scm
- (or box-mixed.scm) is responsible for doing the load-extension
- call. The Scheme modules are also responsible for placing the
- procedure definitions in the correct module. */
-void
-scm_init_box ()
-{
- scm_tc16_box = scm_make_smob_type ("box", 0);
- scm_set_smob_mark (scm_tc16_box, mark_box);
- scm_set_smob_print (scm_tc16_box, print_box);
-
- scm_c_define_gsubr ("make-box", 0, 0, 0, make_box);
- scm_c_define_gsubr ("box-set!", 2, 0, 0, box_set_x);
- scm_c_define_gsubr ("box-ref", 1, 0, 0, box_ref);
-}
-
-/* End of file. */
diff --git a/examples/box-dynamic-module/check.test b/examples/box-dynamic-module/check.test
deleted file mode 100755
index 935176d20..000000000
--- a/examples/box-dynamic-module/check.test
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/sh
-
-# must be run from this directory
-guile=${GUILE-../../libguile/guile}
-
-set -e
-
-#
-# ./box test #1
-#
-$guile -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline)))' > TMP
-cat <<EOF | diff -u - TMP
-#<box #f>
-EOF
-rm -f TMP
-
-#
-# ./box test #2
-#
-$guile -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline)))' > TMP
-cat <<EOF | diff -u - TMP
-#<box #f>
-#<box 1>
-EOF
-rm -f TMP
-
-#
-# ./box test #3
-#
-$guile -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline) (display (box-ref b)) (newline)))' > TMP
-cat <<EOF | diff -u - TMP
-#<box #f>
-#<box 1>
-1
-EOF
-rm -f TMP
-
-#
-# ./box test #4
-#
-$guile -c '(begin (use-modules (box-mixed)) (let ((b (make-box-list 1 2 3))) (display b) (newline) (display (box-map 1+ b)) (newline)))' > TMP
-cat <<EOF | diff -u - TMP
-(#<box 1> #<box 2> #<box 3>)
-(#<box 2> #<box 3> #<box 4>)
-EOF
-rm -f TMP
-
-# check.test ends here
diff --git a/examples/box-dynamic/.cvsignore b/examples/box-dynamic/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/examples/box-dynamic/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/examples/box-dynamic/Makefile.am b/examples/box-dynamic/Makefile.am
deleted file mode 100644
index 574eadb85..000000000
--- a/examples/box-dynamic/Makefile.am
+++ /dev/null
@@ -1,36 +0,0 @@
-## Process this file with Automake to create Makefile.in
-##
-## Copyright (C) 2001 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-EXTRA_DIST = README box.c check.test
-
-CFLAGS=`$(bindir)/guile-config compile`
-LIBS=`$(bindir)/guile-config link`
-
-libbox: box.lo
- sh ../../libtool --mode=link $(CC) $< $(LIBS) -rpath $(libdir) -o libbox.la
-
-box.lo: box.c
- sh ../../libtool --mode=compile $(CC) $(CFLAGS) -c $<
-
-installcheck: libbox
- LTDL_LIBRARY_PATH=.libs GUILE_LOAD_PATH=$(top_srcdir):$(srcdir) $(srcdir)/check.test
-
-CLEANFILES=libbox.la box.lo box.o
diff --git a/examples/box-dynamic/README b/examples/box-dynamic/README
deleted file mode 100644
index 7acc9f432..000000000
--- a/examples/box-dynamic/README
+++ /dev/null
@@ -1,58 +0,0 @@
- -*- outline -*-
-
-* Overview
-
-This directory includes an example program for extending Guile with a
-new (and even useful) data type, putting it into a shared library, so it
-can be called from an unmodified guile interpreter.
-
-
-* Build Instructions
-
-To build the example, simply type
-
- make libbox
-
-in this directory.
-
-
-* The Box Data Type
-
-A box is simply an object for storing one other object in. It can be
-used for passing parameters by reference, for example. You simply
-store an object into a box, pass it to another procedure which can
-store a new object into it and thus return a value via the box.
-
-
-** Usage
-
-Box objects are created with `make-box', set with `box-set!' and
-examined with `box-ref'. Note that these procedures are placed in a
-module called (box-module) and can thus only be accessed after using
-this module. See the following example session for usage details:
-
-Extend your LD_LIBRARY_PATH variable (or equivalent) to include . and
-.libs
-
-
-** Example Session
-
-$ guile
-guile> (load-extension "libbox" "scm_init_box")
-guile> (define b (make-box))
-guile> b
-#<box #f>
-guile> (box-set! b '(list of values))
-guile> b
-#<box (list of values)>
-guile> (box-ref b)
-(list of values)
-guile> (quit)
-$
-
-
-* Module Installation
-
-If you like this example so much that you want to have it available
-for normal usage, install the dynamic libraries in the .libs directory
-to the directory $(prefix)/lib
diff --git a/examples/box-dynamic/box.c b/examples/box-dynamic/box.c
deleted file mode 100644
index 9379b86a5..000000000
--- a/examples/box-dynamic/box.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/* examples/box-dynamic/box.c
- *
- * Copyright (C) 1998,2001 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, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307 USA
- */
-
-/* Include all needed declarations. */
-#include <libguile.h>
-
-
-/* The type code for the newly created smob type will be stored into
- this variable. It has the prefix `scm_tc16_' to make it usable
- with the SCM_VALIDATE_SMOB macro below. */
-static scm_t_bits scm_tc16_box;
-
-
-/* This function is responsible for marking all SCM objects included
- in the smob. */
-static SCM
-mark_box (SCM b)
-{
- /* Since we have only one SCM object to protect, we simply return it
- and the caller will mark it. */
- return SCM_CELL_OBJECT_1 (b);
-}
-
-
-/* Print a textual represenation of the smob to a given port. */
-static int
-print_box (SCM b, SCM port, scm_print_state *pstate)
-{
- SCM value = SCM_CELL_OBJECT_1 (b);
-
- scm_puts ("#<box ", port);
- scm_write (value, port);
- scm_puts (">", port);
-
- /* Non-zero means success. */
- return 1;
-}
-
-
-/* This defines the primitve `make-box', which returns a new smob of
- type `box', initialized to `#f'. */
-static SCM
-#define FUNC_NAME "make-box"
-make_box (void)
-{
- /* This macro creates the new objects, stores the value `#f' into it
- and returns it to the caller. */
- SCM_RETURN_NEWSMOB (scm_tc16_box, SCM_BOOL_F);
-}
-#undef FUNC_NAME
-
-
-/* This is the primitive `box-ref' which returns the object stored in
- the box. */
-static SCM
-box_ref (SCM b)
-#define FUNC_NAME "box-ref"
-{
- /* First, we have to ensure that the user really gave us a box
- objects. The macro SCM_VALIDATE_SMOB will do all what is needed.
- The parameters are interpreted as follows:
-
- 1: The position of the checked variable in the parameter list.
- b: The passed parameter.
- box: Concatenated with the fixed prefix scm_tc16_, names the type
- code for the expected smob type. */
- SCM_VALIDATE_SMOB (1, b, box);
-
- /* Fetch the object from the box and return it. */
- return SCM_CELL_OBJECT_1 (b);
-}
-#undef FUNC_NAME
-
-
-/* Primitive which stores an arbitrary value into a box. */
-static SCM
-box_set_x (SCM b, SCM value)
-#define FUNC_NAME "box-set!"
-{
- SCM_VALIDATE_SMOB (1, b, box);
-
- /* Set the cell number 1 of the smob to the given value. */
- SCM_SET_CELL_OBJECT_1 (b, value);
-
- /* When this constant is returned, the REPL will not print the
- returned value. All procedures in Guile which are documented as
- returning `and unspecified value' actually return this value. */
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
-
-/* Create and initialize the new smob type, and register the
- primitives with the interpreter library.
-
- To be called with (load-extension "libbox" "scm_init_box")
- from a script.
-*/
-void
-scm_init_box ()
-{
- scm_tc16_box = scm_make_smob_type ("box", 0);
- scm_set_smob_mark (scm_tc16_box, mark_box);
- scm_set_smob_print (scm_tc16_box, print_box);
-
- scm_c_define_gsubr ("make-box", 0, 0, 0, make_box);
- scm_c_define_gsubr ("box-set!", 2, 0, 0, box_set_x);
- scm_c_define_gsubr ("box-ref", 1, 0, 0, box_ref);
-}
-
-/* End of file. */
diff --git a/examples/box-dynamic/check.test b/examples/box-dynamic/check.test
deleted file mode 100755
index c0923365c..000000000
--- a/examples/box-dynamic/check.test
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-
-# must be run from this directory
-guile=${GUILE-../../libguile/guile}
-
-set -e
-
-#
-# ./box test #1
-#
-$guile -c '(begin (load-extension "libbox" "scm_init_box") (let ((b (make-box))) (display b) (newline)))' > TMP
-cat <<EOF | diff -u - TMP
-#<box #f>
-EOF
-rm -f TMP
-
-#
-# ./box test #2
-#
-$guile -c '(begin (load-extension "libbox" "scm_init_box") (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline)))' > TMP
-cat <<EOF | diff -u - TMP
-#<box #f>
-#<box 1>
-EOF
-rm -f TMP
-
-#
-# ./box test #3
-#
-$guile -c '(begin (load-extension "libbox" "scm_init_box") (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline) (display (box-ref b)) (newline)))' > TMP
-cat <<EOF | diff -u - TMP
-#<box #f>
-#<box 1>
-1
-EOF
-rm -f TMP
-
-# check.test ends here
diff --git a/examples/box-module/.cvsignore b/examples/box-module/.cvsignore
deleted file mode 100644
index 051d1bd50..000000000
--- a/examples/box-module/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-Makefile
-Makefile.in
-.deps
diff --git a/examples/box-module/Makefile.am b/examples/box-module/Makefile.am
deleted file mode 100644
index 3fe82e7cd..000000000
--- a/examples/box-module/Makefile.am
+++ /dev/null
@@ -1,36 +0,0 @@
-## Process this file with Automake to create Makefile.in
-##
-## Copyright (C) 2001 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-EXTRA_DIST = README box.c check.test
-
-CFLAGS=`$(bindir)/guile-config compile`
-LIBS=`$(bindir)/guile-config link`
-
-box: box.o
- $(CC) $< $(LIBS) -o box
-
-box.o: box.c
- $(CC) $(CFLAGS) -c $<
-
-installcheck: box
- LD_LIBRARY_PATH=$(libdir) GUILE_LOAD_PATH=$(top_srcdir) $(srcdir)/check.test
-
-CLEANFILES=box box.o
diff --git a/examples/box-module/README b/examples/box-module/README
deleted file mode 100644
index e1f1cd7af..000000000
--- a/examples/box-module/README
+++ /dev/null
@@ -1,56 +0,0 @@
- -*- outline -*-
-
-* Overview
-
-This directory includes an example program for extending Guile with a
-new (and even useful) data type.
-
-The `box' program created by this example is nearly identical to the
-one produced in directory ../box, with one (important) difference: The
-interpreter in this directory will place all defined primitive
-procedures in a module called (box-module). That means that this
-module must be used before the primitives can be accessed.
-
-
-* Build Instructions
-
-To build the example, simply type
-
- make box
-
-in this directory.
-
-The resulting `box' program is a Guile interpreter which has one
-additional data type called `box'.
-
-
-* The Box Data Type
-
-A box is simply an object for storing one other object in. It can be
-used for passing parameters by reference, for example. You simply
-store an object into a box, pass it to another procedure which can
-store a new object into it and thus return a value via the box.
-
-
-** Usage
-
-Box objects are created with `make-box', set with `box-set!' and
-examined with `box-ref'. Note that these procedures are placed in a
-module called (box-module) and can thus only be accessed after using
-this module. See the following example session for usage details:
-
-
-** Example Session
-
-$ ./box
-guile> (use-modules (box-module))
-guile> (define b (make-box))
-guile> b
-#<box #f>
-guile> (box-set! b '(list of values))
-guile> b
-#<box (list of values)>
-guile> (box-ref b)
-(list of values)
-guile> (quit)
-$
diff --git a/examples/box-module/box.c b/examples/box-module/box.c
deleted file mode 100644
index 90f6881dd..000000000
--- a/examples/box-module/box.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/* examples/box-module/box.c
- *
- * Copyright (C) 1998,2001 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, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307 USA
- */
-
-/* Include all needed declarations. */
-#include <libguile.h>
-
-
-/* The type code for the newly created smob type will be stored into
- this variable. It has the prefix `scm_tc16_' to make it usable
- with the SCM_VALIDATE_SMOB macro below. */
-static scm_t_bits scm_tc16_box;
-
-
-/* This function is responsible for marking all SCM objects included
- in the smob. */
-static SCM
-mark_box (SCM b)
-{
- /* Since we have only one SCM object to protect, we simply return it
- and the caller will mark it. */
- return SCM_CELL_OBJECT_1 (b);
-}
-
-
-/* Print a textual represenation of the smob to a given port. */
-static int
-print_box (SCM b, SCM port, scm_print_state *pstate)
-{
- SCM value = SCM_CELL_OBJECT_1 (b);
-
- scm_puts ("#<box ", port);
- scm_write (value, port);
- scm_puts (">", port);
-
- /* Non-zero means success. */
- return 1;
-}
-
-
-/* This defines the primitve `make-box', which returns a new smob of
- type `box', initialized to `#f'. */
-static SCM
-#define FUNC_NAME "make-box"
-make_box (void)
-{
- /* This macro creates the new objects, stores the value `#f' into it
- and returns it to the caller. */
- SCM_RETURN_NEWSMOB (scm_tc16_box, SCM_BOOL_F);
-}
-#undef FUNC_NAME
-
-
-/* This is the primitive `box-ref' which returns the object stored in
- the box. */
-static SCM
-box_ref (SCM b)
-#define FUNC_NAME "box-ref"
-{
- /* First, we have to ensure that the user really gave us a box
- objects. The macro SCM_VALIDATE_SMOB will do all what is needed.
- The parameters are interpreted as follows:
-
- 1: The position of the checked variable in the parameter list.
- b: The passed parameter.
- box: Concatenated with the fixed prefix scm_tc16_, names the type
- code for the expected smob type. */
- SCM_VALIDATE_SMOB (1, b, box);
-
- /* Fetch the object from the box and return it. */
- return SCM_CELL_OBJECT_1 (b);
-}
-#undef FUNC_NAME
-
-
-/* Primitive which stores an arbitrary value into a box. */
-static SCM
-box_set_x (SCM b, SCM value)
-#define FUNC_NAME "box-set!"
-{
- SCM_VALIDATE_SMOB (1, b, box);
-
- /* Set the cell number 1 of the smob to the given value. */
- SCM_SET_CELL_OBJECT_1 (b, value);
-
- /* When this constant is returned, the REPL will not print the
- returned value. All procedures in Guile which are documented as
- returning `and unspecified value' actually return this value. */
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
-
-/* Create and initialize the new smob type, and register the
- primitives withe the interpreter library.
-
- This function must be declared a bit different from the example in
- the ../box directory, because it will be called by
- `scm_c_define_module', called from below. */
-static void
-init_box_type (void * unused)
-{
- scm_tc16_box = scm_make_smob_type ("box", 0);
- scm_set_smob_mark (scm_tc16_box, mark_box);
- scm_set_smob_print (scm_tc16_box, print_box);
-
- scm_c_define_gsubr ("make-box", 0, 0, 0, make_box);
- scm_c_define_gsubr ("box-set!", 2, 0, 0, box_set_x);
- scm_c_define_gsubr ("box-ref", 1, 0, 0, box_ref);
-
- /* This is new too: Since the procedures are now in a module, we
- have to explicitly export them before they can be used. */
- scm_c_export ("make-box", "box-set!", "box-ref", NULL);
-}
-
-
-/* This is the function which gets called by scm_boot_guile after the
- Guile library is completely initialized. */
-static void
-inner_main (void *closure, int argc, char **argv)
-{
- /* Unlike the example in ../box, init_box_type is not called
- directly, but by scm_c_define_module, which will create a module
- named (box-module) and make this module current while called
- init_box_type, thus placing the definitions into that module. */
- scm_c_define_module ("box-module", init_box_type, NULL);
-
- /* ... then we start a shell, in which the box data type can be
- used (after using the module (box-module)). */
- scm_shell (argc, argv);
-}
-
-
-/* Main program. */
-int
-main (int argc, char **argv)
-{
- /* Initialize Guile, then call `inner_main' with the arguments 0,
- argc and argv. */
- scm_boot_guile (argc, argv, inner_main, 0);
- return 0; /* Never reached. */
-}
-
-/* End of file. */
diff --git a/examples/box-module/check.test b/examples/box-module/check.test
deleted file mode 100755
index 28a79d45b..000000000
--- a/examples/box-module/check.test
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-
-# must be run from this directory
-guile=${GUILE-../../libguile/guile}
-
-set -e
-
-#
-# ./box test #1
-#
-./box -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline)))' > TMP
-cat <<EOF | diff -u - TMP
-#<box #f>
-EOF
-rm -f TMP
-
-#
-# ./box test #2
-#
-./box -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline)))' > TMP
-cat <<EOF | diff -u - TMP
-#<box #f>
-#<box 1>
-EOF
-rm -f TMP
-
-#
-# ./box test #3
-#
-./box -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline) (display (box-ref b)) (newline)))' > TMP
-cat <<EOF | diff -u - TMP
-#<box #f>
-#<box 1>
-1
-EOF
-rm -f TMP
-
-# check.test ends here
diff --git a/examples/box/.cvsignore b/examples/box/.cvsignore
deleted file mode 100644
index 051d1bd50..000000000
--- a/examples/box/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-Makefile
-Makefile.in
-.deps
diff --git a/examples/box/Makefile.am b/examples/box/Makefile.am
deleted file mode 100644
index 3fe82e7cd..000000000
--- a/examples/box/Makefile.am
+++ /dev/null
@@ -1,36 +0,0 @@
-## Process this file with Automake to create Makefile.in
-##
-## Copyright (C) 2001 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-EXTRA_DIST = README box.c check.test
-
-CFLAGS=`$(bindir)/guile-config compile`
-LIBS=`$(bindir)/guile-config link`
-
-box: box.o
- $(CC) $< $(LIBS) -o box
-
-box.o: box.c
- $(CC) $(CFLAGS) -c $<
-
-installcheck: box
- LD_LIBRARY_PATH=$(libdir) GUILE_LOAD_PATH=$(top_srcdir) $(srcdir)/check.test
-
-CLEANFILES=box box.o
diff --git a/examples/box/README b/examples/box/README
deleted file mode 100644
index fb0ef1305..000000000
--- a/examples/box/README
+++ /dev/null
@@ -1,48 +0,0 @@
- -*- outline -*-
-
-* Overview
-
-This directory includes an example program for extending Guile with a
-new (and even useful) data type.
-
-
-* Build Instructions
-
-To build the example, simply type
-
- make box
-
-in this directory.
-
-The resulting `box' program is a Guile interpreter which has one
-additional data type called `box'.
-
-
-* The Box Data Type
-
-A box is simply an object for storing one other object in. It can be
-used for passing parameters by reference, for example. You simply
-store an object into a box, pass it to another procedure which can
-store a new object into it and thus return a value via the box.
-
-
-** Usage
-
-Box objects are created with `make-box', set with `box-set!' and
-examined with `box-ref'. See the following example session for usage
-details:
-
-
-** Example Session
-
-$ ./box
-guile> (define b (make-box))
-guile> b
-#<box #f>
-guile> (box-set! b '(list of values))
-guile> b
-#<box (list of values)>
-guile> (box-ref b)
-(list of values)
-guile> (quit)
-$
diff --git a/examples/box/box.c b/examples/box/box.c
deleted file mode 100644
index e526fa880..000000000
--- a/examples/box/box.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/* examples/box/box.c
- *
- * Copyright (C) 1998,2001 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, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307 USA
- */
-
-/* Include all needed declarations. */
-#include <libguile.h>
-
-
-/* The type code for the newly created smob type will be stored into
- this variable. It has the prefix `scm_tc16_' to make it usable
- with the SCM_VALIDATE_SMOB macro below. */
-static scm_t_bits scm_tc16_box;
-
-
-/* This function is responsible for marking all SCM objects included
- in the smob. */
-static SCM
-mark_box (SCM b)
-{
- /* Since we have only one SCM object to protect, we simply return it
- and the caller will mark it. */
- return SCM_CELL_OBJECT_1 (b);
-}
-
-
-/* Print a textual represenation of the smob to a given port. */
-static int
-print_box (SCM b, SCM port, scm_print_state *pstate)
-{
- SCM value = SCM_CELL_OBJECT_1 (b);
-
- scm_puts ("#<box ", port);
- scm_write (value, port);
- scm_puts (">", port);
-
- /* Non-zero means success. */
- return 1;
-}
-
-
-/* This defines the primitve `make-box', which returns a new smob of
- type `box', initialized to `#f'. */
-static SCM
-#define FUNC_NAME "make-box"
-make_box (void)
-{
- /* This macro creates the new objects, stores the value `#f' into it
- and returns it to the caller. */
- SCM_RETURN_NEWSMOB (scm_tc16_box, SCM_BOOL_F);
-}
-#undef FUNC_NAME
-
-
-/* This is the primitive `box-ref' which returns the object stored in
- the box. */
-static SCM
-box_ref (SCM b)
-#define FUNC_NAME "box-ref"
-{
- /* First, we have to ensure that the user really gave us a box
- objects. The macro SCM_VALIDATE_SMOB will do all what is needed.
- The parameters are interpreted as follows:
-
- 1: The position of the checked variable in the parameter list.
- b: The passed parameter.
- box: Concatenated with the fixed prefix scm_tc16_, names the type
- code for the expected smob type. */
- SCM_VALIDATE_SMOB (1, b, box);
-
- /* Fetch the object from the box and return it. */
- return SCM_CELL_OBJECT_1 (b);
-}
-#undef FUNC_NAME
-
-
-/* Primitive which stores an arbitrary value into a box. */
-static SCM
-box_set_x (SCM b, SCM value)
-#define FUNC_NAME "box-set!"
-{
- SCM_VALIDATE_SMOB (1, b, box);
-
- /* Set the cell number 1 of the smob to the given value. */
- SCM_SET_CELL_OBJECT_1 (b, value);
-
- /* When this constant is returned, the REPL will not print the
- returned value. All procedures in Guile which are documented as
- returning `and unspecified value' actually return this value. */
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
-
-/* Create and initialize the new smob type, and register the
- primitives withe the interpreter library. */
-static void
-init_box_type (void)
-{
- scm_tc16_box = scm_make_smob_type ("box", 0);
- scm_set_smob_mark (scm_tc16_box, mark_box);
- scm_set_smob_print (scm_tc16_box, print_box);
-
- scm_c_define_gsubr ("make-box", 0, 0, 0, make_box);
- scm_c_define_gsubr ("box-set!", 2, 0, 0, box_set_x);
- scm_c_define_gsubr ("box-ref", 1, 0, 0, box_ref);
-}
-
-
-/* This is the function which gets called by scm_boot_guile after the
- Guile library is completely initialized. */
-static void
-inner_main (void *closure, int argc, char **argv)
-{
- /* First, we create our data type... */
- init_box_type ();
- /* ... then we start a shell, in which the box data type can be
- used. */
- scm_shell (argc, argv);
-}
-
-
-/* Main program. */
-int
-main (int argc, char **argv)
-{
- /* Initialize Guile, then call `inner_main' with the arguments 0,
- argc and argv. */
- scm_boot_guile (argc, argv, inner_main, 0);
- return 0; /* Never reached. */
-}
-
-/* End of file. */
diff --git a/examples/box/check.test b/examples/box/check.test
deleted file mode 100755
index 1909ffb7e..000000000
--- a/examples/box/check.test
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-
-# must be run from this directory
-guile=${GUILE-../../libguile/guile}
-
-set -e
-
-#
-# ./box test #1
-#
-./box -c '(let ((b (make-box))) (display b) (newline))' > TMP
-cat <<EOF | diff -u - TMP
-#<box #f>
-EOF
-rm -f TMP
-
-#
-# ./box test #2
-#
-./box -c '(let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline))' > TMP
-cat <<EOF | diff -u - TMP
-#<box #f>
-#<box 1>
-EOF
-rm -f TMP
-
-#
-# ./box test #3
-#
-./box -c '(let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline) (display (box-ref b)) (newline))' > TMP
-cat <<EOF | diff -u - TMP
-#<box #f>
-#<box 1>
-1
-EOF
-rm -f TMP
-
-# check.test ends here
diff --git a/examples/modules/.cvsignore b/examples/modules/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/examples/modules/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/examples/modules/Makefile.am b/examples/modules/Makefile.am
deleted file mode 100644
index a6a9e0e03..000000000
--- a/examples/modules/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-## Process this file with Automake to create Makefile.in
-##
-## Copyright (C) 2001 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-EXTRA_DIST = README module-0.scm module-1.scm module-2.scm main check.test
-
-installcheck:
- srcdir=$(srcdir) GUILE_LOAD_PATH=$(top_srcdir):$(srcdir) $(srcdir)/check.test
diff --git a/examples/modules/README b/examples/modules/README
deleted file mode 100644
index ddad881cc..000000000
--- a/examples/modules/README
+++ /dev/null
@@ -1,32 +0,0 @@
- -*- outline -*-
-
-* Overview
-
-This directory includes examples which show how to write and use Guile
-modules in Scheme programs.
-
-The descriptions below assume that you have a working copy of Guile
-installed and available with the standard installation prefix
-`/usr/local'.
-
-
-* Included Examples
-
-
-** main
-
- The main program, which uses the modules described below to perform
- some actions. Module usage and selective importing as well as
- renaming is demonstrated here.n
-
- $ ./main
-
- or
-
- guile -s main
-
-** module-0.scm, module-1.scm, module-2.scm
-
- Two modules which export several procedure, some of which have the
- same names (so that renaming/selection is required for proper
- importing).
diff --git a/examples/modules/check.test b/examples/modules/check.test
deleted file mode 100755
index f7a789b69..000000000
--- a/examples/modules/check.test
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-# must be run from this directory
-guile=${GUILE-../../libguile/guile}
-
-if test "X$srcdir" = X; then
- srcdir=.
-fi
-
-set -e
-
-#
-# ./main test
-#
-$guile -s $srcdir/main > TMP
-cat <<EOF | diff -u - TMP
-module-0 foo
-module-0 bar
-module-1 foo
-module-1 bar
-module-2 braz
-module-2 braz
-module-2 foo
-EOF
-rm -f TMP
-
-# check.test ends here
diff --git a/examples/modules/main b/examples/modules/main
deleted file mode 100644
index e4cc71dc7..000000000
--- a/examples/modules/main
+++ /dev/null
@@ -1,52 +0,0 @@
-#! /usr/local/bin/guile -s
-!#
-;;; examples/modules/main -- Module system demo.
-
-;;; Commentary:
-
-;;; The main demo program for the modules subdirectory.
-;;;
-;;; This program shows how all the new fancy module import features
-;;; are to be used.
-
-;;; Author: Martin Grabmueller
-;;; Date: 2001-05-29
-
-;;; Code:
-
-(define-module (main)
- ;; The module 0 is imported completely.
- ;;
- :use-module (module-0)
-
- ;; Module 1 is imported completely, too, but the procedure names are
- ;; prefixed with the module name.
- ;;
- :use-module ((module-1) :renamer (symbol-prefix-proc 'module-1:))
-
- ;; From module 2, only the procedure `braz' is imported, so that the
- ;; procedures `foo' and `bar' also exported by that module don't
- ;; clash with the definitions of module 0.
- ;;
- :use-module ((module-2) :select (braz))
-
- ;; Import the bindings from module 2 again, now renaming them by
- ;; explicitly mentioning the original and new names.
- ;;
- :use-module ((module-2) :select ((braz . m-2:braz) (foo . m-2:foo))))
-
-;;
-;; Now call the various imported procedures.
-;;
-
-(foo)
-(bar)
-(module-1:foo)
-(module-1:bar)
-(braz)
-(m-2:braz)
-(m-2:foo)
-
-;; Local variables:
-;; mode: scheme
-;; End:
diff --git a/examples/modules/module-0.scm b/examples/modules/module-0.scm
deleted file mode 100644
index a5a001b64..000000000
--- a/examples/modules/module-0.scm
+++ /dev/null
@@ -1,24 +0,0 @@
-;;; examples/modules/module-0.scm -- Module system demo.
-
-;;; Commentary:
-
-;;; Module 0 of the module demo program.
-
-;;; Author: Martin Grabmueller
-;;; Date: 2001-05-29
-
-;;; Code:
-
-(define-module (module-0))
-
-(export foo bar)
-
-(define (foo)
- (display "module-0 foo")
- (newline))
-
-(define (bar)
- (display "module-0 bar")
- (newline))
-
-;;; End of file.
diff --git a/examples/modules/module-1.scm b/examples/modules/module-1.scm
deleted file mode 100644
index 6a7bb43e0..000000000
--- a/examples/modules/module-1.scm
+++ /dev/null
@@ -1,24 +0,0 @@
-;;; examples/modules/module-1.scm -- Module system demo.
-
-;;; Commentary:
-
-;;; Module 1 of the module demo program.
-
-;;; Author: Martin Grabmueller
-;;; Date: 2001-05-29
-
-;;; Code:
-
-(define-module (module-1))
-
-(export foo bar)
-
-(define (foo)
- (display "module-1 foo")
- (newline))
-
-(define (bar)
- (display "module-1 bar")
- (newline))
-
-;;; End of file.
diff --git a/examples/modules/module-2.scm b/examples/modules/module-2.scm
deleted file mode 100644
index 3147b2cab..000000000
--- a/examples/modules/module-2.scm
+++ /dev/null
@@ -1,28 +0,0 @@
-;;; examples/modules/module-2.scm -- Module system demo.
-
-;;; Commentary:
-
-;;; Module 2 of the module demo program.
-
-;;; Author: Martin Grabmueller
-;;; Date: 2001-05-29
-
-;;; Code:
-
-(define-module (module-2))
-
-(export foo bar braz)
-
-(define (foo)
- (display "module-2 foo")
- (newline))
-
-(define (bar)
- (display "module-2 bar")
- (newline))
-
-(define (braz)
- (display "module-2 braz")
- (newline))
-
-;;; End of file.
diff --git a/examples/safe/.cvsignore b/examples/safe/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/examples/safe/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/examples/safe/Makefile.am b/examples/safe/Makefile.am
deleted file mode 100644
index 16c2f1687..000000000
--- a/examples/safe/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-## Process this file with Automake to create Makefile.in
-##
-## Copyright (C) 2001 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-EXTRA_DIST = README safe untrusted.scm evil.scm check.test
-
-installcheck:
- srcdir=$(srcdir) GUILE_LOAD_PATH=$(top_srcdir) $(srcdir)/check.test
diff --git a/examples/safe/README b/examples/safe/README
deleted file mode 100644
index 47abcbf9f..000000000
--- a/examples/safe/README
+++ /dev/null
@@ -1,41 +0,0 @@
- -*- outline -*-
-
-* Overview
-
-This directory includes examples which show how to create and use safe
-environments for safe (sand-boxed) execution of Scheme programs.
-
-*Note* that the files in this directory are only suitable for
- demonstration purposes, if you have to implement safe evaluation
- mechanisms in important environments, you will have to do more than
- shown here -- for example disabling input/output operations.
-
-The descriptions below assume that you have a working copy of Guile
-installed and available with the standard installation prefix
-`/usr/local'.
-
-* Included Examples
-
-
-** safe
-
- The main program, which executes the Scheme code in a file given on
- the command line in a safe environment. The following command will
- do that with the file `untrusted.scm' (see below.)
-
- $ ./safe untrusted.scm
-
- or
-
- guile -s safe untrusted.scm
-
-** untrusted.scm
-
- This file contains some Scheme code, which will be executed in a
- safe environment by the `safe' script.
-
-** evil.scm
-
- This file also contains Scheme code, but it tries to do evil things.
- Evaluating this with the `safe' script will abort on those evil
- actions.
diff --git a/examples/safe/check.test b/examples/safe/check.test
deleted file mode 100755
index 9e5f192d8..000000000
--- a/examples/safe/check.test
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/sh
-
-# must be run from this directory
-guile=${GUILE-../../libguile/guile}
-
-if test "X$srcdir" = X; then
- srcdir=.
-fi
-
-set -e
-
-#
-# ./safe untrusted.scm
-#
-$guile -s $srcdir/safe $srcdir/untrusted.scm > TMP
-cat <<EOF | diff -u - TMP
-1
-1
-2
-6
-24
-120
-720
-5040
-40320
-362880
-3628800
-EOF
-rm -f TMP
-
-#
-# ./safe evil.scm
-#
-$guile -s $srcdir/safe $srcdir/evil.scm > TMP
-cat <<EOF | diff -u - TMP
-** Exception: (unbound-variable #f "Unbound variable: ~S" (open-input-file) #f)
-EOF
-rm -f TMP
-
-# check.test ends here
diff --git a/examples/safe/evil.scm b/examples/safe/evil.scm
deleted file mode 100644
index f9ee9082f..000000000
--- a/examples/safe/evil.scm
+++ /dev/null
@@ -1,27 +0,0 @@
-;;; examples/safe/evil.scm -- Evil Scheme file to be run in a safe
-;;; environment.
-
-;;; Commentary:
-
-;;; This is an example file to be evaluated by the `safe' program in
-;;; this directory. This program, unlike the `untrusted.scm' (which
-;;; is untrusted, but a really nice fellow though), tries to do evil
-;;; things and will thus break in a safe environment.
-;;;
-;;; *Note* that the files in this directory are only suitable for
-;;; demonstration purposes, if you have to implement safe evaluation
-;;; mechanisms in important environments, you will have to do more
-;;; than shown here -- for example disabling input/output operations.
-
-;;; Author: Martin Grabmueller
-;;; Date: 2001-05-30
-
-;;; Code:
-
-(define passwd (open-input-file "/etc/passwd"))
-
-(let lp ((ch (read-char passwd)))
- (if (not (eof-object? ch))
- (lp (read-char passwd))))
-
-;;; End of file.
diff --git a/examples/safe/safe b/examples/safe/safe
deleted file mode 100755
index 7653dc2b8..000000000
--- a/examples/safe/safe
+++ /dev/null
@@ -1,85 +0,0 @@
-#! /usr/local/bin/guile -s
-!#
-;;; examples/safe/safe -- Example for safe (sand-boxed) evaluation.
-
-;;; Commentary:
-
-;;; This is a demo program for evaluating arbitrary (untrusted) Scheme
-;;; code in a controlled, safe environment. Evaluation in safe
-;;; environments restricts the evaluated code's access to some given
-;;; primitives, which are considered `safe', that means which cannot
-;;; do any harm to the world outside of Guile (creating/deleting files
-;;; etc.)
-;;;
-;;; *Note* that the files in this directory are only suitable for
-;;; demonstration purposes, if you have to implement safe evaluation
-;;; mechanisms in important environments, you will have to do more
-;;; than shown here -- for example disabling input/output operations.
-
-;;; Author: Martin Grabmueller
-;;; Date: 2001-05-30
-
-;;; Code:
-
-;; Safe module creation is implemented in this module:
-;;
-(use-modules (ice-9 safe))
-
-;; This is the main program. It expects one parameter in the format
-;; returned by (command-line) and expects that exactly one file name
-;; is passed in this list (after the script name, which is passed as
-;; the 0th parameter.)
-;;
-;; The given file is opened for reading, one expression after the
-;; other is read and evaluated in a safe environment. All exceptions
-;; caused by this evaluation are caught and printed out.
-;;
-(define (main cmd-line)
-
- ;; Internal definition of the procedure which prints usage
- ;; information.
- ;;
- (define (display-help)
- (display "Usage: safe FILENAME")
- (newline)
- (quit 1))
-
- ;; Check that we received exactly one command line argument after
- ;; the script name
- ;;
- (if (not (= (length cmd-line) 2))
- (display-help)
- (let ((port (open-input-file (cadr cmd-line)))
-
- ;; Create the safe module.
- (safe-module (make-safe-module)))
-
- ;; Read one expression a time.
- (let lp ((expr (read port)))
- ;; End of file? -> Return.
- (if (eof-object? expr)
- #t
- (catch #t
- (lambda ()
- ;; Evaluate the expression in the safe environment.
- (eval expr safe-module)
- ;; ... and read the next expression if no error occured.
- (lp (read port)))
-
- ;; Handle exceptions. This procedure will be called when an
- ;; error occurs while evaluating the expression. It just
- ;; prints out a message telling so and returns from the
- ;; evaluation loop, thus terminating the program.
- ;;
- (lambda args
- (display "** Exception: ")
- (write args)
- (newline))))))))
-
-;; Start the main program.
-;;
-(main (command-line))
-
-;; Local variables:
-;; mode: scheme
-;; End:
diff --git a/examples/safe/untrusted.scm b/examples/safe/untrusted.scm
deleted file mode 100644
index f3ae5fe97..000000000
--- a/examples/safe/untrusted.scm
+++ /dev/null
@@ -1,33 +0,0 @@
-;;; examples/safe/untrusted.scm -- Scheme file to be run in a safe
-;;; environment.
-
-;;; Commentary:
-
-;;; This is an example file to be evaluated by the `safe' program in
-;;; this directory.
-;;;
-;;; *Note* that the files in this directory are only suitable for
-;;; demonstration purposes, if you have to implement safe evaluation
-;;; mechanisms in important environments, you will have to do more
-;;; than shown here -- for example disabling input/output operations.
-
-;;; Author: Martin Grabmueller
-;;; Date: 2001-05-30
-
-;;; Code:
-
-;; fact -- the everlasting factorial function...
-;;
-(define (fact n)
- (if (< n 2)
- 1
- (* n (fact (- n 1)))))
-
-;; Display the factorial of 0..9 to the terminal.
-;;
-(do ((x 0 (+ x 1)))
- ((= x 11))
- (display (fact x))
- (newline))
-
-;;; End of file.
diff --git a/examples/scripts/.cvsignore b/examples/scripts/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/examples/scripts/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/examples/scripts/Makefile.am b/examples/scripts/Makefile.am
deleted file mode 100644
index 3a82dad77..000000000
--- a/examples/scripts/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-## Process this file with Automake to create Makefile.in
-##
-## Copyright (C) 2001 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-EXTRA_DIST = README simple-hello.scm hello fact check.test
-
-installcheck:
- srcdir=$(srcdir) GUILE_LOAD_PATH=$(top_srcdir) $(srcdir)/check.test
diff --git a/examples/scripts/README b/examples/scripts/README
deleted file mode 100644
index f3e965b5a..000000000
--- a/examples/scripts/README
+++ /dev/null
@@ -1,38 +0,0 @@
- -*- outline -*-
-
-* Overview
-
-This directory includes examples which show how to write scripts using
-Guile.
-
-The descriptions below assume that you have a working copy of Guile
-installed and available with the standard installation prefix
-`/usr/local'.
-
-* Included Examples
-
-
-** simple-hello.scm
-
- The simplest "Hello World!" program for Guile. Run it like this:
-
- $ guile -s simple-hello.scm
-
-** hello
-
- An advanced version of the script above, with command line handling
- for the important options --help and --version. Run it like this:
-
- ./hello
-
- or
-
- guile -s hello
-
-** fact
-
- Command-line factorial calculator. Run it like this:
-
- ./fact 5
-
- to calculate the factorial of 5.
diff --git a/examples/scripts/check.test b/examples/scripts/check.test
deleted file mode 100755
index 2a3e753d6..000000000
--- a/examples/scripts/check.test
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/sh
-
-# must be run from this directory
-guile=${GUILE-../../libguile/guile}
-if [ -x $guile ] ; then
- :
-else
- echo could not find guile interpreter.
- echo '(are you running this script from' `dirname $0` '?)'
- echo GUILE env var: ${GUILE-not set}
- exit 1
-fi
-
-if test "X$srcdir" = X; then
- srcdir=.
-fi
-
-set -e
-
-#
-# simple-hello.scm
-#
-$guile -s $srcdir/simple-hello.scm > TMP
-cat <<EOF | diff -u - TMP
-Hello, World!
-EOF
-rm -f TMP
-
-#
-# hello
-#
-$guile -s $srcdir/hello > TMP
-echo "Hello, World!" | diff -u - TMP
-rm -f TMP
-
-$guile -s $srcdir/hello --version > TMP
-echo "hello 0.0.1" | diff -u - TMP
-rm -f TMP
-
-$guile -s $srcdir/hello --help > TMP
-cat <<EOF | diff -u - TMP
-Usage: hello [options...]
- --help, -h Show this usage information
- --version, -v Show version information
-EOF
-rm -f TMP
-
-#
-# fact
-#
-case `$guile -s $srcdir/fact 5` in 120) ;; *) echo $0: error: fact 5 ;; esac
-
-# check.test ends here
diff --git a/examples/scripts/fact b/examples/scripts/fact
deleted file mode 100755
index 05bcc9ffe..000000000
--- a/examples/scripts/fact
+++ /dev/null
@@ -1,69 +0,0 @@
-#! /usr/local/bin/guile -s
-!#
-;;; Commentary:
-
-;;; This is a command-line factorial calculator. Run like this:
-;;;
-;;; ./fact 5
-;;;
-;;; to calculate the factorial of 5
-
-;;; Author: Martin Grabmueller
-;;; Date: 2001-05-29
-
-;;; Code:
-
-(use-modules (ice-9 getopt-long))
-
-;; This is the grammar for the command line synopsis we expect.
-;;
-(define command-synopsis
- '((version (single-char #\v) (value #f))
- (help (single-char #\h) (value #f))))
-
-;; Display version information and exit.
-;;
-(define (display-version)
- (display "fact 0.0.1\n"))
-
-;; Display the usage help message and exit.
-;;
-(define (display-help)
- (display "Usage: fact [options...] number\n")
- (display " --help, -h Show this usage information\n")
- (display " --version, -v Show version information\n"))
-
-;; Interpret options, if --help or --version was given, print out the
-;; requested information and exit. Otherwise, calculate the factorial
-;; of the argument.
-;;
-(define (main options)
- (let ((help-wanted (option-ref options 'help #f))
- (version-wanted (option-ref options 'version #f))
- (args (option-ref options '() '())))
- (cond
- ((or version-wanted help-wanted)
- (if version-wanted
- (display-version))
- (if help-wanted
- (display-help)))
- ((not (= (length args) 1))
- (display-help))
- (else
- (display (fact (string->number (car args))))
- (newline)))))
-
-;; Calculate the factorial of n.
-;;
-(define (fact n)
- (if (< n 2)
- 1
- (* n (fact (- n 1)))))
-
-;; Call the main program with parsed command line options.
-;;
-(main (getopt-long (command-line) command-synopsis))
-
-;; Local variables:
-;; mode: scheme
-;; End:
diff --git a/examples/scripts/hello b/examples/scripts/hello
deleted file mode 100755
index 01f9a6c3b..000000000
--- a/examples/scripts/hello
+++ /dev/null
@@ -1,57 +0,0 @@
-#! /usr/local/bin/guile -s
-!#
-;;; Commentary:
-
-;;; This is the famous Hello-World-program, written for Guile. It is a
-;;; little bit enhanced in that it understands the command line options
-;;; `--help' (-h) and `--version' (-v), which print a short usage
-;;; decription or version information, respectively.
-
-;;; Author: Martin Grabmueller
-;;; Date: 2001-05-29
-
-;;; Code:
-
-(use-modules (ice-9 getopt-long))
-
-;; This is the grammar for the command line synopsis we expect.
-;;
-(define command-synopsis
- '((version (single-char #\v) (value #f))
- (help (single-char #\h) (value #f))))
-
-;; Display version information.
-;;
-(define (display-version)
- (display "hello 0.0.1\n"))
-
-;; Display the usage help message.
-;;
-(define (display-help)
- (display "Usage: hello [options...]\n")
- (display " --help, -h Show this usage information\n")
- (display " --version, -v Show version information\n"))
-
-;; Interpret options, if --help or --version was given, print out the
-;; requested information and exit. Otherwise, print the famous
-;; message.
-;;
-(define (main options)
- (let ((help-wanted (option-ref options 'help #f))
- (version-wanted (option-ref options 'version #f)))
- (if (or version-wanted help-wanted)
- (begin
- (if version-wanted
- (display-version))
- (if help-wanted
- (display-help)))
- (begin
- (display "Hello, World!") (newline)))))
-
-;; Call the main program with parsed command line options.
-;;
-(main (getopt-long (command-line) command-synopsis))
-
-;; Local variables:
-;; mode: scheme
-;; End:
diff --git a/examples/scripts/simple-hello.scm b/examples/scripts/simple-hello.scm
deleted file mode 100644
index b46bc36ff..000000000
--- a/examples/scripts/simple-hello.scm
+++ /dev/null
@@ -1,16 +0,0 @@
-;;; Commentary:
-
-;;; This is the famous Hello-World-program, written for Guile.
-;;;
-;;; For an advanced version, see the script `hello' in the same
-;;; directory.
-
-;;; Author: Martin Grabmueller
-;;; Date: 2001-05-29
-
-;;; Code:
-
-(display "Hello, World!")
-(newline)
-
-;;; End of file.
diff --git a/guile-aclocal.sh b/guile-aclocal.sh
deleted file mode 100755
index e69de29bb..000000000
--- a/guile-aclocal.sh
+++ /dev/null
diff --git a/guile-config/.cvsignore b/guile-config/.cvsignore
deleted file mode 100644
index 0c604f859..000000000
--- a/guile-config/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-Makefile
-Makefile.in
-guile-config
diff --git a/guile-config/COPYING b/guile-config/COPYING
deleted file mode 100644
index eeb586b39..000000000
--- a/guile-config/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED 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.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
-
- 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 of the License, 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 program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) 19yy name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/guile-config/ChangeLog b/guile-config/ChangeLog
deleted file mode 100644
index d938f4280..000000000
--- a/guile-config/ChangeLog
+++ /dev/null
@@ -1,182 +0,0 @@
-2002-07-17 Marius Vollmer <mvo@zagadka.ping.de>
-
- * qthreads.m4: Added configuration for ARM.
-
-2002-04-26 Marius Vollmer <mvo@zagadka.ping.de>
-
- * Makefile.am (EXTRA_DIST): Added qthreads.m4.
- * qthreads.m4: Moved here from top directory.
-
-2002-03-12 Rob Browning <rlb@defaultvalue.org>
-
- * guile-config.in (build-link): don't output -L/usr/lib.
- (build-compile): don't output -I/usr/include.
-
-2002-03-03 Neil Jerram <neil@ossau.uklinux.net>
-
- * guile.m4 (GUILE_PROGS): In docstring, change `are' to `is'.
-
-2002-01-02 Thien-Thi Nguyen <ttn@glug.org>
-
- * guile.m4: Rewrite comments in texi.
-
- (GUILE_FLAGS): Rewrite.
- Thanks to Alexandre Duret-Lutz.
-
-2001-12-28 Thien-Thi Nguyen <ttn@glug.org>
-
- * guile.m4 (GUILE_PROGS, GUILE_SITE_DIR, GUILE_CHECK,
- GUILE_MODULE_EXPORTS, GUILE_MODULE_REQUIRED_EXPORTS): New macros.
-
- (GUILE_MODULE_CHECK): Renamed from AC_GUILE_MODULE_CHECK.
- Rewritten to expect `description' as a present-tense verb phrase.
-
- (GUILE_MODULE_AVAILABLE, GUILE_MODULE_REQUIRED): Renamed likewise.
-
-2001-12-28 Thien-Thi Nguyen <ttn@glug.org>
-
- * guile.m4: Update copyright.
- Add index in header comments.
-
- (AC_GUILE_MODULE_CHECK, AC_GUILE_MODULE_AVAILABLE,
- AC_GUILE_MODULE_REQUIRED): New macros.
-
-2001-07-18 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * guile-config.in, Makefile.am: Updated copyright notice.
-
-2001-05-28 Gary Houston <ghouston@arglist.com>
-
- * Makefile.am: let guile-config depend on libguile/libpath.h,
- so that it will be rebuilt if configure --prefix changes.
-
-2001-03-07 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * guile-config.in (build-link): Really reverted the change of
- 2001-03-05.
-
-2001-03-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * guile-config.in (build-link): Reverted the previous patch.
-
-2001-03-05 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * guile-config.in (build-link): Fixed duplicate binding bug
- reported by Ralf Mattes.
-
-2000-11-28 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * guile-config.in (build-link): Use substring instead of
- make-shared-substring.
-
-2000-11-01 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * guile-config.in (display-line-port): Make sure all output is
- sent to the given port. Thanks to I. N. Golubev for the patch.
-
-2000-01-12 Marius Vollmer <mvo@zagadka.ping.de>
-
- * Makefile.am (EXTRA_DIST): Added "guile.m4".
-
-1999-10-05 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * guile.m4: Moved here from top-level directory; see the ChangeLog
- entry there.
- * Makefile.am (aclocaldir, aclocal_DATA): New variables, ensuring
- that guile.m4 gets installed.
-
- * Makefile.in: Deleted from CVS repository. Run the autogen.sh
- script to create generated files like this one.
-
-1999-09-11 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * Makefile.in: Regenerated.
-
-1998-07-29 Marius Vollmer <mvo@zagadka.ping.de>
-
- * guile-config.in (build-link): Correct non-RnRS usage of internal
- defines.
-
-1999-04-17 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * Makefile.in: Regenerated.
-
-1998-10-19 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * COPYING: New file.
- * Makefile.in: Regenerated.
-
-1998-10-09 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * guile-config.in: Add copyright notice.
-
-1998-10-07 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * guile-config.in (build-link): It isn't. Revert the change.
-
- * guile-config.in (build-link): Include a -R flag in the output
- from link. Not sure if this is the right thing to do.
-
-1998-10-05 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * guile-config.in (build-compile, help-compile, usage-compile):
- New functions to implement new subcommand.
-
- * guile-config.in: Redo the help system, so that each subcommand
- defines its own usage text, as well as its help text.
-
- * guile-config.in (build-link): Include a -L option in the output
- from `guile-config link', indicating where libguile was installed.
- (Thanks to Greg Troxel.)
-
-1998-10-03 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * guile-config.in: Don't import ice-9 regex; that's not available
- on all systems. Maybe someday we'll have our own...
- (set-program-name!): Use basename.
- (build-link): Use basename and stock string functions, instead of
- string-match.
- (Bug report from Greg Troxel --- thanks!)
-
- * Directory renamed to guile-config from build.
- * guile-config.in: Renamed from build-guile.in, for consistency
- with the analogous script for GTK, called gtk-config.
- * Makefile.am, .cvsignore: References to `build-guile' replaced
- with `guile-config'.
-
-1998-07-29 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * Makefile.in: Regenerated using the last public version of
- automake, not the hacked Cygnus version.
-
-1998-07-28 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * Makefile.in: Regenerated, after removing Totoro kludge.
-
-1998-07-26 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * Makefile.in: Rebuilt, for config changes in parent dir.
-
-1998-01-05 Tim Pierce <twp@skepsis.com>
-
- * .cvsignore: New file.
-
-Mon Oct 6 11:45:59 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- * build-guile.in: Try to return an appropriate exit status.
-
- * build-guile.in: Rearranged to use a table of subcommands, and
- include per-subcommand help.
-
- * build-guile.in: New "info" subcommand, for easy access to Guile
- build variables.
-
-Mon Sep 29 23:53:14 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- * Makefile.in: Regenerated with automake 1.2c.
-
-Sat Sep 27 23:15:26 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- * New directory --- the build-guile command, intended to help
- people build Guile-based applications.
- * Makefile.am, Makefile.in, build-guile.in: New files.
diff --git a/guile-config/Makefile.am b/guile-config/Makefile.am
deleted file mode 100644
index 5007c700b..000000000
--- a/guile-config/Makefile.am
+++ /dev/null
@@ -1,46 +0,0 @@
-## Process this file with Automake to create Makefile.in
-## Jim Blandy <jimb@red-bean.com> --- September 1997
-##
-## Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-bin_SCRIPTS=guile-config
-CLEANFILES=guile-config
-EXTRA_DIST=guile-config.in guile.m4 qthreads.m4
-
-## FIXME: in the future there will be direct automake support for
-## doing this. When that happens, switch over.
-aclocaldir = $(datadir)/aclocal
-aclocal_DATA = guile.m4
-
-## We use @-...-@ as the substitution brackets here, instead of the
-## usual @...@, so autoconf doesn't go and substitute the values
-## directly into the left-hand sides of the sed substitutions. *sigh*
-guile-config: guile-config.in ${top_builddir}/libguile/libpath.h
- rm -f guile-config.tmp
- sed < ${srcdir}/guile-config.in > guile-config.tmp \
- -e s:@-bindir-@:${bindir}: \
- -e s:@-GUILE_VERSION-@:${GUILE_VERSION}:
- chmod +x guile-config.tmp
- mv guile-config.tmp guile-config
-
-## Get rid of any copies of the configuration script under the old
-## name, so people don't end up running ancient copies of it.
-install-exec-local:
- rm -f ${bindir}/build-guile
diff --git a/guile-config/guile-config.in b/guile-config/guile-config.in
deleted file mode 100644
index ff3f08a7e..000000000
--- a/guile-config/guile-config.in
+++ /dev/null
@@ -1,299 +0,0 @@
-#!@-bindir-@/guile \
--e main -s
-!#
-;;;; guile-config --- utility for linking programs with Guile
-;;;; Jim Blandy <jim@red-bean.com> --- September 1997
-;;;;
-;;;; Copyright (C) 1998, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-
-;;; TODO:
-;;; * Add some plausible structure for returning the right exit status,
-;;; just something that encourages people to do the correct thing.
-;;; * Implement the static library support. This requires that
-;;; some portion of the module system be done.
-
-(use-modules (ice-9 string-fun))
-
-
-;;;; main function, command-line processing
-
-;;; The script's entry point.
-(define (main args)
- (set-program-name! (car args))
- (let ((args (cdr args)))
- (cond
- ((null? args) (show-help '())
- (quit 1))
- ((assoc (car args) command-table)
- => (lambda (row)
- (set! subcommand-name (car args))
- ((cadr row) (cdr args))))
- (else (show-help '())
- (quit 1)))))
-
-(define program-name #f)
-(define subcommand-name #f)
-(define program-version "@-GUILE_VERSION-@")
-
-;;; Given an executable path PATH, set program-name to something
-;;; appropriate f or use in error messages (i.e., with leading
-;;; directory names stripped).
-(define (set-program-name! path)
- (set! program-name (basename path)))
-
-(define (show-help args)
- (cond
- ((null? args) (show-help-overview))
- ((assoc (car args) command-table)
- => (lambda (row) ((caddr row))))
- (else
- (show-help-overview))))
-
-(define (show-help-overview)
- (display-line-error "Usage: ")
- (for-each (lambda (row) ((cadddr row)))
- command-table))
-
-(define (usage-help)
- (let ((dle display-line-error)
- (p program-name))
- (dle " " p " --help - show usage info (this message)")
- (dle " " p " --help SUBCOMMAND - show help for SUBCOMMAND")))
-
-(define (show-version args)
- (display-line-error program-name " - Guile version " program-version))
-
-(define (help-version)
- (let ((dle display-line-error))
- (dle "Usage: " program-name " --version")
- (dle "Show the version of this script. This is also the version of")
- (dle "Guile this script was installed with.")))
-
-(define (usage-version)
- (display-line-error
- " " program-name " --version - show installed script and Guile version"))
-
-
-;;;; the "link" subcommand
-
-;;; Write a set of linker flags to standard output to include the
-;;; libraries that libguile needs to link against.
-;;;
-;;; In the long run, we want to derive these flags from Guile module
-;;; declarations files that are installed along the load path. For
-;;; now, we're just going to reach into Guile's configuration info and
-;;; hack it out.
-(define (build-link args)
-
- ;; If PATH has the form FOO/libBAR.a, return the substring
- ;; BAR, otherwise return #f.
- (define (match-lib path)
- (let* ((base (basename path))
- (len (string-length base)))
- (if (and (> len 5)
- (string=? (substring base 0 3) "lib")
- (string=? (substring base (- len 2)) ".a"))
- (substring base 3 (- len 2))
- #f)))
-
- (if (> (length args) 0)
- (error
- (string-append program-name
- " link: arguments to subcommand not yet implemented")))
-
- (let ((libdir (get-build-info 'libdir))
- (other-flags
- (let loop ((libs
- ;; Get the string of linker flags we used to build
- ;; Guile, and break it up into a list.
- (separate-fields-discarding-char #\space
- (get-build-info 'LIBS)
- list)))
-
- (cond
- ((null? libs) '())
-
- ;; Turn any "FOO/libBAR.a" elements into "-lBAR".
- ((match-lib (car libs))
- => (lambda (bar)
- (cons (string-append "-l" bar)
- (loop (cdr libs)))))
-
- ;; Remove any empty strings that may have seeped in there.
- ((string=? (car libs) "") (loop (cdr libs)))
-
- (else (cons (car libs) (loop (cdr libs))))))))
-
- ;; Include libguile itself in the list, along with the directory
- ;; it was installed in, but do *not* add /usr/lib since that may
- ;; prevent other programs from specifying non-/usr/lib versions
- ;; via their foo-config scripts. If *any* app puts -L/usr/lib in
- ;; the output of its foo-config script then it may prevent the use
- ;; a non-/usr/lib install of anything that also has a /usr/lib
- ;; install. For now we hard-code /usr/lib, but later maybe we can
- ;; do something more dynamic (i.e. what do we need.
-
- ;; Display the flags, separated by spaces.
- (if (or (string=? libdir "/usr/lib")
- (string=? libdir "/usr/lib/"))
- (display-separated (cons "-lguile" other-flags))
- (display-separated (cons
- (string-append "-L" (get-build-info 'libdir))
- (cons "-lguile" other-flags))))
- (newline)))
-
-(define (help-link)
- (let ((dle display-line-error))
- (dle "Usage: " program-name " link")
- (dle "Print linker flags for building the `guile' executable.")
- (dle "Print the linker command-line flags necessary to link against")
- (dle "the Guile library, and any other libraries it requires.")))
-
-(define (usage-link)
- (display-line-error
- " " program-name " link - print libraries to link with"))
-
-
-
-;;;; The "compile" subcommand
-
-(define (build-compile args)
- (if (> (length args) 0)
- (error
- (string-append program-name
- " compile: no arguments expected")))
-
- ;; See gcc manual wrt fixincludes. Search for "Use of
- ;; `-I/usr/include' may cause trouble." For now we hard-code this.
- ;; Later maybe we can do something more dynamic.
- (if (not (string=? (get-build-info 'includedir) "/usr/include"))
- (display-line "-I" (get-build-info 'includedir))))
-
-(define (help-compile)
- (let ((dle display-line-error))
- (dle "Usage: " program-name " compile")
- (dle "Print C compiler flags for compiling code that uses Guile.")
- (dle "This includes any `-I' flags needed to find Guile's header files.")))
-
-(define (usage-compile)
- (display-line-error
- " " program-name " compile - print C compiler flags to compile with"))
-
-
-;;;; The "info" subcommand
-
-(define (build-info args)
- (cond
- ((null? args) (show-all-vars))
- ((null? (cdr args)) (show-var (car args)))
- (else (display-line-error "Usage: " program-name " info [VAR]")
- (quit 2))))
-
-(define (show-all-vars)
- (for-each (lambda (binding)
- (display-line (car binding) " = " (cdr binding)))
- %guile-build-info))
-
-(define (show-var var)
- (display (get-build-info (string->symbol var)))
- (newline))
-
-(define (help-info)
- (let ((d display-line-error))
- (d "Usage: " program-name " info [VAR]")
- (d "Display the value of the Makefile variable VAR used when Guile")
- (d "was built. If VAR is omitted, display all Makefile variables.")
- (d "Use this command to find out where Guile was installed,")
- (d "where it will look for Scheme code at run-time, and so on.")))
-
-(define (usage-info)
- (display-line-error
- " " program-name " info [VAR] - print Guile build directories"))
-
-
-;;;; trivial utilities
-
-(define (get-build-info name)
- (let ((val (assq name %guile-build-info)))
- (if (not (pair? val))
- (begin
- (display-line-error
- program-name " " subcommand-name ": no such build-info: " name)
- (quit 2)))
- (cdr val)))
-
-(define (display-line . args)
- (apply display-line-port (current-output-port) args))
-
-(define (display-line-error . args)
- (apply display-line-port (current-error-port) args))
-
-(define (display-line-port port . args)
- (for-each (lambda (arg) (display arg port))
- args)
- (newline port))
-
-(define (display-separated args)
- (if (not (null? args))
- (begin
- (display (car args))
- (for-each
- (lambda (arg) (display " ") (display arg))
- (cdr args)))))
-
-
-;;;; the command table
-
-;;; We define this down here, so Guile builds the list after all the
-;;; functions have been defined.
-(define command-table
- (list
- (list "--version" show-version help-version usage-version)
- (list "--help" show-help show-help-overview usage-help)
- (list "link" build-link help-link usage-link)
- (list "compile" build-compile help-compile usage-compile)
- (list "info" build-info help-info usage-info)))
-
-
-;;; Local Variables:
-;;; mode: scheme
-;;; End:
diff --git a/guile-config/guile.m4 b/guile-config/guile.m4
deleted file mode 100644
index 020de5a05..000000000
--- a/guile-config/guile.m4
+++ /dev/null
@@ -1,221 +0,0 @@
-## Autoconf macros for working with Guile.
-##
-## Copyright (C) 1998,2001 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, 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 GUILE.
-##
-## The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-## code from other Free Software Foundation releases into a copy of
-## GUILE, 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 GUILE, it is your choice
-## whether to permit this exception to apply to your modifications.
-## If you do not wish that, delete this exception notice.
-
-## Index
-## -----
-##
-## GUILE_PROGS -- set paths to Guile interpreter, config and tool programs
-## GUILE_FLAGS -- set flags for compiling and linking with Guile
-## GUILE_SITE_DIR -- find path to Guile "site" directory
-## GUILE_CHECK -- evaluate Guile Scheme code and capture the return value
-## GUILE_MODULE_CHECK -- check feature of a Guile Scheme module
-## GUILE_MODULE_AVAILABLE -- check availability of a Guile Scheme module
-## GUILE_MODULE_REQUIRED -- fail if a Guile Scheme module is unavailable
-## GUILE_MODULE_EXPORTS -- check if a module exports a variable
-## GUILE_MODULE_REQUIRED_EXPORT -- fail if a module doesn't export a variable
-
-## Code
-## ----
-
-## NOTE: Comments preceding an AC_DEFUN (starting from "Usage:") are massaged
-## into doc/ref/autoconf-macros.texi (see Makefile.am in that directory).
-
-# GUILE_PROGS -- set paths to Guile interpreter, config and tool programs
-#
-# Usage: GUILE_PROGS
-#
-# This macro looks for programs @code{guile}, @code{guile-config} and
-# @code{guile-tools}, and sets variables @var{GUILE}, @var{GUILE_CONFIG} and
-# @var{GUILE_TOOLS}, to their paths, respectively. If either of the first two
-# is not found, signal error.
-#
-# The variables are marked for substitution, as by @code{AC_SUBST}.
-#
-AC_DEFUN([GUILE_PROGS],
- [AC_PATH_PROG(GUILE,guile)
- if test "$GUILE" = "" ; then
- AC_MSG_ERROR([guile required but not found])
- fi
- AC_SUBST(GUILE)
- AC_PATH_PROG(GUILE_CONFIG,guile-config)
- if test "$GUILE_CONFIG" = "" ; then
- AC_MSG_ERROR([guile-config required but not found])
- fi
- AC_SUBST(GUILE_CONFIG)
- AC_PATH_PROG(GUILE_TOOLS,guile-tools)
- AC_SUBST(GUILE_TOOLS)
- ])
-
-# GUILE_FLAGS -- set flags for compiling and linking with Guile
-#
-# Usage: GUILE_FLAGS
-#
-# This macro runs the @code{guile-config} script, installed with Guile, to
-# find out where Guile's header files and libraries are installed. It sets
-# two variables, @var{GUILE_CFLAGS} and @var{GUILE_LDFLAGS}.
-#
-# @var{GUILE_CFLAGS}: flags to pass to a C or C++ compiler to build code that
-# uses Guile header files. This is almost always just a @code{-I} flag.
-#
-# @var{GUILE_LDFLAGS}: flags to pass to the linker to link a program against
-# Guile. This includes @code{-lguile} for the Guile library itself, any
-# libraries that Guile itself requires (like -lqthreads), and so on. It may
-# also include a @code{-L} flag to tell the compiler where to find the
-# libraries.
-#
-# The variables are marked for substitution, as by @code{AC_SUBST}.
-#
-AC_DEFUN([GUILE_FLAGS],
- [AC_REQUIRE([GUILE_PROGS])dnl
- AC_MSG_CHECKING([libguile compile flags])
- GUILE_CFLAGS="`$GUILE_CONFIG compile`"
- AC_MSG_RESULT([$GUILE_CFLAGS])
- AC_MSG_CHECKING([libguile link flags])
- GUILE_LDFLAGS="`$GUILE_CONFIG link`"
- AC_MSG_RESULT([$GUILE_LDFLAGS])
- AC_SUBST(GUILE_CFLAGS)
- AC_SUBST(GUILE_LDFLAGS)
- ])
-
-# GUILE_SITE_DIR -- find path to Guile "site" directory
-#
-# Usage: GUILE_SITE_DIR
-#
-# This looks for Guile's "site" directory, usually something like
-# PREFIX/share/guile/site, and sets var @var{GUILE_SITE} to the path.
-# Note that the var name is different from the macro name.
-#
-# The variable is marked for substitution, as by @code{AC_SUBST}.
-#
-AC_DEFUN([GUILE_SITE_DIR],
- [AC_REQUIRE([GUILE_PROGS])dnl
- AC_MSG_CHECKING(for Guile site directory)
- GUILE_SITE=`[$GUILE_CONFIG] info pkgdatadir`/site
- AC_MSG_RESULT($GUILE_SITE)
- AC_SUBST(GUILE_SITE)
- ])
-
-# GUILE_CHECK -- evaluate Guile Scheme code and capture the return value
-#
-# Usage: GUILE_CHECK_RETVAL(var,check)
-#
-# @var{var} is a shell variable name to be set to the return value.
-# @var{check} is a Guile Scheme expression, evaluated with "$GUILE -c", and
-# returning either 0 or non-#f to indicate the check passed.
-# Non-0 number or #f indicates failure.
-# Avoid using the character "#" since that confuses autoconf.
-#
-AC_DEFUN([GUILE_CHECK],
- [AC_REQUIRE([GUILE_PROGS])
- $GUILE -c "$2" > /dev/null 2>&1
- $1=$?
- ])
-
-# GUILE_MODULE_CHECK -- check feature of a Guile Scheme module
-#
-# Usage: GUILE_MODULE_CHECK(var,module,featuretest,description)
-#
-# @var{var} is a shell variable name to be set to "yes" or "no".
-# @var{module} is a list of symbols, like: (ice-9 common-list).
-# @var{featuretest} is an expression acceptable to GUILE_CHECK, q.v.
-# @var{description} is a present-tense verb phrase (passed to AC_MSG_CHECKING).
-#
-AC_DEFUN([GUILE_MODULE_CHECK],
- [AC_MSG_CHECKING([if $2 $4])
- GUILE_CHECK($1,(use-modules $2) (exit ((lambda () $3))))
- if test "$$1" = "0" ; then $1=yes ; else $1=no ; fi
- AC_MSG_RESULT($$1)
- ])
-
-# GUILE_MODULE_AVAILABLE -- check availability of a Guile Scheme module
-#
-# Usage: GUILE_MODULE_AVAILABLE(var,module)
-#
-# @var{var} is a shell variable name to be set to "yes" or "no".
-# @var{module} is a list of symbols, like: (ice-9 common-list).
-#
-AC_DEFUN([GUILE_MODULE_AVAILABLE],
- [GUILE_MODULE_CHECK($1,$2,0,is available)
- ])
-
-# GUILE_MODULE_REQUIRED -- fail if a Guile Scheme module is unavailable
-#
-# Usage: GUILE_MODULE_REQUIRED(symlist)
-#
-# @var{symlist} is a list of symbols, WITHOUT surrounding parens,
-# like: ice-9 common-list.
-#
-AC_DEFUN([GUILE_MODULE_REQUIRED],
- [GUILE_MODULE_AVAILABLE(ac_guile_module_required, ($1))
- if test "$ac_guile_module_required" = "no" ; then
- AC_MSG_ERROR([required guile module not found: ($1)])
- fi
- ])
-
-# GUILE_MODULE_EXPORTS -- check if a module exports a variable
-#
-# Usage: GUILE_MODULE_EXPORTS(var,module,modvar)
-#
-# @var{var} is a shell variable to be set to "yes" or "no".
-# @var{module} is a list of symbols, like: (ice-9 common-list).
-# @var{modvar} is the Guile Scheme variable to check.
-#
-AC_DEFUN([GUILE_MODULE_EXPORTS],
- [GUILE_MODULE_CHECK($1,$2,$3,exports `$3')
- ])
-
-# GUILE_MODULE_REQUIRED_EXPORT -- fail if a module doesn't export a variable
-#
-# Usage: GUILE_MODULE_REQUIRED_EXPORT(module,modvar)
-#
-# @var{module} is a list of symbols, like: (ice-9 common-list).
-# @var{modvar} is the Guile Scheme variable to check.
-#
-AC_DEFUN([GUILE_MODULE_REQUIRED_EXPORT],
- [GUILE_MODULE_EXPORTS(guile_module_required_export,$1,$2)
- if test "$guile_module_required_export" = "no" ; then
- AC_MSG_ERROR([module $1 does not export $2; required])
- fi
- ])
-
-## guile.m4 ends here
diff --git a/guile-config/qthreads.m4 b/guile-config/qthreads.m4
deleted file mode 100644
index 8557620a5..000000000
--- a/guile-config/qthreads.m4
+++ /dev/null
@@ -1,165 +0,0 @@
-dnl Autoconf macros for configuring the QuickThreads package
-dnl Jim Blandy <jimb@red-bean.com> --- July 1998
-dnl
-dnl Copyright (C) 1998, 1999 Free Software Foundation, Inc.
-dnl
-dnl This file is part of GUILE.
-dnl
-dnl GUILE is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as
-dnl published by the Free Software Foundation; either version 2, or
-dnl (at your option) any later version.
-dnl
-dnl GUILE is distributed in the hope that it will be useful, but
-dnl WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public
-dnl License along with GUILE; see the file COPYING. If not, write
-dnl to the Free Software Foundation, Inc., 59 Temple Place, Suite
-dnl 330, Boston, MA 02111-1307 USA
-
-
-
-dnl QTHREADS_CONFIGURE configures the QuickThreads package. The QT
-dnl sources should be in $srcdir/qt. If configuration succeeds, this
-dnl macro creates the appropriate symlinks in the qt object directory,
-dnl and sets the following variables, used in building libqthreads.a:
-dnl QTHREAD_LTLIBS --- set to libqthreads.la if configuration
-dnl succeeds, or the empty string if configuration fails.
-dnl qtmd_h, qtmds_s, qtmdc_c, qtdmdb_s --- the names of the machine-
-dnl dependent source files.
-dnl qthread_asflags --- flags to pass to the compiler when processing
-dnl assembly-language files.
-dnl
-dnl It also sets the following variables, which describe how clients
-dnl can link against libqthreads.a:
-dnl THREAD_PACKAGE --- set to "QT" if configuration succeeds, or
-dnl the empty string if configuration fails.
-dnl THREAD_LIBS_LOCAL --- linker options for use in this source tree
-dnl THREAD_LIBS_INSTALLED --- linker options for use after this package
-dnl is installed
-dnl It would be nice if all thread configuration packages for Guile
-dnl followed the same conventions.
-dnl
-dnl All of the above variables will be substituted into Makefiles in
-dnl the usual autoconf fashion.
-dnl
-dnl We distinguish between THREAD_LIBS_LOCAL and
-dnl THREAD_LIBS_INSTALLED because the thread library might be in
-dnl this tree, and be built using libtool. This means that:
-dnl 1) when building other executables in this tree, one must
-dnl pass the relative path to the ../libfoo.la file, but
-dnl 2) once the whole package has been installed, users should
-dnl link using -lfoo.
-dnl Normally, we only care about the first case, but since the
-dnl guile-config script needs to give users all the flags they need
-dnl to link programs against guile, the GUILE_WITH_THREADS macro
-dnl needs to supply the second piece of information as well.
-dnl
-dnl This whole thing is a little confused about what ought to be
-dnl done in the top-level configure script, and what ought to be
-dnl taken care of in the subdirectory. For example, qtmds_s and
-dnl friends really ought not to be even mentioned in the top-level
-dnl configure script, but here they are.
-
-AC_DEFUN([QTHREADS_CONFIGURE],[
- AC_REQUIRE([AC_PROG_LN_S])
-
- AC_MSG_CHECKING(QuickThreads configuration)
-
- changequote(,)dnl We use [ and ] in a regexp in the case
-
- THREAD_PACKAGE=QT
- qthread_asflags=''
- case "$host" in
- i[3456]86-*-*)
- port_name=i386
- qtmd_h=md/i386.h
- qtmds_s=md/i386.s
- qtmdc_c=md/null.c
- qtdmdb_s=
- case "$host" in
- *-*-netbsd* )
- ## NetBSD needs to be told to pass the assembly code through
- ## the C preprocessor. Other GCC installations seem to do
- ## this by default, but NetBSD's doesn't. We could get the
- ## same effect by giving the file a name ending with .S
- ## instead of .s, but I don't see how to tell automake to do
- ## that.
- qthread_asflags='-x assembler-with-cpp'
- ;;
- esac
- ;;
- mips-sgi-irix[56]*)
- port_name=irix
- qtmd_h=md/mips.h
- qtmds_s=md/mips-irix5.s
- qtmdc_c=md/null.c
- qtdmdb_s=md/mips_b.s
- ;;
- mips-*-*)
- port_name=mips
- qtmd_h=md/mips.h
- qtmds_s=md/mips.s
- qtmdc_c=md/null.c
- qtdmdb_s=md/mips_b.s
- ;;
- sparc-*-sunos*)
- port_name=sparc-sunos
- qtmd_h=md/sparc.h
- qtmds_s=md/_sparc.s
- qtmdc_c=md/null.c
- qtdmdb_s=md/_sparc_b.s
- ;;
- sparc*-*-*)
- port_name=sparc
- qtmd_h=md/sparc.h
- qtmds_s=md/sparc.s
- qtmdc_c=md/null.c
- qtdmdb_s=md/sparc_b.s
- ;;
- alpha*-*-*)
- port_name=alpha
- qtmd_h=md/axp.h
- qtmds_s=md/axp.s
- qtmdc_c=md/null.c
- qtdmdb_s=md/axp_b.s
- ;;
- arm*-*-*)
- port_name=arm
- qtmd_h=md/arm.h
- qtmds_s=md/arm.s
- qtmdc_c=md/null.c
- qtdmdb_s=
- ;;
- *)
- echo "Unknown configuration; threads package disabled"
- THREAD_PACKAGE=""
- ;;
- esac
- changequote([, ])
-
- # Did configuration succeed?
- if test -n "$THREAD_PACKAGE"; then
- AC_MSG_RESULT($port_name)
- QTHREAD_LTLIBS=libqthreads.la
- THREAD_LIBS_LOCAL="../qt/libqthreads.la"
- THREAD_LIBS_INSTALLED="-lqthreads"
- else
- AC_MSG_RESULT(none; disabled)
- fi
-
- AC_SUBST(QTHREAD_LTLIBS)
- AC_SUBST(qtmd_h)
- AC_SUBST(qtmds_s)
- AC_SUBST(qtmdc_c)
- AC_SUBST(qtdmdb_s)
- AC_SUBST(qthread_asflags)
- AC_SUBST(THREAD_PACKAGE)
- AC_SUBST(THREAD_LIBS_LOCAL)
- AC_SUBST(THREAD_LIBS_INSTALLED)
-])
-
-dnl qthreads.m4 ends here
diff --git a/guile-readline/.cvsignore b/guile-readline/.cvsignore
deleted file mode 100644
index 9bf5eb05e..000000000
--- a/guile-readline/.cvsignore
+++ /dev/null
@@ -1,16 +0,0 @@
-*.c.clean.c
-*.la
-*.lo
-*.x
-.deps
-.libs
-Makefile
-Makefile.in
-aclocal.m4
-autom4te.cache
-config.guess
-config.log
-config.status
-config.sub
-configure
-libtool
diff --git a/guile-readline/ChangeLog b/guile-readline/ChangeLog
deleted file mode 100644
index 8f568e200..000000000
--- a/guile-readline/ChangeLog
+++ /dev/null
@@ -1,534 +0,0 @@
-2002-04-30 Marius Vollmer <marius.vollmer@uni-dortmund.de>
-
- * autogen.sh: Invoke plain aclocal instead of guile-aclocal.sh.
- We don't need the Guile m4 macros and the previous invocation of
- guile-aclocal.sh created the aclocal.m4 file in the wrong
- directory (see change from 2002-04-26).
-
-2002-04-26 Marius Vollmer <mvo@zagadka.ping.de>
-
- * autogen.sh: Change to parent dir before invoking
- guile-aclocal.sh.
-
-2002-04-16 Marius Vollmer <mvo@zagadka.ping.de>
-
- * Makefile.am (dist-hook): Make sure $(distdir)/Makefile.in is
- writable before modifying it.
-
-2002-04-10 Rob Browning <rlb@defaultvalue.org>
-
- * configure.in: add definitions to AC_DEFINE calls for new
- autoconf.
-
- * .cvsignore: add autom4te.cache and *.c.clean.c.
-
-2002-03-24 Marius Vollmer <mvo@zagadka.ping.de>
-
- * Makefile.am (.c.x): Pass "-o $@" to guile-snarf.
-
-2002-03-13 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * Makefile.am (snarfcppopts): New var.
- (.c.x): Use $(snarfcppopts). Rework guile-snarf usage.
-
-2002-02-27 Stefan Jahn <stefan@lkcc.org>
-
- * Makefile.am (EXTRA_DIST): Added the `LIBGUILEREADLINE-VERSION'
- file.
-
-2002-02-25 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * configure.in (LIBGUILEREADLINE-VERSION):
- Look for this file in $srcdir.
-
-2002-02-24 Rob Browning <rlb@defaultvalue.org>
-
- * configure.in: source ./LIBGUILEREADLINE-VERSION for version info
- and then AC_SUBST the resulting variables:
- LIBGUILEREADLINE_INTERFACE_CURRENT,
- LIBGUILEREADLINE_INTERFACE_REVISION,
- LIBGUILEREADLINE_INTERFACE_AGE, and
- LIBGUILEREADLINE_INTERFACE.
-
- * Makefile.am (libguilereadline_la_LDFLAGS): use
- @LIBGUILEREADLINE_INTERFACE@ for version information.
-
- * LIBGUILEREADLINE-VERSION: new file containing shared lib
- versioning information.
-
-2002-02-12 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * Makefile.am (AUTOMAKE_OPTIONS): Replace "gnu" with "foreign".
- This undoes the 2002-02-08 change.
-
-2002-02-08 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * Makefile.am (AUTOMAKE_OPTIONS): Replace "foreign" with "gnu".
-
-2002-01-29 Neil Jerram <neil@ossau.uklinux.net>
-
- * readline.scm (with-readline-completion-function): Renamed from
- `call-with-readline-completion-function'.
-
-2001-11-30 Neil Jerram <neil@ossau.uklinux.net>
-
- * Makefile.am (EXTRA_DIST): Refer to $(ice9_DATA) rather than
- readline.scm explicitly.
- (ETAGS_ARGS): Added.
-
-2001-11-04 Stefan Jahn <stefan@lkcc.org>
-
- * configure.in (EXTRA_DEFS): Follow-up patch. Using SCM_IMPORT
- instead of __SCM_IMPORT__.
-
- * readline.c (scm_readline_init_ports): Disable input/output
- stream redirection for Win32. The readline package for Win32
- does not support this. The guile-readline library works fine
- for command line editing.
-
- * readline.h (SCM_RL_API): Renamed __FOO__ macros into FOO.
-
-2001-11-02 Marius Vollmer <mvo@zagadka.ping.de>
-
- Support for native Win32. Thanks to Stefan Jahn!
-
- * Makefile.am: Put `-export-dynamic -no-undefined' into LDFLAGS
- and add the library `libguile.la' to support linkers which do not
- allow unresolved symbols inside shared libraries.
-
- * configure.in: Define AC_LIBTOOL_WIN32_DLL to build clean dlls
- on Win32 platforms.
- Define extra compiler flags necessary to build clean dlls.
-
- * readline.c: Include `io.h' and exclude `sys/time.h' for MinGW.
-
- * readline.h: Defintion of SCM_RL_API. Prefixed each exported
- symbol with SCM_RL_API.
-
-2001-08-31 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * readline.c (scm_readline, scm_add_history,
- scm_filename_completion_function, completion_function): Remove
- calls to SCM_STRING_COERCE_0TERMINATION_X. Since the substring
- type is gone, all strings are 0-terminated anyway.
-
-2001-08-31 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * readline.scm: `feature?´ is deprecated. Use `provided?´
- instead.
-
-2001-08-25 Marius Vollmer <mvo@zagadka.ping.de>
-
- * readline.scm: Use load-extension instead of explicit
- dynamic-link/dynamic-call. Removed ".so" extension from library
- name.
-
-2001-08-02 Neil Jerram <neil@ossau.uklinux.net>
-
- * readline.scm (call-with-readline-completion-function): New.
-
-2001-07-18 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * Makefile.am, readline.scm: Updated copyright notice.
-
-2001-07-09 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * readline.c: Remove "face-lift" comment.
-
-2001-06-30 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * readline.c (completion_function): Use scm_list_n instead of
- SCM_LISTn.
-
-2001-06-14 Marius Vollmer <mvo@zagadka.ping.de>
-
- * readline.c, readline.h: Replace "scm_*_t" with "scm_t_*".
-
-2001-06-14 Marius Vollmer <mvo@zagadka.ping.de>
-
- Thanks to Matthias Köppe!
-
- * configure.in: Check for rl_filename_completion_function.
- * readline.c (s_scm_filename_completion_function): Use
- rl_filename_completion_function instead of
- filename_completion_function, if we have it.
- (scm_init_readline): Use rl_compentry_func_t instead if Function
- when _RL_FUNCTION_TYPEDEF is defined.
-
- * readline.h (scm_clear_history): New prototype.
-
-2001-06-07 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * readline.c (current_input_getc): Mark unused parameters with
- SCM_UNUSED.
-
-2001-06-03 Marius Vollmer <mvo@zagadka.ping.de>
-
- * configure.in: Added AC_PREREQ(2.50) and minimally changed for
- autoconf 2.50. This is mostly so that the `transparent autoconf
- wrapper' on Debian picks the right version of autoconf.
-
-2001-05-31 Michael Livshin <mlivshin@bigfoot.com>
-
- * Makefile.am (libguilereadline_la_SOURCES): removed readline.x
- from here (not needed).
- (CLEANFILES): added *.x (and removed from DISTCLEANFILES).
- (MKDEP): copied from libguile/Makefile.am. not that it matters
- now, but it will if we stop using BUILT_SOURCES for some reason.
-
-2001-05-24 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- Make it compile with --disable-deprecated.
-
- * readline.h: scm_option->scm_option_t.
-
- * readline.c (stream_from_fport): scm_fport->scm_fport_t;
- scm_option->scm_option_t.
-
-2001-05-23 Michael Livshin <mlivshin@bigfoot.com>
-
- * readline.c (strdup): make `len' a size_t.
-
-2001-05-10 Marius Vollmer <mvo@zagadka.ping.de>
-
- * readline.c (completion_function): Use SCM_VARIABLE_REF to access
- scm_readline_completion_function_var.
- (scm_init_readline): Use scm_c_define instead of scm_sysintern to
- create scm_readline_completion_function_var.
-
-2001-04-09 Marius Vollmer <mvo@zagadka.ping.de>
-
- * readline.c (scm_clear_history): New function.
- * readline.scm (readline-port): Call clear-history on exit.
- Thanks to Utz-Uwe Haus.
-
-2001-03-09 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * readline.c: Add #include <stdio.h>
-
-2001-03-05 Neil Jerram <neil@ossau.uklinux.net>
-
- * readline.scm (make-readline-port): Rewrite using
- make-line-buffered-input-port.
- (activate-readline): Call set-buffered-input-continuation?!.
-
-2001-01-28 Marius Vollmer <mvo@zagadka.ping.de>
-
- * readline.scm (make-readline-port): PROMPT becomes PROMPT2 as
- soon as GET-CHARACTER returns any character at all that was
- previously read. This makes the continuation prompt appear
- properly for partial expressions. Thanks to Neil Jerram!
-
-2001-01-26 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- This patch fixes a problem reported by Martin Grabmueller about
- the impossibility to access readline's run-time options.
-
- * readline.scm: Added a comment about guile's behaviour if one of
- the ports used by readline are closed.
-
- (readline-options readline-enable readline-disable,
- readline-set!): These are now defined here instead of in
- boot-9.scm.
-
-2001-01-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * readline.scm (set-readline-input-port!,
- set-readline-output-port!): Make sure that only valid port
- parameters are passed. Thanks to Martin Grabmueller for sending
- a patch that formed the basis for this change.
-
-2001-01-18 Neil Jerram <neil@ossau.uklinux.net>
-
- * readline.scm (make-readline-port): Make readline port
- input-only.
-
-2000-12-12 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * readline.scm (activate-readline): Lookup 'use-emacs-interface
- in the-root-module.
-
-2000-11-24 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * readline.c (current_input_getc): Use more explicit predicate
- than SCM_NIMP.
-
- (scm_readline, scm_readline_init_ports, completion_function):
- Remove redundant SCM_N?IMP tests.
-
- (scm_readline): Fixed default input/output port parameter
- handling.
-
-2000-11-24 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * readline.c (scm_readline, scm_add_history, completion_function,
- scm_filename_completion_function): Replace calls to
- SCM_COERCE_SUBSTR with SCM_STRING_COERCE_0TERMINATION_X.
-
- (internal_readline, scm_add_history, scm_read_history,
- scm_write_history, scm_filename_completion_function,
- completion_function): Replace SCM_CHARS with SCM_STRING_CHARS.
-
-2000-11-19 Gary Houston <ghouston@arglist.com>
-
- * configure.in: test $ac_cv_lib_readline_readline instead of
- $ac_cv_lib_readline_main. Thanks to Lars J. Aas.
-
-2000-09-17 Marius Vollmer <mvo@zagadka.ping.de>
-
- * configure.in: Check for curses, terminfo and termlib libraries
- in addition to ncurses and termcap.
- Check for `readline' in libreadline, not for `main'.
- Thanks to Albert Chin!
-
-2000-07-17 Marius Vollmer <mvo@zagadka.ping.de>
-
- * configure.in (rl_pre_input_hook): Don't check for this with
- AC_CHECK_FUNCS, it doesn't work on HP/UX. Test for it with
- AC_TRY_LINK.
-
-2000-06-19 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * readline.c (sigwinch_enable_restart, scm_init_readline):
- Re-enable restart for SIGWINCH signal.
-
- * configure.in: Added test if readline clears SA_RESTART flag for
- SIGWINCH. (Thanks to Dale P. Smith.)
- Check for siginterrupt and rl_pre_input_hook.
-
-2000-06-14 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * readline.c (scm_readline): Added parenthesis around && within
- ||.
- Fixed up prototype for `reentry_barrier'.
- Conditionally #include <unistd.h>. (Needed for `dup'.)
-
-2000-06-13 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * Makefile.am (dist-hook): Added kludge to fix automake generated
- dependencies in the distribution archive Makefile.
-
-2000-06-12 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * readline.scm (apropos-completion-function): Don't define and
- install if the 'regex feature is missing.
-
-2000-06-06 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * readline.c: Always provide scm_init_readline, also if readline
- support is not included. Otherwise, a strange dynamic loading
- error will occur. (It would be better not to install
- libguilereadline at all.)
-
- * readline-activator.scm (activate-readline): Report an error if
- readline isn't provided by Guile.
-
- * readline.scm: Report an error if readline isn't provided by
- Guile; Added :no-backtrace to module header.
-
- * configure.in: Put more ink before readline version warning.
- (Thanks to Ian Grant.)
-
-2000-06-01 Michael Livshin <mlivshin@bigfoot.com>
-
- * autogen.sh: call ../guile-aclocal.sh instead of aclocal
-
-2000-05-01 Gary Houston <ghouston@arglist.com>
-
- * readline.c: include libguile.h, not libguile/libguile.h.
-
-2000-04-21 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * *.*: Change includes so that they always use the "prefixes"
- libguile/, qt/, guile-readline/, or libltdl/.
-
- * Makefile.am (DEFS): Added. automake adds -I options to DEFS,
- and we don't want that.
- (INCLUDES): Removed all -I options except for the root source
- directory and the root build directory.
-
-2000-04-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * readline.c (scm_readline): Must unpack SCM values to access
- their raw contents.
-
-2000-03-19 Michael Livshin <mlivshin@bigfoot.com>
-
- * *.[hc]: add Emacs magic at the end of file, to ensure GNU
- indentation style.
-
-2000-03-12 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * readline.c (current_input_getc): Don't pass int values through
- SCM variables.
- (match_paren): Bugfix: First arg to select is not number of
- descriptors but the number of the highest descriptor + 1.
-
-Thu Mar 9 08:00:26 2000 Greg J. Badros <gjb@cs.washington.edu>
-
- * readline.c: scm_validate.h renamed to validate.h.
-
-Wed Mar 8 10:43:10 2000 Greg J. Badros <gjb@cs.washington.edu>
-
- * readline.c (match_paren): Use SELECT_TYPE, not fd_set, for type
- of readset.
-
-2000-01-25 Marius Vollmer <mvo@zagadka.ping.de>
-
- * autogen.sh: Call libtoolize. Pass --add-missing option to
- automake.
-
- * readline.scm: Only link glue code when the 'readline feature is
- not already present. Thanks to Clark McGrew.
-
-Tue Jan 11 17:51:40 2000 Greg J. Badros <gjb@cs.washington.edu>
-
- * readline.c (scm_init_readline): Drop extra argument to
- scm_mutex_init as that argument should not exist. I do not know
- how this escaped detection for so long.
-
-2000-01-09 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * readline.c (match_paren): Changed return type to int (this is
- the definition in readline 4) and modified code layout according
- to GNU coding standards.
-
-Wed Jan 5 11:18:01 2000 Greg J. Badros <gjb@cs.washington.edu>
-
- * readline.c: Whitespace changes -- added space after
- SCM_VALIDATE_* macros to match GNU coding standards.
-
-Wed Jan 5 11:02:40 2000 Greg J. Badros <gjb@cs.washington.edu>
-
- * readline.c: Rename GUILE_PROC to SCM_DEFINE.
-
-Mon Dec 13 13:57:57 1999 Greg J. Badros <gjb@cs.washington.edu>
-
- * readline.c: Include libguile/scm_validate.h
-
-Sun Dec 12 19:56:52 1999 Greg J. Badros <gjb@cs.washington.edu>
-
- * readline.c: Updated to use GUILE_PROC, SCM_VALIDATE, and have
- (now empty) docstrings.
-
-1999-11-18 Gary Houston <ghouston@freewire.co.uk>
-
- * readline.c (scm_init_readline): set rl_readline_name to Guile,
- to allow conditionals in .inputrc.
-
-1999-10-05 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * Makefile.in, configure, aclocal.m4: Deleted from CVS repository.
- Run the autogen.sh script to create generated files like these.
- * autogen.sh: New script, invoked by the top-level autogen.sh.
-
-1999-09-22 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * configure.in: Call AM_PROG_CC_STDC.
- * configure, aclocal.m4: Regenerated.
-
-1999-09-16 Mikael Djurfeldt <mdj@mdj-pc.nada.kth.se>
-
- * Makefile.am (.c.x): Use same rule as in libguile.
-
-1999-09-12 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * readline.h, readline.scm: Updated copyright notices.
-
-1999-09-11 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * readline.scm (activate-readline): Set (using-readline?).
-
-1999-09-11 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * aclocal.m4: Regenerated with newer libtool macros.
-
- * Makefile.am (DISTCLEANFILES): Get rid of .x files.
- * Makefile.in: Regenerated.
- (Thanks to Keisuke Nishida.)
-
-1999-09-11 Marius Vollmer <mvo@zagadka.ping.de>
-
- * readline.scm: Moved from ../ice-9.
- Dynamically link libguilereadline.so.
- (readline): Just define in this module, do not overwrite builtin
- variable. The builtin readline function is now named "%readline",
- so this works. See below.
- (activate-readline): New function which contains the readline
- activation code formerly found in top-repl.
-
- * readline.c (scm_readline): Export it to Scheme as "%readline".
-
- * configure.in: Get version from ../GUILE-VERSION and use it for
- package version.
-
- * Makefile.am: Do not install and distribute
- readline-activator.scm. Install and distribute readline.scm
- instead.
-
- * aclocal.m4, Makefile.in, configure, libtool: Regenerated, but
- probably with the wrong version of the tools.
-
-1999-08-29 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- The following change makes it possible for applications to have
- their own version of scm_readline.
- * readline.c, readline.h (rl_cleanup_after_signal,
- rl_free_line_state): Made global.
- (scm_readline_init_ports): New function.
- (scm_readline): Use scm_readline_init_ports.
- (Thanks to Anders Holst.)
-
- * Makefile.am: Install guile-readline/readline.h.
-
-1999-08-20 James Blandy <jimb@mule.m17n.org>
-
- * Makefile.in, aclocal.m4, configure: Regenerated.
-
-1999-08-17 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * configure.in (HAVE_RL_GETC_FUNCTION): Modified test to actually
- use rl_getc_function. Otherwise smart compilers, like gcc,
- optimize away the reference so that no error occurs in the link
- phase.
-
-1999-08-04 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * Makefile.am (INCLUDES): Added -I$(srcdir)/../libguile.
- (Thanks to Greg Badros.)
-
-1999-07-24 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * readline.c (handle_error): Put a cosmetic newline on
- rl_outstream on error before closing it.
-
- * configure.in: Changed AC_MSG_ERROR into AC_MSG_WARN in case
- readline doesn't exist on the system, so that configuration can
- proceed normally without readline.
-
- * readline.c: #include "libguile/_scm.h" (so that we get the
- configuration information) and fix other includes so that they'll
- work on a system where guile is not yet installed.
-
- * Makefile.am (BUILT_SOURCES): Added.
-
-1999-07-23 Marius Vollmer <mvo@zagadka.ping.de>
-
- * Checked everything into CVS.
-
-1999-07-22 Marius Vollmer <mvo@zagadka.ping.de>
-
- * readline.c (stream_from_fport): New function.
- (scm_readline): Use it to for the input and output ports. Close
- the streams after readline returns.
- (handle_error): Close them also when an error occured.
-
-1999-06-17 Marius Vollmer <mvo@zagadka.ping.de>
-
- * readline.h, readline.c: Removed exception notice from copyright
- statement.
-
-1999-05-16 Marius Vollmer <mvo@zagadka.ping.de>
-
- * Started guile-readline package. Files are copied from old
- guile-core package and slightly modified.
diff --git a/guile-readline/LIBGUILEREADLINE-VERSION b/guile-readline/LIBGUILEREADLINE-VERSION
deleted file mode 100644
index ecab91095..000000000
--- a/guile-readline/LIBGUILEREADLINE-VERSION
+++ /dev/null
@@ -1,13 +0,0 @@
-# -*-shell-script-*-
-
-# This file contains the shared library versioning information. Right
-# now, for this to work properly, you'll also need to add AC_SUBST
-# calls to the right place in configure.in, add the right
-# -version-info statement to your Makefile.am, and add a call to
-# source this file from configure.in. Later we may automate more of
-# this.
-
-LIBGUILEREADLINE_INTERFACE_CURRENT=10
-LIBGUILEREADLINE_INTERFACE_REVISION=0
-LIBGUILEREADLINE_INTERFACE_AGE=0
-LIBGUILEREADLINE_INTERFACE="${LIBGUILEREADLINE_INTERFACE_CURRENT}:${LIBGUILEREADLINE_INTERFACE_REVISION}:${LIBGUILEREADLINE_INTERFACE_AGE}"
diff --git a/guile-readline/Makefile.am b/guile-readline/Makefile.am
deleted file mode 100644
index 22f9acfb2..000000000
--- a/guile-readline/Makefile.am
+++ /dev/null
@@ -1,66 +0,0 @@
-## Process this file with Automake to create Makefile.in
-##
-## Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-AUTOMAKE_OPTIONS = foreign
-
-## Prevent automake from adding extra -I options
-DEFS = @DEFS@ @EXTRA_DEFS@
-## Check for headers in $(srcdir)/.., so that #include
-## <libguile/MUMBLE.h> will find MUMBLE.h in this dir when we're
-## building.
-INCLUDES = -I.. -I$(srcdir)/..
-
-GUILE_SNARF = ../libguile/guile-snarf
-
-lib_LTLIBRARIES = libguilereadline.la
-
-libguilereadline_la_SOURCES = readline.c
-libguilereadline_la_LIBADD = ../libguile/libguile.la
-libguilereadline_la_LDFLAGS = -version-info @LIBGUILEREADLINE_INTERFACE@ \
- -export-dynamic -no-undefined
-
-
-BUILT_SOURCES = readline.x
-
-pkginclude_HEADERS = readline.h
-
-ice9dir = $(datadir)/guile/$(VERSION)/ice-9
-ice9_DATA = readline.scm
-
-snarfcppopts = $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-SUFFIXES = .x
-.c.x:
- $(GUILE_SNARF) -o $@ $< $(snarfcppopts)
-
-EXTRA_DIST = $(ice9_DATA) LIBGUILEREADLINE-VERSION
-ETAGS_ARGS = $(ice9_DATA)
-
-MKDEP = gcc -M -MG $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-
-CLEANFILES = *.x
-
-dist-hook:
- (temp="/tmp/mangle-deps.$$$$"; \
- trap "rm -f $$temp" 0 1 2 15; \
- sed -e 's|\([ ]\)\(\.\./\(\|libguile/\|guile-readline/\)[a-z_-]*\.h\)|\1$$(srcdir)/\2|g' $(distdir)/Makefile.in \
- | sed -e 's|\$$(srcdir)/\(\.\./libguile/\(libpath\|scmconfig\|versiondat\)\)|\1|g' \
- | sed -e 's|\.\./guile-readline/\([a-z_-]*\.x\)|\1|g' > $$temp \
- && chmod u+w $(distdir)/Makefile.in && cp -p $$temp $(distdir)/Makefile.in)
diff --git a/guile-readline/autogen.sh b/guile-readline/autogen.sh
deleted file mode 100755
index 587c072e2..000000000
--- a/guile-readline/autogen.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-[ -f readline-activator.scm ] || {
- echo "autogen.sh: run this command only in the guile-readline directory."
- exit 1
-}
-
-aclocal
-libtoolize --copy --automake
-autoconf
-automake --add-missing
diff --git a/guile-readline/configure.in b/guile-readline/configure.in
deleted file mode 100644
index c2056712c..000000000
--- a/guile-readline/configure.in
+++ /dev/null
@@ -1,130 +0,0 @@
-AC_PREREQ(2.50)
-
-AC_INIT
-AC_CONFIG_SRCDIR([readline.c])
-. $srcdir/../GUILE-VERSION
-PACKAGE=guile-readline
-AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
-
-AC_PROG_INSTALL
-AC_PROG_CC
-AM_PROG_CC_STDC
-AC_LIBTOOL_WIN32_DLL
-AM_PROG_LIBTOOL
-
-dnl
-dnl Check for Winsock and other functionality on Win32 (*not* CygWin)
-dnl
-AC_CYGWIN
-AC_MINGW32
-EXTRA_DEFS=""
-if test "$MINGW32" = "yes" ; then
- if test $enable_shared = yes ; then
- EXTRA_DEFS="-DSCM_IMPORT"
- fi
-fi
-AC_SUBST(EXTRA_DEFS)
-
-for termlib in ncurses curses termcap terminfo termlib ; do
- AC_CHECK_LIB(${termlib}, tgoto,
- [LIBS="-l${termlib} $LIBS"; break])
-done
-
-AC_CHECK_LIB(readline, readline)
-if test $ac_cv_lib_readline_readline = no; then
- AC_MSG_WARN([libreadline was not found on your system.])
-fi
-
-AC_CHECK_FUNCS(siginterrupt rl_clear_signals rl_cleanup_after_signal)
-
-dnl Check for modern readline naming
-AC_CHECK_FUNCS(rl_filename_completion_function)
-
-dnl Check for rl_pre_input_hook. This is more complicated because on
-dnl some systems (HP/UX), the linker wont let us treat
-dnl rl_pre_input_hook as a function when it really is a function
-dnl pointer.
-
-AC_MSG_CHECKING([for rl_pre_input_hook])
-AC_CACHE_VAL(ac_cv_var_rl_pre_input_hook,
-[AC_TRY_LINK([
-#include <stdio.h>
-#include <readline/readline.h>
-], [
-rl_pre_input_hook = 0;
-],
-ac_cv_var_rl_pre_input_hook=yes,
-ac_cv_var_rl_pre_input_hook=no)])
-AC_MSG_RESULT($ac_cv_var_rl_pre_input_hook)
-if test $ac_cv_var_rl_pre_input_hook = yes; then
- AC_DEFINE(HAVE_RL_PRE_INPUT_HOOK)
-fi
-
-
-AC_MSG_CHECKING(if readline clears SA_RESTART flag for SIGWINCH)
-AC_CACHE_VAL(guile_cv_sigwinch_sa_restart_cleared,
-AC_TRY_RUN([#include <signal.h>
-#include <stdio.h>
-#include <readline/readline.h>
-
-int
-hook ()
-{
- struct sigaction action;
-
- sigaction (SIGWINCH, NULL, &action);
- rl_cleanup_after_signal();
-
- /* exit with 0 if readline disabled SA_RESTART */
- exit (action.sa_flags & SA_RESTART);
-}
-
-int
-main ()
-{
- struct sigaction action;
-
- sigaction (SIGWINCH, NULL, &action);
- action.sa_flags |= SA_RESTART;
- sigaction (SIGWINCH, &action, NULL);
-
- rl_pre_input_hook = hook;
- readline ("");
-}],
-guile_cv_sigwinch_sa_restart_cleared=yes,
-guile_cv_sigwinch_sa_restart_cleared=no,
-guile_cv_sigwinch_sa_restart_cleared=yes))
-AC_MSG_RESULT($guile_cv_sigwinch_sa_restart_cleared)
-if test $guile_cv_sigwinch_sa_restart_cleared = yes; then
- AC_DEFINE(GUILE_SIGWINCH_SA_RESTART_CLEARED)
-fi
-
-AC_CACHE_CHECK([for rl_getc_function pointer in readline],
- ac_cv_var_rl_getc_function,
- [AC_TRY_LINK([
-#include <stdio.h>
-#include <readline/readline.h>],
- [printf ("%ld", (long) rl_getc_function)],
- [ac_cv_var_rl_getc_function=yes],
- [ac_cv_var_rl_getc_function=no])])
-if test "${ac_cv_var_rl_getc_function}" = "yes"; then
- AC_DEFINE(HAVE_RL_GETC_FUNCTION, 1,
- [Define if your readline library has the rl_getc_function variable.])
-fi
-
-if test $ac_cv_lib_readline_readline = yes \
- -a $ac_cv_var_rl_getc_function = no; then
- AC_MSG_WARN([*** libreadline is too old on your system.])
- AC_MSG_WARN([*** You need readline version 2.1 or later.])
-fi
-
-AC_CHECK_FUNCS(strdup)
-
-. $srcdir/LIBGUILEREADLINE-VERSION
-AC_SUBST(LIBGUILEREADLINE_INTERFACE_CURRENT)
-AC_SUBST(LIBGUILEREADLINE_INTERFACE_REVISION)
-AC_SUBST(LIBGUILEREADLINE_INTERFACE_AGE)
-AC_SUBST(LIBGUILEREADLINE_INTERFACE)
-
-AC_CONFIG_FILES(Makefile)
-AC_OUTPUT
diff --git a/guile-readline/readline-activator.scm b/guile-readline/readline-activator.scm
deleted file mode 100644
index 42ed113bf..000000000
--- a/guile-readline/readline-activator.scm
+++ /dev/null
@@ -1,17 +0,0 @@
-(define-module (readline-activator))
-
-(define-public (activate-readline)
- (if (not (provided? 'readline))
- (scm-error 'misc-error
- 'activate-readline
- "readline is not provided in this Guile installation"
- '()
- '()))
- (save-module-excursion
- (lambda ()
- (define-module (guile))
- (dynamic-call "scm_init_readline" (dynamic-link "libguilereadline.so"))
- (if (isatty? (current-input-port))
- (begin
- (define-module (guile) :use-module (ice-9 readline))
- (define-module (guile-user) :use-module (ice-9 readline)))))))
diff --git a/guile-readline/readline.c b/guile-readline/readline.c
deleted file mode 100644
index 0802fa3dc..000000000
--- a/guile-readline/readline.c
+++ /dev/null
@@ -1,594 +0,0 @@
-/* readline.c --- line editing support for Guile */
-
-/* Copyright (C) 1997,1999,2000,2001 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, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307 USA
- *
- */
-
-
-
-
-#include "libguile/_scm.h"
-#ifdef HAVE_RL_GETC_FUNCTION
-#include "libguile.h"
-#include "libguile/gh.h"
-#include "libguile/iselect.h"
-
-#include <stdio.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <readline/readline.h>
-#include <readline/history.h>
-#ifndef __MINGW32__
-#include <sys/time.h>
-#else
-#include <io.h>
-#endif
-#include <signal.h>
-
-#include "libguile/validate.h"
-#include "guile-readline/readline.h"
-
-scm_t_option scm_readline_opts[] = {
- { SCM_OPTION_BOOLEAN, "history-file", 1,
- "Use history file." },
- { SCM_OPTION_INTEGER, "history-length", 200,
- "History length." },
- { SCM_OPTION_INTEGER, "bounce-parens", 500,
- "Time (ms) to show matching opening parenthesis (0 = off)."}
-};
-
-extern void stifle_history (int max);
-
-SCM_DEFINE (scm_readline_options, "readline-options-interface", 0, 1, 0,
- (SCM setting),
-"")
-#define FUNC_NAME s_scm_readline_options
-{
- SCM ans = scm_options (setting,
- scm_readline_opts,
- SCM_N_READLINE_OPTIONS,
- FUNC_NAME);
- stifle_history (SCM_HISTORY_LENGTH);
- return ans;
-}
-#undef FUNC_NAME
-
-#ifndef HAVE_STRDUP
-static char *
-strdup (char *s)
-{
- size_t len = strlen (s);
- char *new = malloc (len + 1);
- strcpy (new, s);
- return new;
-}
-#endif /* HAVE_STRDUP */
-
-#ifndef HAVE_RL_CLEANUP_AFTER_SIGNAL
-
-/* These are readline functions added in release 2.3. They will work
- * together with readline-2.1 and 2.2. (The readline interface is
- * disabled for earlier releases.)
- * They are declared static; if we want to use them elsewhere, then
- * we need external declarations for them, but at the moment, I don't
- * think anything else in Guile ought to use these.
- */
-
-extern void _rl_clean_up_for_exit ();
-extern void _rl_kill_kbd_macro ();
-extern int _rl_init_argument ();
-
-void
-rl_cleanup_after_signal ()
-{
-#ifdef HAVE_RL_CLEAR_SIGNALS
- _rl_clean_up_for_exit ();
-#endif
- (*rl_deprep_term_function) ();
-#ifdef HAVE_RL_CLEAR_SIGNALS
- rl_clear_signals ();
-#endif
- rl_pending_input = 0;
-}
-
-void
-rl_free_line_state ()
-{
- register HIST_ENTRY *entry;
-
- free_undo_list ();
-
- entry = current_history ();
- if (entry)
- entry->data = (char *)NULL;
-
- _rl_kill_kbd_macro ();
- rl_clear_message ();
- _rl_init_argument ();
-}
-
-#endif /* !HAVE_RL_CLEANUP_AFTER_SIGNAL */
-
-static int promptp;
-static SCM input_port;
-static SCM before_read;
-
-static int
-current_input_getc (FILE *in SCM_UNUSED)
-{
- if (promptp && !SCM_FALSEP (before_read))
- {
- scm_apply (before_read, SCM_EOL, SCM_EOL);
- promptp = 0;
- }
- return scm_getc (input_port);
-}
-
-static void
-redisplay ()
-{
- rl_redisplay ();
- /* promptp = 1; */
-}
-
-static int in_readline = 0;
-#ifdef USE_THREADS
-static scm_t_mutex reentry_barrier_mutex;
-#endif
-
-static SCM internal_readline (SCM text);
-static SCM handle_error (void *data, SCM tag, SCM args);
-static void reentry_barrier (void);
-
-
-SCM_DEFINE (scm_readline, "%readline", 0, 4, 0,
- (SCM text, SCM inp, SCM outp, SCM read_hook),
-"")
-#define FUNC_NAME s_scm_readline
-{
- SCM ans;
-
- reentry_barrier ();
-
- before_read = SCM_BOOL_F;
-
- if (!SCM_UNBNDP (text))
- {
- if (!SCM_STRINGP (text))
- {
- --in_readline;
- scm_wrong_type_arg (s_scm_readline, SCM_ARG1, text);
- }
- }
-
- if (!((SCM_UNBNDP (inp) && SCM_OPINFPORTP (scm_cur_inp))
- || SCM_OPINFPORTP (inp)))
- {
- --in_readline;
- scm_misc_error (s_scm_readline,
- "Input port is not open or not a file port",
- SCM_EOL);
- }
-
- if (!((SCM_UNBNDP (outp) && SCM_OPINFPORTP (scm_cur_outp))
- || SCM_OPOUTFPORTP (outp)))
- {
- --in_readline;
- scm_misc_error (s_scm_readline,
- "Output port is not open or not a file port",
- SCM_EOL);
- }
-
- if (!(SCM_UNBNDP (read_hook) || SCM_FALSEP (read_hook)))
- {
- if (!(SCM_NFALSEP (scm_thunk_p (read_hook))))
- {
- --in_readline;
- scm_wrong_type_arg (s_scm_readline, SCM_ARG4, read_hook);
- }
- before_read = read_hook;
- }
-
- scm_readline_init_ports (inp, outp);
-
- ans = scm_internal_catch (SCM_BOOL_T,
- (scm_t_catch_body) internal_readline,
- (void *) SCM_UNPACK (text),
- handle_error, 0);
-
-#ifndef __MINGW32__
- fclose (rl_instream);
- fclose (rl_outstream);
-#endif
-
- --in_readline;
- return ans;
-}
-#undef FUNC_NAME
-
-
-static void
-reentry_barrier ()
-{
- int reentryp = 0;
-#ifdef USE_THREADS
- /* We should rather use scm_t_mutexry_lock when it becomes available */
- scm_mutex_lock (&reentry_barrier_mutex);
-#endif
- if (in_readline)
- reentryp = 1;
- else
- ++in_readline;
-#ifdef USE_THREADS
- scm_mutex_unlock (&reentry_barrier_mutex);
-#endif
- if (reentryp)
- scm_misc_error (s_scm_readline, "readline is not reentrant", SCM_EOL);
-}
-
-static SCM
-handle_error (void *data, SCM tag, SCM args)
-{
- rl_free_line_state ();
- rl_cleanup_after_signal ();
- fputc ('\n', rl_outstream); /* We don't want next output on this line */
-#ifndef __MINGW32__
- fclose (rl_instream);
- fclose (rl_outstream);
-#endif
- --in_readline;
- scm_handle_by_throw (data, tag, args);
- return SCM_UNSPECIFIED; /* never reached */
-}
-
-static SCM
-internal_readline (SCM text)
-{
- SCM ret;
- char *s;
- char *prompt = SCM_UNBNDP (text) ? "" : SCM_STRING_CHARS (text);
-
- promptp = 1;
- s = readline (prompt);
- if (s)
- ret = scm_makfrom0str (s);
- else
- ret = SCM_EOF_VAL;
-
- free (s);
-
- return ret;
-}
-
-static FILE *
-stream_from_fport (SCM port, char *mode, const char *subr)
-{
- int fd;
- FILE *f;
-
- fd = dup (((struct scm_t_fport *) SCM_STREAM (port))->fdes);
- if (fd == -1)
- {
- --in_readline;
- scm_syserror (subr);
- }
-
- f = fdopen (fd, mode);
- if (f == NULL)
- {
- --in_readline;
- scm_syserror (subr);
- }
-
- return f;
-}
-
-void
-scm_readline_init_ports (SCM inp, SCM outp)
-{
- if (SCM_UNBNDP (inp))
- inp = scm_cur_inp;
-
- if (SCM_UNBNDP (outp))
- outp = scm_cur_outp;
-
- if (!SCM_OPINFPORTP (inp)) {
- scm_misc_error (0,
- "Input port is not open or not a file port",
- SCM_EOL);
- }
-
- if (!SCM_OPOUTFPORTP (outp)) {
- scm_misc_error (0,
- "Output port is not open or not a file port",
- SCM_EOL);
- }
-
- input_port = inp;
-#ifndef __MINGW32__
- rl_instream = stream_from_fport (inp, "r", s_scm_readline);
- rl_outstream = stream_from_fport (outp, "w", s_scm_readline);
-#endif
-}
-
-
-
-SCM_DEFINE (scm_add_history, "add-history", 1, 0, 0,
- (SCM text),
-"")
-#define FUNC_NAME s_scm_add_history
-{
- char* s;
- SCM_VALIDATE_STRING (1,text);
-
- s = SCM_STRING_CHARS (text);
- add_history (strdup (s));
-
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_read_history, "read-history", 1, 0, 0,
- (SCM file),
-"")
-#define FUNC_NAME s_scm_read_history
-{
- SCM_VALIDATE_STRING (1,file);
- return SCM_NEGATE_BOOL (read_history (SCM_STRING_CHARS (file)));
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_write_history, "write-history", 1, 0, 0,
- (SCM file),
-"")
-#define FUNC_NAME s_scm_write_history
-{
- SCM_VALIDATE_STRING (1,file);
- return SCM_NEGATE_BOOL (write_history (SCM_STRING_CHARS (file)));
-}
-#undef FUNC_NAME
-
-SCM_DEFINE (scm_clear_history, "clear-history", 0, 0, 0,
- (),
- "Clear the history buffer of the readline machinery.")
-#define FUNC_NAME s_scm_clear_history
-{
- clear_history();
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_filename_completion_function, "filename-completion-function", 2, 0, 0,
- (SCM text, SCM continuep),
-"")
-#define FUNC_NAME s_scm_filename_completion_function
-{
- char *s;
- SCM ans;
- SCM_VALIDATE_STRING (1,text);
-#ifdef HAVE_RL_FILENAME_COMPLETION_FUNCTION
- s = rl_filename_completion_function (SCM_STRING_CHARS (text), SCM_NFALSEP (continuep));
-#else
- s = filename_completion_function (SCM_STRING_CHARS (text), SCM_NFALSEP (continuep));
-#endif
- ans = scm_makfrom0str (s);
- free (s);
- return ans;
-}
-#undef FUNC_NAME
-
-/*
- * The following has been modified from code contributed by
- * Andrew Archibald <aarchiba@undergrad.math.uwaterloo.ca>
- */
-
-SCM scm_readline_completion_function_var;
-
-static char *
-completion_function (char *text, int continuep)
-{
- SCM compfunc = SCM_VARIABLE_REF (scm_readline_completion_function_var);
- SCM res;
-
- if (SCM_FALSEP (compfunc))
- return NULL; /* #f => completion disabled */
- else
- {
- SCM t = scm_makfrom0str (text);
- SCM c = continuep ? SCM_BOOL_T : SCM_BOOL_F;
- res = scm_apply (compfunc, scm_list_2 (t, c), SCM_EOL);
-
- if (SCM_FALSEP (res))
- return NULL;
-
- if (!SCM_STRINGP (res))
- scm_misc_error (s_scm_readline,
- "Completion function returned bogus value: %S",
- scm_list_1 (res));
- return strdup (SCM_STRING_CHARS (res));
- }
-}
-
-/*Bouncing parenthesis (reimplemented by GH, 11/23/98, since readline is strict gpl)*/
-
-static int match_paren (int x, int k);
-static int find_matching_paren (int k);
-static void init_bouncing_parens ();
-
-static void
-init_bouncing_parens ()
-{
- if (strncmp (rl_get_keymap_name (rl_get_keymap ()), "vi", 2))
- {
- rl_bind_key (')', match_paren);
- rl_bind_key (']', match_paren);
- rl_bind_key ('}', match_paren);
- }
-}
-
-static int
-find_matching_paren(int k)
-{
- register int i;
- register char c = 0;
- int end_parens_found = 0;
-
- /* Choose the corresponding opening bracket. */
- if (k == ')') c = '(';
- else if (k == ']') c = '[';
- else if (k == '}') c = '{';
-
- for (i=rl_point-2; i>=0; i--)
- {
- /* Is the current character part of a character literal? */
- if (i - 2 >= 0
- && rl_line_buffer[i - 1] == '\\'
- && rl_line_buffer[i - 2] == '#')
- ;
- else if (rl_line_buffer[i] == k)
- end_parens_found++;
- else if (rl_line_buffer[i] == '"')
- {
- /* Skip over a string literal. */
- for (i--; i >= 0; i--)
- if (rl_line_buffer[i] == '"'
- && ! (i - 1 >= 0
- && rl_line_buffer[i - 1] == '\\'))
- break;
- }
- else if (rl_line_buffer[i] == c)
- {
- if (end_parens_found==0)
- return i;
- else --end_parens_found;
- }
- }
- return -1;
-}
-
-static int
-match_paren (int x, int k)
-{
- int tmp;
-#ifndef __MINGW32__
- int fno;
- SELECT_TYPE readset;
- struct timeval timeout;
-#endif
-
- rl_insert (x, k);
- if (!SCM_READLINE_BOUNCE_PARENS)
- return 0;
-
- /* Did we just insert a quoted paren? If so, then don't bounce. */
- if (rl_point - 1 >= 1
- && rl_line_buffer[rl_point - 2] == '\\')
- return 0;
-
-#ifndef __MINGW32__
- tmp = 1000 * SCM_READLINE_BOUNCE_PARENS;
- timeout.tv_sec = tmp / 1000000;
- timeout.tv_usec = tmp % 1000000;
- FD_ZERO (&readset);
- fno = fileno (rl_instream);
- FD_SET (fno, &readset);
-#endif
-
- if (rl_point > 1)
- {
- tmp = rl_point;
- rl_point = find_matching_paren (k);
- if (rl_point > -1)
- {
- rl_redisplay ();
-#ifndef __MINGW32__
- scm_internal_select (fno + 1, &readset, NULL, NULL, &timeout);
-#else
- WaitForSingleObject (GetStdHandle(STD_INPUT_HANDLE),
- SCM_READLINE_BOUNCE_PARENS);
-#endif
- }
- rl_point = tmp;
- }
- return 0;
-}
-
-#if defined (HAVE_RL_PRE_INPUT_HOOK) && defined (GUILE_SIGWINCH_SA_RESTART_CLEARED)
-/* Readline disables SA_RESTART on SIGWINCH.
- * This code turns it back on.
- */
-static int
-sigwinch_enable_restart (void)
-{
-#ifdef HAVE_SIGINTERRUPT
- siginterrupt (SIGWINCH, 0);
-#else
- struct sigaction action;
-
- sigaction (SIGWINCH, NULL, &action);
- action.sa_flags |= SA_RESTART;
- sigaction (SIGWINCH, &action, NULL);
-#endif
- return 0;
-}
-#endif
-
-#endif /* HAVE_RL_GETC_FUNCTION */
-
-void
-scm_init_readline ()
-{
-#ifdef HAVE_RL_GETC_FUNCTION
-#include "guile-readline/readline.x"
- scm_readline_completion_function_var
- = scm_c_define ("*readline-completion-function*", SCM_BOOL_F);
-#ifndef __MINGW32__
- rl_getc_function = current_input_getc;
-#endif
- rl_redisplay_function = redisplay;
-#if defined (_RL_FUNCTION_TYPEDEF)
- rl_completion_entry_function = (rl_compentry_func_t*) completion_function;
-#else
- rl_completion_entry_function = (Function*) completion_function;
-#endif
- rl_basic_word_break_characters = "\t\n\"'`;()";
- rl_readline_name = "Guile";
-#if defined (HAVE_RL_PRE_INPUT_HOOK) && defined (GUILE_SIGWINCH_SA_RESTART_CLEARED)
- rl_pre_input_hook = sigwinch_enable_restart;
-#endif
-
-#ifdef USE_THREADS
- scm_mutex_init (&reentry_barrier_mutex);
-#endif
- scm_init_opts (scm_readline_options,
- scm_readline_opts,
- SCM_N_READLINE_OPTIONS);
- init_bouncing_parens();
- scm_add_feature ("readline");
-#endif /* HAVE_RL_GETC_FUNCTION */
-}
-
-/*
- Local Variables:
- c-file-style: "gnu"
- End:
-*/
diff --git a/guile-readline/readline.h b/guile-readline/readline.h
deleted file mode 100644
index 1fc51de4f..000000000
--- a/guile-readline/readline.h
+++ /dev/null
@@ -1,65 +0,0 @@
-#ifndef READLINEH
-#define READLINEH
-
-/* Copyright (C) 1997, 1999, 2000 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, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307 USA
- *
- */
-
-/* SCM_RL_API is a macro prepended to all function and data definitions
- which should be exported or imported in the resulting dynamic link
- library in the Win32 port. */
-
-#if defined (SCM_RL_IMPORT)
-# define SCM_RL_API __declspec (dllimport) extern
-#elif defined (SCM_RL_EXPORT) || defined (DLL_EXPORT)
-# define SCM_RL_API __declspec (dllexport) extern
-#else
-# define SCM_RL_API extern
-#endif
-
-#include "libguile/__scm.h"
-
-SCM_RL_API scm_t_option scm_readline_opts[];
-
-#define SCM_HISTORY_FILE_P scm_readline_opts[0].val
-#define SCM_HISTORY_LENGTH scm_readline_opts[1].val
-#define SCM_READLINE_BOUNCE_PARENS scm_readline_opts[2].val
-#define SCM_N_READLINE_OPTIONS 3
-
-SCM_RL_API SCM scm_readline_options (SCM setting);
-SCM_RL_API void scm_readline_init_ports (SCM inp, SCM outp);
-SCM_RL_API SCM scm_readline (SCM txt, SCM inp, SCM outp, SCM read_hook);
-SCM_RL_API SCM scm_add_history (SCM txt);
-SCM_RL_API SCM scm_clear_history (void);
-SCM_RL_API SCM scm_read_history (SCM file);
-SCM_RL_API SCM scm_write_history (SCM file);
-SCM_RL_API SCM scm_filename_completion_function (SCM text, SCM continuep);
-SCM_RL_API void scm_init_readline (void);
-
-#ifndef HAVE_RL_CLEANUP_AFTER_SIGNAL
-void rl_cleanup_after_signal ();
-void rl_free_line_state ();
-#endif
-
-#endif
-
-/*
- Local Variables:
- c-file-style: "gnu"
- End:
-*/
diff --git a/guile-readline/readline.scm b/guile-readline/readline.scm
deleted file mode 100644
index cae45e30b..000000000
--- a/guile-readline/readline.scm
+++ /dev/null
@@ -1,217 +0,0 @@
-;;;; readline.scm --- support functions for command-line editing
-;;;;
-;;;; Copyright (C) 1997, 1999, 2000, 2001 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-;;;;
-;;;; Contributed by Daniel Risacher <risacher@worldnet.att.net>.
-;;;; Extensions based upon code by
-;;;; Andrew Archibald <aarchiba@undergrad.math.uwaterloo.ca>.
-
-
-
-(define-module (ice-9 readline)
- :use-module (ice-9 session)
- :use-module (ice-9 regex)
- :use-module (ice-9 buffered-input)
- :no-backtrace)
-
-
-
-;;; Dynamically link the glue code for accessing the readline library,
-;;; but only when it isn't already present.
-
-(if (not (provided? 'readline))
- (load-extension "libguilereadline" "scm_init_readline"))
-
-(if (not (provided? 'readline))
- (scm-error 'misc-error
- #f
- "readline is not provided in this Guile installation"
- '()
- '()))
-
-
-
-;;; Run-time options
-
-(export
- readline-options
- readline-enable
- readline-disable)
-(export-syntax
- readline-set!)
-
-(define-option-interface
- (readline-options-interface
- (readline-options readline-enable readline-disable)
- (readline-set!)))
-
-
-
-;;; MDJ 980513 <djurfeldt@nada.kth.se>:
-;;; There should probably be low-level support instead of this code.
-
-;;; Dirk:FIXME:: If the-readline-port, input-port or output-port are closed,
-;;; guile will enter an endless loop or crash.
-
-(define prompt "")
-(define prompt2 "")
-(define input-port (current-input-port))
-(define output-port (current-output-port))
-(define read-hook #f)
-
-(define (make-readline-port)
- (make-line-buffered-input-port (lambda (continuation?)
- (let* ((prompt (if continuation?
- prompt2
- prompt))
- (str (%readline (if (string? prompt)
- prompt
- (prompt))
- input-port
- output-port
- read-hook)))
- (or (eof-object? str)
- (string=? str "")
- (add-history str))
- str))))
-
-;;; We only create one readline port. There's no point in having
-;;; more, since they would all share the tty and history ---
-;;; everything except the prompt. And don't forget the
-;;; compile/load/run phase distinctions. Also, the readline library
-;;; isn't reentrant.
-(define the-readline-port #f)
-
-(define history-variable "GUILE_HISTORY")
-(define history-file (string-append (getenv "HOME") "/.guile_history"))
-
-(define-public readline-port
- (let ((do (lambda (r/w)
- (if (memq 'history-file (readline-options-interface))
- (r/w (or (getenv history-variable)
- history-file))))))
- (lambda ()
- (if (not the-readline-port)
- (begin
- (do read-history)
- (set! the-readline-port (make-readline-port))
- (add-hook! exit-hook (lambda ()
- (do write-history)
- (clear-history)))))
- the-readline-port)))
-
-;;; The user might try to use readline in his programs. It then
-;;; becomes very uncomfortable that the current-input-port is the
-;;; readline port...
-;;;
-;;; Here, we detect this situation and replace it with the
-;;; underlying port.
-;;;
-;;; %readline is the low-level readline procedure.
-
-(define-public (readline . args)
- (let ((prompt prompt)
- (inp input-port))
- (cond ((not (null? args))
- (set! prompt (car args))
- (set! args (cdr args))
- (cond ((not (null? args))
- (set! inp (car args))
- (set! args (cdr args))))))
- (apply %readline
- prompt
- (if (eq? inp the-readline-port)
- input-port
- inp)
- args)))
-
-(define-public (set-readline-prompt! p . rest)
- (set! prompt p)
- (if (not (null? rest))
- (set! prompt2 (car rest))))
-
-(define-public (set-readline-input-port! p)
- (cond ((or (not (file-port? p)) (not (input-port? p)))
- (scm-error 'wrong-type-arg "set-readline-input-port!"
- "Not a file input port: ~S" (list p) #f))
- ((port-closed? p)
- (scm-error 'misc-error "set-readline-input-port!"
- "Port not open: ~S" (list p) #f))
- (else
- (set! input-port p))))
-
-(define-public (set-readline-output-port! p)
- (cond ((or (not (file-port? p)) (not (output-port? p)))
- (scm-error 'wrong-type-arg "set-readline-input-port!"
- "Not a file output port: ~S" (list p) #f))
- ((port-closed? p)
- (scm-error 'misc-error "set-readline-output-port!"
- "Port not open: ~S" (list p) #f))
- (else
- (set! output-port p))))
-
-(define-public (set-readline-read-hook! h)
- (set! read-hook h))
-
-(if (provided? 'regex)
- (begin
- (define-public apropos-completion-function
- (let ((completions '()))
- (lambda (text cont?)
- (if (not cont?)
- (set! completions
- (map symbol->string
- (apropos-internal
- (string-append "^" (regexp-quote text))))))
- (if (null? completions)
- #f
- (let ((retval (car completions)))
- (begin (set! completions (cdr completions))
- retval))))))
-
- (set! *readline-completion-function* apropos-completion-function)
- ))
-
-(define-public (with-readline-completion-function completer thunk)
- "With @var{completer} as readline completion function, call @var{thunk}."
- (let ((old-completer *readline-completion-function*))
- (dynamic-wind
- (lambda ()
- (set! *readline-completion-function* completer))
- thunk
- (lambda ()
- (set! *readline-completion-function* old-completer)))))
-
-(define-public (activate-readline)
- (if (and (isatty? (current-input-port))
- (not (and (module-defined? the-root-module 'use-emacs-interface)
- (module-ref the-root-module 'use-emacs-interface))))
- (let ((read-hook (lambda () (run-hook before-read-hook))))
- (set-current-input-port (readline-port))
- (set! repl-reader
- (lambda (prompt)
- (dynamic-wind
- (lambda ()
- (set-buffered-input-continuation?! (readline-port) #f)
- (set-readline-prompt! prompt "... ")
- (set-readline-read-hook! read-hook))
- (lambda () (read))
- (lambda ()
- (set-readline-prompt! "" "")
- (set-readline-read-hook! #f)))))
- (set! (using-readline?) #t))))
diff --git a/guile-tools.in b/guile-tools.in
deleted file mode 100644
index 8b32ba648..000000000
--- a/guile-tools.in
+++ /dev/null
@@ -1,114 +0,0 @@
-#!/bin/sh
-
-# Copyright (C) 2001 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, Inc., 59 Temple Place, Suite 330,
-# Boston, MA 02111-1307 USA
-
-# Usage: See `help' func below.
-#
-# TODO
-# - handle pre-install invocation
-# - "full" option processing (but see comment below)
-#
-# Author: Thien-Thi Nguyen
-
-help ()
-{
- cat <<EOF
-Usage: guile-tools --version
- guile-tools --help
- guile-tools [OPTION] PROGRAM [ARGS]
-
-If PROGRAM is "list" or omitted, display contents of scripts dir, otherwise
-PROGRAM is run w/ ARGS. Options (only one of which may be used at a time):
- --scriptsdir DIR -- Look in DIR for scripts
- --guileversion VERS -- Look in $pkgdatadir/VERS/scripts for scripts
- --source -- Display PROGRAM source (ignore ARGS) to stdout
-
-Default scripts dir: $default_scriptsdir
-EOF
-}
-
-prefix="@prefix@"
-pkgdatadir="@datadir@/@PACKAGE@"
-guileversion="@GUILE_VERSION@"
-default_scriptsdir=$pkgdatadir/$guileversion/scripts
-
-# pre-install invocation frob
-mydir=`dirname $0`
-if [ -d "$mydir/scripts" -a -f "$mydir/scripts/Makefile.am" ] ; then
- default_scriptsdir=`(cd $mydir/scripts ; pwd)`
-fi
-
-# option processing -- basically, you can override either the script dir
-# completely, or just the guile version. we choose implementation simplicity
-# over orthogonality.
-
-case x"$1" in
-x--version)
- echo $0 $guileversion
- exit 0
- ;;
-x--help)
- help
- exit 0
- ;;
-esac
-
-if [ x"$1" = x--scriptsdir ] ; then
- user_scriptsdir=$2
- shift
- shift
-elif [ x"$1" = x--guileversion ] ; then
- user_scriptsdir=$pkgdatadir/$2/scripts
- shift
- shift
-fi
-
-scriptsdir=${user_scriptsdir-$default_scriptsdir}
-
-if [ ! -d $scriptsdir ] ; then
- echo $0: no such directory: $scriptsdir
- exit 1
-fi
-
-if [ x"$1" = x -o x"$1" = xlist ] ; then
- ls $scriptsdir
- exit 0
-fi
-
-if [ x"$1" = x--source ] ; then
- if [ x"$2" = x ] ; then echo $0: need to specify program ; exit 1 ; fi
- if [ -x $scriptsdir/$2 ] ; then
- cat $scriptsdir/$2
- exit 0
- else
- echo $0: no such program: $2
- exit 1
- fi
-fi
-
-program=$scriptsdir/$1
-shift
-
-if [ -x $program ] ; then
- exec $program "$@"
-else
- echo $0: no such program: $program
- exit 1
-fi
-
-# guile-tools ends here
diff --git a/ice-9/.cvsignore b/ice-9/.cvsignore
deleted file mode 100644
index f477a6190..000000000
--- a/ice-9/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-Makefile
-Makefile.in
-config.log
-config.status
-version.scm
diff --git a/ice-9/COPYING b/ice-9/COPYING
deleted file mode 100644
index eeb586b39..000000000
--- a/ice-9/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED 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.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
-
- 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 of the License, 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 program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) 19yy name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog
deleted file mode 100644
index 18ef926ce..000000000
--- a/ice-9/ChangeLog
+++ /dev/null
@@ -1,3686 +0,0 @@
-2002-07-08 Marius Vollmer <mvo@zagadka.ping.de>
-
- * slib.scm (make-exchanger): Added. Thanks to Clinton Ebadi!
-
-2002-07-07 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * boot-9.scm (define-option-interface): Replaced "macro" by
- mmacro.
-
-2002-06-01 Gary Houston <ghouston@arglist.com>
-
- * boot-9.scm (file-set-position): Make third argument optional,
- for SCM compatibility.
- (file-position): simplify definition.
-
-2002-06-01 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (file-set-position): Use seek instead of fseek.
-
-2002-05-09 Marius Vollmer <mvo@zagadka.ping.de>
-
- * format.scm (format:out-inf-nan): New.
- (format:out-fixed, format:out-expon, format:out-general): Use it
- to print infs and nans.
-
- * boot-9.scm (unsetenv): New, for completeness.
-
-2002-05-08 Marius Vollmer <mvo@zagadka.ping.de>
-
- * format.scm (format:fn-max): Increase to 400 so ~f and ~g can
- print long real numbers with large positive and negative
- exponents.
-
-2002-05-06 Marius Vollmer <mvo@zagadka.ping.de>
-
- * syncase.scm: Use (ice-9 threads) so that with-mutex is defined.
-
-2002-04-30 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * gap-buffer.scm: New file.
-
- * Makefile.am (ice9_sources): Add gap-buffer.scm.
-
-2002-03-12 Rob Browning <rlb@defaultvalue.org>
-
- * syncase.scm: fix bad let.
- (gensym): fix failure on non-threaded
-
-2002-03-05 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * ftw.scm: New file.
-
- * Makefile.am (ice9_sources): Add ftw.scm.
-
-2002-02-26 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * Makefile.am: Update path to pre-inst-guile automake frag.
-
- * boot-9.scm: Comment grammar fixes; nfc.
- Thanks to Christopher Cramer.
-
-2002-02-24 Rob Browning <rlb@defaultvalue.org>
-
- * syncase.scm (gensym): redefine locally so we can control it's
- properties. This is in preparation for changing the future public
- gensym to produce unreadable symbols.
-
- * psyntax.pp: updated to reflect new syncase.scm.
-
-2002-02-07 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * regex.scm: Add commentary; nfc.
-
-2002-02-05 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * Makefile.am: Include $(top_srcdir)/pre-inst-guile.am.
-
- (psyntax.pp): Use $(preinstguile).
-
-2002-01-14 Marius Vollmer <mvo@zagadka.ping.de>
-
- * psyntax.ss (datum->syntax-object): Removed assertion in
- datum->syntax-object that checked if the first argument, a
- syntax-object, is an identifier. This was a unconvenient and
- unnecessary restriction. Thanks to Dorai Sitaram!
-
-2002-01-12 Marius Vollmer <mvo@zagadka.ping.de>
-
- More options for pretty-print. Thanks to Matthias Köppe!
-
- * pretty-print.scm (generic-write): New per-line-prefix argument.
- (pretty-print): Check whether the new keyword argument style is
- used and dispatch to pretty-print-with-keys accordingly.
-
-2001-11-27 Marius Vollmer <mvo@zagadka.ping.de>
-
- * format.scm (string-index, list-head): Removed, we already have
- these in the core.
-
-2001-11-06 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (turn-on-debugging): New function, to be used by
- scm_compile_shell_switches.
-
- * debug.scm: Do not enable debugging and recording of source
- positions.
-
-2001-10-21 Mikael Djurfeldt <mdj@linnaeus>
-
- * slib.scm (array-indexes): New procedure.
- (*features*): Extend. (Probably some of these options should be
- set elsewhere.) (Thanks to Aubrey Jaffer.)
-
- * and-let-star-compat.scm, and-let-star.scm, calling.scm,
- channel.scm, common-list.scm, debug.scm, debugger.scm,
- expect.scm, hcons.scm, lineio.scm, ls.scm, mapping.scm,
- null.scm, optargs.scm, poe.scm, popen.scm, pretty-print.scm,
- q.scm, r5rs.scm, rdelim.scm, regex.scm, runq.scm, safe-r5rs.scm,
- safe.scm, session.scm, slib.scm, streams.scm, string-fun.scm,
- syncase.scm, threads.scm: Move module the system directives
- `export', `export-syntax', `re-export' and `re-export-syntax'
- into the `define-module' form. This is the recommended way of
- exporting bindings.
-
-2001-10-17 Mikael Djurfeldt <mdj@linnaeus>
-
- * boot-9.scm (process-define-module): New options: :export-syntax,
- :re-export-syntax
-
-2001-10-14 Mikael Djurfeldt <mdj@linnaeus>
-
- * arrays.scm (read:uniform-vector): Return *unspecified* instead
- of raising an exception if hash extend character isn't followed by
- the array list. (This prevents parsing of uniform vectors from
- interfering with parsing of numbers.)
-
-2001-10-08 Mikael Djurfeldt <mdj@linnaeus>
-
- * emacs.scm (%%load-port, %%emacs-load, %%emacs-eval-request,
- %%emacs-select-frame, %%emacs-frame-eval, %%emacs-symdoc,
- %%apropos-internal): Use module-define! instead of
- builtin-variable.
-
-2001-09-24 Mikael Djurfeldt <mdj@linnaeus>
-
- * boot-9.scm (process-define-module): Added :re-export.
-
-2001-09-19 Thien-Thi Nguyen <ttn@glug.org>
-
- * expect.scm: Commentary fix; nfc.
-
- * boot-9.scm (process-use-modules): Fix typo.
-
-2001-09-18 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * Makefile.am (psyntax.pp): Reference compile-psyntax.scm in
- $(srcdir) in order to support separate build trees.
-
-2001-09-08 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * optargs.scm (lambda*): Record the broken-down argument list in
- the `arglist' procedure property.
- * session.scm (arity): Use new `arglist' procedure property to
- present a more detailed argument list.
-
- Thanks to Matthias Köppe!
-
-2001-09-07 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * getopt-long.scm (process-options, getopt-long): Fix omission
- bug: Handle multiple occurrances of an option. Thanks to Daniel
- Skarda.
-
-2001-08-31 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * boot-9.scm: Don't load module (ice-9 rdelim).
-
- (feature?): Deprecated.
-
- (id, -1+, return-it, string-character-length, flags,
- eval-in-module, split-c-module-name,
- (convert-c-registered-modules, registered-modules,
- register-modules, warn-autoload-deprecation, init-dynamic-module,
- dynamic-maybe-call, dynamic-maybe-link,
- find-and-link-dynamic-module, try-using-libtool-name,
- try-using-sharlib-name, link-dynamic-module, try-module-linked,
- try-module-dynamic-link): Removed.
-
- (module-make-local-var!, module-ensure-local-variable!,
- module-define!): Eliminate call to `variable-set-name-hint!´.
-
- (try-load-module, use-syntax, module-export!): Remove deprecated
- functionality.
-
- * format.scm: Remove deprecated definition of format that was
- needed to trick export.
-
-2001-08-31 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * optargs.scm: Remove #& reader extension.
-
-2001-08-31 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * and-let-star-compat.scm: Deleted.
-
- * Makefile.am: Remove references to and-let-star-compat.scm.
-
-2001-08-30 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * boot-9.scm (resolve-interface): When returning a custom
- interface, also consult source module's entire binding set,
- not just its exported bindings, before throwing error.
-
-2001-08-25 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (resolve-interface): Get variables from the public
- interface of a module instead of from the module itselfs.
-
-2001-08-25 Marius Vollmer <mvo@zagadka.ping.de>
-
- * Makefile.am (AUTOMAKE_OPTIONS): Change "foreign" to "gnu".
-
-2001-08-12 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * getopt-long.scm: Rewrite.
- Touch up docstrings.
- Augment commentary.
-
-2001-08-02 Neil Jerram <neil@ossau.uklinux.net>
-
- * debugger.scm (run-last-command): Return current state if
- last-command fluid is not yet set.
-
-2001-08-02 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * getopt-long.scm: Refill to fit in 80 columns.
-
- (process-long-option): Fix bug: Keep track of `optional'
- value-required info and use this to determine whether or not the
- next element is to be taken as the option arg.
-
-2001-07-31 Keisuke Nishida <knishida@nurs.or.jp>
-
- * boot-9.scm (process-define-module): Fixed a bug that did not
- handle :use-syntax correctly.
-
-2001-07-24 Marius Vollmer <mvo@zagadka.ping.de>
-
- * syncase.scm (psyncomp): Removed, it is now in
- compile-psyntax.scm.
-
-2001-07-23 Marius Vollmer <mvo@zagadka.ping.de>
-
- * Makefile.am (psyntax.pp): Enable rule for psyntax.pp only in
- maintainer mode. Use compile-psyntax.scm for actual compilation.
- Make sure the uninstalled guile is used.
- (EXTRA_DIST): Distribute compile-psyntax.scm
- * compile-psyntax.scm: New file.
-
-2001-07-18 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * and-let-star.scm, debug.scm, debugger.scm, history.scm,
- lineio.scm, null.scm, optargs.scm, r4rs.scm, r5rs.scm,
- receive.scm, safe-r5rs.scm, streams.scm: Updated copyright notice.
-
-2001-07-17 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * r5rs.scm: Use `re-export' instead of `export' for re-exported
- primitives. Thanks Neil!
-
-2001-07-13 Marius Vollmer <mvo@zagadka.ping.de>
-
- * safe-r5rs.scm: Use `re-export' instead of `export' for
- re-exported core bindings. Do not re-export `numerator',
- `denominator' and `rationalize' since Guile does not have them.
- Continue to use `export' for `null-environment'.
-
- * null.scm: Use `re-export' instead of `export' for re-exported
- core bindings. Do not export `unquote' and `unquote-splicing'
- since there aren't definitions for them.
-
- * boot-9.scm (compile-interface-spec): Bug fix: the keyword
- argument is "renamer" not "rename".
-
-2001-07-09 Rob Browning <rlb@defaultvalue.org>
-
- * boot-9.scm: Fixed the sense of the error message when read-eval?
- is #f. Thanks to Matthias for catching this.
-
-2001-07-06 Rob Browning <rlb@defaultvalue.org>
-
- * boot-9.scm: added fix suggested by Matthias for #. read
- extension -- now only works if read-eval? is not #f.
-
-2001-06-30 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * arrays.scm: Don't install a read-hash-extension for 'b': #b
- is already defined by R5RS. Further, there is already a working
- read syntax for bitvectors, starting with #*.
-
-2001-06-30 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * Makefile.am (ice9_sources): Removed tags.scm.
-
- * tags.scm: Removed file.
-
-2001-06-29 Neil Jerram <neil@ossau.uklinux.net>
-
- Changes to support tracing other than inside the repl-stack that
- is set up by the REPL code in boot-9.scm.
-
- * debug.scm (trace-entry, trace-exit): Conditionalize tracing on
- whether the current stack id is in `traced-stack-ids'.
- (traced-stack-ids, trace-all-stacks?, trace-stack, untrace-stack):
- New.
-
-2001-06-27 Marius Vollmer <mvo@zagadka.ping.de>
-
- * common-list.scm (member-if): Put in docstring for member-if, it
- was a cut-n-paste error previously.
-
-2001-06-26 Neil Jerram <neil@ossau.uklinux.net>
-
- * debug.scm (trace): Set evaluator trap options to handle tracing.
- Don't reset trace-level to 0.
-
- * boot-9.scm (lazy-handler-dispatch): Remove enter-frame-handler,
- apply-frame-handler and exit-frame-handler. (They're replaced by
- evaluator trap options.)
-
-2001-06-25 Michael Livshin <mlivshin@bigfoot.com>
-
- * streams.scm (stream-for-each-many): typo fix.
-
-2001-06-25 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (re-export-syntax): New.
-
-2001-06-16 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (system-error-errno): New.
-
-2001-06-14 Marius Vollmer <mvo@zagadka.ping.de>
-
- * common-list.scm (remove-if, remove-if-not): Fix typo: use
- `pred', not `pred?', in the body.
-
-2001-06-13 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * match.scm:
- No longer use module `(ice-9 slib)'.
- Use module `(ice-9 pretty-print)'.
- No longer require `pretty-print'.
-
- (slib:error): Delete.
- (match:error, match:syntax-err): Rewrite.
-
- Thanks to Dale P. Smith.
-
- * README: New file.
-
- * common-list.scm:
- Clean up some docstrings; nfc.
- Add Commentary.
- Update copyright.
-
-2001-06-11 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm: Use `begin-deprecated' instead of testing
- `include-deprecated-features' when conditionally using the (ice-9
- rdelim) module. See below.
-
-2001-06-10 Gary Houston <ghouston@arglist.com>
-
- * boot-9.scm: use the (ice-9 rdelim) module if
- include-deprecated-features is true.
-
-2001-06-09 Marius Vollmer <mvo@zagadka.ping.de>
-
- * pretty-print.scm (generic-write): Use `object->string' to print
- unknown objects.
-
- * optargs.scm (lambda*): Make sure that BODY is always put into a
- real body context so that it can contain internal definitions.
- Thanks to Matthias Köppe!
-
- * format.scm: Use (ice-9 and-let-star).
- (format:out): Initialize format:output-col with current column of
- `port', if it has one. Else leave it alone. Thanks to Matthias
- Köppe!
-
-2001-06-05 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (module-ensure-local-variable!): Renamed from
- `module-ensure-variable!'. Make sure that there really is a local
- variable, not just a visible one.
- (module-ensure-variable!): See above.
- (module-export!): Behave like always when deprecated features are
- enabled, but issue a warning when re-exporting a variable. When
- deprecated features are disabled, only export local variables,
- creating them uninitialized when they don't yet exist.
- (module-re-export!): New. Use this for re-exporting imported
- variables.
- (re-export): New, to go with `module-re-export!'.
-
- * format.scm: Added kluge at top that keeps `export' from
- re-exporting the `format' variable of the `(guile)' module.
-
-2001-06-04 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (named-module-use!, top-repl): Use resolve-interface
- instead of resolve-module to get at the used module.
-
-2001-06-04 Gary Houston <ghouston@arglist.com>
-
- * rw.scm: export write-string/partial.
-
-2001-06-04 Marius Vollmer <mvo@zagadka.ping.de>
-
- Added exception notice to all files.
-
- * boot-9.scm (module-export!): Revert 2001-06-02 change. It
- caused more problems than it solved by accidentally re-exporting
- importing bindings once in a while.
-
-2001-06-03 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (try-load-module): Bracket calls to try-module-linked
- and try-module-dynamic-link with `begin-deprecated'.
- (split-c-module-name, convert-c-registered-modules,
- registered-modules, register-modules, warn-autoload-deprecation,
- init-dynamic-module, dynamic-maybe-call, dynamic-maybe-link,
- find-and-link-dynamic-module, try-using-libtool-name,
- try-using-sharlib-name, link-dynamic-module, try-module-linked,
- try-module-dynamic-link): Deprecated. Activate deprecation
- message.
- (define-public): Define binding before exporting it. This is to
- avoid accidentally re-exporting a imported binding.
-
-2001-06-02 Marius Vollmer <mvo@zagadka.ping.de>
-
- * Makefile.am (psyntax.pp): Make it dependent on psyntax.ss and
- fix command so that it works.
-
- * session.scm (apropos-fold, submodules, apropos): Be careful not
- to access unbound variables.
-
- * boot-9.scm (module-ensure-variable!): New.
- (module-export!): Use it to ensure that there is a variable to
- export. Previously, we would always create a new variable, copy
- the value over, and export the new variable. This confused
- syncase since it keys important properties on variables.
-
-2001-06-01 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (top-repl): Revert part of the 2001-05-19 change.
- When defining the guile-user module, do not use any modules. Add
- them to guile-user when `top-repl' is called.
- (resolve-interface): Expect keyword arguments instead of a `spec'.
- (compile-interface-spec, compile-define-module-args): New.
- (define-module): Use compile-define-module-args to construct
- argument for process-define-module.
- (use-modules, use-syntax): Use compile-interface-spec to construct
- arguments for process-use-modules.
- (process-define-module): Expect keywords in argument list.
-
-2001-05-25 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (cond-expand): Define using
- `procedure->memoizing-macro' to get at the lexical environment.
- Use `env-module' instead of `current-module' to get the right
- module.
-
- * Makefile.am (ice9_sources): Added "pretty-print.scm".
- * pretty-print.scm: New file, copied from SLIB.
- (generic-write): Return the `unspecified' value.
-
- * format.scm: Autoload `pretty-print'.
-
-2001-05-23 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * boot-9.scm (%cond-expand-table): New hash table mapping modules
- to feature lists.
- (cond-expand): Use feature information associated with modules.
-
-2001-05-21 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * boot-9.scm (use-srfis): Do not extend the srfi-0 feature list.
- (cond-expand-provide): New procedure.
-
-2001-05-22 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (define-module): Return the new module.
- (process-define-module): Use `spec' instead of `module-name' when
- getting the syntax transformer. Thanks to Matthias Köppe!
-
-2001-05-21 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (use-syntax): Do not set scm:eval-transformer when
- deprecated features have been removed. Thanks to Dale P. Smith!
-
- * optargs.scm (#\&): Use `issue-deprecation-warning' instead of
- `display'.
-
-2001-05-19 Marius Vollmer <mvo@zagadka.ping.de>
-
- * psyntax.ss (build-lexical-var): Use gensym instead of gentemp.
- * match.scm: Likewise.
- * expect.scm: Likewise.
- * psyntax.pp: Regenerated.
-
- * rdelim.scm: Call `%init-rdelim-builtins'.
-
- * rw.scm: Call `%init-rw-builtins'.
-
- * boot-9.scm (process-define-module): Do not call
- set-current-module.
- (define-module): Do it here, in the expansion.
- (top-repl): Do not define '(guile-user)' module and conditionally
- load `(ice-9 threads)' and/or `(ice-9 regex)' here. Do it on
- top-level as the last thing in boot-9.scm instead.
- (%load-path): Use `list' instead of `cons' to create a single
- element list when adding "." to it.
- (process-define-module, process-use-modules, module-export!): Add
- dummy definitions prior to booting the mdule system.
-
-2001-05-18 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * boot-9.scm: (resolve-interface, use-srfis): Small
- cleanup; nfc.
- (process-define-module): Internal proc `unrecognized'
- now accepts arg; update callers.
- Reverse order of interfaces added to module to be
- consistent with that specified in `define-module' form.
-
- * session.scm: (help): Use `provided?' instead of `feature?'.
- Factor "TYPE not found for X" output into internal proc.
- Support `(quote SYMBOL)'; call `search-documentation-files'.
- (help-doc): If initial search fails, try using
- `search-documentation-files'.
- (apropos-fold-accessible, apropos-fold-all): Use `identity'
- instead of `(lambda (x) x)'. "An identity edit", ha ha.
- (help-usage): Mention support for "(help 'NAME)".
-
- * documentation.scm: Fix documentation for Guile Documentation
- Format Version 2: Mention required terminating newlines.
-
- (find-documentation): Delete.
- (search-documentation-files): New proc, exported.
- (object-documentation): Use `search-documentation-files'.
-
-2001-05-15 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * boot-9.scm (cond-expand-features): Made the feature list public,
- so it can be manipulated by `use-srfis'.
- (use-srfis): New procedure.
-
-2001-05-15 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * boot-9.scm (resolve-interface): Signal error now also if
- used module's public interface is not available.
- No longer call `beautify-user-module!'.
- Signal error now also if selected binding not found.
-
-2001-05-10 Marius Vollmer <mvo@zagadka.ping.de>
-
- Merge from mvo-vcell-clenaup-1-branch.
-
- * session.scm (apropos): Do not use `builtin-bindings', always use
- the module obarray.
- (apropos-fold): Likewise.
-
- * optargs.scm (bound?): Removed. We should not play games with
- the magical undefined value.
- (let-o-k-template): Use `#f' instead of the undefined value as
- the default default for bindings.
-
- * boot-9.scm (module-make-local-var!): Do not pass name hint to
- make-undefined-variable, use `variable-set-name-hint!' instead.
- (root-module-closure): Removed.
- (make-root-module): Set the obarray of the module to the
- `pre-modules-obarray'. Do not use a lazy binder.
- (scm-module-closure): Removed.
- (make-root-module): Set the obarray of the module to the
- `pre-modules-obarray'. Do not use a lazy binder. Set the
- eval-closure to a `standard-interface-eval-closure'.
- (module-define!): Do not pass name hint to make-variable, use
- `variable-set-name-hint!' instead.
- (make-modules-in, beautify-user-module, resolve-module): Moved
- towards the beginning of boot-9.scm, across the call to
- set-current-module that boots the module system. These
- definitions need to be visible at the time of the first
- `set-current-module' call.
- (try-module-autoload): Define a `#f' before the call to
- set-current-module. It is redefined later.
-
- * debug.scm: Use `module-set!' instead of `variable-set!' to set
- insert `debug-options' into the-root-module.
- * format.scm: Likewise, for `format'.
-
-2001-05-15 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (error-catching-repl): Call the E
- ("eval'er") procedure via call-with-values and call the P
- ("printer") for each produced value. Thanks to Matthias Köppe!
-
-2001-05-14 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * boot-9.scm (cond-expand): Reduce feature list to built-in
- features.
-
-2001-05-14 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * boot-9.scm (-1+, return-it, string-character-length, flags):
- Deprecated.
-
-2001-05-11 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * boot-9.scm: Added `cond-expand' (SRFI-0) for portable feature
- checking.
-
-2001-05-10 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * boot-9.scm (resolve-module): Abstraction maintenance: Use
- `module-public-interface'.
- (resolve-interface): Extend to handle selection and renaming in spec.
- Arg is now `spec' which can be a simple module name (list of symbols)
- or a interface spec.
- (symbol-prefix-proc): New proc.
- (%autoloader-developer-mode): Delete.
- (process-define-module): Use "define-module" in error messages
- instead of "defmodule". Factor error into internal proc.
- Rewrite `use-module' and `use-syntax' handlers.
- Replace some single-arm `if-not' constructs w/ `or'.
- (process-use-modules): Arg is now `module-interface-specs',
- which is passed through to `resolve-interface' as before; nfc.
- (named-module-use!, top-repl): Abstraction maintenance: Use
- `provided?'.
-
-2001-05-06 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * q.scm, runq.scm, getopt-long.scm: Update copyright.
- Surround commentary w/ standard markers; nfc.
-
- * expect.scm: Update copyright.
- Fix commentary typo; nfc.
-
-2001-05-05 Rob Browning <rlb@cs.utexas.edu>
-
- * psyntax.ss: make sure emacs knows it's scheme code.
-
-2001-05-05 Neil Jerram <neil@ossau.uklinux.net>
-
- * boot-9.scm (use-syntax): Change error message to say
- `use-syntax' rather than `use-modules'.
-
-2001-05-02 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * safe-r5rs.scm: Fix typo: make-rectangualr => make-rectangular.
-
-2001-05-02 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (begin-deprecated): New.
- (call-with-deprecation): Removed.
- (id): Use `issue-deprecation-warning' instead of
- `call-with-deprecation'. Wrap definition in `begin-deprecated'.
- (eval-in-module): Manifest deprecation via `begin-deprecation' and
- `issue-deprecation-warning'.
- (warn-autoload-deprecation): Deactivated.
-
-2001-04-26 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (the-module, set-current-module, current-module):
- Removed, they are now defined in libguile.
-
-2001-04-29 Gary Houston <ghouston@arglist.com>
-
- * rw.scm: new file, for module (ice-9 rw).
- * Makefile.am: add rw.scm.
-
-2001-04-28 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * boot-9.scm, optargs.scm:
- Surround commentary w/ standard markers; nfc.
-
- * threads.scm, time.scm, channel.scm, expect.scm:
- Add commentary; nfc.
-
-2001-04-27 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * documentation.scm: Update copyright.
- Add commentary.
- Use `define-module' `:export' clause instead of `define-public'.
- Autoload (ice-9 regex) on `match:suffix'.
-
- (default-in-line-re, default-after-line-re): New vars.
- (default-scrub): New proc.
- (file-commentary): New proc, exported.
- (object-documentation): Expand docstring; nfc.
-
- * session.scm: Update copyright.
- Use (ice-9 rdelim).
-
- (help): Consider a list of symbols that does not start with
- `quote' as a module name and call `module-commentary' on it.
- (module-filename, module-commentary): New procs.
- (id): Delete.
- (apropos): Use `identity' instead of deprecated `id'.
- (help-usage): Add blurb about "(help (my module))" support.
-
-2001-04-27 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * Makefile.am (ice9_sources): Remove srfi-8.scm.
-
-2001-04-26 Rob Browning <rlb@cs.utexas.edu>
-
- * srfi-8.scm: removed in favor of srfi/srfi-8.scm - (wasn't ever
- in a production release).
-
-2001-04-25 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * channel.scm: New file.
- * Makefile.am (ice9_sources): Include channel.scm.
-
-2001-04-19 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * receive.scm (receive): Use `define-macro'.
-
-2001-04-15 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * boot-9.scm (load-compiled): New variable, initialized in the VM.
- (try-module-autoload): Try loading compiled modules if applicable.
-
-2001-04-15 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * boot-9.scm (call-with-deprecation): New procedure.
- (identity): New procedure.
- (id): Deprecated.
-
-2001-04-15 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * boot-9.scm (defmacro, define-macro, define-syntax-macro):
- Define only at the top level.
-
-2001-04-06 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * threads.scm: Update copyright.
-
- Use `export' and `export-syntax' instead of
- `define-public' and `defmacro-public'.
-
- (make-thread): Rename first arg to `proc'; nfc.
- (begin-thread, monitor): Rename second arg to `rest'; nfc.
- (with-mutex): Rename second arg to `body'; nfc.
-
-2001-04-06 Neil Jerram <neil@ossau.uklinux.net>
-
- * boot-9.scm (warn-autoload-deprecation): Close parenthesis in
- "You just tried to autoload ..." message.
-
-2001-04-05 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * Makefile.am (ice9_sources): Add history.scm.
- * history.scm: Create the module (value-history) at the beginning.
-
-2001-03-29 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (init-dynamic-module): Fix typo in call to
- warn-autoload-deprecation. I feel silly.
-
-2001-03-27 Marius Vollmer <mvo@zagadka.ping.de>
-
- * r4rs.scm (call-with-values): New definition, defers to
- @call-with-values.
-
-2001-03-26 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (warn-autoload-deprecation): New function.
- (init-dynamic-module): Use it here to print warning. Only give
- warning when a module has actually been found.
-
-2001-03-25 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (init-dynamic-module): Issue warning about
- auto-loading of compiled code modules being deprecated.
-
- * Makefile.am (ice9_sources): Added "time.scm".
-
-2001-03-20 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * time.scm (time): Reimplemented as a procedure call.
- (Thanks to Marius Vollmer)
-
-2001-03-20 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * safe-r5rs.scm (list): Export.
-
-2001-03-17 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * boot-9.scm (before-eval-hook, after-eval-hook,
- before-print-hook, after-print-hook): New hooks.
- (scm-style-repl): Call these hooks.
-
- * history.scm: New file.
-
-2001-03-17 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * time.scm: New file.
-
-2001-03-17 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * oldprint.scm: Removed.
-
-2001-03-12 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * arrays.scm (make-array): Added quote in front of ().
-
-2001-03-12 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * common-list.scm (count-if): New procedure.
-
-2001-03-10 Neil Jerram <neil@ossau.uklinux.net>
-
- * buffered-input.scm (make-buffered-input-port): New, more general
- buffered input procedure. Does not assume that a newline
- character should be interpolated between chunks of input returned
- by the reader proc.
- (make-line-buffered-input-port): Redefine in terms of
- make-buffered-input-port.
-
-2001-03-09 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * match.scm: Don't export defstruct. Use (unquote defstruct) instead.
-
-2001-03-09 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * Makefile.am (psyntax.pp): Added rule for producing psyntax.pp.
-
-2001-03-09 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * match.scm: export defstruct.
-
-2001-03-08 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * psyntax.ss: Added FSF copyright notice. Added a notice of
- changes in order to comply with paragraph 2a of the GPL. (Thanks
- to Keith Wright.)
-
-2001-03-07 Neil Jerram <neil@ossau.uklinux.net>
-
- * buffered-input.scm (make-line-buffered-input-port): Don't set
- the continuation flag for leading whitespace. Thanks to Dirk
- Herrmann for the suggestion.
-
-2001-03-05 Neil Jerram <neil@ossau.uklinux.net>
-
- * optargs.scm (rest-arg->keyword-binding-list): Use "'()" instead
- of "()".
-
- * buffered-input.scm: New file, with guts of line buffered input
- port implementation extracted from guile-readline/readline.scm.
-
-2001-03-03 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * stack-catch.scm: New file.
-
- * Makefile.am (ice9_sources): Added stack-catch.scm.
-
-2001-03-03 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm, rdelim.scm: Use "'()" instead of "()" in all places
- where the empty list is meant.
-
-2001-02-26 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * boot-9.scm (save-stack): Use `primitive-eval' for stack
- cutting. Makes backtraces work again! Also added a reference to
- save-stack from the place in the repl where the primitive-eval
- frame is invoked.
-
-2001-02-25 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * match.scm: New file, including Andrew K. Wright's pattern matcher.
- * Makefile.am (ice9_sources): Added match.scm.
-
-2001-02-16 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (eval-when, eval-case): Renamed `eval-when' to
- `eval-case', everywhere.
-
-2001-02-13 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (define-public): Removed spurious call to
- `interaction-evironment'.
- (define-public, defmacro-public): Use `export' instead of explicit
- module magic.
- (eval-when): New macro.
- (define-module, use-modules, use-syntax, export): Use it to
- restrict the use of these forms to the top level.
- (define-public, defmacro-public): Only export binding when on
- top-level.
- (process-define-module): Call `set-current-module' with the
- defined module.
- (define-module): Simply call `process-define-module' without any
- fuss (but only on top-level).
- (named-module-use!): New function.
- (top-repl): Do not use `define-module'. Use equivalent low-level
- means instead.
-
-2001-02-11 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (scm-style-repl): Use `primitive-eval' instead of
- `eval'.
- (define-public): Do not use `eval'.
-
-2001-02-08 Marius Vollmer <marius.vollmer@uni-dortmund.de>
-
- * and-let-star-compat.scm: Display the warning to the
- `current-error-port'.
-
-2001-02-04 Marius Vollmer <mvo@zagadka.ping.de>
-
- Avoid the use of "*" in file names for the benefit of lesser
- operating systems.
-
- * and-let-star.scm, and-let*.scm: Renamed `and-let*.scm' to
- `and-let-star.scm'. Updated module name as well.
- * and-let-star-compat.scm: New file, installed as `and-let*.scm'.
- * Makefile.am (ice9_sources): Replaced "and-let*.scm" with
- "and-let-star.scm".
- (install-data-local): Install "and-let-star-compat.scm" as
- "and-let*.scm", ignoring errors.
- (EXTRA_DIST): Distribute `and-let-star-compat.scm'.
-
-2001-01-26 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- This patch fixes a problem reported by Martin Grabmueller about
- the impossibility to access readline's run-time options.
-
- * boot-9.scm (define-option-interface): New macro. Allows to
- conveniently define a group of option interface functions.
-
- (readline-options readline-enable readline-disable,
- readline-set!): Moved to guile-readline/readline.scm.
-
-2001-01-24 Gary Houston <ghouston@arglist.com>
-
- * boot-9.scm: don't import (ice-9 rdelim) here. it's done
- in C for now.
- * rdelim.scm: export the C primitives too.
- * documentation.scm: use (ice-9 rdelim).
-
-2001-01-21 Gary Houston <ghouston@arglist.com>
-
- * rdelim.scm: new file implementing module (ice-9 rdelim).
- * ice-9.scm (scm-line-incrementors read-line! read-delimited!
- read-delimited read-line): moved to rdelim.scm.
- scm-line-incrementors is not exported.
- * boot-9.scm: import (ice-9 rdelim) for backwards compatibility,
- for now.
- * lineio.scm: use module (ice-9 rdelim).
- * Makefile.am (ice9_sources): add rdelim.scm.
-
-2000-12-29 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * boot-9.scm (root-module-closure, scm-module-closure): Remove
- calls '(symbol-interned? #f s)'. Formerly, these calls were
- basically no-ops, guaranteed to return #t if 's' was a symbol.
- After the separation of symbols and bindings, a call to
- '(symbol-interned? #f s)' will only return #t if there really is a
- binding for 's' in the scm_symhash table. Thanks to Dale P. Smith
- for providing a test case that helped finding this bug.
-
-2000-12-13 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * session.scm (apropos): Completed the last patch, which did only
- half the job. Thanks to Dale P. Smith.
-
-2000-12-12 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * session.scm (apropos, apropos-fold): There are no weak bindings
- any more.
-
-2000-12-12 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * boot-9.scm (top-repl): Lookup 'use-emacs-interface in
- the-root-module.
-
-2000-12-07 Neil Jerram <neil@ossau.uklinux.net>
-
- * emacs.scm (flush-whitespace): Fix spelling typo ("recieving").
-
-2000-11-28 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * boot-9.scm (read-delimited), lineio.scm
- (make-line-buffering-input-port), regex.scm (match:prefix,
- match:suffix, match:substring, regexp-substitute/global), slib.scm
- (slib-parent-dir), string-fun.scm (split-after-char,
- split-before-char, split-discarding-char, split-after-char-last,
- split-before-char-last, split-discarding-char-last,
- split-before-predicate, split-after-predicate,
- split-discarding-predicate, separate-fields-discarding-char,
- separate-fields-after-char, separate-fields-before-char,
- string-prefix-predicate, sans-surrounding-whitespace,
- sans-trailing-whitespace, sans-leading-whitespace,
- sans-final-newline): Use substring instead of
- make-shared-substring.
-
-2000-11-26 Gary Houston <ghouston@arglist.com>
-
- * boot-9.scm: values?, get-values, values, call-with-values:
- removed. values and call-with-values are now primitives and
- the other two were only exported by accident. don't define
- *values-rtd* record type or handle multiple values in
- scm-style-repl.
-
-2000-11-07 Gary Houston <ghouston@arglist.com>
-
- * popen.scm (open-output-pipe): added docstrings for open-input-pipe
- and open-output-pipe.
-
-2000-11-06 Gary Houston <ghouston@arglist.com>
-
- * popen.scm (open-process): bug fix: don't use
- close-all-ports-except to close ports in the child process, since
- it causes port buffers to be flushed. they may be flushed again
- in the parent, causing duplicate output. use a more elaborate
- method for setting up the child descriptors (thanks to David
- Pirotte for the bug report).
- standard file descriptors 0, 1, 2 in the child process
- are now set up from current-input-port etc., where possible.
-
-2000-10-10 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * syncase.scm (eval): string=? requires a string argument.
- Thanks to Dale P. Smith for the patch.
-
-2000-10-15 Neil Jerram <neil@ossau.uklinux.net>
-
- * optargs.scm: Fix typos in commentary for bound? and lambda*.
-
-2000-10-10 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * session.scm (apropos, apropos-fold): regexp-exec does not
- accept symbol arguments any more. Thanks to Dale P. Smith for the
- patch.
-
-2000-09-30 Gary Houston <ghouston@arglist.com>
-
- * posix.scm (setgrent): pass #t, not #f. thanks to
- Jacques A. Vidrine.
-
-2000-09-29 Neil Jerram <neil@ossau.uklinux.net>
-
- * documentation.scm (find-documentation-in-file): Modified
- according to changed format of guile-procedures.txt caused by my
- snarfing/makeinfo changes in libguile.
-
- * session.scm (help-doc): Improvements to (help) output: (i) a
- friendlier Emacs-style introduction line; (ii) where the help arg
- matches multiple documented entries, print an initial list of the
- entries for which documentation is found, before printing the
- actual documentation entries themselves.
-
-2000-09-20 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * boot-9.scm: Removed comment. (Thanks to Brad Knotwell.)
-
-2000-09-12 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * syncase.scm (putprop): Use the high-level property interface.
-
-2000-09-12 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * psyntax.ss (build-lexical-var): Use gentemp instead of gensym;
- Convert first argument to a string.
-
- * calling.scm (excursion-function-syntax,
- getter-and-setter-syntax,
- delegating-getter-and-setter-syntax): Call gensym with string
- argument. (Thanks to Dale P. Smith.)
-
- * oldprint.scm (print-table-add!): Ditto.
-
- * boot-9.scm (gentemp): Moved to symbols.c.
-
-2000-08-27 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (make-object-property): New function.
-
-2000-08-26 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * boot-9.scm (make-record-type): Use `string-append' instead of
- `symbol-append'.
- (symbol-append): Map `symbol->string' on
- args.
- (obarray-symbol-append, obarray-gensym): Simply removed. I don't
- think I'll announce this in NEWS even. One of the functions never
- even worked... /mdj.
- (find-and-link-dynamic-module, keyword->symbol): Use
- `symbol->string'.
- (try-module-autoload, process-define-module): Rewrote using R5RS
- semantics.
-
-2000-08-24 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * psyntax.ss (set!): Added generalized set! support to core syntax
- form set!.
-
-2000-08-19 Marius Vollmer <mvo@zagadka.ping.de>
-
- * optargs.scm (#\&): Changed #:allow-other-keys-value to
- #:allow-other-keys. Thanks to Bill Schottstaedt!
-
-2000-08-17 Marius Vollmer <mvo@zagadka.ping.de>
-
- * optargs.scm (#\&): Emit warning about `#&' being deprecated.
-
-2000-08-16 Marius Vollmer <mvo@zagadka.ping.de>
-
- * optargs.scm: Replaced `#&' reader syntax with keywords.
-
-2000-08-14 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * format.scm (format:obj->str): Made tail-recursive. (Thanks to
- Matthias Köppe.)
-
-2000-08-13 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * psyntax.ss (top-level-eval-hook, local-eval-hook): Pass
- `(interaction-environment)' as second arg to `eval'. This is
- completely equivalent with the state before the change to eval of
- 2000-08-11, but we should extend psyntax.ss to be module aware.
- (Thanks to Ian Bicking.)
-
- * emacs.scm (emacs-symdoc): Parenthesis fix.
-
-2000-08-11 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * r5rs.scm (interaction-environment): Removed definition. (Is now
- provided by libguile/modules.c.)
-
- * safe-r5rs.scm (null-environment): Bugfix: Should include
- syntactic bindings.
-
- * boot-9.scm (record-constructor, record-accessor,
- record-modifier, scm-style-repl): Add second arg to eval.
- (read-hash-extend #\.): Ditto. (This is actually a bugfix!)
- (eval-in-module): Redefined to be eval and deprecated.
-
- * syncase.scm (eval): Add second arg both in definition and use.
-
- * slib.scm (slib:eval): Use eval instead of eval-in-module.
- (defmacro:eval): Eval in (interaction-environment).
-
- * safe-r5rs.scm (eval): Removed definition.
-
- * emacs.scm (emacs-eval-request):
- (emacs-symdoc): (This procedure needs updating!)
-
-2000-08-10 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * boot-9.scm: Added note about dependency in modules.h to
- definition of module-type.
-
- * Makefile.am (ice9_sources): Added receive.scm, srfi-8.scm.
-
- * receive.scm, srfi-8.scm: New files.
-
- * boot-9.scm (scm-style-repl): Print multiple values on successive
- lines.
- (process-define-module): Bugfix: Make sure that exports are done
- *after* all used interfaces has been added.
-
-2000-07-24 Marius Vollmer <mvo@zagadka.ping.de>
-
- * common-list.scm (uniq): Made tail-recursive. Thanks to thi!
-
-2000-07-13 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * boot-9.scm (expt): In case of negative integer exponents return
- an exact result if the input paramters were exact. Thanks to
- Mikael for the suggestion.
-
-2000-07-12 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * boot-9.scm (expt): Make sure that integer-expt is only called
- if the exponent is a non-negative integer.
-
-2000-07-01 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * boot-9.scm (process-define-module): Bugfix: Only check the CDR
- for export args.
-
-2000-06-27 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * popen.scm: gc-thunk is deprecated. Use after-gc-hook instead.
-
-2000-06-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * common-list.scm (intersection, set-difference, remove-if,
- remove-if-not): Made tail-recursive. Thanks to William Webber
- for the hint.
-
- (delete-if!, delete-if-not!): Renamed parameter from `list' to
- `l' in order to avoid confusion. Note: These functions are not
- tail recursive yet.
-
-2000-06-21 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * boot-9.scm: Turned `the-module', `*top-level-lookup-closure*',
- and `scm:eval-transformer' into fluids.
-
- * boot-9.scm (purify-module!, module-export!): New procedures.
- (export): Rewritten using `module-export!'.
- (process-define-module): New define-module options: pure, export.
- See NEWS.
- (scm-style-repl): Added optional module argument.
-
- * null.scm, r5rs.scm, safe-r5rs.scm, safe.scm: New modules.
-
-2000-06-20 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * session.scm (make-fold-modules): Detect circular references in
- module graph. (Thanks to Matthias Köppe.)
-
-2000-06-20 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * session.scm: Use module (ice-9 regex).
- (help): Regexp-quote a name given as a symbol.
-
-2000-06-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * common-list.scm (list*): Removed, since this function is
- implemented as a primitive in libguile/list.c.
-
-2000-06-12 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * session.scm (help): Warn user if 'regex isn't provided.
-
- * Makefile.am (ice9_sources): Removed getopt-gnu-style.scm.
-
- * getopt-gnu-style.scm: Removed deprecated module.
-
-2000-06-11 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * boot-9.scm (make-autoload-interface): Set init value for uses to
- '() instead of #f.
- (make-modules-in): Name modules with their real (= full) names.
- (the-root-module, the-scm-module): Named `(guile)' instead of
- `the-root-module'.
- (the-scm-module): Set kind to 'interface.
-
- * Makefile.am (ice9_sources): Replaced doc.scm with
- documentation.scm.
-
- * session.scm (ice-9): Use module (ice-9 documentation).
- (name): Use the name property if everything else fails.
- (apropos-fold): New procedure.
- (apropos-internal): Re-implement in terms of `apropos-fold'.
- (help): Rewritten.
-
- * doc.scm: Removed module (ice-9 doc).
-
- * documentation.scm: New module (ice-9 documentation).
-
-2000-06-08 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * doc.scm (documentation-files): Renamed from `doc-files'.
- (write-all): Removed.
- (find-documentation): Renamed from `documentation'. Return
- documentation string instead of printing it. Not exported.
-
-Tue Jun 6 09:21:28 2000 Greg J. Badros <gregb@go2net.com>
-
- * session.scm: Update references to `proc-doc' to be
- `proc-documentation'
-
- * doc.scm: Cleaned up a great deal. Put variables at the top of
- the file, eliminated `object-documentation' that was broken
- (referencing Scwm), drop `help' as session.scm has a better
- supported version of that procedure. Rename `proc-doc' to
- `proc-documentation' -- `procedure-documentation' is a primitive
- getter function, so I use the shorter name for this more useful
- function. (Alternatively, we could rename the primitive
- getter...)
-
-2000-06-05 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * boot-9.scm (error-catching-loop): Inform about debugger on error.
-
-2000-06-04 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * boot-9.scm (scm-module-closure): New procedure: Was previously
- anonymous. Now needed in modules.c.
- (make-module): Use `standard-eval-closure' to create the eval
- closure.
-
-2000-05-14 Gary Houston <ghouston@arglist.com>
-
- * boot-9.scm (load-user-init): rewritten. first work out the home
- directory and then try to open the file (previously it could try
- to open a file in more than one place). catch exceptions when
- trying to get a directory from the user database. don't check
- that ~/.guile is not a directory before trying to load it (a lack
- of ~/.guile is not a crime, but if the file is not valid for any
- reason then primitive-load will raise an error).
-
-2000-05-11 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * boot-9.scm (abs): Don't set to magnitude. abs now does not
- accept complex numbers as parameter.
-
-2000-05-09 Marius Vollmer <mvo@zagadka.ping.de>
-
- * common-list.scm (delete-if-not!): Bug fix of bug fix: change
- label of named let to `delete-if-not'. Sorry.
-
-2000-05-08 Marius Vollmer <mvo@zagadka.ping.de>
-
- * common-list.scm (doc fixes): Talk about `true values' instead of
- `#t' when a function treats all non-#f valuers the same.
- (remove-if-not): Bug fix: call remove-if-not
- instead of remove-if when iterating.
- (delete-if-not!): Bug fix: call delete-if-not! instead of
- delete-if! when iterating.
-
-2000-04-16 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * r4rs.scm (close-input-port, close-output-port): Removed.
-
-2000-04-13 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * session.scm (help): New macro. Prints helpful information.
-
-2000-04-10 Gary Houston <ghouston@arglist.com>
-
- * popen.scm (open-process): after forking, close all ports except
- the end of the pipe to the parent. otherwise move->fdes and
- the exec'd program and the exit handlers can interfere with file
- descriptors still in use in parent ports.
-
-2000-04-09 Gary Houston <ghouston@arglist.com>
-
- * popen.scm (close-process-quietly): new procedure. use it from
- reap-pipes to avoid errors or hanging during background cleanup.
-
-2000-04-04 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * format.scm (format:obj->str): Handle circular references. Also,
- print improper lists with (x y . z) syntax rather than as
- individual pairs. (This code should probably be integrated into C
- level facilities. It is currently terribly slow.)
-
-2000-04-03 Michael Livshin <mlivshin@bigfoot.com>
-
- * streams.scm (stream-fold, stream-for-each): don't use named let,
- because it prevents the gc from junking the stream argument.
-
-Thu Mar 9 08:05:08 2000 Greg J. Badros <gjb@cs.washington.edu>
-
- * slib.scm: Back-out change to software-type -- renamed
- slib:software-type to software-type, and leave it non-public.
-
-Thu Mar 2 12:20:52 2000 Greg J. Badros <gjb@cs.washington.edu>
-
- * boot-9.scm: Drop unused definition of sfx function -- thanks
- Dirk Hermann!
-
-Wed Mar 1 12:21:02 2000 Greg J. Badros <gjb@cs.washington.edu>
-
- * streams.scm: Doc patch from Richard Kim, using MIT Scheme as
- source of the numerous very short changes.
-
-Sun Feb 13 18:03:19 2000 Greg J. Badros <gjb@cs.washington.edu>
-
- * slib.scm: Rename software-type to slib:software-type and make it
- public.
-
- * r4rs.scm: Added documentation; largely cut and pasted from R4RS
- info pages.
-
-Sun Feb 13 17:49:29 2000 Greg J. Badros <gjb@cs.washington.edu>
-
- * common-list.scm: Added documentation; largely cut and pasted
- from slib docs.
-
-2000-02-11 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * format.scm (format): Reintroduce (define format format:format)
- so that the binding in the public interface of the module will be OK.
-
-2000-01-30 Gary Houston <ghouston@arglist.com>
-
- * boot-9.scm (find-and-link-dynamic-module): pass strings, not symbols,
- to string-append.
-
-2000-01-29 Gary Houston <ghouston@arglist.com>
-
- * expect.scm (expect): don't call char-ready? before expect-select,
- since select now checks port buffers itself. don't bother to check
- the time first either, since expect-select does it.
-
-Thu Jan 20 12:57:36 2000 Greg J. Badros <gjb@cs.washington.edu>
-
- * format.scm: Use (variable-set! (builtin-variable 'format)) to
- re-define format to be format:format (instead of just define,
- which interacts poorly with the module system). Thanks to Shuji
- Narazaki for this change.
-
-Tue Jan 11 10:49:22 2000 Greg J. Badros <gjb@cs.washington.edu>
-
- * boot-9.scm expect.scm, syncase.scm: Switch to new style
- `simple-format' message strings: substitute ~A for %s, and ~S for
- %S.
-
- * boot-9.scm: Added (define format simple-format) to expose that
- primitive via the simpler name until format.scm is loaded.
-
-2000-01-09 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (try-using-libtool-name): Do not bother to look
- inside libtool ".la" file, dynamic-link does this for us now.
-
-1999-12-15 Gary Houston <ghouston@freewire.co.uk>
-
- * slib.scm (library-vicinity, home-vicinity,
- scheme-implementation-type, scheme-implemenation-version):
- use define-public to export from the module.
-
-Wed Dec 15 08:32:09 1999 Greg J. Badros <gjb@cs.washington.edu>
-
- * doc.scm: Use `%library-dir' and the other system directories,
- not the quickly defuncted `library-dir' that I added before
- realizing the former existed. Thanks Brad Knotwell!
-
-Sun Dec 12 19:18:52 1999 Greg J. Badros <gjb@cs.washington.edu>
-
- * Makefile.am, doc.scm: Added doc.scm.
-
-1999-12-12 18:54:06 1999 Greg J. Badros <gjb@cs.washington.edu>
-
- * popen.scm, slib.scm: Added some docstrings for procedures that
- were primitives that I encountered in posix.texi.
-
-1999-11-19 Gary Houston <ghouston@freewire.co.uk>
-
- * Makefile.am (ice9_sources): add arrays.scm.
-
- * boot-9.scm: load arrays.scm if 'array is provided.
-
- * arrays.scm: new file with stuff from boot-9.scm.
-
-1999-11-18 Gary Houston <ghouston@freewire.co.uk>
-
- * boot-9.scm (read-hash-extend to set up arrays): add 'l' for
- long_long uniform vectors.
-
-1999-11-17 Gary Houston <ghouston@freewire.co.uk>
-
- * networking.scm (sethostent, setnetent, setprotoent, setservent):
- take an optional argument STAYOPEN. default is #f.
-
-1999-10-05 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * Makefile.in: Deleted from CVS repository. Run the autogen.sh
- script to create generated files like this one.
-
-1999-09-23 Gary Houston <ghouston@freewire.co.uk>
-
- * boot-9.scm (load-user-init): check that the posix feature is
- available before using getpw and getuid.
- (top-repl): don't install handlers for SIGINT etc., without posix.
- (file-is-directory?): use 'posix instead of i/o-extensions to
- check for stat.
- (load-user-init): use file-exists? and file-is-directory? to
- check for .guile, instead of stat.
- (file-is-directory?): don't display the file name if posix not
- available.
- (feature?): I guess this is deprecated. redefined using "provided?"
- and changed users in boot-9.scm to "provided?".
- Conditionally load posix.scm and networking.scm.
-
- posix.scm, networking.scm: new files. Move definitions from
- boot-9.scm if they are only useful with posix/networking available.
-
- * Makefile.am (ice9_sources): add posix.scm, networking.scm.
-
-1999-09-17 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * debugger.scm (read-and-dispatch-commands): Handle other throws
- than 'exit-debugger.
-
- * boot-9.scm (before-signal-stack): New fluid.
- (top-repl): Set before-signal-stack in the signal handler.
-
- * debugger.scm (eval-handler): Handle unhandled exceptions.
-
-1999-09-16 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * debugger.scm ("p"): New alias for "evaluate";
- Mark module with :no-backtrace.
- ("position"): New command.
- (source-position, display-position): New procedures.
- (display-source): Display position of expression, if available.
- (catch-user-errors): Return #f on error. (Commands are expected
- to return a valid state.)
- (read-and-dispatch-command): Bugfix: Return old state on error.
-
-1999-09-16 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * regex.scm (regexp-substitute/global): Handle the end of the
- match list and an empty match list identically. (Thanks to Greg
- Badros.)
-
-1999-09-15 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * debugger.scm ("evaluate"): Replaced `write-line' with calls to
- `write' and `newline' since write-line doesn't write but displays.
-
-1999-09-12 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * debugger.scm ("evaluate"): Newline after no env announcement.
-
- * debug.scm, emacs.scm: Updated copyright notices.
-
- * boot-9.scm (make-autoload-interface): Bugfix.
- (top-repl): Autoload debugger.
-
- * debugger.scm ("backtrace"): Don't pass length param to
- display-backtrace if it wasn't explicitly given by the user.
- (write-frame-long/application): Also print corresponding source
- expression.
- ("evaluate"): Evaluate in local environment frame, if existent;
- Handle errors.
-
-1999-09-11 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * format.scm (format:format-work): Use #\tab and #\page instead of
- slib:form-feed and slib:tab. (Thanks to Ceri Storey.)
-
- * format.scm (format:abort): Call error, not slib:error.
-
-1999-09-11 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * boot-9.scm (using-readline?): New procedure: Returns #t if
- readline is used by the repl run by this thread.
- (handle-system-error): Print "Backtrace:" before backtrace since
- this is no longer done by display-backtrace.
-
- * debug.scm (frame-number->index): Optionally take stack as
- argument.
-
- * debugger.scm: Use the frame number abstraction which allows for
- both forward and backward views of the stack
- (write-frame-index-short, write-frame-index-long):
- Use selector `frame-number';
- (select-frame-absolute): Use frame-number->index.
- ("backtrace"): Use builtin backtrace printing.
- Use (ice-9 debug).
- Use readline conditionally.
-
-1999-09-11 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * regex.scm (fold-matches, list-matches): New functions.
- (regexp-substitute/global): Rewritten again in terms of
- list-matches, to get null match behavior correct.
-
- * regex.scm (regexp-substitute/global): Rewrite so that 'post at
- the end of the item list actually causes a tail call. (Thanks to
- Jan Nieuwenhuizen.)
-
-1999-09-11 Marius Vollmer <mvo@zagadka.ping.de>
-
- * readline.scm: Moved to ../guile-readline.
-
- * boot-9.scm (top-repl): Removed code for activating readline.
-
- * Makefile.am: Removed mention of readline.scm.
-
- * Makefile.in: Regenerated.
-
-1999-09-11 Jim Blandy <jimb@savonarola.red-bean.com>
-
- Delete the test which compares the configuration date of libguile
- with the configuration date of ice-9. This test yields too many
- false positives to be helpful. For example, if you build Guile
- for several architectures but have them all share a "share"
- directory (which is supposed to work), then all but one
- architecture's Guile will complain that the configuration dates
- don't match. Which is true, but indicates nothing wrong.
- * boot-9.scm: Delete code which compares ice-9-config-stamp with
- libguile-config-stamp.
- * version.scm.in: Delete.
- * Makefile.am (ice9_generated): Delete.
- (subpkgdata_DATA): Remove ice9_generated.
- (EXTRA_DIST): Remove version.scm.in.
- * Makefile.in: Regenerate.
-
-1999-09-11 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * debugger.scm: New file: Initial version of the Guile debugger
- written by Chris Hanson. (The debugger isn't finished, but is
- included in Guile anyway since it is already quite useful.)
-
- * boot-9.scm (top-repl): Use (ice-9 debug) (ice-9 debugger) (ice-9
- session) (ice-9 threads) (ice-9 regex) from guile-user only if
- top-repl is called. This makes startup time for scripts 30% of
- what it was before... Removed redundant code for loading of
- readline.
-
- * Makefile.am (ice9_sources): Added debugger.scm.
-
-1999-08-29 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * boot-9.scm (try-module-autoload): Use %search-load-path.
-
-1999-08-24 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * boot-9.scm: Removed old style hooks.
- (inherit-print-state): Rwwritten to use port-with-print-state.
-
-1999-08-20 James Blandy <jimb@mule.m17n.org>
-
- Remove support for the #/ path list syntax entirely.
- * boot-9.scm (read-path-list-notation,
- read-path-list-notation-warning): Deleted.
- Don't register read-path-list-notation-warning as a reader for
- objects starting with '#/'.
-
-1999-08-05 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- GOOPS needs the observer protocol specified for the new module
- system. Here's a simple version for the old module system:
- * boot-9.scm (module-observers, module-weak-observers,
- module-observer-id, set-module-observers!,
- set-module-observer-id!): New accessors.
- (module-type): Added slots `observers', `weak-observers' and
- `observer-id'.
- (module-observe, module-observe-weak, module-unobserve,
- module-modified): New procedures.
- (module-make-local-var!, module-add!, module-remove!,
- module-clear!, module-define!, module-use!): Call module-modified.
-
-1999-07-29 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (error-catching-loop): Correct non-RnRS usage of internal
- defines.
-
-1999-07-19 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * streams.scm: New module, contributed by Michael Livshin.
- * Makefile.am (ice9_sources): List it.
- * Makefile.in: Regenerated.
-
- * boot-9.scm (read-delimited!): Put the terminator in the correct
- position.
-
-1999-06-29 Mikael Djurfeldt <mdj@mdj-pc.nada.kth.se>
-
- * readline.scm: Bugfix: Avoid getting the continued-lines prompt
- at multiple calls to read.
- (promtp2): Variable for continued-lines prompt.
- (make-readline-port): Use prompt2.
- (set-readline-prompt!): New optional arg which sets
- continued-lines prompt.
-
- * boot-9.scm (top-repl): Set/clear readline prompts before/after
- reading expressions.
-
-1999-06-18 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * ls.scm (ls, lls): Handle no arguments as meaning to look in
- `(current-module)'. (Patch from Thien-Thi Nguyen.)
-
-1999-06-14 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * string-fun.scm (split-before-predicate, split-after-predicate,
- split-discarding-predicate): Make these public. (Thanks to
- Thien-Thi Nguyen.)
-
- 1999-06-13 Gary Houston <ghouston@easynet.co.uk>
-
- * more changes to expect.scm, to avoid the one-character lookhead
- that was introduced to fix the $ problem:
-
- * expect.scm (expect): call the match proc an extra time at end
- of file and set the eof? argument appropriately. call
- expect-eof-proc only if the last call didn't match.
- * expect.scm (expect-strings): change port to eof? in match proc.
- * expect.scm (expect-regexec): take an eof indicator as an argument
- instead of a port.
-
-1999-06-09 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * Makefile.am (ice9_sources): Add popen.scm to list.
- * Makefile.in: Regenerated.
-
- Fixes for expect from Gary Houston <ghouston@easynet.co.uk>:
-
- * expect.scm (expect-regexec): define 'eof-next?'. I don't
- know why it was missing. also don't peek for end of lines
- unless expect-strings-exec-flags contains regexp/noteol.
- (expect-strings-exec-flags): initialise to regexp/noteol.
-
- Gary Houston's open-buffer port patches:
-
- 1999-04-01 Gary Houston <ghouston@easynet.co.uk>
-
- * popen.scm: applied fixes from Greg Harvey. use a guardian
- and a gc-thunk so that cleanup is done if a pipe is garbage
- collected or closed with close-port. use a weak hash-table instead of
- an alist.
-
- 1999-03-20 Gary Houston <ghouston@easynet.co.uk>
-
- * expect.scm (expect): call the match proc with the port instead.
- (expect-strings): use peek-char to get the next char. this has
- the advantage of getting the handling of $ "correct", but the
- disadvantage of needing to get (and maybe block for) an extra character
- from the port when it may not be needed. hence:
- (expect-strings-exec-flags): new variable/parameter, supplies
- flags for regexp-exec. if this includes regexp/noteol, then
- automatic regexp/noteol handling (requiring an extra peeked char)
- is enabled. default is regexp/noteol.
- (expect-strings-compile-flags): new variable/parameter, supplies
- flags for make-regexp. default is regexp/newline.
-
- 1999-03-15 Gary Houston <ghouston@easynet.co.uk>
-
- * expect.scm (expect): call the match proc with an extra char,
- peeked from the stream.
- (expect-strings): build a match proc which takes the extra char.
- (expect-regexec): take an extra arg "eof-next?" and use it
- to decide whether the regexp/noteol flag should be added.
-
- 1999-02-26 Gary Houston <ghouston@easynet.co.uk>
-
- * boot-9.scm (top-repl): don't flush all ports at exit.
- (error-catching-loop): likewise.
-
- 1998-12-23 Gary Houston <ghouston@easynet.co.uk>
-
- * boot-9.scm (scm-style-repl): -read: don't call
- consume-trailing-whitespace if val is eof object. Allows
- exiting repl with single control-D.
-
- 1998-12-06 Gary Houston <ghouston@easynet.co.uk>
-
- * boot-9.scm (error-catching-loop): don't force output within
- error catching loop after quit received.
- (top-repl): flush all ports when the repl terminates.
-
- * boot-9.scm (error-catching-loop): flush all ports before
- primitive exit if non-interactive.
- force-output on current-error-port if interactive.
-
- * boot-9.scm (reopen-file): deleted.
- * popen.scm (open-output-pipe, open-input-pipe): moved from
- boot-9.scm.
- * popen.scm: new file.
-
-1999-06-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * boot-9.scm (iota): replaced by a tail recursive version.
- (reverse-iota): removed.
-
-1999-06-03 Mikael Djurfeldt <mdj@mdj-pc.nada.kth.se>
-
- * optargs.scm (lambda*): Bugfix: Replaced ARGLIST -->
- non-optional-args. (Thanks to David Lutterkort.)
-
-1999-05-09 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * string-case.scm: Removed; functions moved to libguile/strop.c
- (which could be dynamically linked in the future anyway).
- * Makefile.am (ice9_sources): Don't list string-case.scm.
- * Makefile.in: Regenerated.
- * format.scm: Don't bother importing (ice-9 string-case).
-
-1999-05-02 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * boot-9.scm (provided?): New function.
-
- * Makefile.am: Add string-case.scm and format.scm to ice9_sources.
- * Makefile.in: Regenerated.
-
- * string-case.scm: New file, brought in from SLIB, and adapted to
- Guile's module system.
-
- * format.scm: New file, brought in from SLIB, with the following
- changes:
- (format:format): If the first argument is the format string, stick
- a #f on the front of it, so it is now a valid CL format argument
- list. This is easier than changing everyplace else (like the
- error formatter) that expects it to be in CL form. The other
- clause which explicitly tests for this case is now dead code.
- (format:format-work): Allow `@' and `:' in either order, as per
- modern CL behavior.
- (format:num->cardinal): Don't assume that an elseless if returns
- '() when the condition is false.
-
-1999-04-17 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * Makefile.in: Regenerated.
-
-1999-04-08 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * boot-9.scm: Provide 'values.
-
-1999-03-21 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
-
- * boot-9.scm (process-define-module, use-syntax): Bugfix:
- :use-syntax should add syntax to using module, not current module.
- (internal-use-syntax): Removed.
-
-1999-03-21 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * session.scm (apropos-internal): Modified to comply with new
- argument order for hash-fold.
-
-1999-03-19 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
-
- * boot-9.scm (try-load-module): New procedure. Broken out from
- resolve-module.
- (resolve-module): Bugfix: Make it possible for a module at a
- deeper level (x y z) to depend on a module on a higher (x y).
-
- This also has the desired side-effect that multiple attempts to
- load a module (e.g. with `use-modules') work until source is
- actually found for the module (e.g. because the correct catalog
- has been added to the load path).
-
- Use try-load-module.
-
-1999-03-18 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * session.scm (system-module): New procedure. Used to switch a
- module between system and user state.
-
-1999-03-16 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * session.scm (apropos-internal): Rewritten using hash-fold.
-
- * emacs.scm, session.scm, slib.scm): Added :no-backtrace in module
- definition.
-
-1999-03-14 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
-
- * boot-9.scm (make-record-type): Use `set-struct-vtable-name!' to
- associate a name to the record type descriptor so that the object
- system can create a wrapper class for it.
-
-1999-03-12 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- Improvement of backtraces: Introduces a new stack narrowing
- specifier, #t, for the inner cut. If the inner cut is specified
- by #t, `make-stack' will throw away inner stack frames (most
- recent calls on call chain) up to but excluding the first user
- stack frame encountered.
-
- This specifier is now used in `save-stack' so that the call
- `(save-stack)' will get the new behaviour. [It is recommended that
- any error reporting functions written by the user have this call
- on the outermost expression level (i.e. as a member of the lambda
- list).]
-
- Modules are partitioned into "user" and "system" modules. [I know
- that some names used here are silly, but I don't have more time to
- spend on a better solution, especially considering that the module
- system will be replaced. But if people have better ideas, then
- please tell me!]
-
- System modules are created by adding :no-backtrace among the
- define-module switches:
-
- (define-module (foo)
- :no-backtrace)
-
- Modules which doesn't have the :no-backtrace specifier are user
- modules.
-
- A stack frame is classified as a user frame if it has source code
- associated with it and if this source code can be proven to come
- from a user module. If it can be proven to come from a system
- module it is a system frame.
-
- Frames which can't be classified, e.g. application frames, are cut
- away if they occur between system frames, but are left on the
- stack if they occur between the last system frame and the first
- user frame encountered. (Note that the first user frame
- encountered is the last user code being evaluated!)
-
- In some cases the system part of the call chain is introduced by
- frames which should but can't be proven to be system frames. The
- following workaround has been implemented: The cutting proceeds
- over application frames where the operator is marked by the
- `system-procedure' property. (This has been used to cut away
- generic function dispatch code in the object system.)
-
- * boot-9.scm (set-system-module!): New procedure: Set system/user
- status of a module.;
- Mark `the-root-module' and `the-scm-module' as system modules.
- (process-define-module): Add new keyword :no-backtrace.
-
- * boot-9.scm (environment-module): Bugfixed.
- (set-module-eval-closure!): Add a pointer back from the eval
- closure to the module.
-
- * emacs.scm (emacs-load): Reset port filename after transfer.
-
-1999-03-03 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * slib.scm (make-random-state): Added for compatibility.
-
-1999-02-16 Maciej Stachowiak <mstachow@alum.mit.edu>
-
- * optargs.scm (lambda*): Handle empty argument lists properly.
-
-1999-02-15 Jim Blandy <jimb@savonarola.red-bean.com>
-
- Fix from Russ McManus:
- * getopt-long.scm (parse-option-spec): Store 'optional as the
- value-required? field for options that take optional values.
- (process-short-option): Grab a value for the option when it takes
- either an optional or required value.
-
-1999-02-12 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * getopt-long.scm: Remove debugging calls to `pk'.
-
- * getopt-long.scm: Return list of ordinary arguments as the value
- of the '() key, not `rest'.
-
- A new argument-processing package from Russ McManus.
- * getopt-long.scm: New file.
- * Makefile.am (ice9_sources): Added getopt-long.scm.
- * Makefile.in: Regenerated.
-
-1999-02-09 Maciej Stachowiak <mstachow@alum.mit.edu>
-
- * optargs.scm: New file.
- * Makefile.am (ice9_sources): Add optargs.scm here. Makefile.in
- not regenerated because I don't have the right version of Automake.
-
-1999-02-06 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * and-let*.scm: New file, from Michael Livshin.
- * Makefile.am (ice9_sources): Add and-let* here.
- * Makefile.in: Regenerated.
-
-1999-01-11 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * slib.scm (install-require-module): Fixed the kludge which loads
- the slib catalog: Doesn't anylonger assume that the feature tested
- for isn't loaded.
-
-1998-12-14 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * Makefile.in: Regenerated.
-
-1998-12-14 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * boot-9.scm (process-define-module): Reverted the change of
- 1998-11-23 which caused loading of object code if :use-module was
- applied to the module itself.
-
-1998-12-11 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
-
- * Makefile.am: Removed setf.scm.
-
- * setf.scm: Removed. 1. It was buggy. 2. It was unschemey.
- (These shortcomings were my fault.)
-
-1998-12-10 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * boot-9.scm (environment-module): New procedure.
-
-1998-12-07 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
-
- * Makefile.am: Added setf.scm.
-
-1998-12-05 Christian Lynbech <chl@tbit.dk>
-
- * setf.scm: New file. Adds the new forms `setf!' and `setter'
- which implements generalized references a la Common LISP.
-
-1998-12-02 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
-
- * boot-9.scm (process-define-module): Added new specifier
- :autoload MODULENAME BINDINGS to the define-module form.
- The autoload specifier tells the module system to load the module
- MODULENAME at the first occasion that any variable with its name
- among BINDINGS is referenced.
- (make-autoload-interface): New procedure: Constructs a stand-in
- for the public interface for the module to be autoloaded.
-
-1998-12-01 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * boot-9.scm (*suppress-old-style-hook-warning*): Set this to #t
- if you don't want the old style hook warnings.
-
-1998-12-01 Christian Lynbech <chl@tbit.dk>
-
- * boot-9.scm (try-using-libtool-name): Fix check on dlname to make
- sure that it isn't empty, as it is when we are only buidling
- static libraries.
-
-1998-11-27 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * session.scm (arity): New procedure.
-
-1998-11-26 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * boot-9.scm: Use run-hook instead of run-hooks everywhere.
-
-1998-11-26 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
-
- * boot-9.scm (run-hooks, add-hook!, remove-hook!): Added temporary
- code for backward compatibility until people have had time to
- adapt to the new hooks.
-
-1998-11-23 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
-
- * boot-9.scm (beautify-user-module!): Beautify also if public
- interface is set to the module itself. In this way we can use
- beautify-user-module! to beautify a module prepared for object
- code.
- (process-define-module): Special case: Try to load object code as
- well if a module does :use-module on itself.
-
- * boot-9.scm: Bugfix: Since boot-9.scm is now loaded from
- invoke_main_func, we can no longer be sure that all modules have
- been registered when boot-9.scm is loaded.
- (register-modules): New function: Register and tag modules
- registered by scm_register_module_xxx since last call to this
- function. Modules are tagged with the dynamic object passed as
- argument. (Already linked modules should be tagged with #f.)
- (init-dynamic-module, link-dynamic-module): Call register-modules
- first to register linked modules.
-
- * boot-9.scm (init-dynamic-module): Remove module from
- registered-modules as soon as possible in case we are recursively
- invoked; Set public interface before doing the dynamic-call.
-
- * boot-9.scm (map-in-order): Removed (replaced by scm_serial_map).
- (abort-hook, before-error-hook, after-error-hook,
- before-backtrace-hook, after-backtrace-hook, before-read-hook,
- after-read-hook, exit-hook): Make hooks with `make-hook'.
-
- * boot-9.scm: Make hooks first class citizens and make them easier
- to use from C:
- (make-hook, add-hook!, remove-hook!, run-hooks): Moved to
- libguile/feature.c.
-
- * boot-9.scm: Added warnings about bindings used in
- libguile/modules.c: the-module, set-current-module,
- make-modules-in, beautify-user-module!, module-eval-closure.
-
-1998-11-21 Mikael Djurfeldt <mdj@kenneth>
-
- * boot-9.scm (the-environment): New special form: Returns an
- object representing the current local evaluation environment.
- This object can be used in `local-eval' and `defined?'.
-
-1998-11-13 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
-
- * boot-9.scm (collect): New syntax. Similar to begin but returns
- a list of the results of all forms in the sequence instead of the
- result of the last form.
-
-1998-11-10 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
-
- * boot-9.scm (values, call-with-values): Moved here from
- syncase.scm.
-
- * syncase.scm (values, call-with-values): Moved to boot-9.scm.
-
- * boot-9.scm (readline-options, readline-enable, readline.disable,
- readline-set!: New options interface.
-
- * readline.scm (readline-port): Use readline-options-interface.
-
-1998-11-05 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
-
- * boot-9.scm: Set the repl start module in `top-repl' instead of
- at the end of boot-9.scm.
-
-1998-11-01 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * emacs.scm (format): Bugfix: Handle multiple arguments
- correctly. (Thanks to Thien-Thi Nguyen.)
-
-1998-11-01 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
-
- * boot-9.scm (exit-hook): New hook: Is run at the very end of an
- interactive session.
- (top-repl): Run exit-hook on exit.
-
- * readline.scm (readline-port): Maybe read history; Maybe write
- history at exit (add to exit-hook).
-
-Fri Oct 30 15:15:37 1998 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * readline.scm (make-readline-port): Bugfixed last change...
-
-1998-10-28 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
-
- * readline.scm (make-readline-port): Don't set prompt to "... " if
- read line was empty.
-
-1998-10-19 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * boot-9.scm, debug.scm, expect.scm, hcons.scm, lineio.scm,
- r4rs.scm, slib.scm, threads.scm: Update copyright years.
-
- * getopt-gnu-style.scm, slib.scm: Add copyright notice.
-
- Talked to Stallman. Actually, the syntax-case copyright is no
- problem. Duh.
- * Makefile.am (ice9_sources): Revert last change.
- * syncase.scm, psyntax.pp, psyntax.ss: Added again.
- * Makefile.in: Regeneretade.
-
- * boot-9.scm: Don't assume that this file is loaded just before
- entering a read-eval-print loop. Turn code to load (ice-9 emacs)
- into...
- (load-emacs-interface): New function.
- (top-repl): Call it, if use-emacs-interface is defined and true.
- At this point, we *do* know we're about to enter a REPL.
-
- We can't include Kent Dybvig's syntax-case macro expander in the
- core Guile distribution, because we don't have copyright
- assignments for this code. We can certainly distribute them as a
- separate package, but Guile should be FSF code.
- * syncase.scm, psyntax.pp, psyntax.ss: Removed.
- * Makefile.am (ice9_sources): Removed syncase.scm, psyntax.pp, and
- psyntax.ss.
- * Makefile.in: Regenerated.
-
- * Makefile.am (ice9_sources): Add getopt-gnu-style.scm.
- * Makefile.in: Regenerated.
-
-1998-10-18 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
-
- * boot-9.scm: Added extended read syntax for byte vectors #y(...)
- and short vectors #h(...).
-
-1998-10-14 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * calling.scm (excursion-function-syntax): Use a sequence of
- set!'s, not a single multi-variable set!; we removed support for
- that syntax a long time ago. (Thanks to Shuji Narazaki.)
-
-1998-10-12 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * r4rs.scm (OPEN_READ, OPEN_WRITE, OPEN_BOTH): Don't bother
- testing software-type here. That's the least of our Windows
- porting issues, and it's done wrong anyway.
-
-1998-10-09 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * boot-9.scm (read-path-list-notation-warning): New function:
- print a warning the first time we see `#/' notation.
-
- * q.scm (sync-q!, q?, q-remove!, q-push!, enq!): Lots of bugs, and
- (eq? #f '()) assumptions. Make functions that aren't documented
- to return anything else return the queue itself. (Bug report from
- Michael Livshin --- thanks!)
-
-1998-08-21 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * debug.scm (trace-entry, trace-exit): Removed re-enabling of
- trace flag.
-
- * boot-9.scm (make-options): Bugfix: Changed pair? --> list? in
- order to allow the empty list as arg.
- (error-catching-loop): Use `with-traps' to create a dynamic
- context with traps enabled.
-
-1998-08-19 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
-
- * boot-9.scm: Removed (ice-9 regex) from use-list of (guile)
- module.
- (try-using-libtool-name): Removed dependency on (ice-9 regex).
-
-1998-08-15 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
-
- * boot-9.scm: Make the root module use (ice-9 regex) if
- available. The dynamic linking facilities in boot-9.scm are
- currently dependent upon regular expressions. My change of
- 1998-07-14 removed (ice-9 regex) from the use-list of the root
- module and thereby destroyed dynamic linking.
-
-1998-07-29 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * Makefile.in: Regenerated using the last public version of
- automake, not the hacked Cygnus version.
-
-1998-07-28 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * Makefile.in: Regenerated, after removing Totoro kludge.
-
-1998-07-28 Jim Blandy <jimb@totoro.red-bean.com>
-
- * getopt-gnu-style.scm: New file. (Thanks to Russ McManus.)
-
-1998-07-26 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * Makefile.in Rebuilt, for config changes in parent dir.
-
-1998-07-21 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * readline.scm (make-readline-port): Set prompt string to "... "
- after first read line. (Thanks to Richard Polton.)
-
-1998-07-19 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * lineio.scm (make-line-buffering-input-port): Don't use
- ungetc-char-ready?, since we don't provide that function any
- more. The unread-string function doesn't interact properly with
- any of the standard I/O functions anyway. (Thanks to Andrew
- Archibald.)
-
- * hcons.scm (hashq-cons-assoc): Don't assume the empty list is
- false. Return false when we cannot find a matching entry in the
- list. (Thanks to Andrew Archibald.)
-
-1998-07-16 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
-
- * boot-9.scm (export, export-syntax): New special forms: Export
- bindings from a module. `(export name1 name2 ...)' can be used at
- the top of a module (after `define-module') to specify which names
- should be exported. It can be used as an alternative to
- `define-public'. `export-syntax' works equivalently to `export'
- but is intended for export of syntactic keywords.
- (Thanks to Thien-Thi Nguyen.)
-
-1998-07-15 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
-
- * boot-9.scm: Renamed module `(guile-repl)' --> `(guile-user)'.
-
-1998-07-14 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * boot-9.scm: Let the user start in module `(guile-repl)' instead
- of module `(guile)'. Also make sure that `(guile-repl)' uses
- suitable modules. This change improves Guile stability
- substantially since bindings will only be copied from the root
- module: If the user redefines builtins in `(guile-repl)' it won't
- affect the internal operation of Guile itself.
-
-1998-06-19 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
-
- * boot-9.scm (load-module): When loading files from within files
- themselves being loaded: Use the directory path of the file being
- loaded as root for relative filenames. (After suggestion by
- Steven G. Johnson.)
-
-1998-06-15 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * emacs.scm (emacs-load): New feature: Eval in specified module.
-
-1998-06-14 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * readline.scm: Typo in regex module name.
-
-1998-06-13 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
-
- * readline.scm (apropos-completion-function): regexp-quote text to
- be completed.
-
-1998-06-11 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * debug.scm, emacs.scm: Bugfix: Treat `the-last-stack' as a fluid.
-
-1998-06-09 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * boot-9.scm: Check that (current-input-port) is a tty before
- enabling readline. (Thanks to Michael N. Livshin.)
-
-1998-06-07 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * boot-9.scm (use-syntax): Turned into a macro inorder to be
- similar in use to `use-modules'.
- Example: (use-syntax (ice-9 syncase)) will 1. load the module
- (ice-9 syncase), and, 2. install the procedure `syncase' as eval
- transformer.
- (internal-use-syntax): New procedure.
- (process-define-module): Use `internal-use-syntax'.
-
-1998-05-19 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * Makefile.am (ice9_sources): Add emacs.scm.
-
-1998-05-13 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * readline.scm: Use the new readline facilities: Add the
- possibility to control input and output ports; Add apropos
- completion.
-
- * boot-9.scm: Antirevert Jim's readline code which he reverted
- 19971027 and adapt it to the current readline interface.
-
- * boot-9.scm (top-repl): Only enable readline if not using the
- Emacs interface; Only use repl prompt when using the readline port
- from repl-read. (We don't want to see it when calling `read'.)
-
- * boot-9.scm (remove-hook!): Parenthesis bug.
-
-1998-05-11 Mikael Djurfeldt <mdj@kenneth>
-
- * boot-9.scm: Load readline module if readline is present.
-
- * readline.scm (apropos-completion-function): New procedure:
- Symbolic completion. (Thanks to Andrew Archibald!)
-
-1998-04-22 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * boot-9.scm (process-define-module): Added keyword use-syntax.
-
-1998-04-19 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * nonblocking.scm: Removed. libguile is now inherently
- nonblocking through the use of scm_internal_select.
-
- * emacs.scm: Removed use of nonblocking.scm.
-
- * gwish.scm, gtcl.scm: Removed. tcltk.scm has made these
- obsolete.
-
-1998-04-15 Mikael Djurfeldt <mdj@nada.kth.se>
-
- * runq.scm (runq-control): Corrected spelling of enqueue!.
- (Thanks to Karl M. Hegbloom.)
-
-1998-03-30 Mikael Djurfeldt <mdj@nada.kth.se>
-
- * boot-9.scm: Added new run-time option interface eval-options.
-
-1998-03-28 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * boot-9.scm (remove-hook!): New macro. (Thanks to Maciej
- Stachowiak.)
-
-1998-01-30 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * threads.scm: Added simple error and signal handler.
- (make-thread, begin-handler): Use this handler. The most
- important effect of this is that signals get unmasked.
- Previously, when a signal was thrown signals remained masked
- (signals get masked when a signal is taken) which influenced other
- threads.
-
-1998-01-01 Tim Pierce <twp@skepsis.com>
-
- A better fix to the SLIB identity problem -- thanks to Marius Vollmer.
- * slib.scm (identity): Unmake public.
- (slib:eval): Evaluate inside `slib-module'.
-
-1997-12-24 Tim Pierce <twp@skepsis.com>
-
- * boot-9.scm: Doc fix.
-
- * slib.scm (identity): Made public.
- (home-vicinity): New function (from SLIB/Template.scm).
-
-1997-12-13 Tim Pierce <twp@skepsis.com>
-
- * boot-9.scm (read-line): Rewritten to call %read-line for
- improved speed. Minor user-visible changes: the new functions are
- hardwired to treat the LFD character as signifying end-of-line, so
- changing `scm-line-incrementors' will no longer affect the
- behavior of read-line. On platforms which do not represent
- end-of-line with a LFD character, read-line should behave more
- like native line-processing facilities, but there is still a ways
- to go here.
-
-Sat Nov 29 01:24:46 1997 Mikael Djurfeldt <mdj@kenneth>
-
- * boot-9.scm (error-catching-loop, save-stack): `the-last-stack'
- is now a fluid.
-
-1997-11-28 Tim Pierce <twp@skepsis.com>
-
- * boot-9.scm (find-and-link-dynamic-module): If a module directory
- contains a .la file (a libtool support file), attempt to extract
- the shared library name from that file. If the .la file does not
- exist, try to link against a .so file. Libtool-generated compiled
- modules should load more cleanly in Guile now.
- (try-using-libtool-name, try-using-sharlib-name): New functions.
-
-Sun Nov 9 06:10:59 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (set-batch-mode?!, batch-mode?): initialize more
- usefully so they will work from a script.
-
-1997-10-31 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (inherit-print-state): Moved definition to the
- neighborhood of the record code.
-
-Mon Oct 27 02:05:49 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- * boot-9.scm: Revert changes to this file from Oct 23. It turns
- out to interact badly with the Emacs support and the Tcl/Tk
- support. It's not a high enough priority at the moment to be
- worth fixing. I'm leaving the other readline support in, though.
-
-Sat Oct 25 14:23:22 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- * Makefile.am: Include readline.scm in the list of files to be
- installed, so Guile can find it for interactive use.
- * Makefile.in: Regenerated.
-
-Thu Oct 23 01:00:33 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- Add support for readline function.
- * readline.scm: New module.
- * boot-9.scm (repl-reader): New function.
- (scm-style-repl): Call repl-reader, instead of doing the reading
- ourselves. Remove repl-report-reset; it was never used for
- anything.
- (top-repl): If we've got the readline primitives, then redefine
- repl-reader to use them.
- If we've got the readline primitives, import the readline module.
-
- * ls.scm (ls, lls): Don't assume (eq? #f '()).
-
-Wed Oct 22 18:26:57 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- * calling.scm, common-list.scm, ls.scm, q.scm, runq.scm,
- string-fun.scm: Added copyright notices; reformatted.
-
-Thu Oct 9 05:44:00 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * expect.scm: (expect-regexec): new procedure, use it in
- expect-strings to fix the => syntax under the new regex system.
- (top): include regex module in define-module statement.
-
-Wed Oct 8 03:16:01 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * (error-catching-loop): new local variable "interactive". if
- #f, abort terminates the process.
- (set-batch-mode?!, batch-mode?): new closures, defined in
- error-catching-loop. the names are from scsh.
-
-1997-10-06 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (inherit-print-state): If NEW-PORT contains a
- print-state, throw it away.
-
-Fri Oct 3 12:00:00 Mikael Djurfeldt <mdj@nada.kth.se>
-
- * boot-9.scm (struct-layout): Use `vtable-index-layout' instead of
- `0'.
-
-Thu Oct 2 12:00:00 Mikael Djurfeldt <mdj@nada.kth.se>
-
- * boot-9.scm (struct-printer, make-struct-printer,
- set-struct-printer-in-vtable!, *struct-printer*): Removed.
- (record-type-vtable, make-record-type): Don't use make-struct-printer.
- (record-type-vtable): User fields "prpr" (printer is no longer a
- user field).
- (record-type-name, record-type-fields): Decreased slot index by
- one; Use `vtable-offset-user'.
-
-Thu Oct 2 12:00:00 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (inherit-print-state): New experimental function.
-
-Tue Sep 30 13:12:48 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- Suggestion and script from Maciej Stachowiak:
- * boot-9.scm: Split off modules into separate, autoloadable files.
- This reduces startup time from 10.5s to 5.5s (user cpu).
- * calling.scm, common-list.scm, ls.scm, q.scm, runq.scm,
- string-fun.scm: New files, containing stuff that used to be in
- boot-9.scm.
- * Makefile.am (ice9_sources): List new files here, for
- distribution and installation.
- * Makefile.in: Regenerated.
-
-Mon Sep 29 23:53:55 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- * Makefile.in: Regenerated with automake 1.2c.
-
-Mon Sep 29 03:21:24 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * slib.scm (slib:load): slib:load first tries to load the file
- named NAME, then NAME.scm. On error, report the error occuring at
- the first attempt (NAME) rather than the second (NAME.scm).
-
- * boot-9.scm: Bugfix: Hard-solder the print-option procedure into
- the make-options macro so that we needn't refer to a global
- symbol.
-
-Sun Sep 28 21:40:24 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * debug.scm: Moved options interface procedures to boot-9.scm.
-
- * boot-9.scm: Define options interface procedures here instead.
-
-Sat Sep 27 20:19:20 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- * boot-9.scm (separate-fields-discarding-char,
- separate-fields-after-char, separate-fields-before-char): Call
- continuation function, RET, as advertised: with each separated
- field a separate argument.
-
- * Makefile.in: Regenerated with automake 1.2a.
-
-Sat Sep 20 14:23:53 1997 Mikael Djurfeldt <mdj@kenneth>
-
- * slib.scm (slib:load): Export.
-
- * boot-9.scm (in-vicinity): Bugfix: Don't add "/" to an empty
- vicinity;
- Provide defmacro.
-
-Thu Sep 18 01:24:31 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * r4rs.scm (apply): Set name property to 'apply.
-
-Tue Sep 16 22:09:50 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * boot-9.scm (keyword->symbol, display-usage-report): Changed
- length --> string-length. (Thanks to Aleksandar Bakic.)
- (separate-fields-discarding-char, separate-fields-after-char,
- separate-fields-before-char): Bugfix from Maciej Stachowiak
- <mstachow@mit.edu>. Thanks!
- (try-module-linked): Try to find module among those already
- registered.
- (try-module-dynamic-link): Removed the first test which
- corresponds to a call to `try-module-linked'.
- (resolve-module): Resolve modules in this order: 1. Already
- registered modules (for example those which have been statically
- linked), 2. Try to autoload an .scm-file, 3. Try to dynamically
- link a .so-file.
-
-Mon Sep 15 23:39:54 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * boot-9.scm (iota): Renamed list-reverse! --> reverse!
-
-Thu Sep 11 02:31:38 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * session.scm (name): New procedure: Gives name of object.
- (source): New procedure: Gives source of object.
-
-Wed Sep 10 20:12:45 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * boot-9.scm (primitive-macro?): New procedure.
-
- * slib.scm: Added hack which transfers syntactic information from
- the builtin variable `define' to the slib version if module (ice-9
- syncase) has been loaded. This is necessary to get correct
- expansion inside the slib module.
-
- * psyntax.ss (build-let, build-named-let): New output
- constructors.
- (build-lexical-var): Seed gensym with symbolic name.
- (self-evaluating?): Add keywords among self-evaluating types.
- (let): New core form.
- (if): Removed from core language.
- (or, and, let, cond): Removed syntactic definitions.
- (sc-expand3): New procedure: Expander which takes optional mode
- and eval-syntactic-expanders-when arguments.
-
- * syncase.scm (psyncomp): New procedure: Recompiles psyntax.pp.
- Should be used inside the (ice-9 syncase) module with (use-syntax
- syncase) and with the current directory containing the psyntax.ss
- source.
- Added hack to transfer syntactic information from the builtin
- variable `define' to the slib version if module (ice-9 slib) has
- been loaded.
-
-Fri Sep 5 05:47:36 1997 Mikael Djurfeldt <mdj@faun.nada.kth.se>
-
- * syncase.scm (sc-interface, sc-expand): Removed hook setup.
- (syncase): Publish syntax transformer to be used with
- `use-syntax'.
- (sc-macro): Use this as the value when publishing macros.
-
- * boot-9.scm (module-type): Added `transformer'.
- (make-module): Modified initialization.
- (module-transformer, set-module-transformer!): Selector and
- mutator for module-associated transformer.
- (set-current-module): Use module-transformer to set
- `scm:eval-transformer'.
- (module-use!): Previous change reverted.
- (use-syntax): New function: Install a transformer in current
- module.
- (sc-interface, sc-expand): Removed! :)
-
-Fri Sep 5 03:09:09 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * emacs.scm (emacs-load): Added new parameter `module'.
-
- * syncase.scm (putprop, getprop): Modified to use the object
- properties of the variable object corresponding to the symbol;
- This way we can ride on the mechanisms of the module system.
- Changed `builtin-variable' calls to `define-public' calls.
- Setup the hooks sc-expand and sc-interface.
-
- * boot-9.scm (sc-interface, sc-expand): New builtin variables.
- (set-current-module): Switch to and from sc-expand as
- scm:eval-transformer when going into and out of modules using
- syncase macros.
- (module-use!): Set scm:eval-transformer to sc-expand when adding
- the syncase interface.
-
-Thu Sep 4 14:57:04 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * syncase.scm (putprop): Temporary fix which publishes new syntax
- globally (the old behaviour was complex and connected to the inner
- workings of the current module system).
-
-Wed Sep 3 21:29:13 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * psyntax.ss: Updated.
- psyntax.pp: Bugfix: Previous version had some leading "t":s cut
- off!
-
-Tue Sep 2 00:26:42 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * boot-9.scm (gensym): Removed (replaced by primitive).
- (obarray-gensym): Rewritten to use `gensym'.
- (gentemp): Rewritten to use `gensym'.
-
-Mon Sep 1 20:08:32 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * gtcl.scm (make-tcl-binder): Rewritten to choose bindings
- according to the following priorities:
- 1. tcl bindings which are present in override-scheme-list
- 2. bindings from the-scm-module
- 3. tcl bindings
- This way the gtcl module can occur first in the use-list without
- disabling the scheme interpreter.
- (new-interpreter): New function.
-
- * gwish.scm: Moved initialization code for the-interpreter to
- gtcl.scm; Moved name space cleaning code to gtcl.scm and rewrote
- it; Call `new-interpreter'; Don't :use-module (guile).
-
-Thu Aug 28 23:48:53 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- * Makefile.in: Regenerated.
-
-Wed Aug 27 11:35:09 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- * Makefile.in: Regenerated, so it uses "tar", not "gtar".
-
-Mon Aug 25 22:00:44 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * emacs.scm (object->string, format, error-args->string): New
- procedures.
- (emacs-frame-eval): Reworked.
-
-Mon Aug 25 16:15:55 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * session.scm (apropos-internal): Musn't initialize symbol
- accumulator with a constant pair. That led to mutation of the
- source!
-
-Sun Aug 24 01:03:10 1997 Mikael Djurfeldt <mdj@kenneth>
-
- * session.scm (vector-for-each): Removed.
- (apropos): vector-for-each --> array-for-each.
- (apropos-internal): New function. Return list of accessible
- symbols matching regexp.
-
- * debug.scm (frame-number->index): New function. Convert frame
- number (as displayed in the backtrace) to frame index (to be used
- in stack-ref).
-
- * emacs.scm (emacs-load): New arguments: interactivep: when
- non-false, send back results to Emacs; colnum: Column number;
- Use modules (ice-9 debug) and (ice-9 session);
- (no-stack, no-source): New simple-actions;
- (result-to-emacs): New procedure. Sends data to Emacs via the
- result protocol;
- (get-frame-source, emacs-select-frame, emacs-frame-eval,
- emacs-symdoc): New procedures.
-
-Wed Aug 20 13:21:11 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * emacs.scm (emacs-load): Adjust stack narrowing.
- (whitespace-chars): Include #\np.
-
- * syncase.scm: Also turn off debugging evaluator and recording of
- procedure names during loading of psyntax.pp.
-
- * psyntax.pp: Removed leading blanks => 800K -> 100K.
-
-Tue Aug 19 02:39:41 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * syncase.scm: Don't tamper with debug mode setting when enabling
- macros. Instead cut the stack with start-stack.
- Load psyntax.pp with recording of positions turned off.
-
- * psyntax.pp, psyntax.ss (quasiquote): Changed fx= --> =.
-
- * syncase.scm: New file: Guile-adaption for syntax-case macros.
- * psyntax.pp, psyntax.ss: Syntax-case macros, portable version 2 by
- R. Kent Dybvig, Oscar Waddell, Bob Hieb and Carl Bruggeman
-
-Mon Aug 18 21:58:25 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * session.scm: New file: Session support.
- (apropos): New procedure: List bindings given regexp.
-
-Sat Aug 16 18:44:24 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm: define tms accessors: clock, utime, stime, cutime,
- cstime.
-
-Thu Aug 14 19:55:37 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * emacs.scm (emacs-load): Something has changed in the reader so
- that we now should set the port line count to the specified value
- (linum) instead of (- linum 1).
-
- * slib.scm (slib:load): Use load-from-path instead of
- primitive-load-path so that backtraces get narrowed properly at
- the top.
-
- * boot-9.scm (top-repl): Save stack already in signal handler in
- order to narrow it correctly.
- (save-stack): Adjust narrowing tag for the top of load-stacks.
-
-Tue Jul 29 01:18:08 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (move->fdes, dup->port): use dup->fdes, not primitive-dup.
- (dup->fdes): deleted, now done in C.
-
-Sat Jul 26 08:00:42 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (setenv): new procedure, scsh compatible.
-
-Sat Jul 26 21:30:10 1997 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (with-fluids): New macro to go with the
- builtin `with-fluids*'.
-
-Thu Jul 24 04:28:11 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * slib.scm (install-require-module): In newer versions of slib
- *catalog* is #f until the first access. Therefore we call
- require:provided? for a random feature if *catalog* is #f.
-
-Wed Jul 23 20:13:04 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * boot-9.scm: If using emacs interface, enable backtraces
- automatically.
-
-Mon Jul 21 06:45:45 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (dup->port, dup->inport, dup->outport, dup->fdes,
- dup, fdes->inport, fdes->outport, port->fdes): new procedures.
- (duplicate-port): was a C primitive, now it's here.
- (move->fdes): allow the first argument to be a file descriptor.
- Return the modified port or file descriptor (was unspecified.)
-
-Fri Jul 11 00:13:43 1997 Jim Blandy <jimb@floss.red-bean.com>
-
- Changes to compile under gnu-win32, from Marcus Daniels:
- * boot-9.scm (load-user-init): If HOME is unset, provide
- a default of /.
-
- * boot-9.scm (define-public): Changed to accomodate Hobbit.
-
-Tue Jun 24 00:31:47 1997 Jim Blandy <jimb@floss.red-bean.com>
-
- * boot-9.scm, debug.scm, hcons.scm, lineio.scm, mapping.scm,
- poe.scm, slib.scm, tags.scm, threads.scm: Use normal list
- notation, instead of #/ notation.
-
- * expect.scm (expect-strings): Pass regexp/newline flag to
- make-regexp.
-
-Mon Jun 23 16:13:38 1997 Jim Blandy <jimb@floss.red-bean.com>
-
- Fix inconsistencies in parsing of #/ style lists.
- * boot-9.scm (read-path-list-notation): New function.
- (parse-path-symbol): Deleted. Replaced by above.
- Plug in read-path-list-notation as the parser for #/ lists,
- instead of the anonymous lambda form calling parse-path-symbol.
- (Thanks to Maurizio Vitale.)
-
- * boot-9.scm (make-list): Remove the definition of this function
- from the (ice-9 common-list) module; make the `init' argument
- optional in the scm module's definition, to match the deleted
- definition. Harmony reigneth? (Thanks to Bernard URBAN.)
-
-Sun Jun 22 18:33:17 1997 Jim Blandy <jimb@floss.red-bean.com>
-
- Try to detect when people are using one version of libguile and a
- different version of ice-9. People have been skewing things and
- sending in bug reports.
- * version.scm.in: New file, which the configure script munges to
- produce version.scm, which contains the ice-9 config stamp.
- * boot-9.scm: Compare the libguile and ice-9 config stamps;
- display a warning if the two are different.
- * Makefile.am: Install version.scm, but don't distribute it.
- Distribute version.scm.in, but don't install it.
- * Makefile.in: Regenerated.
-
-Thu Jun 19 21:01:16 1997 Jim Blandy <jimb@floss.red-bean.com>
-
- * slib.scm (slib:warn): Alias for WARN function.
-
-Fri Jun 13 00:32:04 1997 Jim Blandy <jimb@floss.red-bean.com>
-
- * boot-9.scm (struct-printer): Fix off-by-one error in range
- check. Correctly check for struct printer tag.
-
- * expect.scm: Turn this into a module, (ice-9 expect).
- (expect-port, expect-timeout, expect-timeout-proc,
- expect-eof-proc, expect-char-proc, expect, expect-strings,
- expect-select): Make these public definitions.
- (expect-strings): Use make-regexp and regexp-exec, instead of
- regcomp and regexec. We've omitted the REG_NEWLINE flag; hope
- that's okay.
-
- * boot-9.scm (with-regexp-parts): Comment this out. It has no
- users in the core, and relies on mildly hairy details of the old
- regexp interface.
-
- * test.scm: Re-enable tests asserting that '() is true, and not a
- boolean. This stuff has been true for a while.
-
- * boot-9.scm (ipow-by-squaring, butlast): Fix uses of outdated
- function names.
-
- * boot-9.scm (with-excursion-getter-and-setter, q-rear): Doc
- fixes.
-
-Wed Jun 11 00:31:40 1997 Jim Blandy <jimb@floss.red-bean.com>
-
- * Makefile.in: Regenerated after xtra_PLUGIN_guile_libs change in
- ../configure.in.
-
-Fri Jun 6 14:37:18 1997 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (struct-printer): Bugfix: Check the layout of the
- vtable and not the one of the struct.
-
-Wed Jun 4 23:27:16 1997 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (struct-layout, %struct-printer-tag, struct-printer,
- make-struct-printer, set-struct-printer-in-vtable!): New bindings
- to support printing of structures.
- (record-type-vtable, make-record-type): Add slot to hold printing
- function and initialize it with something appropriate. Removed
- commented out printing code.
- (record-type-name, record-type-fields): Adjusted slot offsets.
- (%print-module): Reduce argument list to "mod" and "port".
-
-Tue Jun 3 17:04:18 1997 Jim Blandy <jimb@totoro.cyclic.com>
-
- * slib.scm (identity): New function, used by SLIB.
-
-Sat May 31 18:57:12 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm: signal-handler, alarm-thunk: removed.
- don't define ticks-interrupt etc.
- top-repl: install signal handlers for SIGINT, SIGFPE, SIGSEGV, SIGBUS
- during call to scm-style-repl.
-
-Fri May 30 18:08:10 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- * slib.scm (slib:load): Use primitive-load-path instead of
- basic-load. This is probably wrong, but hopefully the entire
- source access system will be revised soon anyway, and this will
- make require behave more like Emacs Lisp's require. If this
- breaks something, please let me know. Maybe this is real dumb.
-
-Thu May 29 02:36:48 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- * regex.scm: Add a module declaration. Use DEFINE-PUBLIC everywhere.
- * boot-9.scm: If the `regex' feature is present, use the module
- (ice-9 regex).
-
-Tue May 27 22:48:14 1997 Tim Pierce <twp@twp.tezcat.com>
-
- * regex.scm: New file.
- * Makefile.am (subpkgdata_DATA): Add regex.scm.
- * Makefile.in: Regenerated.
-
-Mon May 26 17:24:48 1997 Jim Blandy <jimb@totoro.cyclic.com>
-
- * COPYING, boot-9.scm, debug.scm, emacs.scm, expect.scm, gtcl.scm,
- gwish.scm, hcons.scm, lineio.scm, mapping.scm, nonblocking.scm,
- oldprint.scm, poe.scm, r4rs.scm, source.scm, tags.scm, test.scm,
- threads.scm: New address for FSF.
-
-Fri May 16 04:09:45 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- * debug.scm: Update copyright years; this file has been worked on
- in 1997.
-
-Thu May 15 07:56:08 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * expect.scm: use gettimeofday instead of get-internal-real-time
- and use a floating point timeout when calling select. Untested,
- since the regex library is currently AWOL.
-
-Wed May 14 21:00:30 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- * boot-9.scm (eval-string): Function deleted; it was already
- implemented in C, so there's no point in making a divergable copy
- here.
-
-Tue May 13 16:40:06 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- * Makefile.in: Regenerated, using automake-1.1p.
-
-Tue May 13 16:40:06 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- * Makefile.in: Regenerated, using automake-1.1p.
-
-Tue May 13 02:48:49 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (error-catching-loop): don't read a line from
- current input when quit is encountered, the previous change
- fixes this too.
-
-Mon May 12 19:00:21 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- * boot-9.scm (scm-style-repl): After reading an expression,
- consume any trailing newline (perhaps preceded by whitespace), to
- avoid screwing up GDB. More detail in comments.
-
-Mon May 5 13:18:38 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- * Makefile.am (ETAGS_ARGS): New variable, since we're not treating
- the Scheme code like code yet.
- * Makefile.in: Resrac,husrched.
-
-Wed Apr 30 15:25:15 1997 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (link-dynamic-module): Do not catch errors from
- dynamic-link and dynamic-call. When the shared library exists it
- is now assumed to be suitable for a dynamic C module.
-
-Fri Apr 25 21:21:35 1997 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (process-use-modules): New function to support the
- use-modules macro
- (use-modules): throw an error iff one of the requested modules
- can't be found.
-
-Tue Apr 29 06:54:46 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm: don't define timer-thunk or gc-thunk.
-
-Sun Apr 27 17:56:09 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- * aclocal.m4: Removed; unnecessary, given changes of Apr 24.
-
- * Makefile.am (subpkgdatadir): Use "ice-9" instead of "@module@";
- we're not using AM_INIT_GUILE_MODULE any more.
- * Makefile.in: Regeneratitetedrerd.
-
-Thu Apr 24 01:33:33 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- Get 'make dist' to work again.
- * Makefile.am (EXTRA_DIST): Remove PLUGIN files.
- * Makefile.in: Regenerated, like two tons of fleas.
-
- Changes for reduced Guile distribution: one configure script,
- no plugins.
- * configure.in, configure: Removed.
- * Makefile.in: Regenerated.
-
-Sat Apr 19 08:03:50 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- * boot-9.scm (eval-string, command-line, load-user-init): New
- functions.
-
-Sat Apr 12 08:27:05 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (log10): defined.
-
-Tue Apr 1 17:46:49 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * expect.scm (expect-select): correct the millisecond timeout
- arithmetic (from Marko.Kohtala@ntc.nokia.com).
-
-Mon Mar 31 03:23:19 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (open-input-pipe, open-output-pipe): defined here
- instead of in libguile.
- (tm:sec etc.) new accessors for broken-down time.
- (set-tm:sec etc.) new setters for broken-down time.
-
-Thu Mar 27 05:06:00 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (netent:addrtype, servent:port): added missing
- procedures.
- (netent:net, servent:proto): repaired.
- (utsname:sysname etc.): new accessors for uname.
-
-Tue Mar 25 03:04:03 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (sockaddr:fam, sockaddr:path, sockaddr:addr,
- sockaddr:port): new functions.
-
-Wed Mar 19 04:50:34 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm: define accessor procedures for the objects returned
- by getpw, getgr, gethost, getnet, getproto, getserv (e.g.,
- passwd:name, where the first component is the name of the C structure
- and the second is the unprefixed C member name.)
-
-Tue Mar 18 18:39:31 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (setpwent, setgrent, sethostent, setnetent, setprotoent,
- setservent): no longer take an argument, it was bogus.
-
-Thu Mar 13 00:13:41 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (scm-error): deleted, reimplemented in C.
-
-Mon Mar 10 15:48:31 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * boot-9.scm (process-define-module): Modified to handle both
- keywords and symbols.
-
-Sat Mar 8 04:32:44 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * slib.scm: update read usage.
-
- * r4rs.scm: update primitive-load usage.
- Don't define read-sharp.
-
- * boot-9.scm: use read-hash-extend to install extra read syntax.
- (read-sharp): removed.
- Adjust usage of primitive-load-path, read, which no longer take
- case_i or read-sharp arguments.
-
-Sat Mar 8 00:07:54 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * boot-9.scm: Added loading of session support module.
-
- * debug.scm: Removed `display-application'. (Replaced by
- primitive procedure.)
-
- * boot-9.scm (beautify-user-module!): Don't add the root module
- interface to the end of the use-list of the root module.
-
-Thu Mar 6 07:26:34 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm: repl-quit, repl-abort: obsolete variables deleted.
-
-Wed Mar 5 20:30:24 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm: check use-emacs-interface for emacs support.
-
-Sun Mar 2 19:47:14 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (scm-style-repl): call repl-report-start-timing if
- read gets EOF.
- * (exit): alias for quit.
-
-Sun Mar 2 05:25:11 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (error-catching-loop thunk): use a status variable to
- return the quit args.
- (scm-style-repl): call -quit, passing return value from
- error-catching-repl. Make -quit return its args.
- stand-alone-repl: comment out, since it seems unused.
-
- (error-catching-loop thunk): discard trailing junk after a (quit).
-
-Sat Mar 1 15:24:39 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * boot-9.scm: Removed the old printer code.
-
- * r4rs.scm (apply, call-with-current-continuation): Added comment
- explaining why apply and call/cc need to be closures.
-
- * boot-9.scm (apply, call-with-current-continuation): Bugfix:
- Removed. These definitions are already present in r4rs.scm.
-
- * debug.scm (trace-entry, trace-exit): Check that we're on a repl
- stack before printing traced frames; Re-enable trace flag at end
- of handlers.
-
-Sat Mar 1 00:10:38 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * debug.scm: Add hook for reset of trace level at abort.
-
- * boot-9.scm (run-hooks): New procedure.
- (add-hooks!): New macro.
- Change hooks to use these functions.
-
- * debug.scm: *Warning* This feature is a bit premature. I add
- it anyway because 1. it is very useful, and, 2. you can start
- making it less premature by complaining to me and by modifying
- the source! :-)
- (trace): Given one or more procedure objects, trace each one.
- Given no arguments, show all traced procedures.
- (untrace): Given one or more procedure objects, untrace each one.
- Given no arguments, untrace all traced procedures. The tracing in
- Guile have an advantage to most other systems: We don't create new
- procedure objects, but mark the procedure objects themselves.
- This means that also anonymous and internal procedures can be
- traced.
-
- * boot-9.scm (error-catching-loop): Added handling of apply-frame
- and exit-frame exceptions.
-
- * boot-9.scm (assert-repl-prompt, the-prompt-string): Removed.
- (set-repl-prompt!): Setter for repl prompt.
- (scm-style-repl): If prompt is #f, don't prompt; if prompt is a
- string, display it; if prompt is a thunk, call it and display its
- result; otherwise display "> ".
- (Change suggested by Roland Orre <orre@nada.kth.se>.)
-
- * r4rs.scm (%load-verbosely): Reverted change to
- `module-defined?', since the module system isn't bootstrapped when
- we load r4rs.scm. This is just a temporary fix to make the
- repository version runnable.
-
-Thu Feb 27 23:25:47 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * boot-9.scm: Removed the enabling of debug evaluator and
- recording of source code positions. This was placed there for our
- convenience, but it has already sneaked into the distribution
- once... so we'd better add this in our local copies instead when
- we need it. (These options are normally enabled at the end of
- boot-9.scm when loading the debug module.)
-
-Thu Feb 27 16:04:45 1997 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (module-defined?): New function.
- (macroexpand-1, macroexpand): Use local-ref instead of defined?
- and eval.
- * r4rs.scm (%load-verbosely): Use "module-defined?" instead of
- "defined?".
- * slib.scm (defined?): New function to take the place of the
- builtin "defined?". It allways examines the slib module.
-
-Mon Feb 24 21:46:15 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * configure.in: Added AM_MAINTAINER_MODE
-
-Sat Feb 15 04:51:20 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (read-sharp): define directly, don't go through a
- %read-sharp layer.
-
-Tue Feb 11 08:45:48 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (uniform-vector-set!): use uniform-array-set1!, not
- uniform-vector-set1! which doesn't exist.
-
-Mon Feb 10 03:01:48 1997 Mikael Djurfeldt <mdj@kenneth>
-
- * boot-9.scm (backtrace): Removed. (A C version now exists in
- backtrace.c.)
-
-Fri Jan 24 06:05:36 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (read-line!, read-delimited!, read-delimited,
- read-line): new procedures, see libguile/ChangeLog.
-
-Thu Jan 16 17:07:03 1997 Marius Vollmer <mvo@zagadka.ping.de>
-
- Added dynamic linking of modules. See libguile/DYNAMIC-LINKING.
-
- * boot-9.scm (split-c-module-name, convert-c-registered-modules,
- init-dynamic-module, dynamic-maybe-call,
- find-and-link-dynamic-module, link-dynamic-module,
- try-module-dynamic-link, registered-modules): New definitions for
- dynamic linking of modules.
- (resolve-module): Try to dynamically link the requested module
- after failing to load it as Scheme code.
-
-Wed Jan 8 05:50:14 1997 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (getservbyport, getservbyname): remove stray %.
-
-Tue Jan 7 20:02:24 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- * boot-9.scm (and=>): Rename THUNK argument to PROCEDURE, 'cos
- that's what it is.
-
- * lineio.scm (make-line-buffering-input-port): Properly test for
- the case of an empty buffer list. The old code assumed that '()
- was false.
-
-Mon Jan 6 01:13:53 1997 Mikael Djurfeldt <mdj@kenneth>
-
- * boot-9.scm (use-modules): New macro (from Marius Vollmer).
- (use-modules <module name> ...) Put the the modules named by
- <module name> ... on the use list of the current module.
-
-Sun Jan 5 15:52:59 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- * boot-9.scm (error-catching-loop): Remove message saying that
- typing "$" will put you in the debugger. This isn't implemented
- yet.
-
-Sun Dec 22 23:27:25 1996 Jim Blandy <jimb@floss.cyclic.com>
-
- * boot-9.scm (delq-all!): Function deleted; delq!'s semantics have
- been fixed, so this function is superfluous.
- (transform-usage-lambda): Use delq!, not delq-all!.
-
-Tue Dec 17 20:36:45 1996 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (resolve-module): New optional parameter that
- controls whether autoloading is attempted or not. Default is #t.
- (process-define-module): Don't autoload the defined module.
- (try-module-autoload): Don't autoload the directory modules.
-
- * boot-9.scm (process-define-module): Ensure that the-scm-module
- is last in the `uses' list to allow shadowing builtin
- bindings. All :use-module options are added in the order they
- appear in the arguments but before anything already on the list
- (such as the-scm-module).
-
-Wed Dec 11 21:06:05 1996 Gary Houston <ghouston@actrix.gen.nz>
-
- * slib.scm (slib-parent-dir): throw error if #f returned from
- %search-load-path.
-
-Sat Nov 30 23:57:28 1996 Tom Tromey <tromey@cygnus.com>
-
- * PLUGIN/greet, PLUGIN/split.sed, PLUGIN/this.configure: Removed.
- * Makefile.am, aclocal.m4: New files.
- * configure.in: Updated for Automake.
-
-Wed Nov 27 14:16:14 1996 Marius Vollmer <mvo@zagadka.ping.de>
-
- * boot-9.scm (macroexpand-1, macroexpand), slib.scm
- (slib:features), r4rs.scm (%load-verbosely): "defined?" is now a
- function, use it accordingly.
-
-Thu Nov 21 11:12:10 1996 Jim Blandy <jimb@floss.cyclic.com>
-
- It's an "eval closure", not an "eval thunk." A thunk is a
- function of no arguments.
- * boot-9.scm (module-type): Rename module field.
- (make-module, eval-in-module, make-root-module,
- set-current-module): Uses changed.
- (module-eval-closure, set-module-eval-closure!,
- root-module-closure): Renamed from module-eval-thunk,
- set-module-eval-thunk!, root-module-thunk.
- (set-current-module): Change uses of *top-level-lookup-thunk* to
- *top-level-eval-closure*.
-
-Wed Nov 20 14:45:27 1996 Jim Blandy <jimb@totoro.cyclic.com>
-
- * slib.scm (slib-parent-dir): Use string-length, not length.
- (Thanks to Bernard Urban.)
-
-Sat Nov 2 20:00:42 1996 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * boot-9.scm: The debugging evaluator and recording of positions
- aren't enabled by default any longer (they are switched on in
- debug.scm). But during development we want to have them also
- *inside* boot-9.scm. Therefore, two lines are added at the
- beginning of boot-9.scm to enable these.
-
- Call `provide' so that `records' are included among the
- `*features*'.
-
- The scheme for saving the stack has been adjusted: save-stack is
- now commonly available for saving the stack. Calling `save-stack'
- sets a flag `stack-saved?' which prevents overwriting the stack.
- `stack-saved?' is reset at `abort'.
-
- Spelling correction: seperate --> separate.
-
- Removed `:'s that had creeped into some comments.
-
- The repl now doesn't print #<unspecified> results any longer
- If the user wants to see this, he can do
- (assert-repl-print-unspecified #t) in his startup file.
-
- The user now gets a friendly message instead of a backtrace at
- error.
-
- Added `before-read-hook'.
-
- Load module (ice-9 emacs) if option `-e' was specified.
-
- (provide): New function.
-
- (error): Save stack at entry, so that Guile entrails won't show up
- in backtraces.
-
- (backtrace): New function.
-
- (save-stack): Can now take arbitrary number of stack narrowing
- specifier pairs. The first specifier in a pair controls inner
- border, the second the outer border. A number means cut that
- number of frames, a procedure object means cut until that object
- is found in operator position in a frame.
-
- * debug.scm: Enable debugging evaluator and recording of positions
- by default.
-
- * slib.scm (slib:load): Adapt to the new behavior of
- primitive-load: It doesn't any longer try both with and without
- ".scm" extension. (We don't want to use %search-load-path here.)
-
- (implementation-vicinity): New function. slib requires it
-
- (library-vicinity): Updated.
-
- Load "require.scm" in the library-vicinity.
-
- (install-require-vicinity, install-require-module): New functions.
-
-Mon Oct 28 17:56:29 1996 Jim Blandy <jimb@floss.cyclic.com>
-
- * boot-9.scm (load-from-path): New function.
-
- * boot-9.scm (try-load, basic-try-load, try-load-module,
- try-load): Deleted. I don't think they're being used.
-
- * Makefile.in (scm_files): Add r4rs.scm and test.scm to this list,
- so they'll get distributed.
-
- Get Guile to be a little less chatty by default. The new user
- should see as little clutter as possible.
- * r4rs.scm (%load-verbosely): Make this #f by default.
- * boot-9.scm (scm-repl-verbose): Make this #f by default.
- (scm-style-repl): Don't run 'pk' on the value passed to quit.
-
- * r4rs.scm: New file.
- * boot-9.scm: Load r4rs.scm, first thing.
- (OPEN_READ, OPEN_WRITE, OPEN_BOTH, *null-device*, open-input-file,
- open-output-file, open-io-file, close-input-port,
- close-output-port, close-io-port, call-with-input-file,
- call-with-output-file, with-input-from-port, with-output-to-port,
- with-error-to-port, with-input-from-file, with-output-to-file,
- with-error-to-file, with-input-from-string, with-output-to-string,
- with-error-to-string, the-eof-object): Definitions moved to
- r4rs.scm. Not all of them are R4RS, but those that are use those
- that are not.
- (load, %load-verbosely, %load-announce): Moved, along with code to
- set %load-hook, to r4rs.scm.
-
- * test.scm: New file.
-
- * boot-9.scm (integer?): Definition deleted, in favor of the one
- present in libguile (which used to be called int?). I have no
- idea why integer? didn't just call int? to begin with.
-
- * boot-9.scm (<, <=, =, >, >=): Definitions in terms of <?, <=?,
- =?, >?, and >=? deleted; they're defined that way by libguile now.
-
- * boot-9.scm (load): Simplified; primitive-load does most of this
- work now.
- (%load-announce-win): Removed; no longer used. Set %load-hook to
- call %load-announce.
-
-Sun Oct 27 07:47:03 1996 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (stat:dev, stat:ino, stat:mode, stat:nlink, stat:uid,
- stat:gid, stat:rdev, stat:size, stat:atime, stat:mtime,
- stat:ctime, stat:blksize, stat:blocks) accessor functions for stat
- components.
- (file-is-directory?): use stat:type.
-
-Fri Oct 25 03:34:47 1996 Jim Blandy <jimb@floss.cyclic.com>
-
- * boot-9.scm (%read-sharp): Don't recognize the `#!' syntax here;
- that's now taken care of in libguile, and in a way compatible with
- SCSH (which this isn't).
-
-Mon Oct 21 18:52:36 1996 Jim Blandy <jimb@totoro.cyclic.com>
-
- * boot-9.scm: Formatting tweaks.
-
-Fri Oct 18 01:03:08 1996 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * boot-9.scm (handle-system-error): Added hooks before-error-hook,
- after-error-hook, before-backtrace-hook and after-backtrace-hook
- to the error handler. E.g.: fancy emacs support could plug into
- these.
- (save-stack): New function. The stack is now made differently
- depending on the stack id. (The motivation is to make a better
- choice regarding what stack frames to present to the user.)
- (error-catching-loop): Stack handling code moved outside into
- save-stack.
-
-Thu Oct 17 20:33:08 1996 Gary Houston <ghouston@actrix.gen.nz>
-
- * Makefile.in (scm_files): add expect.scm.
-
- * expect.scm: new file ported from guile-iii.
-
- * boot-9.scm: remove handle-system-error, after moving the code into
- error-catching-loop.
- Don't set 'throw-handler-default property on error keys.
- Just interpret (almost) any throw with 4 args as an error throw.
- Delete some try-load stuff that was already commented out.
-
- Second thoughts, keep handle-system-error but call it from
- error-catching-loop.
-
-Tue Oct 15 17:07:20 1996 Jim Blandy <jimb@floss.cyclic.com>
-
- * boot-9.scm: Doc fixes.
- (make-module): Rework for readability.
- (make-root-module, make-scm-module): USES argument to make-module
- should be '(), not #f.
-
- * boot-9.scm (try-load): %sys-load-path has been renamed to
- primitive-load-path; adjust call here.
-
-Tue Oct 15 14:25:01 1996 Mikael Djurfeldt <mdj@woody.nada.kth.se>
-
- * boot-9.scm (signal-handler): Bugfix: Moved the recording of
- the stack to the correct place: when it is decided to generate an
- error-signal.
-
-Mon Oct 14 22:20:30 1996 Mikael Djurfeldt <mdj@woody.nada.kth.se>
-
- * boot-9.scm (error-catching-loop, signal-handler,
- handle-system-error): Backtracing now works for signals aswell;
- Backtracing mechanism can now identify the stack root created by
- start-stack so that the user isn't exposed to system stack frames.
-
-Mon Oct 14 06:05:42 1996 Mikael Djurfeldt <mdj@woody.nada.kth.se>
-
- * Makefile.in: Added threads.scm.
-
-Mon Oct 14 04:21:51 1996 Mikael Djurfeldt <mdj@woody.nada.kth.se>
-
- * debug.scm (make-enable, make-disable): Simplified.
-
- * boot-9.scm: Renamed %%throw-handler-default -->
- throw-handler-default.
- ((handle-system-error key . arg-list)): Changed the way errors are
- reported.
- ((scm-style-repl)): Wrap up the call to eval in a start-stack
- acro.
- ((error-catching-loop thunk)): Introduce a lazy-catch into
- error-catching-loop so that the stack can be captured.
-
-Thu Oct 10 22:27:32 1996 Jim Blandy <jimb@totoro.cyclic.com>
-
- * mapping.scm (hash-table-mapping): Explicitly request that
- make-vector fill new vectors with '(); this will make it easier to
- port Guile Scheme code to other Schemes.
- * boot-9.scm (make-print-style, make-print-table): Same.
-
-Sun Oct 6 03:54:59 1996 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (load): rewritten again.
- Append "." to the default %load-path.
- (feature?): new function: checks for a symbol in the features list.
- (module-local-variable): remove apparently useless (caddr (list m v
- ...))
- (%load-announce): minor formatting change.
- (file-exists?): use access? if posix is featured.
- (file-is-directory?): use stat if i/o-extensions is featured.
- (try-module-autoload module-name): use file-exists? before
- file-is-directory?
-
-Sat Oct 5 18:54:03 1996 Mikael Djurfeldt <mdj@kenneth>
-
- * boot-9.scm: Added conditional loading of threads.scm.
-
- * threads.scm: New file. Modified from the Cygnus-r0.3
- distribution.
-
- * boot-9.scm (error-catching-loop): Added handling of key
- `switch-repl'.
-
- * boot-9.scm: Name change %%bad-throw --> bad-throw.
-
-Wed Oct 2 23:38:44 1996 Jim Blandy <jimb@totoro.cyclic.com>
-
- * boot-9.scm (make-record-type, record-constructor): Don't assume
- the empty list is false when parsing the argument list.
-
-Mon Sep 30 22:15:50 1996 Jim Blandy <jimb@totoro.cyclic.com>
-
- * boot-9.scm (signal-handler): Clean up logic.
-
- * boot-9.scm (load): Assume %load-path is always bound.
-
-Sat Sep 28 00:15:37 1996 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (error): replace another throw with scm-error. Throw
- to 'misc-error instead of 'error (no need to distinguish these.)
- Don't set up 'error as a key.
- Set up regex-error as a key, if regex is available.
- (signal-handler): use scm-error, not throw.
-
- (%try-load, try-load-with-path, %load, load-with-path,
- basic-try-load-with-path, basic-load-with-path,
- try-load-module-with-path,load-module-with-path): deleted, since
- they seem redundant.
- (try-load): define using %try-load, not try-load-with-path.
- (load): rewritten. load tries to open the file directly and
- with a .scm extension before searching the library directories
- (should "." be added to %load-path? then load could still open
- directly files starting with "/").
- (try-module-autoload): use load, not load-with-path.
- (%load-indent): deleted, -2 was causing errors.
-
- (%read-sharp): use port-line, not line-number.
-
-Fri Sep 27 16:23:51 1996 Jim Blandy <jimb@totoro.cyclic.com>
-
- * boot-9.scm (%%bad-throw): Delete definition. 1) It's very
- straightforward to provide the equivalent functionality using
- (catch #t ...), so there's no need for the extra complexity. 2)
- Outside the context of a read-eval-print loop (which Guile should
- not require) it's not clear we should do anything more complicated
- than print an error and exit; the user or REPL can establish
- something better if it wants. 3) In that case, it's much more
- robust to just do it in the C code.
-
-Tue Sep 24 06:53:04 1996 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (%try-load): define using primitive-load. Previously
- %try-load itself was the primitive.
- (load-with-path): use scm-error instead of %load-announce-lossage.
- Errors are thrown to 'misc-error instead of 'could-not-load.
- (%load-announce-lossage): deleted.
-
-Mon Sep 23 00:16:31 1996 Mikael Djurfeldt <mdj@kenneth>
-
- * boot-9.scm (warn, scm-style-repl): Use C printer instead of `print'.
- (make-record-type type-name fields): Temporarily remove support
- for printing of records (not possible yet with C printer).
-
-Fri Sep 20 00:24:27 1996 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (file-exists?, file-is-directory): catch only
- system-error, not every kind of error.
- (scm-error): new procedure.
-
-Thu Sep 19 16:02:46 1996 Jim Blandy <jimb@totoro.cyclic.com>
-
- * boot-9.scm: Formatting tweaks.
-
-Wed Sep 18 09:07:37 1996 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (%%handle-system-error key): remove the code for
- SCM-style errors. handle the case that an unexpected number
- of args are supplied.
- (%%system-errors): removed.
- (error): redefine using a throw with key and 4 args.
- ('error): associate 'error, 'error-signal keys with
- %%handle-system-error.
- (%%default-error-handler): removed.
- (signal-handler): throw with 4 args and use the error-signal key.
- Create an error message instead of using numerical codes.
- (%%bad-throw): call error instead of throw if key not found.
-
-Tue Sep 17 04:11:28 1996 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm: initialize new error keys (see libguile/ChangeLog).
- (%%handle-system-error key): check subr is not #f before printing.
- Recognize %s (embed an argument using "display") and
- %S (embed an argument using "write").
-
-Sun Sep 15 03:55:35 1996 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (%%handle-system-error key): set args and rest to
- the empty list if they are #f.
- Initialize out-of-range as an error key.
-
-Sat Sep 14 03:41:15 1996 Gary Houston <ghouston@actrix.gen.nz>
-
- * PLUGIN/REQ: remove the "ice-9 lgh" line which causes a cycle.
-
- * boot-9.scm: remove leading %% from references to '%%system-error.
- (%%handle-system-error): don't pass all the thrown arguments when
- aborting, just the key and subr.
- Remove the code to "Install default handlers for built-in errors."
- Remove the definition of the syserror procedure.
- Associate 'numerical-overflow with default handler.
-
-Fri Sep 13 04:58:11 1996 Mikael Djurfeldt <mdj@woody.nada.kth.se>
-
- * boot-9.scm: Name change: value-ref --> local-ref
- resolved-ref --> nested-ref Motivation: conformance to the other
- dictionary operators: list-ref operates on list, vector-ref
- operates on vector, nested-ref operates on nested namespace,
- local-ref operates on the local nested namespace.
-
-Sat Sep 7 06:44:47 1996 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (%%handle-system-error): recognise errors thrown
- by lgh-error (fill-message etc.)
- (fill-message): check first whether args is null.
- (fill-message): bug fix and check that args is a list.
-
-Thu Sep 5 11:33:41 1996 Jim Blandy <jimb@floss.cyclic.com>
-
- * boot-9.scm: %load-path is initialized in C code now.
- (implementation-vicinity, parse-path): Deleted, along with code to
- initialize %load-path.
-
- * boot-9.scm (in-vicinity): If the vicinity doesn't end with a
- "/", use one to separate it from the file.
-
-Thu Aug 29 23:05:11 1996 Thomas Morgan <tmorgan@gnu.ai.mit.edu>
-
- * boot-9.scm (%load-path): Add the site directory.
- Add the directory named after the version number.
- Prepend the version number to the other directories in the path.
- Simplify by mapping the common prefix onto each item.
- * Makefile.in (datadir, pkgdatadir, pkgverdatadir, subpkgdatadir,
- sitedatadir): New definitions.
- (libparent, libdir, install_path): Replaced by above.
- (install): Create the above directories.
- Put the source files into subpkgdatadir.
- (uninstall): Remove the above directories.
-
-Thu Aug 29 21:48:47 1996 Jim Blandy <jimb@floss.cyclic.com>
-
- Don't use the PLUGIN system to gather information for the
- Makefile's distribution and installation targets; just put it all
- in the Makefile directly.
- * PLUGIN/this.configure (scm_files, aux_files): Remove sections
- for these.
- * configure.in: Remove code that gets and substitutes scm_files and
- aux_files.
- * Makefile.in (scm_files, aux_files): Write out the list of files
- here, where people expect to find them.
-
-Fri Aug 23 06:44:36 1996 Mikael Djurfeldt <mdj@woody.nada.kth.se>
-
- * boot-9.scm: Preliminary solution: optionally load the debug
- module. Changed "gls" to "guile1.0b3".
-
- * debug.scm: New file: debug extensions.
-
-Wed Aug 21 13:06:56 1996 Mikael Djurfeldt <mdj@woody.nada.kth.se>
-
- * boot-9.scm (print-vector): Renamed weak-hash-table? -->
- weak-key-hash-table?. (Again!)
-
-Tue Aug 20 07:31:39 1996 Mikael Djurfeldt <mdj@woody.nada.kth.se>
-
- * boot-9.scm (print-vector, macro-table, xformer-table):
- Renamed weak-hash-table --> weak-key-hash-table.
-
- * poe.scm (funcq-memo): Renamed weak-hash-table -->
- weak-key-hash-table.
-
-Sat Aug 3 06:16:35 1996 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (*null-device*): global constant from goonix.
- (move->fdes): adjusted for boolean primitive-move->fdes. return
- the modified port, always set revealed count to 1 (SCSH compatible).
- (release-port-handle port): from goonix (SCSH compatible).
- (%open-file): removed.
- (open-input-file, open-output-file, file-exists?, file-is-directory?):
- modified for open-file change (does not return #f).
-
-Thu Aug 1 02:52:42 1996 Jim Blandy <jimb@totoro.cyclic.com>
-
- * Makefile.in (dist-dir): New target for new dist system.
- (manifest): Deleted.
- * PLUGIN/this.configure (aux_files): Removed PLUGIN; it's a
- directory, and needs special treatment in the dist-dir target.
-
-Thu Aug 1 09:00:21 1996 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm: remove the wrappers for '%' system primitives,
- now that they throw errors directly.
- remove make-simple-wrapper and similar functions.
- protect a call to getenv which may now throw an exception.
-
-Wed Jul 31 23:44:42 1996 Gary Houston <ghouston@actrix.gen.nz>
-
- * boot-9.scm (false-if-exception): new macro.
-
-Fri Apr 19 13:53:08 1996 Tom Lord <lord@beehive>
-
- * The more things change...
-
-
diff --git a/ice-9/Makefile.am b/ice-9/Makefile.am
deleted file mode 100644
index 8f23e56b7..000000000
--- a/ice-9/Makefile.am
+++ /dev/null
@@ -1,54 +0,0 @@
-## Process this file with automake to produce Makefile.in.
-##
-## Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-AUTOMAKE_OPTIONS = gnu
-
-# These should be installed and distributed.
-ice9_sources = \
- and-let-star.scm arrays.scm boot-9.scm calling.scm common-list.scm \
- debug.scm debugger.scm documentation.scm emacs.scm expect.scm \
- format.scm getopt-long.scm hcons.scm lineio.scm ls.scm mapping.scm \
- match.scm networking.scm null.scm optargs.scm poe.scm popen.scm \
- posix.scm psyntax.pp psyntax.ss q.scm r4rs.scm r5rs.scm \
- rdelim.scm receive.scm regex.scm runq.scm rw.scm \
- safe-r5rs.scm safe.scm session.scm slib.scm stack-catch.scm \
- streams.scm string-fun.scm syncase.scm threads.scm \
- buffered-input.scm time.scm history.scm channel.scm \
- pretty-print.scm ftw.scm gap-buffer.scm
-
-subpkgdatadir = $(pkgdatadir)/$(VERSION)/ice-9
-subpkgdata_DATA = $(ice9_sources)
-ETAGS_ARGS = $(subpkgdata_DATA)
-
-## test.scm is not currently installed.
-EXTRA_DIST = $(ice9_sources) test.scm compile-psyntax.scm
-
-if MAINTAINER_MODE
-# We expect this to never be invoked when there is not already
-# ice-9/psyntax.pp in %load-path, since compile-psyntax.scm depends
-# on ice-9/syncase.scm, which does `(load-from-path "ice-9/psyntax.pp")'.
-# In other words, to bootstrap this file, you need to do something like:
-# GUILE_LOAD_PATH=/usr/local/share/guile/1.5.4 make psyntax.pp
-include $(top_srcdir)/am/pre-inst-guile
-psyntax.pp: psyntax.ss
- $(preinstguile) -s $(srcdir)/compile-psyntax.scm \
- $(srcdir)/psyntax.ss $(srcdir)/psyntax.pp
-endif
diff --git a/ice-9/README b/ice-9/README
deleted file mode 100644
index f659b9ee7..000000000
--- a/ice-9/README
+++ /dev/null
@@ -1,12 +0,0 @@
-This directory contains various bits of Guile Scheme code.
-Most of these are packaged as modules, with foo.scm implementing
-the module `(ice-9 foo)'.
-
-The non-module files are:
-
-boot-9.scm -- loaded on guile startup
- implements module system + lots of other stuff
-arrays.scm -- loaded by boot-9.scm
-networking.scm -- loaded by boot-9.scm
-posix.scm -- loaded by boot-9.scm
-r4rs.scm -- loaded by boot-9.scm
diff --git a/ice-9/and-let-star.scm b/ice-9/and-let-star.scm
deleted file mode 100644
index 472d8b626..000000000
--- a/ice-9/and-let-star.scm
+++ /dev/null
@@ -1,71 +0,0 @@
-;;;; and-let-star.scm --- and-let* syntactic form (draft SRFI-2) for Guile
-;;;; written by Michael Livshin <mike@olan.com>
-;;;;
-;;;; Copyright (C) 1999, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-
-(define-module (ice-9 and-let-star)
- :export-syntax (and-let*))
-
-(defmacro and-let* (vars . body)
-
- (define (expand vars body)
- (cond
- ((null? vars)
- `(begin ,@body))
- ((pair? vars)
- (let ((exp (car vars)))
- (cond
- ((pair? exp)
- (cond
- ((null? (cdr exp))
- `(and ,(car exp) ,(expand (cdr vars) body)))
- (else
- (let ((var (car exp))
- (val (cadr exp)))
- `(let (,exp)
- (and ,var ,(expand (cdr vars) body)))))))
- (else
- `(and ,exp ,(expand (cdr vars) body))))))
- (else
- (error "not a proper list" vars))))
-
- (expand vars body))
diff --git a/ice-9/arrays.scm b/ice-9/arrays.scm
deleted file mode 100644
index ae711d062..000000000
--- a/ice-9/arrays.scm
+++ /dev/null
@@ -1,82 +0,0 @@
-;;; installed-scm-file
-
-;;;; Copyright (C) 1999, 2001 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-;;;;
-
-(define uniform-vector? array?)
-(define make-uniform-vector dimensions->uniform-array)
-
-;; (define uniform-vector-ref array-ref)
-
-(define (uniform-vector-set! u i o)
- (uniform-array-set1! u o i))
-(define uniform-vector-fill! array-fill!)
-(define uniform-vector-read! uniform-array-read!)
-(define uniform-vector-write uniform-array-write)
-
-(define (make-array fill . args)
- (dimensions->uniform-array args '() fill))
-(define (make-uniform-array prot . args)
- (dimensions->uniform-array args prot))
-(define (list->array ndim lst)
- (list->uniform-array ndim '() lst))
-(define (list->uniform-vector prot lst)
- (list->uniform-array 1 prot lst))
-(define (array-shape a)
- (map (lambda (ind) (if (number? ind) (list 0 (+ -1 ind)) ind))
- (array-dimensions a)))
-
-(let ((make-array-proc (lambda (template)
- (lambda (c port)
- (read:uniform-vector template port)))))
- (for-each (lambda (char template)
- (read-hash-extend char
- (make-array-proc template)))
- '(#\a #\u #\e #\s #\i #\c #\y #\h #\l)
- '(#\a 1 -1 1.0 1/3 0+i #\nul s l)))
-
-(let ((array-proc (lambda (c port)
- (read:array c port))))
- (for-each (lambda (char) (read-hash-extend char array-proc))
- '(#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9)))
-
-(define (read:array digit port)
- (define chr0 (char->integer #\0))
- (let ((rank (let readnum ((val (- (char->integer digit) chr0)))
- (if (char-numeric? (peek-char port))
- (readnum (+ (* 10 val)
- (- (char->integer (read-char port)) chr0)))
- val)))
- (prot (if (eq? #\( (peek-char port))
- '()
- (let ((c (read-char port)))
- (case c ((#\b) #t)
- ((#\a) #\a)
- ((#\u) 1)
- ((#\e) -1)
- ((#\s) 1.0)
- ((#\i) 1/3)
- ((#\c) 0+i)
- (else (error "read:array unknown option " c)))))))
- (if (eq? (peek-char port) #\()
- (list->uniform-array rank prot (read port))
- (error "read:array list not found"))))
-
-(define (read:uniform-vector proto port)
- (if (eq? #\( (peek-char port))
- (list->uniform-array 1 proto (read port))))
diff --git a/ice-9/boot-9.scm b/ice-9/boot-9.scm
deleted file mode 100644
index 5fd5b638e..000000000
--- a/ice-9/boot-9.scm
+++ /dev/null
@@ -1,2918 +0,0 @@
-;;; installed-scm-file
-
-;;;; Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-
-;;; Commentary:
-
-;;; This file is the first thing loaded into Guile. It adds many mundane
-;;; definitions and a few that are interesting.
-;;;
-;;; The module system (hence the hierarchical namespace) are defined in this
-;;; file.
-;;;
-
-;;; Code:
-
-
-;;; {Deprecation}
-;;;
-
-;; We don't have macros here, but we do want to define
-;; `begin-deprecated' early.
-
-(define begin-deprecated
- (procedure->memoizing-macro
- (lambda (exp env)
- (if (include-deprecated-features)
- `(begin ,@(cdr exp))
- `#f))))
-
-
-;;; {Features}
-;;
-
-(define (provide sym)
- (if (not (memq sym *features*))
- (set! *features* (cons sym *features*))))
-
-;;; Return #t iff FEATURE is available to this Guile interpreter.
-;;; In SLIB, provided? also checks to see if the module is available.
-;;; We should do that too, but don't.
-(define (provided? feature)
- (and (memq feature *features*) #t))
-
-(begin-deprecated
- (define feature? provided?))
-
-;;; let format alias simple-format until the more complete version is loaded
-(define format simple-format)
-
-
-;;; {R4RS compliance}
-
-(primitive-load-path "ice-9/r4rs.scm")
-
-
-;;; {Simple Debugging Tools}
-;;
-
-
-;; peek takes any number of arguments, writes them to the
-;; current ouput port, and returns the last argument.
-;; It is handy to wrap around an expression to look at
-;; a value each time is evaluated, e.g.:
-;;
-;; (+ 10 (troublesome-fn))
-;; => (+ 10 (pk 'troublesome-fn-returned (troublesome-fn)))
-;;
-
-(define (peek . stuff)
- (newline)
- (display ";;; ")
- (write stuff)
- (newline)
- (car (last-pair stuff)))
-
-(define pk peek)
-
-(define (warn . stuff)
- (with-output-to-port (current-error-port)
- (lambda ()
- (newline)
- (display ";;; WARNING ")
- (display stuff)
- (newline)
- (car (last-pair stuff)))))
-
-
-;;; {Trivial Functions}
-;;;
-
-(define (identity x) x)
-(define (1+ n) (+ n 1))
-(define (1- n) (+ n -1))
-(define (and=> value procedure) (and value (procedure value)))
-(define (make-hash-table k) (make-vector k '()))
-
-;;; apply-to-args is functionally redundant with apply and, worse,
-;;; is less general than apply since it only takes two arguments.
-;;;
-;;; On the other hand, apply-to-args is a syntacticly convenient way to
-;;; perform binding in many circumstances when the "let" family of
-;;; of forms don't cut it. E.g.:
-;;;
-;;; (apply-to-args (return-3d-mouse-coords)
-;;; (lambda (x y z)
-;;; ...))
-;;;
-
-(define (apply-to-args args fn) (apply fn args))
-
-
-
-;;; {Integer Math}
-;;;
-
-(define (ipow-by-squaring x k acc proc)
- (cond ((zero? k) acc)
- ((= 1 k) (proc acc x))
- (else (ipow-by-squaring (proc x x)
- (quotient k 2)
- (if (even? k) acc (proc acc x))
- proc))))
-
-
-;;; {Symbol Properties}
-;;;
-
-(define (symbol-property sym prop)
- (let ((pair (assoc prop (symbol-pref sym))))
- (and pair (cdr pair))))
-
-(define (set-symbol-property! sym prop val)
- (let ((pair (assoc prop (symbol-pref sym))))
- (if pair
- (set-cdr! pair val)
- (symbol-pset! sym (acons prop val (symbol-pref sym))))))
-
-(define (symbol-property-remove! sym prop)
- (let ((pair (assoc prop (symbol-pref sym))))
- (if pair
- (symbol-pset! sym (delq! pair (symbol-pref sym))))))
-
-;;; {General Properties}
-;;;
-
-;; This is a more modern interface to properties. It will replace all
-;; other property-like things eventually.
-
-(define (make-object-property)
- (let ((prop (primitive-make-property #f)))
- (make-procedure-with-setter
- (lambda (obj) (primitive-property-ref prop obj))
- (lambda (obj val) (primitive-property-set! prop obj val)))))
-
-
-
-;;; {Arrays}
-;;;
-
-(if (provided? 'array)
- (primitive-load-path "ice-9/arrays.scm"))
-
-
-;;; {Keywords}
-;;;
-
-(define (symbol->keyword symbol)
- (make-keyword-from-dash-symbol (symbol-append '- symbol)))
-
-(define (keyword->symbol kw)
- (let ((sym (symbol->string (keyword-dash-symbol kw))))
- (string->symbol (substring sym 1 (string-length sym)))))
-
-(define (kw-arg-ref args kw)
- (let ((rem (member kw args)))
- (and rem (pair? (cdr rem)) (cadr rem))))
-
-
-
-;;; {Structs}
-
-(define (struct-layout s)
- (struct-ref (struct-vtable s) vtable-index-layout))
-
-
-
-;;; Environments
-
-(define the-environment
- (procedure->syntax
- (lambda (x e)
- e)))
-
-(define the-root-environment (the-environment))
-
-(define (environment-module env)
- (let ((closure (and (pair? env) (car (last-pair env)))))
- (and closure (procedure-property closure 'module))))
-
-
-;;; {Records}
-;;;
-
-;; Printing records: by default, records are printed as
-;;
-;; #<type-name field1: val1 field2: val2 ...>
-;;
-;; You can change that by giving a custom printing function to
-;; MAKE-RECORD-TYPE (after the list of field symbols). This function
-;; will be called like
-;;
-;; (<printer> object port)
-;;
-;; It should print OBJECT to PORT.
-
-(define (inherit-print-state old-port new-port)
- (if (get-print-state old-port)
- (port-with-print-state new-port (get-print-state old-port))
- new-port))
-
-;; 0: type-name, 1: fields
-(define record-type-vtable
- (make-vtable-vtable "prpr" 0
- (lambda (s p)
- (cond ((eq? s record-type-vtable)
- (display "#<record-type-vtable>" p))
- (else
- (display "#<record-type " p)
- (display (record-type-name s) p)
- (display ">" p))))))
-
-(define (record-type? obj)
- (and (struct? obj) (eq? record-type-vtable (struct-vtable obj))))
-
-(define (make-record-type type-name fields . opt)
- (let ((printer-fn (and (pair? opt) (car opt))))
- (let ((struct (make-struct record-type-vtable 0
- (make-struct-layout
- (apply string-append
- (map (lambda (f) "pw") fields)))
- (or printer-fn
- (lambda (s p)
- (display "#<" p)
- (display type-name p)
- (let loop ((fields fields)
- (off 0))
- (cond
- ((not (null? fields))
- (display " " p)
- (display (car fields) p)
- (display ": " p)
- (display (struct-ref s off) p)
- (loop (cdr fields) (+ 1 off)))))
- (display ">" p)))
- type-name
- (copy-tree fields))))
- ;; Temporary solution: Associate a name to the record type descriptor
- ;; so that the object system can create a wrapper class for it.
- (set-struct-vtable-name! struct (if (symbol? type-name)
- type-name
- (string->symbol type-name)))
- struct)))
-
-(define (record-type-name obj)
- (if (record-type? obj)
- (struct-ref obj vtable-offset-user)
- (error 'not-a-record-type obj)))
-
-(define (record-type-fields obj)
- (if (record-type? obj)
- (struct-ref obj (+ 1 vtable-offset-user))
- (error 'not-a-record-type obj)))
-
-(define (record-constructor rtd . opt)
- (let ((field-names (if (pair? opt) (car opt) (record-type-fields rtd))))
- (local-eval `(lambda ,field-names
- (make-struct ',rtd 0 ,@(map (lambda (f)
- (if (memq f field-names)
- f
- #f))
- (record-type-fields rtd))))
- the-root-environment)))
-
-(define (record-predicate rtd)
- (lambda (obj) (and (struct? obj) (eq? rtd (struct-vtable obj)))))
-
-(define (record-accessor rtd field-name)
- (let* ((pos (list-index (record-type-fields rtd) field-name)))
- (if (not pos)
- (error 'no-such-field field-name))
- (local-eval `(lambda (obj)
- (and (eq? ',rtd (record-type-descriptor obj))
- (struct-ref obj ,pos)))
- the-root-environment)))
-
-(define (record-modifier rtd field-name)
- (let* ((pos (list-index (record-type-fields rtd) field-name)))
- (if (not pos)
- (error 'no-such-field field-name))
- (local-eval `(lambda (obj val)
- (and (eq? ',rtd (record-type-descriptor obj))
- (struct-set! obj ,pos val)))
- the-root-environment)))
-
-
-(define (record? obj)
- (and (struct? obj) (record-type? (struct-vtable obj))))
-
-(define (record-type-descriptor obj)
- (if (struct? obj)
- (struct-vtable obj)
- (error 'not-a-record obj)))
-
-(provide 'record)
-
-
-;;; {Booleans}
-;;;
-
-(define (->bool x) (not (not x)))
-
-
-;;; {Symbols}
-;;;
-
-(define (symbol-append . args)
- (string->symbol (apply string-append (map symbol->string args))))
-
-(define (list->symbol . args)
- (string->symbol (apply list->string args)))
-
-(define (symbol . args)
- (string->symbol (apply string args)))
-
-
-;;; {Lists}
-;;;
-
-(define (list-index l k)
- (let loop ((n 0)
- (l l))
- (and (not (null? l))
- (if (eq? (car l) k)
- n
- (loop (+ n 1) (cdr l))))))
-
-(define (make-list n . init)
- (if (pair? init) (set! init (car init)))
- (let loop ((answer '())
- (n n))
- (if (<= n 0)
- answer
- (loop (cons init answer) (- n 1)))))
-
-
-;;; {and-map and or-map}
-;;;
-;;; (and-map fn lst) is like (and (fn (car lst)) (fn (cadr lst)) (fn...) ...)
-;;; (or-map fn lst) is like (or (fn (car lst)) (fn (cadr lst)) (fn...) ...)
-;;;
-
-;; and-map f l
-;;
-;; Apply f to successive elements of l until exhaustion or f returns #f.
-;; If returning early, return #f. Otherwise, return the last value returned
-;; by f. If f has never been called because l is empty, return #t.
-;;
-(define (and-map f lst)
- (let loop ((result #t)
- (l lst))
- (and result
- (or (and (null? l)
- result)
- (loop (f (car l)) (cdr l))))))
-
-;; or-map f l
-;;
-;; Apply f to successive elements of l until exhaustion or while f returns #f.
-;; If returning early, return the return value of f.
-;;
-(define (or-map f lst)
- (let loop ((result #f)
- (l lst))
- (or result
- (and (not (null? l))
- (loop (f (car l)) (cdr l))))))
-
-
-
-(if (provided? 'posix)
- (primitive-load-path "ice-9/posix.scm"))
-
-(if (provided? 'socket)
- (primitive-load-path "ice-9/networking.scm"))
-
-(define file-exists?
- (if (provided? 'posix)
- (lambda (str)
- (access? str F_OK))
- (lambda (str)
- (let ((port (catch 'system-error (lambda () (open-file str OPEN_READ))
- (lambda args #f))))
- (if port (begin (close-port port) #t)
- #f)))))
-
-(define file-is-directory?
- (if (provided? 'posix)
- (lambda (str)
- (eq? (stat:type (stat str)) 'directory))
- (lambda (str)
- (let ((port (catch 'system-error
- (lambda () (open-file (string-append str "/.")
- OPEN_READ))
- (lambda args #f))))
- (if port (begin (close-port port) #t)
- #f)))))
-
-(define (has-suffix? str suffix)
- (let ((sufl (string-length suffix))
- (sl (string-length str)))
- (and (> sl sufl)
- (string=? (substring str (- sl sufl) sl) suffix))))
-
-(define (system-error-errno args)
- (if (eq? (car args) 'system-error)
- (car (list-ref args 4))
- #f))
-
-
-;;; {Error Handling}
-;;;
-
-(define (error . args)
- (save-stack)
- (if (null? args)
- (scm-error 'misc-error #f "?" #f #f)
- (let loop ((msg "~A")
- (rest (cdr args)))
- (if (not (null? rest))
- (loop (string-append msg " ~S")
- (cdr rest))
- (scm-error 'misc-error #f msg args #f)))))
-
-;; bad-throw is the hook that is called upon a throw to a an unhandled
-;; key (unless the throw has four arguments, in which case
-;; it's usually interpreted as an error throw.)
-;; If the key has a default handler (a throw-handler-default property),
-;; it is applied to the throw.
-;;
-(define (bad-throw key . args)
- (let ((default (symbol-property key 'throw-handler-default)))
- (or (and default (apply default key args))
- (apply error "unhandled-exception:" key args))))
-
-
-
-(define (tm:sec obj) (vector-ref obj 0))
-(define (tm:min obj) (vector-ref obj 1))
-(define (tm:hour obj) (vector-ref obj 2))
-(define (tm:mday obj) (vector-ref obj 3))
-(define (tm:mon obj) (vector-ref obj 4))
-(define (tm:year obj) (vector-ref obj 5))
-(define (tm:wday obj) (vector-ref obj 6))
-(define (tm:yday obj) (vector-ref obj 7))
-(define (tm:isdst obj) (vector-ref obj 8))
-(define (tm:gmtoff obj) (vector-ref obj 9))
-(define (tm:zone obj) (vector-ref obj 10))
-
-(define (set-tm:sec obj val) (vector-set! obj 0 val))
-(define (set-tm:min obj val) (vector-set! obj 1 val))
-(define (set-tm:hour obj val) (vector-set! obj 2 val))
-(define (set-tm:mday obj val) (vector-set! obj 3 val))
-(define (set-tm:mon obj val) (vector-set! obj 4 val))
-(define (set-tm:year obj val) (vector-set! obj 5 val))
-(define (set-tm:wday obj val) (vector-set! obj 6 val))
-(define (set-tm:yday obj val) (vector-set! obj 7 val))
-(define (set-tm:isdst obj val) (vector-set! obj 8 val))
-(define (set-tm:gmtoff obj val) (vector-set! obj 9 val))
-(define (set-tm:zone obj val) (vector-set! obj 10 val))
-
-(define (tms:clock obj) (vector-ref obj 0))
-(define (tms:utime obj) (vector-ref obj 1))
-(define (tms:stime obj) (vector-ref obj 2))
-(define (tms:cutime obj) (vector-ref obj 3))
-(define (tms:cstime obj) (vector-ref obj 4))
-
-(define file-position ftell)
-(define (file-set-position port offset . whence)
- (let ((whence (if (eq? whence '()) SEEK_SET (car whence))))
- (seek port offset whence)))
-
-(define (move->fdes fd/port fd)
- (cond ((integer? fd/port)
- (dup->fdes fd/port fd)
- (close fd/port)
- fd)
- (else
- (primitive-move->fdes fd/port fd)
- (set-port-revealed! fd/port 1)
- fd/port)))
-
-(define (release-port-handle port)
- (let ((revealed (port-revealed port)))
- (if (> revealed 0)
- (set-port-revealed! port (- revealed 1)))))
-
-(define (dup->port port/fd mode . maybe-fd)
- (let ((port (fdopen (apply dup->fdes port/fd maybe-fd)
- mode)))
- (if (pair? maybe-fd)
- (set-port-revealed! port 1))
- port))
-
-(define (dup->inport port/fd . maybe-fd)
- (apply dup->port port/fd "r" maybe-fd))
-
-(define (dup->outport port/fd . maybe-fd)
- (apply dup->port port/fd "w" maybe-fd))
-
-(define (dup port/fd . maybe-fd)
- (if (integer? port/fd)
- (apply dup->fdes port/fd maybe-fd)
- (apply dup->port port/fd (port-mode port/fd) maybe-fd)))
-
-(define (duplicate-port port modes)
- (dup->port port modes))
-
-(define (fdes->inport fdes)
- (let loop ((rest-ports (fdes->ports fdes)))
- (cond ((null? rest-ports)
- (let ((result (fdopen fdes "r")))
- (set-port-revealed! result 1)
- result))
- ((input-port? (car rest-ports))
- (set-port-revealed! (car rest-ports)
- (+ (port-revealed (car rest-ports)) 1))
- (car rest-ports))
- (else
- (loop (cdr rest-ports))))))
-
-(define (fdes->outport fdes)
- (let loop ((rest-ports (fdes->ports fdes)))
- (cond ((null? rest-ports)
- (let ((result (fdopen fdes "w")))
- (set-port-revealed! result 1)
- result))
- ((output-port? (car rest-ports))
- (set-port-revealed! (car rest-ports)
- (+ (port-revealed (car rest-ports)) 1))
- (car rest-ports))
- (else
- (loop (cdr rest-ports))))))
-
-(define (port->fdes port)
- (set-port-revealed! port (+ (port-revealed port) 1))
- (fileno port))
-
-(define (setenv name value)
- (if value
- (putenv (string-append name "=" value))
- (putenv name)))
-
-(define (unsetenv name)
- "Remove the entry for NAME from the environment."
- (putenv name))
-
-
-;;; {Load Paths}
-;;;
-
-;;; Here for backward compatability
-;;
-(define scheme-file-suffix (lambda () ".scm"))
-
-(define (in-vicinity vicinity file)
- (let ((tail (let ((len (string-length vicinity)))
- (if (zero? len)
- #f
- (string-ref vicinity (- len 1))))))
- (string-append vicinity
- (if (or (not tail)
- (eq? tail #\/))
- ""
- "/")
- file)))
-
-
-;;; {Help for scm_shell}
-;;; The argument-processing code used by Guile-based shells generates
-;;; Scheme code based on the argument list. This page contains help
-;;; functions for the code it generates.
-
-(define (command-line) (program-arguments))
-
-;; This is mostly for the internal use of the code generated by
-;; scm_compile_shell_switches.
-
-(define (turn-on-debugging)
- (debug-enable 'debug)
- (debug-enable 'backtrace)
- (read-enable 'positions))
-
-(define (load-user-init)
- (let* ((home (or (getenv "HOME")
- (false-if-exception (passwd:dir (getpwuid (getuid))))
- "/")) ;; fallback for cygwin etc.
- (init-file (in-vicinity home ".guile")))
- (if (file-exists? init-file)
- (primitive-load init-file))))
-
-
-;;; {Loading by paths}
-
-;;; Load a Scheme source file named NAME, searching for it in the
-;;; directories listed in %load-path, and applying each of the file
-;;; name extensions listed in %load-extensions.
-(define (load-from-path name)
- (start-stack 'load-stack
- (primitive-load-path name)))
-
-
-
-;;; {Transcendental Functions}
-;;;
-;;; Derived from "Transcen.scm", Complex trancendental functions for SCM.
-;;; Written by Jerry D. Hedden, (C) FSF.
-;;; See the file `COPYING' for terms applying to this program.
-;;;
-
-(define (exp z)
- (if (real? z) ($exp z)
- (make-polar ($exp (real-part z)) (imag-part z))))
-
-(define (log z)
- (if (and (real? z) (>= z 0))
- ($log z)
- (make-rectangular ($log (magnitude z)) (angle z))))
-
-(define (sqrt z)
- (if (real? z)
- (if (negative? z) (make-rectangular 0 ($sqrt (- z)))
- ($sqrt z))
- (make-polar ($sqrt (magnitude z)) (/ (angle z) 2))))
-
-(define expt
- (let ((integer-expt integer-expt))
- (lambda (z1 z2)
- (cond ((integer? z2)
- (if (>= z2 0)
- (integer-expt z1 z2)
- (/ 1 (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)))
- (make-rectangular (* ($sinh x) ($cos y))
- (* ($cosh x) ($sin y))))))
-(define (cosh z)
- (if (real? z) ($cosh z)
- (let ((x (real-part z)) (y (imag-part z)))
- (make-rectangular (* ($cosh x) ($cos y))
- (* ($sinh x) ($sin y))))))
-(define (tanh z)
- (if (real? z) ($tanh z)
- (let* ((x (* 2 (real-part z)))
- (y (* 2 (imag-part z)))
- (w (+ ($cosh x) ($cos y))))
- (make-rectangular (/ ($sinh x) w) (/ ($sin y) w)))))
-
-(define (asinh z)
- (if (real? z) ($asinh z)
- (log (+ z (sqrt (+ (* z z) 1))))))
-
-(define (acosh z)
- (if (and (real? z) (>= z 1))
- ($acosh z)
- (log (+ z (sqrt (- (* z z) 1))))))
-
-(define (atanh z)
- (if (and (real? z) (> z -1) (< z 1))
- ($atanh z)
- (/ (log (/ (+ 1 z) (- 1 z))) 2)))
-
-(define (sin z)
- (if (real? z) ($sin z)
- (let ((x (real-part z)) (y (imag-part z)))
- (make-rectangular (* ($sin x) ($cosh y))
- (* ($cos x) ($sinh y))))))
-(define (cos z)
- (if (real? z) ($cos z)
- (let ((x (real-part z)) (y (imag-part z)))
- (make-rectangular (* ($cos x) ($cosh y))
- (- (* ($sin x) ($sinh y)))))))
-(define (tan z)
- (if (real? z) ($tan z)
- (let* ((x (* 2 (real-part z)))
- (y (* 2 (imag-part z)))
- (w (+ ($cos x) ($cosh y))))
- (make-rectangular (/ ($sin x) w) (/ ($sinh y) w)))))
-
-(define (asin z)
- (if (and (real? z) (>= z -1) (<= z 1))
- ($asin z)
- (* -i (asinh (* +i z)))))
-
-(define (acos z)
- (if (and (real? z) (>= z -1) (<= z 1))
- ($acos z)
- (+ (/ (angle -1) 2) (* +i (asinh (* +i z))))))
-
-(define (atan z . y)
- (if (null? y)
- (if (real? z) ($atan z)
- (/ (log (/ (- +i z) (+ +i z))) +2i))
- ($atan2 z (car y))))
-
-(define (log10 arg)
- (/ (log arg) (log 10)))
-
-
-
-;;; {Reader Extensions}
-;;;
-
-;;; Reader code for various "#c" forms.
-;;;
-
-(read-hash-extend #\' (lambda (c port)
- (read port)))
-
-(define read-eval? (make-fluid))
-(fluid-set! read-eval? #f)
-(read-hash-extend #\.
- (lambda (c port)
- (if (fluid-ref read-eval?)
- (eval (read port) (interaction-environment))
- (error
- "#. read expansion found and read-eval? is #f."))))
-
-
-;;; {Command Line Options}
-;;;
-
-(define (get-option argv kw-opts kw-args return)
- (cond
- ((null? argv)
- (return #f #f argv))
-
- ((or (not (eq? #\- (string-ref (car argv) 0)))
- (eq? (string-length (car argv)) 1))
- (return 'normal-arg (car argv) (cdr argv)))
-
- ((eq? #\- (string-ref (car argv) 1))
- (let* ((kw-arg-pos (or (string-index (car argv) #\=)
- (string-length (car argv))))
- (kw (symbol->keyword (substring (car argv) 2 kw-arg-pos)))
- (kw-opt? (member kw kw-opts))
- (kw-arg? (member kw kw-args))
- (arg (or (and (not (eq? kw-arg-pos (string-length (car argv))))
- (substring (car argv)
- (+ kw-arg-pos 1)
- (string-length (car argv))))
- (and kw-arg?
- (begin (set! argv (cdr argv)) (car argv))))))
- (if (or kw-opt? kw-arg?)
- (return kw arg (cdr argv))
- (return 'usage-error kw (cdr argv)))))
-
- (else
- (let* ((char (substring (car argv) 1 2))
- (kw (symbol->keyword char)))
- (cond
-
- ((member kw kw-opts)
- (let* ((rest-car (substring (car argv) 2 (string-length (car argv))))
- (new-argv (if (= 0 (string-length rest-car))
- (cdr argv)
- (cons (string-append "-" rest-car) (cdr argv)))))
- (return kw #f new-argv)))
-
- ((member kw kw-args)
- (let* ((rest-car (substring (car argv) 2 (string-length (car argv))))
- (arg (if (= 0 (string-length rest-car))
- (cadr argv)
- rest-car))
- (new-argv (if (= 0 (string-length rest-car))
- (cddr argv)
- (cdr argv))))
- (return kw arg new-argv)))
-
- (else (return 'usage-error kw argv)))))))
-
-(define (for-next-option proc argv kw-opts kw-args)
- (let loop ((argv argv))
- (get-option argv kw-opts kw-args
- (lambda (opt opt-arg argv)
- (and opt (proc opt opt-arg argv loop))))))
-
-(define (display-usage-report kw-desc)
- (for-each
- (lambda (kw)
- (or (eq? (car kw) #t)
- (eq? (car kw) 'else)
- (let* ((opt-desc kw)
- (help (cadr opt-desc))
- (opts (car opt-desc))
- (opts-proper (if (string? (car opts)) (cdr opts) opts))
- (arg-name (if (string? (car opts))
- (string-append "<" (car opts) ">")
- ""))
- (left-part (string-append
- (with-output-to-string
- (lambda ()
- (map (lambda (x) (display (keyword-symbol x)) (display " "))
- opts-proper)))
- arg-name))
- (middle-part (if (and (< (string-length left-part) 30)
- (< (string-length help) 40))
- (make-string (- 30 (string-length left-part)) #\ )
- "\n\t")))
- (display left-part)
- (display middle-part)
- (display help)
- (newline))))
- kw-desc))
-
-
-
-(define (transform-usage-lambda cases)
- (let* ((raw-usage (delq! 'else (map car cases)))
- (usage-sans-specials (map (lambda (x)
- (or (and (not (list? x)) x)
- (and (symbol? (car x)) #t)
- (and (boolean? (car x)) #t)
- x))
- raw-usage))
- (usage-desc (delq! #t usage-sans-specials))
- (kw-desc (map car usage-desc))
- (kw-opts (apply append (map (lambda (x) (and (not (string? (car x))) x)) kw-desc)))
- (kw-args (apply append (map (lambda (x) (and (string? (car x)) (cdr x))) kw-desc)))
- (transmogrified-cases (map (lambda (case)
- (cons (let ((opts (car case)))
- (if (or (boolean? opts) (eq? 'else opts))
- opts
- (cond
- ((symbol? (car opts)) opts)
- ((boolean? (car opts)) opts)
- ((string? (caar opts)) (cdar opts))
- (else (car opts)))))
- (cdr case)))
- cases)))
- `(let ((%display-usage (lambda () (display-usage-report ',usage-desc))))
- (lambda (%argv)
- (let %next-arg ((%argv %argv))
- (get-option %argv
- ',kw-opts
- ',kw-args
- (lambda (%opt %arg %new-argv)
- (case %opt
- ,@ transmogrified-cases))))))))
-
-
-
-
-;;; {Low Level Modules}
-;;;
-;;; These are the low level data structures for modules.
-;;;
-;;; !!! warning: The interface to lazy binder procedures is going
-;;; to be changed in an incompatible way to permit all the basic
-;;; module ops to be virtualized.
-;;;
-;;; (make-module size use-list lazy-binding-proc) => module
-;;; module-{obarray,uses,binder}[|-set!]
-;;; (module? obj) => [#t|#f]
-;;; (module-locally-bound? module symbol) => [#t|#f]
-;;; (module-bound? module symbol) => [#t|#f]
-;;; (module-symbol-locally-interned? module symbol) => [#t|#f]
-;;; (module-symbol-interned? module symbol) => [#t|#f]
-;;; (module-local-variable module symbol) => [#<variable ...> | #f]
-;;; (module-variable module symbol) => [#<variable ...> | #f]
-;;; (module-symbol-binding module symbol opt-value)
-;;; => [ <obj> | opt-value | an error occurs ]
-;;; (module-make-local-var! module symbol) => #<variable...>
-;;; (module-add! module symbol var) => unspecified
-;;; (module-remove! module symbol) => unspecified
-;;; (module-for-each proc module) => unspecified
-;;; (make-scm-module) => module ; a lazy copy of the symhash module
-;;; (set-current-module module) => unspecified
-;;; (current-module) => #<module...>
-;;;
-;;;
-
-
-;;; {Printing Modules}
-;; This is how modules are printed. You can re-define it.
-;; (Redefining is actually more complicated than simply redefining
-;; %print-module because that would only change the binding and not
-;; the value stored in the vtable that determines how record are
-;; printed. Sigh.)
-
-(define (%print-module mod port) ; unused args: depth length style table)
- (display "#<" port)
- (display (or (module-kind mod) "module") port)
- (let ((name (module-name mod)))
- (if name
- (begin
- (display " " port)
- (display name port))))
- (display " " port)
- (display (number->string (object-address mod) 16) port)
- (display ">" port))
-
-;; module-type
-;;
-;; A module is characterized by an obarray in which local symbols
-;; are interned, a list of modules, "uses", from which non-local
-;; bindings can be inherited, and an optional lazy-binder which
-;; is a (CLOSURE module symbol) which, as a last resort, can provide
-;; bindings that would otherwise not be found locally in the module.
-;;
-;; NOTE: If you change here, you also need to change libguile/modules.h.
-;;
-(define module-type
- (make-record-type 'module
- '(obarray uses binder eval-closure transformer name kind
- observers weak-observers observer-id)
- %print-module))
-
-;; make-module &opt size uses binder
-;;
-;; Create a new module, perhaps with a particular size of obarray,
-;; initial uses list, or binding procedure.
-;;
-(define make-module
- (lambda args
-
- (define (parse-arg index default)
- (if (> (length args) index)
- (list-ref args index)
- default))
-
- (if (> (length args) 3)
- (error "Too many args to make-module." args))
-
- (let ((size (parse-arg 0 1021))
- (uses (parse-arg 1 '()))
- (binder (parse-arg 2 #f)))
-
- (if (not (integer? size))
- (error "Illegal size to make-module." size))
- (if (not (and (list? uses)
- (and-map module? uses)))
- (error "Incorrect use list." uses))
- (if (and binder (not (procedure? binder)))
- (error
- "Lazy-binder expected to be a procedure or #f." binder))
-
- (let ((module (module-constructor (make-vector size '())
- uses binder #f #f #f #f
- '()
- (make-weak-value-hash-table 31)
- 0)))
-
- ;; We can't pass this as an argument to module-constructor,
- ;; because we need it to close over a pointer to the module
- ;; itself.
- (set-module-eval-closure! module (standard-eval-closure module))
-
- module))))
-
-(define module-constructor (record-constructor module-type))
-(define module-obarray (record-accessor module-type 'obarray))
-(define set-module-obarray! (record-modifier module-type 'obarray))
-(define module-uses (record-accessor module-type 'uses))
-(define set-module-uses! (record-modifier module-type 'uses))
-(define module-binder (record-accessor module-type 'binder))
-(define set-module-binder! (record-modifier module-type 'binder))
-
-;; NOTE: This binding is used in libguile/modules.c.
-(define module-eval-closure (record-accessor module-type 'eval-closure))
-
-(define module-transformer (record-accessor module-type 'transformer))
-(define set-module-transformer! (record-modifier module-type 'transformer))
-(define module-name (record-accessor module-type 'name))
-(define set-module-name! (record-modifier module-type 'name))
-(define module-kind (record-accessor module-type 'kind))
-(define set-module-kind! (record-modifier module-type 'kind))
-(define module-observers (record-accessor module-type 'observers))
-(define set-module-observers! (record-modifier module-type 'observers))
-(define module-weak-observers (record-accessor module-type 'weak-observers))
-(define module-observer-id (record-accessor module-type 'observer-id))
-(define set-module-observer-id! (record-modifier module-type 'observer-id))
-(define module? (record-predicate module-type))
-
-(define set-module-eval-closure!
- (let ((setter (record-modifier module-type 'eval-closure)))
- (lambda (module closure)
- (setter module closure)
- ;; Make it possible to lookup the module from the environment.
- ;; This implementation is correct since an eval closure can belong
- ;; to maximally one module.
- (set-procedure-property! closure 'module module))))
-
-
-;;; {Observer protocol}
-;;;
-
-(define (module-observe module proc)
- (set-module-observers! module (cons proc (module-observers module)))
- (cons module proc))
-
-(define (module-observe-weak module proc)
- (let ((id (module-observer-id module)))
- (hash-set! (module-weak-observers module) id proc)
- (set-module-observer-id! module (+ 1 id))
- (cons module id)))
-
-(define (module-unobserve token)
- (let ((module (car token))
- (id (cdr token)))
- (if (integer? id)
- (hash-remove! (module-weak-observers module) id)
- (set-module-observers! module (delq1! id (module-observers module)))))
- *unspecified*)
-
-(define (module-modified m)
- (for-each (lambda (proc) (proc m)) (module-observers m))
- (hash-fold (lambda (id proc res) (proc m)) #f (module-weak-observers m)))
-
-
-;;; {Module Searching in General}
-;;;
-;;; We sometimes want to look for properties of a symbol
-;;; just within the obarray of one module. If the property
-;;; holds, then it is said to hold ``locally'' as in, ``The symbol
-;;; DISPLAY is locally rebound in the module `safe-guile'.''
-;;;
-;;;
-;;; Other times, we want to test for a symbol property in the obarray
-;;; of M and, if it is not found there, try each of the modules in the
-;;; uses list of M. This is the normal way of testing for some
-;;; property, so we state these properties without qualification as
-;;; in: ``The symbol 'fnord is interned in module M because it is
-;;; interned locally in module M2 which is a member of the uses list
-;;; of M.''
-;;;
-
-;; module-search fn m
-;;
-;; return the first non-#f result of FN applied to M and then to
-;; the modules in the uses of m, and so on recursively. If all applications
-;; return #f, then so does this function.
-;;
-(define (module-search fn m v)
- (define (loop pos)
- (and (pair? pos)
- (or (module-search fn (car pos) v)
- (loop (cdr pos)))))
- (or (fn m v)
- (loop (module-uses m))))
-
-
-;;; {Is a symbol bound in a module?}
-;;;
-;;; Symbol S in Module M is bound if S is interned in M and if the binding
-;;; of S in M has been set to some well-defined value.
-;;;
-
-;; module-locally-bound? module symbol
-;;
-;; Is a symbol bound (interned and defined) locally in a given module?
-;;
-(define (module-locally-bound? m v)
- (let ((var (module-local-variable m v)))
- (and var
- (variable-bound? var))))
-
-;; module-bound? module symbol
-;;
-;; Is a symbol bound (interned and defined) anywhere in a given module
-;; or its uses?
-;;
-(define (module-bound? m v)
- (module-search module-locally-bound? m v))
-
-;;; {Is a symbol interned in a module?}
-;;;
-;;; Symbol S in Module M is interned if S occurs in
-;;; of S in M has been set to some well-defined value.
-;;;
-;;; It is possible to intern a symbol in a module without providing
-;;; an initial binding for the corresponding variable. This is done
-;;; with:
-;;; (module-add! module symbol (make-undefined-variable))
-;;;
-;;; In that case, the symbol is interned in the module, but not
-;;; bound there. The unbound symbol shadows any binding for that
-;;; symbol that might otherwise be inherited from a member of the uses list.
-;;;
-
-(define (module-obarray-get-handle ob key)
- ((if (symbol? key) hashq-get-handle hash-get-handle) ob key))
-
-(define (module-obarray-ref ob key)
- ((if (symbol? key) hashq-ref hash-ref) ob key))
-
-(define (module-obarray-set! ob key val)
- ((if (symbol? key) hashq-set! hash-set!) ob key val))
-
-(define (module-obarray-remove! ob key)
- ((if (symbol? key) hashq-remove! hash-remove!) ob key))
-
-;; module-symbol-locally-interned? module symbol
-;;
-;; is a symbol interned (not neccessarily defined) locally in a given module
-;; or its uses? Interned symbols shadow inherited bindings even if
-;; they are not themselves bound to a defined value.
-;;
-(define (module-symbol-locally-interned? m v)
- (not (not (module-obarray-get-handle (module-obarray m) v))))
-
-;; module-symbol-interned? module symbol
-;;
-;; is a symbol interned (not neccessarily defined) anywhere in a given module
-;; or its uses? Interned symbols shadow inherited bindings even if
-;; they are not themselves bound to a defined value.
-;;
-(define (module-symbol-interned? m v)
- (module-search module-symbol-locally-interned? m v))
-
-
-;;; {Mapping modules x symbols --> variables}
-;;;
-
-;; module-local-variable module symbol
-;; return the local variable associated with a MODULE and SYMBOL.
-;;
-;;; This function is very important. It is the only function that can
-;;; return a variable from a module other than the mutators that store
-;;; new variables in modules. Therefore, this function is the location
-;;; of the "lazy binder" hack.
-;;;
-;;; If symbol is defined in MODULE, and if the definition binds symbol
-;;; to a variable, return that variable object.
-;;;
-;;; If the symbols is not found at first, but the module has a lazy binder,
-;;; then try the binder.
-;;;
-;;; If the symbol is not found at all, return #f.
-;;;
-(define (module-local-variable m v)
-; (caddr
-; (list m v
- (let ((b (module-obarray-ref (module-obarray m) v)))
- (or (and (variable? b) b)
- (and (module-binder m)
- ((module-binder m) m v #f)))))
-;))
-
-;; module-variable module symbol
-;;
-;; like module-local-variable, except search the uses in the
-;; case V is not found in M.
-;;
-;; NOTE: This function is superseded with C code (see modules.c)
-;;; when using the standard eval closure.
-;;
-(define (module-variable m v)
- (module-search module-local-variable m v))
-
-
-;;; {Mapping modules x symbols --> bindings}
-;;;
-;;; These are similar to the mapping to variables, except that the
-;;; variable is dereferenced.
-;;;
-
-;; module-symbol-binding module symbol opt-value
-;;
-;; return the binding of a variable specified by name within
-;; a given module, signalling an error if the variable is unbound.
-;; If the OPT-VALUE is passed, then instead of signalling an error,
-;; return OPT-VALUE.
-;;
-(define (module-symbol-local-binding m v . opt-val)
- (let ((var (module-local-variable m v)))
- (if var
- (variable-ref var)
- (if (not (null? opt-val))
- (car opt-val)
- (error "Locally unbound variable." v)))))
-
-;; module-symbol-binding module symbol opt-value
-;;
-;; return the binding of a variable specified by name within
-;; a given module, signalling an error if the variable is unbound.
-;; If the OPT-VALUE is passed, then instead of signalling an error,
-;; return OPT-VALUE.
-;;
-(define (module-symbol-binding m v . opt-val)
- (let ((var (module-variable m v)))
- (if var
- (variable-ref var)
- (if (not (null? opt-val))
- (car opt-val)
- (error "Unbound variable." v)))))
-
-
-
-;;; {Adding Variables to Modules}
-;;;
-;;;
-
-
-;; module-make-local-var! module symbol
-;;
-;; ensure a variable for V in the local namespace of M.
-;; If no variable was already there, then create a new and uninitialzied
-;; variable.
-;;
-(define (module-make-local-var! m v)
- (or (let ((b (module-obarray-ref (module-obarray m) v)))
- (and (variable? b)
- (begin
- (module-modified m)
- b)))
- (and (module-binder m)
- ((module-binder m) m v #t))
- (begin
- (let ((answer (make-undefined-variable)))
- (module-obarray-set! (module-obarray m) v answer)
- (module-modified m)
- answer))))
-
-;; module-ensure-local-variable! module symbol
-;;
-;; Ensure that there is a local variable in MODULE for SYMBOL. If
-;; there is no binding for SYMBOL, create a new uninitialized
-;; variable. Return the local variable.
-;;
-(define (module-ensure-local-variable! module symbol)
- (or (module-local-variable module symbol)
- (let ((var (make-undefined-variable)))
- (module-add! module symbol var)
- var)))
-
-;; module-add! module symbol var
-;;
-;; ensure a particular variable for V in the local namespace of M.
-;;
-(define (module-add! m v var)
- (if (not (variable? var))
- (error "Bad variable to module-add!" var))
- (module-obarray-set! (module-obarray m) v var)
- (module-modified m))
-
-;; module-remove!
-;;
-;; make sure that a symbol is undefined in the local namespace of M.
-;;
-(define (module-remove! m v)
- (module-obarray-remove! (module-obarray m) v)
- (module-modified m))
-
-(define (module-clear! m)
- (vector-fill! (module-obarray m) '())
- (module-modified m))
-
-;; MODULE-FOR-EACH -- exported
-;;
-;; Call PROC on each symbol in MODULE, with arguments of (SYMBOL VARIABLE).
-;;
-(define (module-for-each proc module)
- (let ((obarray (module-obarray module)))
- (do ((index 0 (+ index 1))
- (end (vector-length obarray)))
- ((= index end))
- (for-each
- (lambda (bucket)
- (proc (car bucket) (cdr bucket)))
- (vector-ref obarray index)))))
-
-
-(define (module-map proc module)
- (let* ((obarray (module-obarray module))
- (end (vector-length obarray)))
-
- (let loop ((i 0)
- (answer '()))
- (if (= i end)
- answer
- (loop (+ 1 i)
- (append!
- (map (lambda (bucket)
- (proc (car bucket) (cdr bucket)))
- (vector-ref obarray i))
- answer))))))
-
-
-;;; {Low Level Bootstrapping}
-;;;
-
-;; make-root-module
-
-;; A root module uses the pre-modules-obarray as its obarray. This
-;; special obarray accumulates all bindings that have been established
-;; before the module system is fully booted.
-;;
-;; (The obarray continues to be used by code that has been closed over
-;; before the module system has been booted.)
-
-(define (make-root-module)
- (let ((m (make-module 0)))
- (set-module-obarray! m (%get-pre-modules-obarray))
- m))
-
-;; make-scm-module
-
-;; The root interface is a module that uses the same obarray as the
-;; root module. It does not allow new definitions, tho.
-
-(define (make-scm-module)
- (let ((m (make-module 0)))
- (set-module-obarray! m (%get-pre-modules-obarray))
- (set-module-eval-closure! m (standard-interface-eval-closure m))
- m))
-
-
-
-;;; {Module-based Loading}
-;;;
-
-(define (save-module-excursion thunk)
- (let ((inner-module (current-module))
- (outer-module #f))
- (dynamic-wind (lambda ()
- (set! outer-module (current-module))
- (set-current-module inner-module)
- (set! inner-module #f))
- thunk
- (lambda ()
- (set! inner-module (current-module))
- (set-current-module outer-module)
- (set! outer-module #f)))))
-
-(define basic-load load)
-
-(define (load-module filename)
- (save-module-excursion
- (lambda ()
- (let ((oldname (and (current-load-port)
- (port-filename (current-load-port)))))
- (basic-load (if (and oldname
- (> (string-length filename) 0)
- (not (char=? (string-ref filename 0) #\/))
- (not (string=? (dirname oldname) ".")))
- (string-append (dirname oldname) "/" filename)
- filename))))))
-
-
-
-;;; {MODULE-REF -- exported}
-;;
-;; Returns the value of a variable called NAME in MODULE or any of its
-;; used modules. If there is no such variable, then if the optional third
-;; argument DEFAULT is present, it is returned; otherwise an error is signaled.
-;;
-(define (module-ref module name . rest)
- (let ((variable (module-variable module name)))
- (if (and variable (variable-bound? variable))
- (variable-ref variable)
- (if (null? rest)
- (error "No variable named" name 'in module)
- (car rest) ; default value
- ))))
-
-;; MODULE-SET! -- exported
-;;
-;; Sets the variable called NAME in MODULE (or in a module that MODULE uses)
-;; to VALUE; if there is no such variable, an error is signaled.
-;;
-(define (module-set! module name value)
- (let ((variable (module-variable module name)))
- (if variable
- (variable-set! variable value)
- (error "No variable named" name 'in module))))
-
-;; MODULE-DEFINE! -- exported
-;;
-;; Sets the variable called NAME in MODULE to VALUE; if there is no such
-;; variable, it is added first.
-;;
-(define (module-define! module name value)
- (let ((variable (module-local-variable module name)))
- (if variable
- (begin
- (variable-set! variable value)
- (module-modified module))
- (let ((variable (make-variable value)))
- (module-add! module name variable)))))
-
-;; MODULE-DEFINED? -- exported
-;;
-;; Return #t iff NAME is defined in MODULE (or in a module that MODULE
-;; uses)
-;;
-(define (module-defined? module name)
- (let ((variable (module-variable module name)))
- (and variable (variable-bound? variable))))
-
-;; MODULE-USE! module interface
-;;
-;; Add INTERFACE to the list of interfaces used by MODULE.
-;;
-(define (module-use! module interface)
- (set-module-uses! module
- (cons interface (delq! interface (module-uses module))))
- (module-modified module))
-
-
-;;; {Recursive Namespaces}
-;;;
-;;;
-;;; A hierarchical namespace emerges if we consider some module to be
-;;; root, and variables bound to modules as nested namespaces.
-;;;
-;;; The routines in this file manage variable names in hierarchical namespace.
-;;; Each variable name is a list of elements, looked up in successively nested
-;;; modules.
-;;;
-;;; (nested-ref some-root-module '(foo bar baz))
-;;; => <value of a variable named baz in the module bound to bar in
-;;; the module bound to foo in some-root-module>
-;;;
-;;;
-;;; There are:
-;;;
-;;; ;; a-root is a module
-;;; ;; name is a list of symbols
-;;;
-;;; nested-ref a-root name
-;;; nested-set! a-root name val
-;;; nested-define! a-root name val
-;;; nested-remove! a-root name
-;;;
-;;;
-;;; (current-module) is a natural choice for a-root so for convenience there are
-;;; also:
-;;;
-;;; local-ref name == nested-ref (current-module) name
-;;; local-set! name val == nested-set! (current-module) name val
-;;; local-define! name val == nested-define! (current-module) name val
-;;; local-remove! name == nested-remove! (current-module) name
-;;;
-
-
-(define (nested-ref root names)
- (let loop ((cur root)
- (elts names))
- (cond
- ((null? elts) cur)
- ((not (module? cur)) #f)
- (else (loop (module-ref cur (car elts) #f) (cdr elts))))))
-
-(define (nested-set! root names val)
- (let loop ((cur root)
- (elts names))
- (if (null? (cdr elts))
- (module-set! cur (car elts) val)
- (loop (module-ref cur (car elts)) (cdr elts)))))
-
-(define (nested-define! root names val)
- (let loop ((cur root)
- (elts names))
- (if (null? (cdr elts))
- (module-define! cur (car elts) val)
- (loop (module-ref cur (car elts)) (cdr elts)))))
-
-(define (nested-remove! root names)
- (let loop ((cur root)
- (elts names))
- (if (null? (cdr elts))
- (module-remove! cur (car elts))
- (loop (module-ref cur (car elts)) (cdr elts)))))
-
-(define (local-ref names) (nested-ref (current-module) names))
-(define (local-set! names val) (nested-set! (current-module) names val))
-(define (local-define names val) (nested-define! (current-module) names val))
-(define (local-remove names) (nested-remove! (current-module) names))
-
-
-
-;;; {The (app) module}
-;;;
-;;; The root of conventionally named objects not directly in the top level.
-;;;
-;;; (app modules)
-;;; (app modules guile)
-;;;
-;;; The directory of all modules and the standard root module.
-;;;
-
-(define (module-public-interface m)
- (module-ref m '%module-public-interface #f))
-(define (set-module-public-interface! m i)
- (module-define! m '%module-public-interface i))
-(define (set-system-module! m s)
- (set-procedure-property! (module-eval-closure m) 'system-module s))
-(define the-root-module (make-root-module))
-(define the-scm-module (make-scm-module))
-(set-module-public-interface! the-root-module the-scm-module)
-(set-module-name! the-root-module '(guile))
-(set-module-name! the-scm-module '(guile))
-(set-module-kind! the-scm-module 'interface)
-(for-each set-system-module! (list the-root-module the-scm-module) '(#t #t))
-
-;; NOTE: This binding is used in libguile/modules.c.
-;;
-(define (make-modules-in module name)
- (if (null? name)
- module
- (cond
- ((module-ref module (car name) #f)
- => (lambda (m) (make-modules-in m (cdr name))))
- (else (let ((m (make-module 31)))
- (set-module-kind! m 'directory)
- (set-module-name! m (append (or (module-name module)
- '())
- (list (car name))))
- (module-define! module (car name) m)
- (make-modules-in m (cdr name)))))))
-
-(define (beautify-user-module! module)
- (let ((interface (module-public-interface module)))
- (if (or (not interface)
- (eq? interface module))
- (let ((interface (make-module 31)))
- (set-module-name! interface (module-name module))
- (set-module-kind! interface 'interface)
- (set-module-public-interface! module interface))))
- (if (and (not (memq the-scm-module (module-uses module)))
- (not (eq? module the-root-module)))
- (set-module-uses! module (append (module-uses module) (list the-scm-module)))))
-
-;; NOTE: This binding is used in libguile/modules.c.
-;;
-(define (resolve-module name . maybe-autoload)
- (let ((full-name (append '(app modules) name)))
- (let ((already (local-ref full-name)))
- (if already
- ;; The module already exists...
- (if (and (or (null? maybe-autoload) (car maybe-autoload))
- (not (module-public-interface already)))
- ;; ...but we are told to load and it doesn't contain source, so
- (begin
- (try-load-module name)
- already)
- ;; simply return it.
- already)
- (begin
- ;; Try to autoload it if we are told so
- (if (or (null? maybe-autoload) (car maybe-autoload))
- (try-load-module name))
- ;; Get/create it.
- (make-modules-in (current-module) full-name))))))
-
-;; Cheat. These bindings are needed by modules.c, but we don't want
-;; to move their real definition here because that would be unnatural.
-;;
-(define try-module-autoload #f)
-(define process-define-module #f)
-(define process-use-modules #f)
-(define module-export! #f)
-
-;; This boots the module system. All bindings needed by modules.c
-;; must have been defined by now.
-;;
-(set-current-module the-root-module)
-
-(define app (make-module 31))
-(local-define '(app modules) (make-module 31))
-(local-define '(app modules guile) the-root-module)
-
-;; (define-special-value '(app modules new-ws) (lambda () (make-scm-module)))
-
-(define (try-load-module name)
- (try-module-autoload name))
-
-(define (purify-module! module)
- "Removes bindings in MODULE which are inherited from the (guile) module."
- (let ((use-list (module-uses module)))
- (if (and (pair? use-list)
- (eq? (car (last-pair use-list)) the-scm-module))
- (set-module-uses! module (reverse (cdr (reverse use-list)))))))
-
-;; Return a module that is an interface to the module designated by
-;; NAME.
-;;
-;; `resolve-interface' takes two keyword arguments:
-;;
-;; #:select SELECTION
-;;
-;; SELECTION is a list of binding-specs to be imported; A binding-spec
-;; is either a symbol or a pair of symbols (ORIG . SEEN), where ORIG
-;; is the name in the used module and SEEN is the name in the using
-;; module. Note that SEEN is also passed through RENAMER, below. The
-;; default is to select all bindings. If you specify no selection but
-;; a renamer, only the bindings that already exist in the used module
-;; are made available in the interface. Bindings that are added later
-;; are not picked up.
-;;
-;; #:renamer RENAMER
-;;
-;; RENAMER is a procedure that takes a symbol and returns its new
-;; name. The default is to not perform any renaming.
-;;
-;; Signal "no code for module" error if module name is not resolvable
-;; or its public interface is not available. Signal "no binding"
-;; error if selected binding does not exist in the used module.
-;;
-(define (resolve-interface name . args)
-
- (define (get-keyword-arg args kw def)
- (cond ((memq kw args)
- => (lambda (kw-arg)
- (if (null? (cdr kw-arg))
- (error "keyword without value: " kw))
- (cadr kw-arg)))
- (else
- def)))
-
- (let* ((select (get-keyword-arg args #:select #f))
- (renamer (get-keyword-arg args #:renamer identity))
- (module (resolve-module name))
- (public-i (and module (module-public-interface module))))
- (and (or (not module) (not public-i))
- (error "no code for module" name))
- (if (and (not select) (eq? renamer identity))
- public-i
- (let ((selection (or select (module-map (lambda (sym var) sym)
- public-i)))
- (custom-i (make-module 31)))
- (set-module-kind! custom-i 'interface)
- ;; XXX - should use a lazy binder so that changes to the
- ;; used module are picked up automatically.
- (for-each (lambda (bspec)
- (let* ((direct? (symbol? bspec))
- (orig (if direct? bspec (car bspec)))
- (seen (if direct? bspec (cdr bspec))))
- (module-add! custom-i (renamer seen)
- (or (module-local-variable public-i orig)
- (module-local-variable module orig)
- (error
- ;; fixme: format manually for now
- (simple-format
- #f "no binding `~A' in module ~A"
- orig name))))))
- selection)
- custom-i))))
-
-(define (symbol-prefix-proc prefix)
- (lambda (symbol)
- (symbol-append prefix symbol)))
-
-;; This function is called from "modules.c". If you change it, be
-;; sure to update "modules.c" as well.
-
-(define (process-define-module args)
- (let* ((module-id (car args))
- (module (resolve-module module-id #f))
- (kws (cdr args))
- (unrecognized (lambda (arg)
- (error "unrecognized define-module argument" arg))))
- (beautify-user-module! module)
- (let loop ((kws kws)
- (reversed-interfaces '())
- (exports '())
- (re-exports '()))
- (if (null? kws)
- (begin
- (for-each (lambda (interface)
- (module-use! module interface))
- (reverse reversed-interfaces))
- (module-export! module exports)
- (module-re-export! module re-exports))
- (case (car kws)
- ((#:use-module #:use-syntax)
- (or (pair? (cdr kws))
- (unrecognized kws))
- (let* ((interface-args (cadr kws))
- (interface (apply resolve-interface interface-args)))
- (and (eq? (car kws) #:use-syntax)
- (or (symbol? (caar interface-args))
- (error "invalid module name for use-syntax"
- (car interface-args)))
- (set-module-transformer!
- module
- (module-ref interface
- (car (last-pair (car interface-args)))
- #f)))
- (loop (cddr kws)
- (cons interface reversed-interfaces)
- exports
- re-exports)))
- ((#:autoload)
- (or (and (pair? (cdr kws)) (pair? (cddr kws)))
- (unrecognized kws))
- (loop (cdddr kws)
- (cons (make-autoload-interface module
- (cadr kws)
- (caddr kws))
- reversed-interfaces)
- exports
- re-exports))
- ((#:no-backtrace)
- (set-system-module! module #t)
- (loop (cdr kws) reversed-interfaces exports re-exports))
- ((#:pure)
- (purify-module! module)
- (loop (cdr kws) reversed-interfaces exports re-exports))
- ((#:export #:export-syntax)
- (or (pair? (cdr kws))
- (unrecognized kws))
- (loop (cddr kws)
- reversed-interfaces
- (append (cadr kws) exports)
- re-exports))
- ((#:re-export #:re-export-syntax)
- (or (pair? (cdr kws))
- (unrecognized kws))
- (loop (cddr kws)
- reversed-interfaces
- exports
- (append (cadr kws) re-exports)))
- (else
- (unrecognized kws)))))
- module))
-
-;;; {Autoload}
-
-(define (make-autoload-interface module name bindings)
- (let ((b (lambda (a sym definep)
- (and (memq sym bindings)
- (let ((i (module-public-interface (resolve-module name))))
- (if (not i)
- (error "missing interface for module" name))
- ;; Replace autoload-interface with interface
- (set-car! (memq a (module-uses module)) i)
- (module-local-variable i sym))))))
- (module-constructor #() '() b #f #f name 'autoload
- '() (make-weak-value-hash-table 31) 0)))
-
-;;; {Compiled module}
-
-(define load-compiled #f)
-
-
-;;; {Autoloading modules}
-
-(define autoloads-in-progress '())
-
-;; This function is called from "modules.c". If you change it, be
-;; sure to update "modules.c" as well.
-
-(define (try-module-autoload module-name)
- (let* ((reverse-name (reverse module-name))
- (name (symbol->string (car reverse-name)))
- (dir-hint-module-name (reverse (cdr reverse-name)))
- (dir-hint (apply string-append
- (map (lambda (elt)
- (string-append (symbol->string elt) "/"))
- dir-hint-module-name))))
- (resolve-module dir-hint-module-name #f)
- (and (not (autoload-done-or-in-progress? dir-hint name))
- (let ((didit #f))
- (define (load-file proc file)
- (save-module-excursion (lambda () (proc file)))
- (set! didit #t))
- (dynamic-wind
- (lambda () (autoload-in-progress! dir-hint name))
- (lambda ()
- (let ((file (in-vicinity dir-hint name)))
- (cond ((and load-compiled
- (%search-load-path (string-append file ".go")))
- => (lambda (full)
- (load-file load-compiled full)))
- ((%search-load-path file)
- => (lambda (full)
- (load-file primitive-load full))))))
- (lambda () (set-autoloaded! dir-hint name didit)))
- didit))))
-
-
-;;; Dynamic linking of modules
-
-(define autoloads-done '((guile . guile)))
-
-(define (autoload-done-or-in-progress? p m)
- (let ((n (cons p m)))
- (->bool (or (member n autoloads-done)
- (member n autoloads-in-progress)))))
-
-(define (autoload-done! p m)
- (let ((n (cons p m)))
- (set! autoloads-in-progress
- (delete! n autoloads-in-progress))
- (or (member n autoloads-done)
- (set! autoloads-done (cons n autoloads-done)))))
-
-(define (autoload-in-progress! p m)
- (let ((n (cons p m)))
- (set! autoloads-done
- (delete! n autoloads-done))
- (set! autoloads-in-progress (cons n autoloads-in-progress))))
-
-(define (set-autoloaded! p m done?)
- (if done?
- (autoload-done! p m)
- (let ((n (cons p m)))
- (set! autoloads-done (delete! n autoloads-done))
- (set! autoloads-in-progress (delete! n autoloads-in-progress)))))
-
-
-
-
-;; {EVAL-CASE}
-;;
-;; (eval-case ((situation*) forms)* (else forms)?)
-;;
-;; Evaluate certain code based on the situation that eval-case is used
-;; in. The only defined situation right now is `load-toplevel' which
-;; triggers for code evaluated at the top-level, for example from the
-;; REPL or when loading a file.
-
-(define eval-case
- (procedure->memoizing-macro
- (lambda (exp env)
- (define (toplevel-env? env)
- (or (not (pair? env)) (not (pair? (car env)))))
- (define (syntax)
- (error "syntax error in eval-case"))
- (let loop ((clauses (cdr exp)))
- (cond
- ((null? clauses)
- #f)
- ((not (list? (car clauses)))
- (syntax))
- ((eq? 'else (caar clauses))
- (or (null? (cdr clauses))
- (syntax))
- (cons 'begin (cdar clauses)))
- ((not (list? (caar clauses)))
- (syntax))
- ((and (toplevel-env? env)
- (memq 'load-toplevel (caar clauses)))
- (cons 'begin (cdar clauses)))
- (else
- (loop (cdr clauses))))))))
-
-
-;;; {Macros}
-;;;
-
-(define (primitive-macro? m)
- (and (macro? m)
- (not (macro-transformer m))))
-
-;;; {Defmacros}
-;;;
-(define macro-table (make-weak-key-hash-table 523))
-(define xformer-table (make-weak-key-hash-table 523))
-
-(define (defmacro? m) (hashq-ref macro-table m))
-(define (assert-defmacro?! m) (hashq-set! macro-table m #t))
-(define (defmacro-transformer m) (hashq-ref xformer-table m))
-(define (set-defmacro-transformer! m t) (hashq-set! xformer-table m t))
-
-(define defmacro:transformer
- (lambda (f)
- (let* ((xform (lambda (exp env)
- (copy-tree (apply f (cdr exp)))))
- (a (procedure->memoizing-macro xform)))
- (assert-defmacro?! a)
- (set-defmacro-transformer! a f)
- a)))
-
-
-(define defmacro
- (let ((defmacro-transformer
- (lambda (name parms . body)
- (let ((transformer `(lambda ,parms ,@body)))
- `(eval-case
- ((load-toplevel)
- (define ,name (defmacro:transformer ,transformer)))
- (else
- (error "defmacro can only be used at the top level")))))))
- (defmacro:transformer defmacro-transformer)))
-
-(define defmacro:syntax-transformer
- (lambda (f)
- (procedure->syntax
- (lambda (exp env)
- (copy-tree (apply f (cdr exp)))))))
-
-
-;; XXX - should the definition of the car really be looked up in the
-;; current module?
-
-(define (macroexpand-1 e)
- (cond
- ((pair? e) (let* ((a (car e))
- (val (and (symbol? a) (local-ref (list a)))))
- (if (defmacro? val)
- (apply (defmacro-transformer val) (cdr e))
- e)))
- (#t e)))
-
-(define (macroexpand e)
- (cond
- ((pair? e) (let* ((a (car e))
- (val (and (symbol? a) (local-ref (list a)))))
- (if (defmacro? val)
- (macroexpand (apply (defmacro-transformer val) (cdr e)))
- e)))
- (#t e)))
-
-(provide 'defmacro)
-
-
-
-;;; {Run-time options}
-
-(define define-option-interface
- (let* ((option-name car)
- (option-value cadr)
- (option-documentation caddr)
-
- (print-option (lambda (option)
- (display (option-name option))
- (if (< (string-length
- (symbol->string (option-name option)))
- 8)
- (display #\tab))
- (display #\tab)
- (display (option-value option))
- (display #\tab)
- (display (option-documentation option))
- (newline)))
-
- ;; Below follow the macros defining the run-time option interfaces.
-
- (make-options (lambda (interface)
- `(lambda args
- (cond ((null? args) (,interface))
- ((list? (car args))
- (,interface (car args)) (,interface))
- (else (for-each ,print-option
- (,interface #t)))))))
-
- (make-enable (lambda (interface)
- `(lambda flags
- (,interface (append flags (,interface)))
- (,interface))))
-
- (make-disable (lambda (interface)
- `(lambda flags
- (let ((options (,interface)))
- (for-each (lambda (flag)
- (set! options (delq! flag options)))
- flags)
- (,interface options)
- (,interface)))))
-
- (make-set! (lambda (interface)
- `((name exp)
- (,'quasiquote
- (begin (,interface (append (,interface)
- (list '(,'unquote name)
- (,'unquote exp))))
- (,interface)))))))
- (procedure->memoizing-macro
- (lambda (exp env)
- (cons 'begin
- (let* ((option-group (cadr exp))
- (interface (car option-group)))
- (append (map (lambda (name constructor)
- `(define ,name
- ,(constructor interface)))
- (cadr option-group)
- (list make-options
- make-enable
- make-disable))
- (map (lambda (name constructor)
- `(defmacro ,name
- ,@(constructor interface)))
- (caddr option-group)
- (list make-set!)))))))))
-
-(define-option-interface
- (eval-options-interface
- (eval-options eval-enable eval-disable)
- (eval-set!)))
-
-(define-option-interface
- (debug-options-interface
- (debug-options debug-enable debug-disable)
- (debug-set!)))
-
-(define-option-interface
- (evaluator-traps-interface
- (traps trap-enable trap-disable)
- (trap-set!)))
-
-(define-option-interface
- (read-options-interface
- (read-options read-enable read-disable)
- (read-set!)))
-
-(define-option-interface
- (print-options-interface
- (print-options print-enable print-disable)
- (print-set!)))
-
-
-
-;;; {Running Repls}
-;;;
-
-(define (repl read evaler print)
- (let loop ((source (read (current-input-port))))
- (print (evaler source))
- (loop (read (current-input-port)))))
-
-;; A provisional repl that acts like the SCM repl:
-;;
-(define scm-repl-silent #f)
-(define (assert-repl-silence v) (set! scm-repl-silent v))
-
-(define *unspecified* (if #f #f))
-(define (unspecified? v) (eq? v *unspecified*))
-
-(define scm-repl-print-unspecified #f)
-(define (assert-repl-print-unspecified v) (set! scm-repl-print-unspecified v))
-
-(define scm-repl-verbose #f)
-(define (assert-repl-verbosity v) (set! scm-repl-verbose v))
-
-(define scm-repl-prompt "guile> ")
-
-(define (set-repl-prompt! v) (set! scm-repl-prompt v))
-
-(define (default-lazy-handler key . args)
- (save-stack lazy-handler-dispatch)
- (apply throw key args))
-
-(define (lazy-handler-dispatch key . args)
- (apply default-lazy-handler key args))
-
-(define abort-hook (make-hook))
-
-;; these definitions are used if running a script.
-;; otherwise redefined in error-catching-loop.
-(define (set-batch-mode?! arg) #t)
-(define (batch-mode?) #t)
-
-(define (error-catching-loop thunk)
- (let ((status #f)
- (interactive #t))
- (define (loop first)
- (let ((next
- (catch #t
-
- (lambda ()
- (lazy-catch #t
- (lambda ()
- (dynamic-wind
- (lambda () (unmask-signals))
- (lambda ()
- (with-traps
- (lambda ()
- (first)
-
- ;; This line is needed because mark
- ;; doesn't do closures quite right.
- ;; Unreferenced locals should be
- ;; collected.
- ;;
- (set! first #f)
- (let loop ((v (thunk)))
- (loop (thunk)))
- #f)))
- (lambda () (mask-signals))))
-
- lazy-handler-dispatch))
-
- (lambda (key . args)
- (case key
- ((quit)
- (set! status args)
- #f)
-
- ((switch-repl)
- (apply throw 'switch-repl args))
-
- ((abort)
- ;; This is one of the closures that require
- ;; (set! first #f) above
- ;;
- (lambda ()
- (run-hook abort-hook)
- (force-output (current-output-port))
- (display "ABORT: " (current-error-port))
- (write args (current-error-port))
- (newline (current-error-port))
- (if interactive
- (begin
- (if (and
- (not has-shown-debugger-hint?)
- (not (memq 'backtrace
- (debug-options-interface)))
- (stack? (fluid-ref the-last-stack)))
- (begin
- (newline (current-error-port))
- (display
- "Type \"(backtrace)\" to get more information or \"(debug)\" to enter the debugger.\n"
- (current-error-port))
- (set! has-shown-debugger-hint? #t)))
- (force-output (current-error-port)))
- (begin
- (primitive-exit 1)))
- (set! stack-saved? #f)))
-
- (else
- ;; This is the other cons-leak closure...
- (lambda ()
- (cond ((= (length args) 4)
- (apply handle-system-error key args))
- (else
- (apply bad-throw key args))))))))))
- (if next (loop next) status)))
- (set! set-batch-mode?! (lambda (arg)
- (cond (arg
- (set! interactive #f)
- (restore-signals))
- (#t
- (error "sorry, not implemented")))))
- (set! batch-mode? (lambda () (not interactive)))
- (loop (lambda () #t))))
-
-;;(define the-last-stack (make-fluid)) Defined by scm_init_backtrace ()
-(define before-signal-stack (make-fluid))
-(define stack-saved? #f)
-
-(define (save-stack . narrowing)
- (or stack-saved?
- (cond ((not (memq 'debug (debug-options-interface)))
- (fluid-set! the-last-stack #f)
- (set! stack-saved? #t))
- (else
- (fluid-set!
- the-last-stack
- (case (stack-id #t)
- ((repl-stack)
- (apply make-stack #t save-stack primitive-eval #t 0 narrowing))
- ((load-stack)
- (apply make-stack #t save-stack 0 #t 0 narrowing))
- ((tk-stack)
- (apply make-stack #t save-stack tk-stack-mark #t 0 narrowing))
- ((#t)
- (apply make-stack #t save-stack 0 1 narrowing))
- (else
- (let ((id (stack-id #t)))
- (and (procedure? id)
- (apply make-stack #t save-stack id #t 0 narrowing))))))
- (set! stack-saved? #t)))))
-
-(define before-error-hook (make-hook))
-(define after-error-hook (make-hook))
-(define before-backtrace-hook (make-hook))
-(define after-backtrace-hook (make-hook))
-
-(define has-shown-debugger-hint? #f)
-
-(define (handle-system-error key . args)
- (let ((cep (current-error-port)))
- (cond ((not (stack? (fluid-ref the-last-stack))))
- ((memq 'backtrace (debug-options-interface))
- (run-hook before-backtrace-hook)
- (newline cep)
- (display "Backtrace:\n")
- (display-backtrace (fluid-ref the-last-stack) cep)
- (newline cep)
- (run-hook after-backtrace-hook)))
- (run-hook before-error-hook)
- (apply display-error (fluid-ref the-last-stack) cep args)
- (run-hook after-error-hook)
- (force-output cep)
- (throw 'abort key)))
-
-(define (quit . args)
- (apply throw 'quit args))
-
-(define exit quit)
-
-;;(define has-shown-backtrace-hint? #f) Defined by scm_init_backtrace ()
-
-;; Replaced by C code:
-;;(define (backtrace)
-;; (if (fluid-ref the-last-stack)
-;; (begin
-;; (newline)
-;; (display-backtrace (fluid-ref the-last-stack) (current-output-port))
-;; (newline)
-;; (if (and (not has-shown-backtrace-hint?)
-;; (not (memq 'backtrace (debug-options-interface))))
-;; (begin
-;; (display
-;;"Type \"(debug-enable 'backtrace)\" if you would like a backtrace
-;;automatically if an error occurs in the future.\n")
-;; (set! has-shown-backtrace-hint? #t))))
-;; (display "No backtrace available.\n")))
-
-(define (error-catching-repl r e p)
- (error-catching-loop
- (lambda ()
- (call-with-values (lambda () (e (r)))
- (lambda the-values (for-each p the-values))))))
-
-(define (gc-run-time)
- (cdr (assq 'gc-time-taken (gc-stats))))
-
-(define before-read-hook (make-hook))
-(define after-read-hook (make-hook))
-(define before-eval-hook (make-hook 1))
-(define after-eval-hook (make-hook 1))
-(define before-print-hook (make-hook 1))
-(define after-print-hook (make-hook 1))
-
-;;; The default repl-reader function. We may override this if we've
-;;; the readline library.
-(define repl-reader
- (lambda (prompt)
- (display prompt)
- (force-output)
- (run-hook before-read-hook)
- (read (current-input-port))))
-
-(define (scm-style-repl)
-
- (letrec (
- (start-gc-rt #f)
- (start-rt #f)
- (repl-report-start-timing (lambda ()
- (set! start-gc-rt (gc-run-time))
- (set! start-rt (get-internal-run-time))))
- (repl-report (lambda ()
- (display ";;; ")
- (display (inexact->exact
- (* 1000 (/ (- (get-internal-run-time) start-rt)
- internal-time-units-per-second))))
- (display " msec (")
- (display (inexact->exact
- (* 1000 (/ (- (gc-run-time) start-gc-rt)
- internal-time-units-per-second))))
- (display " msec in gc)\n")))
-
- (consume-trailing-whitespace
- (lambda ()
- (let ((ch (peek-char)))
- (cond
- ((eof-object? ch))
- ((or (char=? ch #\space) (char=? ch #\tab))
- (read-char)
- (consume-trailing-whitespace))
- ((char=? ch #\newline)
- (read-char))))))
- (-read (lambda ()
- (let ((val
- (let ((prompt (cond ((string? scm-repl-prompt)
- scm-repl-prompt)
- ((thunk? scm-repl-prompt)
- (scm-repl-prompt))
- (scm-repl-prompt "> ")
- (else ""))))
- (repl-reader prompt))))
-
- ;; As described in R4RS, the READ procedure updates the
- ;; port to point to the first character past the end of
- ;; the external representation of the object. This
- ;; means that it doesn't consume the newline typically
- ;; found after an expression. This means that, when
- ;; debugging Guile with GDB, GDB gets the newline, which
- ;; it often interprets as a "continue" command, making
- ;; breakpoints kind of useless. So, consume any
- ;; trailing newline here, as well as any whitespace
- ;; before it.
- ;; But not if EOF, for control-D.
- (if (not (eof-object? val))
- (consume-trailing-whitespace))
- (run-hook after-read-hook)
- (if (eof-object? val)
- (begin
- (repl-report-start-timing)
- (if scm-repl-verbose
- (begin
- (newline)
- (display ";;; EOF -- quitting")
- (newline)))
- (quit 0)))
- val)))
-
- (-eval (lambda (sourc)
- (repl-report-start-timing)
- (run-hook before-eval-hook sourc)
- (let ((val (start-stack 'repl-stack
- ;; If you change this procedure
- ;; (primitive-eval), please also
- ;; modify the repl-stack case in
- ;; save-stack so that stack cutting
- ;; continues to work.
- (primitive-eval sourc))))
- (run-hook after-eval-hook sourc)
- val)))
-
-
- (-print (let ((maybe-print (lambda (result)
- (if (or scm-repl-print-unspecified
- (not (unspecified? result)))
- (begin
- (write result)
- (newline))))))
- (lambda (result)
- (if (not scm-repl-silent)
- (begin
- (run-hook before-print-hook result)
- (maybe-print result)
- (run-hook after-print-hook result)
- (if scm-repl-verbose
- (repl-report))
- (force-output))))))
-
- (-quit (lambda (args)
- (if scm-repl-verbose
- (begin
- (display ";;; QUIT executed, repl exitting")
- (newline)
- (repl-report)))
- args))
-
- (-abort (lambda ()
- (if scm-repl-verbose
- (begin
- (display ";;; ABORT executed.")
- (newline)
- (repl-report)))
- (repl -read -eval -print))))
-
- (let ((status (error-catching-repl -read
- -eval
- -print)))
- (-quit status))))
-
-
-
-;;; {IOTA functions: generating lists of numbers}
-
-(define (iota n)
- (let loop ((count (1- n)) (result '()))
- (if (< count 0) result
- (loop (1- count) (cons count result)))))
-
-
-;;; {While}
-;;;
-;;; with `continue' and `break'.
-;;;
-
-(defmacro while (cond . body)
- `(letrec ((continue (lambda () (or (not ,cond) (begin (begin ,@ body) (continue)))))
- (break (lambda val (apply throw 'break val))))
- (catch 'break
- (lambda () (continue))
- (lambda v (cadr v)))))
-
-;;; {collect}
-;;;
-;;; Similar to `begin' but returns a list of the results of all constituent
-;;; forms instead of the result of the last form.
-;;; (The definition relies on the current left-to-right
-;;; order of evaluation of operands in applications.)
-
-(defmacro collect forms
- (cons 'list forms))
-
-;;; {with-fluids}
-
-;; with-fluids is a convenience wrapper for the builtin procedure
-;; `with-fluids*'. The syntax is just like `let':
-;;
-;; (with-fluids ((fluid val)
-;; ...)
-;; body)
-
-(defmacro with-fluids (bindings . body)
- `(with-fluids* (list ,@(map car bindings)) (list ,@(map cadr bindings))
- (lambda () ,@body)))
-
-
-
-;;; {Macros}
-;;;
-
-;; actually....hobbit might be able to hack these with a little
-;; coaxing
-;;
-
-(defmacro define-macro (first . rest)
- (let ((name (if (symbol? first) first (car first)))
- (transformer
- (if (symbol? first)
- (car rest)
- `(lambda ,(cdr first) ,@rest))))
- `(eval-case
- ((load-toplevel)
- (define ,name (defmacro:transformer ,transformer)))
- (else
- (error "define-macro can only be used at the top level")))))
-
-
-(defmacro define-syntax-macro (first . rest)
- (let ((name (if (symbol? first) first (car first)))
- (transformer
- (if (symbol? first)
- (car rest)
- `(lambda ,(cdr first) ,@rest))))
- `(eval-case
- ((load-toplevel)
- (define ,name (defmacro:syntax-transformer ,transformer)))
- (else
- (error "define-syntax-macro can only be used at the top level")))))
-
-
-;;; {Module System Macros}
-;;;
-
-;; Return a list of expressions that evaluate to the appropriate
-;; arguments for resolve-interface according to SPEC.
-
-(define (compile-interface-spec spec)
- (define (make-keyarg sym key quote?)
- (cond ((or (memq sym spec)
- (memq key spec))
- => (lambda (rest)
- (if quote?
- (list key (list 'quote (cadr rest)))
- (list key (cadr rest)))))
- (else
- '())))
- (define (map-apply func list)
- (map (lambda (args) (apply func args)) list))
- (define keys
- ;; sym key quote?
- '((:select #:select #t)
- (:renamer #:renamer #f)))
- (if (not (pair? (car spec)))
- `(',spec)
- `(',(car spec)
- ,@(apply append (map-apply make-keyarg keys)))))
-
-(define (keyword-like-symbol->keyword sym)
- (symbol->keyword (string->symbol (substring (symbol->string sym) 1))))
-
-(define (compile-define-module-args args)
- ;; Just quote everything except #:use-module and #:use-syntax. We
- ;; need to know about all arguments regardless since we want to turn
- ;; symbols that look like keywords into real keywords, and the
- ;; keyword args in a define-module form are not regular
- ;; (i.e. no-backtrace doesn't take a value).
- (let loop ((compiled-args `((quote ,(car args))))
- (args (cdr args)))
- (cond ((null? args)
- (reverse! compiled-args))
- ;; symbol in keyword position
- ((symbol? (car args))
- (loop compiled-args
- (cons (keyword-like-symbol->keyword (car args)) (cdr args))))
- ((memq (car args) '(#:no-backtrace #:pure))
- (loop (cons (car args) compiled-args)
- (cdr args)))
- ((null? (cdr args))
- (error "keyword without value:" (car args)))
- ((memq (car args) '(#:use-module #:use-syntax))
- (loop (cons* `(list ,@(compile-interface-spec (cadr args)))
- (car args)
- compiled-args)
- (cddr args)))
- ((eq? (car args) #:autoload)
- (loop (cons* `(quote ,(caddr args))
- `(quote ,(cadr args))
- (car args)
- compiled-args)
- (cdddr args)))
- (else
- (loop (cons* `(quote ,(cadr args))
- (car args)
- compiled-args)
- (cddr args))))))
-
-(defmacro define-module args
- `(eval-case
- ((load-toplevel)
- (let ((m (process-define-module
- (list ,@(compile-define-module-args args)))))
- (set-current-module m)
- m))
- (else
- (error "define-module can only be used at the top level"))))
-
-;; The guts of the use-modules macro. Add the interfaces of the named
-;; modules to the use-list of the current module, in order.
-
-;; This function is called by "modules.c". If you change it, be sure
-;; to change scm_c_use_module as well.
-
-(define (process-use-modules module-interface-args)
- (for-each (lambda (mif-args)
- (let ((mod-iface (apply resolve-interface mif-args)))
- (or mod-iface
- (error "no such module" mif-args))
- (module-use! (current-module) mod-iface)))
- module-interface-args))
-
-(defmacro use-modules modules
- `(eval-case
- ((load-toplevel)
- (process-use-modules
- (list ,@(map (lambda (m)
- `(list ,@(compile-interface-spec m)))
- modules))))
- (else
- (error "use-modules can only be used at the top level"))))
-
-(defmacro use-syntax (spec)
- `(eval-case
- ((load-toplevel)
- ,@(if (pair? spec)
- `((process-use-modules (list
- (list ,@(compile-interface-spec spec))))
- (set-module-transformer! (current-module)
- ,(car (last-pair spec))))
- `((set-module-transformer! (current-module) ,spec))))
- (else
- (error "use-syntax can only be used at the top level"))))
-
-(define define-private define)
-
-(defmacro define-public args
- (define (syntax)
- (error "bad syntax" (list 'define-public args)))
- (define (defined-name n)
- (cond
- ((symbol? n) n)
- ((pair? n) (defined-name (car n)))
- (else (syntax))))
- (cond
- ((null? args)
- (syntax))
- (#t
- (let ((name (defined-name (car args))))
- `(begin
- (define-private ,@args)
- (eval-case ((load-toplevel) (export ,name))))))))
-
-(defmacro defmacro-public args
- (define (syntax)
- (error "bad syntax" (list 'defmacro-public args)))
- (define (defined-name n)
- (cond
- ((symbol? n) n)
- (else (syntax))))
- (cond
- ((null? args)
- (syntax))
- (#t
- (let ((name (defined-name (car args))))
- `(begin
- (eval-case ((load-toplevel) (export ,name)))
- (defmacro ,@args))))))
-
-;; Export a local variable
-
-;; This function is called from "modules.c". If you change it, be
-;; sure to update "modules.c" as well.
-
-(define (module-export! m names)
- (let ((public-i (module-public-interface m)))
- (for-each (lambda (name)
- (let ((var (module-ensure-local-variable! m name)))
- (module-add! public-i name var)))
- names)))
-
-;; Re-export a imported variable
-;;
-(define (module-re-export! m names)
- (let ((public-i (module-public-interface m)))
- (for-each (lambda (name)
- (let ((var (module-variable m name)))
- (cond ((not var)
- (error "Undefined variable:" name))
- ((eq? var (module-local-variable m name))
- (error "re-exporting local variable:" name))
- (else
- (module-add! public-i name var)))))
- names)))
-
-(defmacro export names
- `(eval-case
- ((load-toplevel)
- (module-export! (current-module) ',names))
- (else
- (error "export can only be used at the top level"))))
-
-(defmacro re-export names
- `(eval-case
- ((load-toplevel)
- (module-re-export! (current-module) ',names))
- (else
- (error "re-export can only be used at the top level"))))
-
-(define export-syntax export)
-(define re-export-syntax re-export)
-
-
-(define load load-module)
-
-
-
-;;; {`cond-expand' for SRFI-0 support.}
-;;;
-;;; This syntactic form expands into different commands or
-;;; definitions, depending on the features provided by the Scheme
-;;; implementation.
-;;;
-;;; Syntax:
-;;;
-;;; <cond-expand>
-;;; --> (cond-expand <cond-expand-clause>+)
-;;; | (cond-expand <cond-expand-clause>* (else <command-or-definition>))
-;;; <cond-expand-clause>
-;;; --> (<feature-requirement> <command-or-definition>*)
-;;; <feature-requirement>
-;;; --> <feature-identifier>
-;;; | (and <feature-requirement>*)
-;;; | (or <feature-requirement>*)
-;;; | (not <feature-requirement>)
-;;; <feature-identifier>
-;;; --> <a symbol which is the name or alias of a SRFI>
-;;;
-;;; Additionally, this implementation provides the
-;;; <feature-identifier>s `guile' and `r5rs', so that programs can
-;;; determine the implementation type and the supported standard.
-;;;
-;;; Currently, the following feature identifiers are supported:
-;;;
-;;; guile r5rs srfi-0
-;;;
-;;; Remember to update the features list when adding more SRFIs.
-
-(define %cond-expand-features
- ;; Adjust the above comment when changing this.
- '(guile r5rs srfi-0))
-
-;; This table maps module public interfaces to the list of features.
-;;
-(define %cond-expand-table (make-hash-table 31))
-
-;; Add one or more features to the `cond-expand' feature list of the
-;; module `module'.
-;;
-(define (cond-expand-provide module features)
- (let ((mod (module-public-interface module)))
- (and mod
- (hashq-set! %cond-expand-table mod
- (append (hashq-ref %cond-expand-table mod '())
- features)))))
-
-(define cond-expand
- (procedure->memoizing-macro
- (lambda (exp env)
- (let ((clauses (cdr exp))
- (syntax-error (lambda (cl)
- (error "invalid clause in `cond-expand'" cl))))
- (letrec
- ((test-clause
- (lambda (clause)
- (cond
- ((symbol? clause)
- (or (memq clause %cond-expand-features)
- (let lp ((uses (module-uses (env-module env))))
- (if (pair? uses)
- (or (memq clause
- (hashq-ref %cond-expand-table
- (car uses) '()))
- (lp (cdr uses)))
- #f))))
- ((pair? clause)
- (cond
- ((eq? 'and (car clause))
- (let lp ((l (cdr clause)))
- (cond ((null? l)
- #t)
- ((pair? l)
- (and (test-clause (car l)) (lp (cdr l))))
- (else
- (syntax-error clause)))))
- ((eq? 'or (car clause))
- (let lp ((l (cdr clause)))
- (cond ((null? l)
- #f)
- ((pair? l)
- (or (test-clause (car l)) (lp (cdr l))))
- (else
- (syntax-error clause)))))
- ((eq? 'not (car clause))
- (cond ((not (pair? (cdr clause)))
- (syntax-error clause))
- ((pair? (cddr clause))
- ((syntax-error clause))))
- (not (test-clause (cadr clause))))
- (else
- (syntax-error clause))))
- (else
- (syntax-error clause))))))
- (let lp ((c clauses))
- (cond
- ((null? c)
- (error "Unfulfilled `cond-expand'"))
- ((not (pair? c))
- (syntax-error c))
- ((not (pair? (car c)))
- (syntax-error (car c)))
- ((test-clause (caar c))
- `(begin ,@(cdar c)))
- ((eq? (caar c) 'else)
- (if (pair? (cdr c))
- (syntax-error c))
- `(begin ,@(cdar c)))
- (else
- (lp (cdr c))))))))))
-
-;; This procedure gets called from the startup code with a list of
-;; numbers, which are the numbers of the SRFIs to be loaded on startup.
-;;
-(define (use-srfis srfis)
- (let lp ((s srfis))
- (if (pair? s)
- (let* ((srfi (string->symbol
- (string-append "srfi-" (number->string (car s)))))
- (mod-i (resolve-interface (list 'srfi srfi))))
- (module-use! (current-module) mod-i)
- (lp (cdr s))))))
-
-
-
-;;; {Load emacs interface support if emacs option is given.}
-
-(define (named-module-use! user usee)
- (module-use! (resolve-module user) (resolve-interface usee)))
-
-(define (load-emacs-interface)
- (and (provided? 'debug-extensions)
- (debug-enable 'backtrace))
- (named-module-use! '(guile-user) '(ice-9 emacs)))
-
-
-
-(define using-readline?
- (let ((using-readline? (make-fluid)))
- (make-procedure-with-setter
- (lambda () (fluid-ref using-readline?))
- (lambda (v) (fluid-set! using-readline? v)))))
-
-(define (top-repl)
- (let ((guile-user-module (resolve-module '(guile-user))))
-
- ;; Load emacs interface support if emacs option is given.
- (if (and (module-defined? the-root-module 'use-emacs-interface)
- (module-ref the-root-module 'use-emacs-interface))
- (load-emacs-interface))
-
- ;; Use some convenient modules (in reverse order)
-
- (if (provided? 'regex)
- (module-use! guile-user-module (resolve-interface '(ice-9 regex))))
- (if (provided? 'threads)
- (module-use! guile-user-module (resolve-interface '(ice-9 threads))))
- ;; load debugger on demand
- (module-use! guile-user-module
- (make-autoload-interface guile-user-module
- '(ice-9 debugger) '(debug)))
- (module-use! guile-user-module (resolve-interface '(ice-9 session)))
- (module-use! guile-user-module (resolve-interface '(ice-9 debug)))
- ;; so that builtin bindings will be checked first
- (module-use! guile-user-module (resolve-interface '(guile)))
-
- (set-current-module guile-user-module)
-
- (let ((old-handlers #f)
- (signals (if (provided? 'posix)
- `((,SIGINT . "User interrupt")
- (,SIGFPE . "Arithmetic error")
- (,SIGBUS . "Bad memory access (bus error)")
- (,SIGSEGV
- . "Bad memory access (Segmentation violation)"))
- '())))
-
- (dynamic-wind
-
- ;; call at entry
- (lambda ()
- (let ((make-handler (lambda (msg)
- (lambda (sig)
- ;; Make a backup copy of the stack
- (fluid-set! before-signal-stack
- (fluid-ref the-last-stack))
- (save-stack %deliver-signals)
- (scm-error 'signal
- #f
- msg
- #f
- (list sig))))))
- (set! old-handlers
- (map (lambda (sig-msg)
- (sigaction (car sig-msg)
- (make-handler (cdr sig-msg))))
- signals))))
-
- ;; the protected thunk.
- (lambda ()
- (let ((status (scm-style-repl)))
- (run-hook exit-hook)
- status))
-
- ;; call at exit.
- (lambda ()
- (map (lambda (sig-msg old-handler)
- (if (not (car old-handler))
- ;; restore original C handler.
- (sigaction (car sig-msg) #f)
- ;; restore Scheme handler, SIG_IGN or SIG_DFL.
- (sigaction (car sig-msg)
- (car old-handler)
- (cdr old-handler))))
- signals old-handlers))))))
-
-(defmacro false-if-exception (expr)
- `(catch #t (lambda () ,expr)
- (lambda args #f)))
-
-;;; This hook is run at the very end of an interactive session.
-;;;
-(define exit-hook (make-hook))
-
-
-(append! %load-path (list "."))
-
-;; Place the user in the guile-user module.
-;;
-
-(define-module (guile-user))
-
-;;; boot-9.scm ends here
diff --git a/ice-9/buffered-input.scm b/ice-9/buffered-input.scm
deleted file mode 100644
index 1cfc2ea76..000000000
--- a/ice-9/buffered-input.scm
+++ /dev/null
@@ -1,132 +0,0 @@
-;;;; buffered-input.scm --- construct a port from a buffered input reader
-;;;;
-;;;; Copyright (C) 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-
-(define-module (ice-9 buffered-input)
- #:export (make-buffered-input-port
- make-line-buffered-input-port
- set-buffered-input-continuation?!))
-
-;; @code{buffered-input-continuation?} is a property of the ports
-;; created by @code{make-line-buffered-input-port} that stores the
-;; read continuation flag for each such port.
-(define buffered-input-continuation? (make-object-property))
-
-(define (set-buffered-input-continuation?! port val)
- "Set the read continuation flag for @var{port} to @var{val}.
-
-See @code{make-buffered-input-port} for the meaning and use of this
-flag."
- (set! (buffered-input-continuation? port) val))
-
-(define (make-buffered-input-port reader)
- "Construct a line-buffered input port from the specified @var{reader}.
-@var{reader} should be a procedure of one argument that somehow reads
-a chunk of input and returns it as a string.
-
-The port created by @code{make-buffered-input-port} does @emph{not}
-interpolate any additional characters between the strings returned by
-@var{reader}.
-
-@var{reader} should take a boolean @var{continuation?} argument.
-@var{continuation?} indicates whether @var{reader} is being called to
-start a logically new read operation (in which case
-@var{continuation?} is @code{#f}) or to continue a read operation for
-which some input has already been read (in which case
-@var{continuation?} is @code{#t}). Some @var{reader} implementations
-use the @var{continuation?} argument to determine what prompt to
-display to the user.
-
-The new/continuation distinction is largely an application-level
-concept: @code{set-buffered-input-continuation?!} allows an
-application to specify when a read operation is considered to be new.
-But note that if there is non-whitespace data already buffered in the
-port when a new read operation starts, this data will be read before
-the first call to @var{reader}, and so @var{reader} will be called
-with @var{continuation?} set to @code{#t}."
- (let ((read-string "")
- (string-index -1))
- (letrec ((get-character
- (lambda ()
- (cond
- ((eof-object? read-string)
- read-string)
- ((>= string-index (string-length read-string))
- (set! string-index -1)
- (get-character))
- ((= string-index -1)
- (set! read-string (reader (buffered-input-continuation? port)))
- (set! string-index 0)
- (if (not (eof-object? read-string))
- (get-character)
- read-string))
- (else
- (let ((res (string-ref read-string string-index)))
- (set! string-index (+ 1 string-index))
- (if (not (char-whitespace? res))
- (set! (buffered-input-continuation? port) #t))
- res)))))
- (port #f))
- (set! port (make-soft-port (vector #f #f #f get-character #f) "r"))
- (set! (buffered-input-continuation? port) #f)
- port)))
-
-(define (make-line-buffered-input-port reader)
- "Construct a line-buffered input port from the specified @var{reader}.
-@var{reader} should be a procedure of one argument that somehow reads
-a line of input and returns it as a string @emph{without} the
-terminating newline character.
-
-The port created by @code{make-line-buffered-input-port} automatically
-interpolates a newline character after each string returned by
-@var{reader}.
-
-@var{reader} should take a boolean @var{continuation?} argument. For
-the meaning and use of this argument, see
-@code{make-buffered-input-port}."
- (make-buffered-input-port (lambda (continuation?)
- (let ((str (reader continuation?)))
- (if (eof-object? str)
- str
- (string-append str "\n"))))))
-
-;;; buffered-input.scm ends here
diff --git a/ice-9/calling.scm b/ice-9/calling.scm
deleted file mode 100644
index 7785391bd..000000000
--- a/ice-9/calling.scm
+++ /dev/null
@@ -1,351 +0,0 @@
-;;;; calling.scm --- Calling Conventions
-;;;;
-;;;; Copyright (C) 1995, 1996, 1997, 2000, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-(define-module (ice-9 calling)
- :export-syntax (with-excursion-function
- with-getter-and-setter
- with-getter
- with-delegating-getter-and-setter
- with-excursion-getter-and-setter
- with-configuration-getter-and-setter
- with-delegating-configuration-getter-and-setter
- let-with-configuration-getter-and-setter))
-
-;;;;
-;;;
-;;; This file contains a number of macros that support
-;;; common calling conventions.
-
-;;;
-;;; with-excursion-function <vars> proc
-;;; <vars> is an unevaluated list of names that are bound in the caller.
-;;; proc is a procedure, called:
-;;; (proc excursion)
-;;;
-;;; excursion is a procedure isolates all changes to <vars>
-;;; in the dynamic scope of the call to proc. In other words,
-;;; the values of <vars> are saved when proc is entered, and when
-;;; proc returns, those values are restored. Values are also restored
-;;; entering and leaving the call to proc non-locally, such as using
-;;; call-with-current-continuation, error, or throw.
-;;;
-(defmacro with-excursion-function (vars proc)
- `(,proc ,(excursion-function-syntax vars)))
-
-
-
-;;; with-getter-and-setter <vars> proc
-;;; <vars> is an unevaluated list of names that are bound in the caller.
-;;; proc is a procedure, called:
-;;; (proc getter setter)
-;;;
-;;; getter and setter are procedures used to access
-;;; or modify <vars>.
-;;;
-;;; setter, called with keywords arguments, modifies the named
-;;; values. If "foo" and "bar" are among <vars>, then:
-;;;
-;;; (setter :foo 1 :bar 2)
-;;; == (set! foo 1 bar 2)
-;;;
-;;; getter, called with just keywords, returns
-;;; a list of the corresponding values. For example,
-;;; if "foo" and "bar" are among the <vars>, then
-;;;
-;;; (getter :foo :bar)
-;;; => (<value-of-foo> <value-of-bar>)
-;;;
-;;; getter, called with no arguments, returns a list of all accepted
-;;; keywords and the corresponding values. If "foo" and "bar" are
-;;; the *only* <vars>, then:
-;;;
-;;; (getter)
-;;; => (:foo <value-of-bar> :bar <value-of-foo>)
-;;;
-;;; The unusual calling sequence of a getter supports too handy
-;;; idioms:
-;;;
-;;; (apply setter (getter)) ;; save and restore
-;;;
-;;; (apply-to-args (getter :foo :bar) ;; fetch and bind
-;;; (lambda (foo bar) ....))
-;;;
-;;; ;; [ "apply-to-args" is just like two-argument "apply" except that it
-;;; ;; takes its arguments in a different order.
-;;;
-;;;
-(defmacro with-getter-and-setter (vars proc)
- `(,proc ,@ (getter-and-setter-syntax vars)))
-
-;;; with-getter vars proc
-;;; A short-hand for a call to with-getter-and-setter.
-;;; The procedure is called:
-;;; (proc getter)
-;;;
-(defmacro with-getter (vars proc)
- `(,proc ,(car (getter-and-setter-syntax vars))))
-
-
-;;; with-delegating-getter-and-setter <vars> get-delegate set-delegate proc
-;;; Compose getters and setters.
-;;;
-;;; <vars> is an unevaluated list of names that are bound in the caller.
-;;;
-;;; get-delegate is called by the new getter to extend the set of
-;;; gettable variables beyond just <vars>
-;;; set-delegate is called by the new setter to extend the set of
-;;; gettable variables beyond just <vars>
-;;;
-;;; proc is a procedure that is called
-;;; (proc getter setter)
-;;;
-(defmacro with-delegating-getter-and-setter (vars get-delegate set-delegate proc)
- `(,proc ,@ (delegating-getter-and-setter-syntax vars get-delegate set-delegate)))
-
-
-;;; with-excursion-getter-and-setter <vars> proc
-;;; <vars> is an unevaluated list of names that are bound in the caller.
-;;; proc is called:
-;;;
-;;; (proc excursion getter setter)
-;;;
-;;; See also:
-;;; with-getter-and-setter
-;;; with-excursion-function
-;;;
-(defmacro with-excursion-getter-and-setter (vars proc)
- `(,proc ,(excursion-function-syntax vars)
- ,@ (getter-and-setter-syntax vars)))
-
-
-(define (excursion-function-syntax vars)
- (let ((saved-value-names (map gensym vars))
- (tmp-var-name (gensym "temp"))
- (swap-fn-name (gensym "swap"))
- (thunk-name (gensym "thunk")))
- `(lambda (,thunk-name)
- (letrec ((,tmp-var-name #f)
- (,swap-fn-name
- (lambda () ,@ (map (lambda (n sn)
- `(begin (set! ,tmp-var-name ,n)
- (set! ,n ,sn)
- (set! ,sn ,tmp-var-name)))
- vars saved-value-names)))
- ,@ (map (lambda (sn n) `(,sn ,n)) saved-value-names vars))
- (dynamic-wind
- ,swap-fn-name
- ,thunk-name
- ,swap-fn-name)))))
-
-
-(define (getter-and-setter-syntax vars)
- (let ((args-name (gensym "args"))
- (an-arg-name (gensym "an-arg"))
- (new-val-name (gensym "new-value"))
- (loop-name (gensym "loop"))
- (kws (map symbol->keyword vars)))
- (list `(lambda ,args-name
- (let ,loop-name ((,args-name ,args-name))
- (if (null? ,args-name)
- ,(if (null? kws)
- ''()
- `(let ((all-vals (,loop-name ',kws)))
- (let ,loop-name ((vals all-vals)
- (kws ',kws))
- (if (null? vals)
- '()
- `(,(car kws) ,(car vals) ,@(,loop-name (cdr vals) (cdr kws)))))))
- (map (lambda (,an-arg-name)
- (case ,an-arg-name
- ,@ (append
- (map (lambda (kw v) `((,kw) ,v)) kws vars)
- `((else (throw 'bad-get-option ,an-arg-name))))))
- ,args-name))))
-
- `(lambda ,args-name
- (let ,loop-name ((,args-name ,args-name))
- (or (null? ,args-name)
- (null? (cdr ,args-name))
- (let ((,an-arg-name (car ,args-name))
- (,new-val-name (cadr ,args-name)))
- (case ,an-arg-name
- ,@ (append
- (map (lambda (kw v) `((,kw) (set! ,v ,new-val-name))) kws vars)
- `((else (throw 'bad-set-option ,an-arg-name)))))
- (,loop-name (cddr ,args-name)))))))))
-
-(define (delegating-getter-and-setter-syntax vars get-delegate set-delegate)
- (let ((args-name (gensym "args"))
- (an-arg-name (gensym "an-arg"))
- (new-val-name (gensym "new-value"))
- (loop-name (gensym "loop"))
- (kws (map symbol->keyword vars)))
- (list `(lambda ,args-name
- (let ,loop-name ((,args-name ,args-name))
- (if (null? ,args-name)
- (append!
- ,(if (null? kws)
- ''()
- `(let ((all-vals (,loop-name ',kws)))
- (let ,loop-name ((vals all-vals)
- (kws ',kws))
- (if (null? vals)
- '()
- `(,(car kws) ,(car vals) ,@(,loop-name (cdr vals) (cdr kws)))))))
- (,get-delegate))
- (map (lambda (,an-arg-name)
- (case ,an-arg-name
- ,@ (append
- (map (lambda (kw v) `((,kw) ,v)) kws vars)
- `((else (car (,get-delegate ,an-arg-name)))))))
- ,args-name))))
-
- `(lambda ,args-name
- (let ,loop-name ((,args-name ,args-name))
- (or (null? ,args-name)
- (null? (cdr ,args-name))
- (let ((,an-arg-name (car ,args-name))
- (,new-val-name (cadr ,args-name)))
- (case ,an-arg-name
- ,@ (append
- (map (lambda (kw v) `((,kw) (set! ,v ,new-val-name))) kws vars)
- `((else (,set-delegate ,an-arg-name ,new-val-name)))))
- (,loop-name (cddr ,args-name)))))))))
-
-
-
-
-;;; with-configuration-getter-and-setter <vars-etc> proc
-;;;
-;;; Create a getter and setter that can trigger arbitrary computation.
-;;;
-;;; <vars-etc> is a list of variable specifiers, explained below.
-;;; proc is called:
-;;;
-;;; (proc getter setter)
-;;;
-;;; Each element of the <vars-etc> list is of the form:
-;;;
-;;; (<var> getter-hook setter-hook)
-;;;
-;;; Both hook elements are evaluated; the variable name is not.
-;;; Either hook may be #f or procedure.
-;;;
-;;; A getter hook is a thunk that returns a value for the corresponding
-;;; variable. If omitted (#f is passed), the binding of <var> is
-;;; returned.
-;;;
-;;; A setter hook is a procedure of one argument that accepts a new value
-;;; for the corresponding variable. If omitted, the binding of <var>
-;;; is simply set using set!.
-;;;
-(defmacro with-configuration-getter-and-setter (vars-etc proc)
- `((lambda (simpler-get simpler-set body-proc)
- (with-delegating-getter-and-setter ()
- simpler-get simpler-set body-proc))
-
- (lambda (kw)
- (case kw
- ,@(map (lambda (v) `((,(symbol->keyword (car v)))
- ,(cond
- ((cadr v) => list)
- (else `(list ,(car v))))))
- vars-etc)))
-
- (lambda (kw new-val)
- (case kw
- ,@(map (lambda (v) `((,(symbol->keyword (car v)))
- ,(cond
- ((caddr v) => (lambda (proc) `(,proc new-val)))
- (else `(set! ,(car v) new-val)))))
- vars-etc)))
-
- ,proc))
-
-(defmacro with-delegating-configuration-getter-and-setter (vars-etc delegate-get delegate-set proc)
- `((lambda (simpler-get simpler-set body-proc)
- (with-delegating-getter-and-setter ()
- simpler-get simpler-set body-proc))
-
- (lambda (kw)
- (case kw
- ,@(append! (map (lambda (v) `((,(symbol->keyword (car v)))
- ,(cond
- ((cadr v) => list)
- (else `(list ,(car v))))))
- vars-etc)
- `((else (,delegate-get kw))))))
-
- (lambda (kw new-val)
- (case kw
- ,@(append! (map (lambda (v) `((,(symbol->keyword (car v)))
- ,(cond
- ((caddr v) => (lambda (proc) `(,proc new-val)))
- (else `(set! ,(car v) new-val)))))
- vars-etc)
- `((else (,delegate-set kw new-val))))))
-
- ,proc))
-
-
-;;; let-configuration-getter-and-setter <vars-etc> proc
-;;;
-;;; This procedure is like with-configuration-getter-and-setter (q.v.)
-;;; except that each element of <vars-etc> is:
-;;;
-;;; (<var> initial-value getter-hook setter-hook)
-;;;
-;;; Unlike with-configuration-getter-and-setter, let-configuration-getter-and-setter
-;;; introduces bindings for the variables named in <vars-etc>.
-;;; It is short-hand for:
-;;;
-;;; (let ((<var1> initial-value-1)
-;;; (<var2> initial-value-2)
-;;; ...)
-;;; (with-configuration-getter-and-setter ((<var1> v1-get v1-set) ...) proc))
-;;;
-(defmacro let-with-configuration-getter-and-setter (vars-etc proc)
- `(let ,(map (lambda (v) `(,(car v) ,(cadr v))) vars-etc)
- (with-configuration-getter-and-setter ,(map (lambda (v) `(,(car v) ,(caddr v) ,(cadddr v))) vars-etc)
- ,proc)))
diff --git a/ice-9/channel.scm b/ice-9/channel.scm
deleted file mode 100644
index 0ca2fcf3a..000000000
--- a/ice-9/channel.scm
+++ /dev/null
@@ -1,195 +0,0 @@
-;;; Guile object channel
-
-;; Copyright (C) 2001 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 program; 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 GUILE.
-;;
-;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;; code from other Free Software Foundation releases into a copy of
-;; GUILE, 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 GUILE, it is your choice
-;; whether to permit this exception to apply to your modifications.
-;; If you do not wish that, delete this exception notice.
-
-;;; Commentary:
-
-;; Now you can use Guile's modules in Emacs Lisp like this:
-;;
-;; (guile-import current-module)
-;; (guile-import module-ref)
-;;
-;; (setq assq (module-ref (current-module) 'assq))
-;; => ("<guile>" %%1%% . "#<primitive-procedure assq>")
-;;
-;; (guile-use-modules (ice-9 documentation))
-;;
-;; (object-documentation assq)
-;; =>
-;; " - primitive: assq key alist
-;; - primitive: assv key alist
-;; - primitive: assoc key alist
-;; Fetches the entry in ALIST that is associated with KEY. To decide
-;; whether the argument KEY matches a particular entry in ALIST,
-;; `assq' compares keys with `eq?', `assv' uses `eqv?' and `assoc'
-;; uses `equal?'. If KEY cannot be found in ALIST (according to
-;; whichever equality predicate is in use), then `#f' is returned.
-;; These functions return the entire alist entry found (i.e. both the
-;; key and the value)."
-;;
-;; Probably we can use GTK in Emacs Lisp. Can anybody try it?
-;;
-;; I have also implemented Guile Scheme mode and Scheme Interaction mode.
-;; Just put the following lines in your ~/.emacs:
-;;
-;; (require 'guile-scheme)
-;; (setq initial-major-mode 'scheme-interaction-mode)
-;;
-;; Currently, the following commands are available:
-;;
-;; M-TAB guile-scheme-complete-symbol
-;; M-C-x guile-scheme-eval-define
-;; C-x C-e guile-scheme-eval-last-sexp
-;; C-c C-b guile-scheme-eval-buffer
-;; C-c C-r guile-scheme-eval-region
-;; C-c : guile-scheme-eval-expression
-;;
-;; I'll write more commands soon, or if you want to hack, please take
-;; a look at the following files:
-;;
-;; guile-core/ice-9/channel.scm ;; object channel
-;; guile-core/emacs/guile.el ;; object adapter
-;; guile-core/emacs/guile-emacs.scm ;; Guile <-> Emacs channels
-;; guile-core/emacs/guile-scheme.el ;; Guile Scheme mode
-;;
-;; As always, there are more than one bugs ;)
-
-;;; Code:
-
-(define-module (ice-9 channel)
- :export (make-object-channel
- channel-open
- channel-print-value
- channel-print-token))
-
-;;;
-;;; Channel type
-;;;
-
-(define channel-type
- (make-record-type 'channel '(stdin stdout printer token-module)))
-
-(define make-channel (record-constructor channel-type))
-
-(define (make-object-channel printer)
- (make-channel (current-input-port)
- (current-output-port)
- printer
- (make-module)))
-
-(define channel-stdin (record-accessor channel-type 'stdin))
-(define channel-stdout (record-accessor channel-type 'stdout))
-(define channel-printer (record-accessor channel-type 'printer))
-(define channel-token-module (record-accessor channel-type 'token-module))
-
-;;;
-;;; Channel
-;;;
-
-(define (channel-open ch)
- (let ((stdin (channel-stdin ch))
- (stdout (channel-stdout ch))
- (printer (channel-printer ch))
- (token-module (channel-token-module ch)))
- (let loop ()
- (catch #t
- (lambda ()
- (channel:prompt stdout)
- (let ((cmd (read stdin)))
- (if (eof-object? cmd)
- (throw 'quit)
- (case cmd
- ((eval)
- (module-use! (current-module) token-module)
- (printer ch (eval (read stdin) (current-module))))
- ((destroy)
- (let ((token (read stdin)))
- (if (module-defined? token-module token)
- (module-remove! token-module token)
- (channel:error stdout "Invalid token: ~S" token))))
- ((quit)
- (throw 'quit))
- (else
- (channel:error stdout "Unknown command: ~S" cmd)))))
- (loop))
- (lambda (key . args)
- (case key
- ((quit) (throw 'quit))
- (else
- (format stdout "exception = ~S\n"
- (list key (apply format #f (cadr args) (caddr args))))
- (loop))))))))
-
-(define (channel-print-value ch val)
- (format (channel-stdout ch) "value = ~S\n" val))
-
-(define (channel-print-token ch val)
- (let* ((token (symbol-append (gensym "%%") '%%))
- (pair (cons token (object->string val))))
- (format (channel-stdout ch) "token = ~S\n" pair)
- (module-define! (channel-token-module ch) token val)))
-
-(define (channel:prompt port)
- (display "channel> " port)
- (force-output port))
-
-(define (channel:error port msg . args)
- (display "ERROR: " port)
- (apply format port msg args)
- (newline port))
-
-;;;
-;;; Guile 1.4 compatibility
-;;;
-
-(define guile:eval eval)
-(define eval
- (if (= (car (procedure-property guile:eval 'arity)) 1)
- (lambda (x e) (guile:eval x))
- guile:eval))
-
-(define object->string
- (if (defined? 'object->string)
- object->string
- (lambda (x) (format #f "~S" x))))
-
-;;; channel.scm ends here
diff --git a/ice-9/common-list.scm b/ice-9/common-list.scm
deleted file mode 100644
index 29fa0e536..000000000
--- a/ice-9/common-list.scm
+++ /dev/null
@@ -1,303 +0,0 @@
-;;;; common-list.scm --- COMMON LISP list functions for Scheme
-;;;;
-;;;; Copyright (C) 1995, 1996, 1997, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-;;; Commentary:
-
-;; These procedures are exported:
-;; (adjoin e l)
-;; (union l1 l2)
-;; (intersection l1 l2)
-;; (set-difference l1 l2)
-;; (reduce-init p init l)
-;; (reduce p l)
-;; (some pred l . rest)
-;; (every pred l . rest)
-;; (notany pred . ls)
-;; (notevery pred . ls)
-;; (count-if pred l)
-;; (find-if pred l)
-;; (member-if pred l)
-;; (remove-if pred l)
-;; (remove-if-not pred l)
-;; (delete-if! pred l)
-;; (delete-if-not! pred l)
-;; (butlast lst n)
-;; (and? . args)
-;; (or? . args)
-;; (has-duplicates? lst)
-;; (pick p l)
-;; (pick-mappings p l)
-;; (uniq l)
-;;
-;; See docstrings for each procedure for more info. See also module
-;; `(srfi srfi-1)' for a complete list handling library.
-
-;;; Code:
-
-(define-module (ice-9 common-list)
- :export (adjoin union intersection set-difference reduce-init reduce
- some every notany notevery count-if find-if member-if remove-if
- remove-if-not delete-if! delete-if-not! butlast and? or?
- has-duplicates? pick pick-mappings uniq))
-
-;;"comlist.scm" Implementation of COMMON LISP list functions for Scheme
-; Copyright (C) 1991, 1993, 1995 Aubrey Jaffer.
-;
-;Permission to copy this software, to redistribute it, and to use it
-;for any purpose is granted, subject to the following restrictions and
-;understandings.
-;
-;1. Any copy made of this software must include this copyright notice
-;in full.
-;
-;2. I have made no warrantee or representation that the operation of
-;this software will be error-free, and I am under no obligation to
-;provide any services, by way of maintenance, update, or otherwise.
-;
-;3. In conjunction with products arising from the use of this
-;material, there shall be no use of my name in any advertising,
-;promotional, or sales literature without prior written consent in
-;each case.
-
-(define (adjoin e l)
- "Return list L, possibly with element E added if it is not already in L."
- (if (memq e l) l (cons e l)))
-
-(define (union l1 l2)
- "Return a new list that is the union of L1 and L2.
-Elements that occur in both lists occur only once in
-the result list."
- (cond ((null? l1) l2)
- ((null? l2) l1)
- (else (union (cdr l1) (adjoin (car l1) l2)))))
-
-(define (intersection l1 l2)
- "Return a new list that is the intersection of L1 and L2.
-Only elements that occur in both lists occur in the result list."
- (if (null? l2) l2
- (let loop ((l1 l1) (result '()))
- (cond ((null? l1) (reverse! result))
- ((memv (car l1) l2) (loop (cdr l1) (cons (car l1) result)))
- (else (loop (cdr l1) result))))))
-
-(define (set-difference l1 l2)
- "Return elements from list L1 that are not in list L2."
- (let loop ((l1 l1) (result '()))
- (cond ((null? l1) (reverse! result))
- ((memv (car l1) l2) (loop (cdr l1) result))
- (else (loop (cdr l1) (cons (car l1) result))))))
-
-(define (reduce-init p init l)
- "Same as `reduce' except it implicitly inserts INIT at the start of L."
- (if (null? l)
- init
- (reduce-init p (p init (car l)) (cdr l))))
-
-(define (reduce p l)
- "Combine all the elements of sequence L using a binary operation P.
-The combination is left-associative. For example, using +, one can
-add up all the elements. `reduce' allows you to apply a function which
-accepts only two arguments to more than 2 objects. Functional
-programmers usually refer to this as foldl."
- (cond ((null? l) l)
- ((null? (cdr l)) (car l))
- (else (reduce-init p (car l) (cdr l)))))
-
-(define (some pred l . rest)
- "PRED is a boolean function of as many arguments as there are list
-arguments to `some', i.e., L plus any optional arguments. PRED is
-applied to successive elements of the list arguments in order. As soon
-as one of these applications returns a true value, return that value.
-If no application returns a true value, return #f.
-All the lists should have the same length."
- (cond ((null? rest)
- (let mapf ((l l))
- (and (not (null? l))
- (or (pred (car l)) (mapf (cdr l))))))
- (else (let mapf ((l l) (rest rest))
- (and (not (null? l))
- (or (apply pred (car l) (map car rest))
- (mapf (cdr l) (map cdr rest))))))))
-
-(define (every pred l . rest)
- "Return #t iff every application of PRED to L, etc., returns #t.
-Analogous to `some' except it returns #t if every application of
-PRED is #t and #f otherwise."
- (cond ((null? rest)
- (let mapf ((l l))
- (or (null? l)
- (and (pred (car l)) (mapf (cdr l))))))
- (else (let mapf ((l l) (rest rest))
- (or (null? l)
- (and (apply pred (car l) (map car rest))
- (mapf (cdr l) (map cdr rest))))))))
-
-(define (notany pred . ls)
- "Return #t iff every application of PRED to L, etc., returns #f.
-Analogous to some but returns #t if no application of PRED returns a
-true value or #f as soon as any one does."
- (not (apply some pred ls)))
-
-(define (notevery pred . ls)
- "Return #t iff there is an application of PRED to L, etc., that returns #f.
-Analogous to some but returns #t as soon as an application of PRED returns #f,
-or #f otherwise."
- (not (apply every pred ls)))
-
-(define (count-if pred l)
- "Return the number of elements in L for which (PRED element) returns true."
- (let loop ((n 0) (l l))
- (cond ((null? l) n)
- ((pred (car l)) (loop (+ n 1) (cdr l)))
- (else (loop n (cdr l))))))
-
-(define (find-if pred l)
- "Search for the first element in L for which (PRED element) returns true.
-If found, return that element, otherwise return #f."
- (cond ((null? l) #f)
- ((pred (car l)) (car l))
- (else (find-if pred (cdr l)))))
-
-(define (member-if pred l)
- "Return the first sublist of L for whose car PRED is true."
- (cond ((null? l) #f)
- ((pred (car l)) l)
- (else (member-if pred (cdr l)))))
-
-(define (remove-if pred l)
- "Remove all elements from L where (PRED element) is true.
-Return everything that's left."
- (let loop ((l l) (result '()))
- (cond ((null? l) (reverse! result))
- ((pred (car l)) (loop (cdr l) result))
- (else (loop (cdr l) (cons (car l) result))))))
-
-(define (remove-if-not pred l)
- "Remove all elements from L where (PRED element) is #f.
-Return everything that's left."
- (let loop ((l l) (result '()))
- (cond ((null? l) (reverse! result))
- ((not (pred (car l))) (loop (cdr l) result))
- (else (loop (cdr l) (cons (car l) result))))))
-
-(define (delete-if! pred l)
- "Destructive version of `remove-if'."
- (let delete-if ((l l))
- (cond ((null? l) '())
- ((pred (car l)) (delete-if (cdr l)))
- (else
- (set-cdr! l (delete-if (cdr l)))
- l))))
-
-(define (delete-if-not! pred l)
- "Destructive version of `remove-if-not'."
- (let delete-if-not ((l l))
- (cond ((null? l) '())
- ((not (pred (car l))) (delete-if-not (cdr l)))
- (else
- (set-cdr! l (delete-if-not (cdr l)))
- l))))
-
-(define (butlast lst n)
- "Return all but the last N elements of LST."
- (letrec ((l (- (length lst) n))
- (bl (lambda (lst n)
- (cond ((null? lst) lst)
- ((positive? n)
- (cons (car lst) (bl (cdr lst) (+ -1 n))))
- (else '())))))
- (bl lst (if (negative? n)
- (error "negative argument to butlast" n)
- l))))
-
-(define (and? . args)
- "Return #t iff all of ARGS are true."
- (cond ((null? args) #t)
- ((car args) (apply and? (cdr args)))
- (else #f)))
-
-(define (or? . args)
- "Return #t iff any of ARGS is true."
- (cond ((null? args) #f)
- ((car args) #t)
- (else (apply or? (cdr args)))))
-
-(define (has-duplicates? lst)
- "Return #t iff 2 members of LST are equal?, else #f."
- (cond ((null? lst) #f)
- ((member (car lst) (cdr lst)) #t)
- (else (has-duplicates? (cdr lst)))))
-
-(define (pick p l)
- "Apply P to each element of L, returning a list of elts
-for which P returns a non-#f value."
- (let loop ((s '())
- (l l))
- (cond
- ((null? l) s)
- ((p (car l)) (loop (cons (car l) s) (cdr l)))
- (else (loop s (cdr l))))))
-
-(define (pick-mappings p l)
- "Apply P to each element of L, returning a list of the
-non-#f return values of P."
- (let loop ((s '())
- (l l))
- (cond
- ((null? l) s)
- ((p (car l)) => (lambda (mapping) (loop (cons mapping s) (cdr l))))
- (else (loop s (cdr l))))))
-
-(define (uniq l)
- "Return a list containing elements of L, with duplicates removed."
- (let loop ((acc '())
- (l l))
- (if (null? l)
- (reverse! acc)
- (loop (if (memq (car l) acc)
- acc
- (cons (car l) acc))
- (cdr l)))))
-
-;;; common-list.scm ends here
diff --git a/ice-9/compile-psyntax.scm b/ice-9/compile-psyntax.scm
deleted file mode 100644
index b96e8111b..000000000
--- a/ice-9/compile-psyntax.scm
+++ /dev/null
@@ -1,25 +0,0 @@
-(use-modules (ice-9 syncase))
-
-;; XXX - We need to be inside (ice-9 syncase) since psyntax.ss calls
-;; `eval' int he `interaction-environment' aka the current module and
-;; it expects to have `andmap' there. The reason for this escapes me
-;; at the moment.
-;;
-(define-module (ice-9 syncase))
-
-(define source (list-ref (command-line) 1))
-(define target (list-ref (command-line) 2))
-
-(let ((in (open-input-file source))
- (out (open-output-file (string-append target ".tmp"))))
- (let loop ((x (read in)))
- (if (eof-object? x)
- (begin
- (close-port out)
- (close-port in))
- (begin
- (write (sc-expand3 x 'c '(compile load eval)) out)
- (newline out)
- (loop (read in))))))
-
-(system (format #f "mv -f ~s.tmp ~s" target target))
diff --git a/ice-9/debug.scm b/ice-9/debug.scm
deleted file mode 100644
index 41ef0ecce..000000000
--- a/ice-9/debug.scm
+++ /dev/null
@@ -1,159 +0,0 @@
-;;;; Copyright (C) 1996, 1997, 1998, 1999, 2001 Free Software Foundation
-;;;;
-;;;; 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-;;;; The author can be reached at djurfeldt@nada.kth.se
-;;;; Mikael Djurfeldt, SANS/NADA KTH, 10044 STOCKHOLM, SWEDEN
-;;;;
-
-
-(define-module (ice-9 debug)
- :export (frame-number->index trace untrace trace-stack untrace-stack))
-
-
-;;; {Misc}
-;;;
-(define (frame-number->index n . stack)
- (let ((stack (if (null? stack)
- (fluid-ref the-last-stack)
- (car stack))))
- (if (memq 'backwards (debug-options))
- n
- (- (stack-length stack) n 1))))
-
-
-;;; {Trace}
-;;;
-;;; This code is just an experimental prototype (e. g., it is not
-;;; thread safe), but since it's at the same time useful, it's
-;;; included anyway.
-;;;
-(define traced-procedures '())
-
-(define (trace . args)
- (if (null? args)
- (nameify traced-procedures)
- (begin
- (for-each (lambda (proc)
- (if (not (procedure? proc))
- (error "trace: Wrong type argument:" proc))
- (set-procedure-property! proc 'trace #t)
- (if (not (memq proc traced-procedures))
- (set! traced-procedures
- (cons proc traced-procedures))))
- args)
- (trap-set! apply-frame-handler trace-entry)
- (trap-set! exit-frame-handler trace-exit)
- ;; We used to reset `trace-level' here to 0, but this is wrong
- ;; if `trace' itself is being traced, since `trace-exit' will
- ;; then decrement `trace-level' to -1! It shouldn't actually
- ;; be necessary to set `trace-level' here at all.
- (debug-enable 'trace)
- (nameify args))))
-
-(define (untrace . args)
- (if (and (null? args)
- (not (null? traced-procedures)))
- (apply untrace traced-procedures)
- (begin
- (for-each (lambda (proc)
- (set-procedure-property! proc 'trace #f)
- (set! traced-procedures (delq! proc traced-procedures)))
- args)
- (if (null? traced-procedures)
- (debug-disable 'trace))
- (nameify args))))
-
-(define (nameify ls)
- (map (lambda (proc)
- (let ((name (procedure-name proc)))
- (or name proc)))
- ls))
-
-(define trace-level 0)
-(add-hook! abort-hook (lambda () (set! trace-level 0)))
-
-(define traced-stack-ids (list 'repl-stack))
-(define trace-all-stacks? #f)
-
-(define (trace-stack id)
- "Add ID to the set of stack ids for which tracing is active.
-If `#t' is in this set, tracing is active regardless of stack context.
-To remove ID again, use `untrace-stack'. If you add the same ID twice
-using `trace-stack', you will need to remove it twice."
- (set! traced-stack-ids (cons id traced-stack-ids))
- (set! trace-all-stacks? (memq #t traced-stack-ids)))
-
-(define (untrace-stack id)
- "Remove ID from the set of stack ids for which tracing is active."
- (set! traced-stack-ids (delq1! id traced-stack-ids))
- (set! trace-all-stacks? (memq #t traced-stack-ids)))
-
-(define (trace-entry key cont tail)
- (if (or trace-all-stacks?
- (memq (stack-id cont) traced-stack-ids))
- (let ((cep (current-error-port))
- (frame (last-stack-frame cont)))
- (if (not tail)
- (set! trace-level (+ trace-level 1)))
- (let indent ((n trace-level))
- (cond ((> n 1) (display "| " cep) (indent (- n 1)))))
- (display-application frame cep)
- (newline cep)))
- ;; It's not necessary to call the continuation since
- ;; execution will continue if the handler returns
- ;(cont #f)
- )
-
-(define (trace-exit key cont retval)
- (if (or trace-all-stacks?
- (memq (stack-id cont) traced-stack-ids))
- (let ((cep (current-error-port)))
- (set! trace-level (- trace-level 1))
- (let indent ((n trace-level))
- (cond ((> n 0) (display "| " cep) (indent (- n 1)))))
- (write retval cep)
- (newline cep))))
-
-
-;;; A fix to get the error handling working together with the module system.
-;;;
-;;; XXX - Still needed?
-(module-set! the-root-module 'debug-options debug-options)
diff --git a/ice-9/debugger.scm b/ice-9/debugger.scm
deleted file mode 100644
index e65da390b..000000000
--- a/ice-9/debugger.scm
+++ /dev/null
@@ -1,841 +0,0 @@
-;;;; Guile Debugger
-
-;;; Copyright (C) 1999, 2001 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, 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 GUILE.
-;;;
-;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;; code from other Free Software Foundation releases into a copy of
-;;; GUILE, 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 GUILE, it is your choice
-;;; whether to permit this exception to apply to your modifications.
-;;; If you do not wish that, delete this exception notice.
-
-(define-module (ice-9 debugger)
- :use-module (ice-9 debug)
- :use-module (ice-9 format)
- :export (debug)
- :no-backtrace
- )
-
-(if (memq 'readline *features*)
- (define-module (ice-9 debugger)
- :use-module (ice-9 readline)))
-
-
-(define debugger-prompt "debug> ")
-
-(define (debug)
- (let ((stack (fluid-ref the-last-stack)))
- (if stack
- (let ((state (make-state stack 0)))
- (display "This is the Guile debugger; type \"help\" for help.")
- (newline)
- (display "There are ")
- (write (stack-length stack))
- (display " frames on the stack.")
- (newline)
- (newline)
- (write-state-short state)
- (read-and-dispatch-commands state (current-input-port)))
- (display "Nothing to debug.\n"))))
-
-(define (debugger-handler key . args)
- (case key
- ((exit-debugger) #f)
- ((signal)
- ;; Restore stack
- (fluid-set! the-last-stack (fluid-ref before-signal-stack))
- (apply display-error #f (current-error-port) args))
- (else
- (display "Internal debugger error:\n")
- (save-stack debugger-handler)
- (apply throw key args)))
- (throw 'exit-debugger)) ;Pop the stack
-
-(define (read-and-dispatch-commands state port)
- (catch 'exit-debugger
- (lambda ()
- (lazy-catch #t
- (lambda ()
- (with-fluids ((last-command #f))
- (let loop ((state state))
- (loop (read-and-dispatch-command state port)))))
- debugger-handler))
- (lambda args
- *unspecified*)))
-
-(define (read-and-dispatch-command state port)
- (if (using-readline?)
- (set-readline-prompt! debugger-prompt)
- (display debugger-prompt))
- (force-output) ;This should not be necessary...
- (let ((token (read-token port)))
- (cond ((eof-object? token)
- (throw 'exit-debugger))
- ((not token)
- (discard-rest-of-line port)
- (catch-user-errors port (lambda () (run-last-command state))))
- (else
- (or (catch-user-errors port
- (lambda ()
- (dispatch-command token command-table state port)))
- state)))))
-
-(define (run-last-command state)
- (let ((procedure (fluid-ref last-command)))
- (if procedure
- (procedure state)
- state)))
-
-(define (catch-user-errors port thunk)
- (catch 'debugger-user-error
- thunk
- (lambda (key . objects)
- (apply user-warning objects)
- (discard-rest-of-line port)
- #f)))
-
-(define last-command (make-fluid))
-
-(define (user-warning . objects)
- (for-each (lambda (object)
- (display object))
- objects)
- (newline))
-
-(define (user-error . objects)
- (apply throw 'debugger-user-error objects))
-
-;;;; Command dispatch
-
-(define (dispatch-command string table state port)
- (let ((value (command-table-value table string)))
- (if value
- (dispatch-command/value value state port)
- (user-error "Unknown command: " string))))
-
-(define (dispatch-command/value value state port)
- (cond ((command? value)
- (dispatch-command/command value state port))
- ((command-table? value)
- (dispatch-command/table value state port))
- ((list? value)
- (dispatch-command/name value state port))
- (else
- (error "Unrecognized command-table value: " value))))
-
-(define (dispatch-command/command command state port)
- (let ((procedure (command-procedure command))
- (arguments ((command-parser command) port)))
- (let ((procedure (lambda (state) (apply procedure state arguments))))
- (warn-about-extra-args port)
- (fluid-set! last-command procedure)
- (procedure state))))
-
-(define (warn-about-extra-args port)
- ;; **** modify this to show the arguments.
- (let ((char (skip-whitespace port)))
- (cond ((eof-object? char) #f)
- ((char=? #\newline char) (read-char port))
- (else
- (user-warning "Extra arguments at end of line: "
- (read-rest-of-line port))))))
-
-(define (dispatch-command/table table state port)
- (let ((token (read-token port)))
- (if (or (eof-object? token)
- (not token))
- (user-error "Command name too short.")
- (dispatch-command token table state port))))
-
-(define (dispatch-command/name name state port)
- (let ((value (lookup-command name)))
- (cond ((not value)
- (apply user-error "Unknown command name: " name))
- ((command-table? value)
- (apply user-error "Partial command name: " name))
- (else
- (dispatch-command/value value state port)))))
-
-;;;; Command definition
-
-(define (define-command name argument-template documentation procedure)
- (let ((name (canonicalize-command-name name)))
- (add-command name
- (make-command name
- (argument-template->parser argument-template)
- documentation
- procedure)
- command-table)
- name))
-
-(define (define-command-alias name1 name2)
- (let ((name1 (canonicalize-command-name name1)))
- (add-command name1 (canonicalize-command-name name2) command-table)
- name1))
-
-(define (argument-template->parser template)
- ;; Deliberately handles only cases that occur in "commands.scm".
- (cond ((eq? 'tokens template)
- (lambda (port)
- (let loop ((tokens '()))
- (let ((token (read-token port)))
- (if (or (eof-object? token)
- (not token))
- (list (reverse! tokens))
- (loop (cons token tokens)))))))
- ((null? template)
- (lambda (port)
- '()))
- ((and (pair? template)
- (null? (cdr template))
- (eq? 'object (car template)))
- (lambda (port)
- (list (read port))))
- ((and (pair? template)
- (equal? ''optional (car template))
- (pair? (cdr template))
- (null? (cddr template)))
- (case (cadr template)
- ((token)
- (lambda (port)
- (let ((token (read-token port)))
- (if (or (eof-object? token)
- (not token))
- (list #f)
- (list token)))))
- ((exact-integer)
- (lambda (port)
- (list (parse-optional-exact-integer port))))
- ((exact-nonnegative-integer)
- (lambda (port)
- (list (parse-optional-exact-nonnegative-integer port))))
- ((object)
- (lambda (port)
- (list (parse-optional-object port))))
- (else
- (error "Malformed argument template: " template))))
- (else
- (error "Malformed argument template: " template))))
-
-(define (parse-optional-exact-integer port)
- (let ((object (parse-optional-object port)))
- (if (or (not object)
- (and (integer? object)
- (exact? object)))
- object
- (user-error "Argument not an exact integer: " object))))
-
-(define (parse-optional-exact-nonnegative-integer port)
- (let ((object (parse-optional-object port)))
- (if (or (not object)
- (and (integer? object)
- (exact? object)
- (not (negative? object))))
- object
- (user-error "Argument not an exact non-negative integer: " object))))
-
-(define (parse-optional-object port)
- (let ((terminator (skip-whitespace port)))
- (if (or (eof-object? terminator)
- (eq? #\newline terminator))
- #f
- (let ((object (read port)))
- (if (eof-object? object)
- #f
- object)))))
-
-;;;; Command tables
-
-(define (lookup-command name)
- (let loop ((table command-table) (strings name))
- (let ((value (command-table-value table (car strings))))
- (cond ((or (not value) (null? (cdr strings))) value)
- ((command-table? value) (loop value (cdr strings)))
- (else #f)))))
-
-(define (command-table-value table string)
- (let ((entry (command-table-entry table string)))
- (and entry
- (caddr entry))))
-
-(define (command-table-entry table string)
- (let loop ((entries (command-table-entries table)))
- (and (not (null? entries))
- (let ((entry (car entries)))
- (if (and (<= (cadr entry)
- (string-length string)
- (string-length (car entry)))
- (= (string-length string)
- (match-strings (car entry) string)))
- entry
- (loop (cdr entries)))))))
-
-(define (match-strings s1 s2)
- (let ((n (min (string-length s1) (string-length s2))))
- (let loop ((i 0))
- (cond ((= i n) i)
- ((char=? (string-ref s1 i) (string-ref s2 i)) (loop (+ i 1)))
- (else i)))))
-
-(define (write-command-name name)
- (display (car name))
- (for-each (lambda (string)
- (write-char #\space)
- (display string))
- (cdr name)))
-
-(define (add-command name value table)
- (let loop ((strings name) (table table))
- (let ((entry
- (or (let loop ((entries (command-table-entries table)))
- (and (not (null? entries))
- (if (string=? (car strings) (caar entries))
- (car entries)
- (loop (cdr entries)))))
- (let ((entry (list (car strings) #f #f)))
- (let ((entries
- (let ((entries (command-table-entries table)))
- (if (or (null? entries)
- (string<? (car strings) (caar entries)))
- (cons entry entries)
- (begin
- (let loop ((prev entries) (this (cdr entries)))
- (if (or (null? this)
- (string<? (car strings) (caar this)))
- (set-cdr! prev (cons entry this))
- (loop this (cdr this))))
- entries)))))
- (compute-string-abbreviations! entries)
- (set-command-table-entries! table entries))
- entry))))
- (if (null? (cdr strings))
- (set-car! (cddr entry) value)
- (loop (cdr strings)
- (if (command-table? (caddr entry))
- (caddr entry)
- (let ((table (make-command-table '())))
- (set-car! (cddr entry) table)
- table)))))))
-
-(define (canonicalize-command-name name)
- (cond ((and (string? name)
- (not (string-null? name)))
- (list name))
- ((let loop ((name name))
- (and (pair? name)
- (string? (car name))
- (not (string-null? (car name)))
- (or (null? (cdr name))
- (loop (cdr name)))))
- name)
- (else
- (error "Illegal command name: " name))))
-
-(define (compute-string-abbreviations! entries)
- (let loop ((entries entries) (index 0))
- (let ((groups '()))
- (for-each
- (lambda (entry)
- (let* ((char (string-ref (car entry) index))
- (group (assv char groups)))
- (if group
- (set-cdr! group (cons entry (cdr group)))
- (set! groups
- (cons (list char entry)
- groups)))))
- entries)
- (for-each
- (lambda (group)
- (let ((index (+ index 1)))
- (if (null? (cddr group))
- (set-car! (cdadr group) index)
- (loop (let ((entry
- (let loop ((entries (cdr group)))
- (and (not (null? entries))
- (if (= index (string-length (caar entries)))
- (car entries)
- (loop (cdr entries)))))))
- (if entry
- (begin
- (set-car! (cdr entry) index)
- (delq entry (cdr group)))
- (cdr group)))
- index))))
- groups))))
-
-;;;; Data structures
-
-(define command-table-rtd (make-record-type "command-table" '(entries)))
-(define make-command-table (record-constructor command-table-rtd '(entries)))
-(define command-table? (record-predicate command-table-rtd))
-(define command-table-entries (record-accessor command-table-rtd 'entries))
-(define set-command-table-entries!
- (record-modifier command-table-rtd 'entries))
-
-(define command-rtd
- (make-record-type "command"
- '(name parser documentation procedure)))
-
-(define make-command
- (record-constructor command-rtd
- '(name parser documentation procedure)))
-
-(define command? (record-predicate command-rtd))
-(define command-name (record-accessor command-rtd 'name))
-(define command-parser (record-accessor command-rtd 'parser))
-(define command-documentation (record-accessor command-rtd 'documentation))
-(define command-procedure (record-accessor command-rtd 'procedure))
-
-(define state-rtd (make-record-type "debugger-state" '(stack index)))
-(define state? (record-predicate state-rtd))
-(define make-state (record-constructor state-rtd '(stack index)))
-(define state-stack (record-accessor state-rtd 'stack))
-(define state-index (record-accessor state-rtd 'index))
-
-(define (new-state-index state index)
- (make-state (state-stack state) index))
-
-;;;; Character parsing
-
-(define (read-token port)
- (letrec
- ((loop
- (lambda (chars)
- (let ((char (peek-char port)))
- (cond ((eof-object? char)
- (do-eof char chars))
- ((char=? #\newline char)
- (do-eot chars))
- ((char-whitespace? char)
- (do-eot chars))
- ((char=? #\# char)
- (read-char port)
- (let ((terminator (skip-comment port)))
- (if (eof-object? char)
- (do-eof char chars)
- (do-eot chars))))
- (else
- (read-char port)
- (loop (cons char chars)))))))
- (do-eof
- (lambda (eof chars)
- (if (null? chars)
- eof
- (do-eot chars))))
- (do-eot
- (lambda (chars)
- (if (null? chars)
- #f
- (list->string (reverse! chars))))))
- (skip-whitespace port)
- (loop '())))
-
-(define (skip-whitespace port)
- (let ((char (peek-char port)))
- (cond ((or (eof-object? char)
- (char=? #\newline char))
- char)
- ((char-whitespace? char)
- (read-char port)
- (skip-whitespace port))
- ((char=? #\# char)
- (read-char port)
- (skip-comment port))
- (else char))))
-
-(define (skip-comment port)
- (let ((char (peek-char port)))
- (if (or (eof-object? char)
- (char=? #\newline char))
- char
- (begin
- (read-char port)
- (skip-comment port)))))
-
-(define (read-rest-of-line port)
- (let loop ((chars '()))
- (let ((char (read-char port)))
- (if (or (eof-object? char)
- (char=? #\newline char))
- (list->string (reverse! chars))
- (loop (cons char chars))))))
-
-(define (discard-rest-of-line port)
- (let loop ()
- (if (not (let ((char (read-char port)))
- (or (eof-object? char)
- (char=? #\newline char))))
- (loop))))
-
-;;;; Commands
-
-(define command-table (make-command-table '()))
-
-(define-command "help" 'tokens
- "Type \"help\" followed by a command name for full documentation."
- (lambda (state tokens)
- (let loop ((name (if (null? tokens) '("help") tokens)))
- (let ((value (lookup-command name)))
- (cond ((not value)
- (write-command-name name)
- (display " is not a known command name.")
- (newline))
- ((command? value)
- (display (command-documentation value))
- (newline)
- (if (equal? '("help") (command-name value))
- (begin
- (display "Available commands are:")
- (newline)
- (for-each (lambda (entry)
- (if (not (list? (caddr entry)))
- (begin
- (display " ")
- (display (car entry))
- (newline))))
- (command-table-entries command-table)))))
- ((command-table? value)
- (display "The \"")
- (write-command-name name)
- (display "\" command requires a subcommand.")
- (newline)
- (display "Available subcommands are:")
- (newline)
- (for-each (lambda (entry)
- (if (not (list? (caddr entry)))
- (begin
- (display " ")
- (write-command-name name)
- (write-char #\space)
- (display (car entry))
- (newline))))
- (command-table-entries value)))
- ((list? value)
- (loop value))
- (else
- (error "Unknown value from lookup-command:" value)))))
- state))
-
-(define-command "frame" '('optional exact-nonnegative-integer)
- "Select and print a stack frame.
-With no argument, print the selected stack frame. (See also \"info frame\").
-An argument specifies the frame to select; it must be a stack-frame number."
- (lambda (state n)
- (let ((state (if n (select-frame-absolute state n) state)))
- (write-state-short state)
- state)))
-
-(define-command "position" '()
- "Display the position of the current expression."
- (lambda (state)
- (let* ((frame (stack-ref (state-stack state) (state-index state)))
- (source (frame-source frame)))
- (if (not source)
- (display "No source available for this frame.")
- (let ((position (source-position source)))
- (if (not position)
- (display "No position information available for this frame.")
- (display-position position)))))
- (newline)
- state))
-
-(define-command "up" '('optional exact-integer)
- "Move N frames up the stack. For positive numbers N, this advances
-toward the outermost frame, to higher frame numbers, to frames
-that have existed longer. N defaults to one."
- (lambda (state n)
- (let ((state (select-frame-relative state (or n 1))))
- (write-state-short state)
- state)))
-
-(define-command "down" '('optional exact-integer)
- "Move N frames down the stack. For positive numbers N, this
-advances toward the innermost frame, to lower frame numbers, to
-frames that were created more recently. N defaults to one."
- (lambda (state n)
- (let ((state (select-frame-relative state (- (or n 1)))))
- (write-state-short state)
- state)))
-
-(define (eval-handler key . args)
- (let ((stack (make-stack #t eval-handler)))
- (if (= (length args) 4)
- (apply display-error stack (current-error-port) args)
- ;; We want display-error to be the "final common pathway"
- (catch #t
- (lambda ()
- (apply bad-throw key args))
- (lambda (key . args)
- (apply display-error stack (current-error-port) args)))))
- (throw 'continue))
-
-(define-command "evaluate" '(object)
- "Evaluate an expression.
-The expression must appear on the same line as the command,
-however it may be continued over multiple lines."
- (lambda (state expression)
- (let ((source (frame-source (stack-ref (state-stack state)
- (state-index state)))))
- (if (not source)
- (display "No environment for this frame.\n")
- (catch 'continue
- (lambda ()
- (lazy-catch #t
- (lambda ()
- (let* ((env (memoized-environment source))
- (value (local-eval expression env)))
- (display ";value: ")
- (write value)
- (newline)))
- eval-handler))
- (lambda args args)))
- state)))
-
-(define-command "backtrace" '('optional exact-integer)
- "Print backtrace of all stack frames, or innermost COUNT frames.
-With a negative argument, print outermost -COUNT frames.
-If the number of frames aren't explicitly given, the debug option
-`depth' determines the maximum number of frames printed."
- (lambda (state n-frames)
- (let ((stack (state-stack state)))
- ;; Kludge around lack of call-with-values.
- (let ((values
- (lambda (start end)
- ;;(do ((index start (+ index 1)))
- ;; ((= index end))
- ;;(write-state-short* stack index))
- ;;
- ;; Use builtin backtrace instead:
- (display-backtrace stack
- (current-output-port)
- (if (memq 'backwards (debug-options))
- start
- (- end 1))
- (- end start))
- )))
- (let ((end (stack-length stack)))
- (cond ((not n-frames) ;(>= (abs n-frames) end))
- (values 0 (min end (cadr (memq 'depth (debug-options))))))
- ((>= n-frames 0)
- (values 0 n-frames))
- (else
- (values (+ end n-frames) end))))))
- state))
-
-(define-command "quit" '()
- "Exit the debugger."
- (lambda (state)
- (throw 'exit-debugger)))
-
-(define-command '("info" "frame") '()
- "All about selected stack frame."
- (lambda (state)
- (write-state-long state)
- state))
-
-(define-command '("info" "args") '()
- "Argument variables of current stack frame."
- (lambda (state)
- (let ((index (state-index state)))
- (let ((frame (stack-ref (state-stack state) index)))
- (write-frame-index-long frame)
- (write-frame-args-long frame)))
- state))
-
-(define-command-alias "f" "frame")
-(define-command-alias '("info" "f") '("info" "frame"))
-(define-command-alias "bt" "backtrace")
-(define-command-alias "where" "backtrace")
-(define-command-alias "p" "evaluate")
-(define-command-alias '("info" "stack") "backtrace")
-
-;;;; Command Support
-
-(define (select-frame-absolute state number)
- (new-state-index state
- (frame-number->index
- (let ((end (stack-length (state-stack state))))
- (if (>= number end)
- (- end 1)
- number))
- (state-stack state))))
-
-(define (select-frame-relative state delta)
- (new-state-index state
- (let ((index (+ (state-index state) delta))
- (end (stack-length (state-stack state))))
- (cond ((< index 0) 0)
- ((>= index end) (- end 1))
- (else index)))))
-
-(define (write-state-short state)
- (display "Frame ")
- (write-state-short* (state-stack state) (state-index state)))
-
-(define (write-state-short* stack index)
- (write-frame-index-short stack index)
- (write-char #\space)
- (write-frame-short (stack-ref stack index))
- (newline))
-
-(define (write-frame-index-short stack index)
- (let ((s (number->string (frame-number (stack-ref stack index)))))
- (display s)
- (write-char #\:)
- (write-chars #\space (- 4 (string-length s)))))
-
-(define (write-frame-short frame)
- (if (frame-procedure? frame)
- (write-frame-short/application frame)
- (write-frame-short/expression frame)))
-
-(define (write-frame-short/application frame)
- (write-char #\[)
- (write (let ((procedure (frame-procedure frame)))
- (or (and (procedure? procedure)
- (procedure-name procedure))
- procedure)))
- (if (frame-evaluating-args? frame)
- (display " ...")
- (begin
- (for-each (lambda (argument)
- (write-char #\space)
- (write argument))
- (frame-arguments frame))
- (write-char #\]))))
-
-;;; Use builtin function instead:
-(set! write-frame-short/application
- (lambda (frame)
- (display-application frame (current-output-port) 12)))
-
-(define (write-frame-short/expression frame)
- (write (let* ((source (frame-source frame))
- (copy (source-property source 'copy)))
- (if (pair? copy)
- copy
- (unmemoize source)))))
-
-(define (write-state-long state)
- (let ((index (state-index state)))
- (let ((frame (stack-ref (state-stack state) index)))
- (write-frame-index-long frame)
- (write-frame-long frame))))
-
-(define (write-frame-index-long frame)
- (display "Stack frame: ")
- (write (frame-number frame))
- (if (frame-real? frame)
- (display " (real)"))
- (newline))
-
-(define (write-frame-long frame)
- (if (frame-procedure? frame)
- (write-frame-long/application frame)
- (write-frame-long/expression frame)))
-
-(define (write-frame-long/application frame)
- (display "This frame is an application.")
- (newline)
- (if (frame-source frame)
- (begin
- (display "The corresponding expression is:")
- (newline)
- (display-source frame)
- (newline)))
- (display "The procedure being applied is: ")
- (write (let ((procedure (frame-procedure frame)))
- (or (and (procedure? procedure)
- (procedure-name procedure))
- procedure)))
- (newline)
- (display "The procedure's arguments are")
- (if (frame-evaluating-args? frame)
- (display " being evaluated.")
- (begin
- (display ": ")
- (write (frame-arguments frame))))
- (newline))
-
-(define (display-source frame)
- (let* ((source (frame-source frame))
- (copy (source-property source 'copy)))
- (cond ((source-position source)
- => (lambda (p) (display-position p) (display ":\n"))))
- (display " ")
- (write (or copy (unmemoize source)))))
-
-(define (source-position source)
- (let ((fname (source-property source 'filename))
- (line (source-property source 'line))
- (column (source-property source 'column)))
- (and fname
- (list fname line column))))
-
-(define (display-position pos)
- (format #t "~A:~D:~D" (car pos) (+ 1 (cadr pos)) (+ 1 (caddr pos))))
-
-(define (write-frame-long/expression frame)
- (display "This frame is an evaluation.")
- (newline)
- (display "The expression being evaluated is:")
- (newline)
- (display-source frame)
- (newline))
-
-(define (write-frame-args-long frame)
- (if (frame-procedure? frame)
- (let ((arguments (frame-arguments frame)))
- (let ((n (length arguments)))
- (display "This frame has ")
- (write n)
- (display " argument")
- (if (not (= n 1))
- (display "s"))
- (write-char (if (null? arguments) #\. #\:))
- (newline))
- (for-each (lambda (argument)
- (display " ")
- (write argument)
- (newline))
- arguments))
- (begin
- (display "This frame is an evaluation frame; it has no arguments.")
- (newline))))
-
-(define (write-chars char n)
- (do ((i 0 (+ i 1)))
- ((>= i n))
- (write-char char)))
diff --git a/ice-9/documentation.scm b/ice-9/documentation.scm
deleted file mode 100644
index 1a9e04c5c..000000000
--- a/ice-9/documentation.scm
+++ /dev/null
@@ -1,227 +0,0 @@
-;;;; Copyright (C) 2000,2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-;;; Commentary:
-
-;; * This module exports:
-;;
-;; file-commentary -- a procedure that returns a file's "commentary"
-;;
-;; documentation-files -- a search-list of files using the Guile
-;; Documentation Format Version 2.
-;;
-;; search-documentation-files -- a procedure that takes NAME (a symbol)
-;; and searches `documentation-files' for
-;; associated documentation. optional
-;; arg FILES is a list of filenames to use
-;; instead of `documentation-files'.
-;;
-;; object-documentation -- a procedure that returns its arg's docstring
-;;
-;; * Guile Documentation Format
-;;
-;; Here is the complete and authoritative documentation for the Guile
-;; Documentation Format Version 2:
-;;
-;; HEADER
-;; ^LPROC1
-;; DOCUMENTATION1
-;;
-;; ^LPROC2
-;; DOCUMENTATION2
-;;
-;; ^L...
-;;
-;; The HEADER is completely ignored. The "^L" are formfeeds. PROC1, PROC2
-;; and so on are symbols that name the element documented. DOCUMENTATION1,
-;; DOCUMENTATION2 and so on are the related documentation, w/o any further
-;; formatting. Note that there are two newlines before the next formfeed;
-;; these are discarded when the documentation is read in.
-;;
-;; (Version 1, corresponding to guile-1.4 and prior, is documented as being
-;; not documented anywhere except by this embarrassingly circular comment.)
-;;
-;; * File Commentary
-;;
-;; A file's commentary is the body of text found between comments
-;; ;;; Commentary:
-;; and
-;; ;;; Code:
-;; both of which must be at the beginning of the line. In the result string,
-;; semicolons at the beginning of each line are discarded.
-;;
-;; You can specify to `file-commentary' alternate begin and end strings, and
-;; scrub procedure. Use #t to get default values. For example:
-;;
-;; (file-commentary "documentation.scm")
-;; You should see this text!
-;;
-;; (file-commentary "documentation.scm" "^;;; Code:" "ends here$")
-;; You should see the rest of this file.
-;;
-;; (file-commentary "documentation.scm" #t #t string-upcase)
-;; You should see this text very loudly (note semicolons untouched).
-
-;;; Code:
-
-(define-module (ice-9 documentation)
- :use-module (ice-9 rdelim)
- :export (file-commentary
- documentation-files search-documentation-files
- object-documentation)
- :autoload (ice-9 regex) (match:suffix)
- :no-backtrace)
-
-
-;;
-;; commentary extraction
-;;
-(define default-in-line-re (make-regexp "^;;; Commentary:"))
-(define default-after-line-re (make-regexp "^;;; Code:"))
-(define default-scrub (let ((dirt (make-regexp "^;+")))
- (lambda (line)
- (let ((m (regexp-exec dirt line)))
- (if m (match:suffix m) line)))))
-
-(define (file-commentary filename . cust) ; (IN-LINE-RE AFTER-LINE-RE SCRUB)
- ;; fixme: might be cleaner to use optargs here...
- (let ((in-line-re (if (> 1 (length cust))
- default-in-line-re
- (let ((v (car cust)))
- (cond ((regexp? v) v)
- ((string? v) (make-regexp v))
- (else default-in-line-re)))))
- (after-line-re (if (> 2 (length cust))
- default-after-line-re
- (let ((v (cadr cust)))
- (cond ((regexp? v) v)
- ((string? v) (make-regexp v))
- (else default-after-line-re)))))
- (scrub (if (> 3 (length cust))
- default-scrub
- (let ((v (caddr cust)))
- (cond ((procedure? v) v)
- (else default-scrub)))))
- (port (open-input-file filename)))
- (let loop ((line (read-delimited "\n" port))
- (doc "")
- (parse-state 'before))
- (if (or (eof-object? line) (eq? 'after parse-state))
- doc
- (let ((new-state
- (cond ((regexp-exec in-line-re line) 'in)
- ((regexp-exec after-line-re line) 'after)
- (else parse-state))))
- (if (eq? 'after new-state)
- doc
- (loop (read-delimited "\n" port)
- (if (and (eq? 'in new-state) (eq? 'in parse-state))
- (string-append doc (scrub line) "\n")
- doc)
- new-state)))))))
-
-
-
-;;
-;; documentation-files is the list of places to look for documentation
-;;
-(define documentation-files
- (map (lambda (vicinity)
- (in-vicinity (vicinity) "guile-procedures.txt"))
- (list %library-dir
- %package-data-dir
- %site-dir
- (lambda () "."))))
-
-(define entry-delimiter "\f")
-
-(define (find-documentation-in-file name file)
- (and (file-exists? file)
- (let ((port (open-input-file file))
- (name (symbol->string name)))
- (let ((len (string-length name)))
- (read-delimited entry-delimiter port) ;skip to first entry
- (let loop ((entry (read-delimited entry-delimiter port)))
- (cond ((eof-object? entry) #f)
- ;; match?
- ((and ;; large enough?
- (>= (string-length entry) len)
- ;; matching name?
- (string=? (substring entry 0 len) name)
- ;; terminated?
- (memq (string-ref entry len) '(#\newline)))
- ;; cut away name tag and extra surrounding newlines
- (substring entry (+ len 2) (- (string-length entry) 2)))
- (else (loop (read-delimited entry-delimiter port)))))))))
-
-(define (search-documentation-files name . files)
- (or-map (lambda (file)
- (find-documentation-in-file name file))
- (cond ((null? files) documentation-files)
- (else files))))
-
-;; helper until the procedure documentation property is cleaned up
-(define (proc-doc proc)
- (or (procedure-documentation proc)
- (procedure-property proc 'documentation)))
-
-(define (object-documentation object)
- "Return the docstring for OBJECT.
-OBJECT can be a procedure, macro or any object that has its
-`documentation' property set."
- (or (and (procedure? object)
- (proc-doc object))
- (and (macro? object)
- (let ((transformer (macro-transformer object)))
- (and transformer
- (proc-doc transformer))))
- (object-property object 'documentation)
- (and (procedure? object)
- (not (closure? object))
- (procedure-name object)
- (let ((docstring (search-documentation-files
- (procedure-name object))))
- (if docstring
- (set-procedure-property! object 'documentation docstring))
- docstring))))
-
-;;; documentation.scm ends here
diff --git a/ice-9/emacs.scm b/ice-9/emacs.scm
deleted file mode 100644
index 7673d52e5..000000000
--- a/ice-9/emacs.scm
+++ /dev/null
@@ -1,296 +0,0 @@
-;;;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-;;;; The author can be reached at djurfeldt@nada.kth.se
-;;;; Mikael Djurfeldt, SANS/NADA KTH, 10044 STOCKHOLM, SWEDEN
-;;;; (I didn't write this!)
-;;;;
-
-
-;;; *********************************************************************
-;;; * This is the Guile side of the Emacs interface *
-;;; * Experimental hACK---the real version will be coming soon (almost) *
-;;; *********************************************************************
-
-;;; {Session support for Emacs}
-;;;
-
-(define-module (ice-9 emacs)
- :use-module (ice-9 debug)
- :use-module (ice-9 threads)
- :use-module (ice-9 session)
- :no-backtrace)
-
-(define emacs-escape-character #\sub)
-
-(define emacs-output-port (current-output-port))
-
-(define (make-emacs-command char)
- (let ((cmd (list->string (list emacs-escape-character char))))
- (lambda ()
- (display cmd emacs-output-port))))
-
-(define enter-input-wait (make-emacs-command #\s))
-(define exit-input-wait (make-emacs-command #\f))
-(define enter-read-character #\r)
-(define sending-error (make-emacs-command #\F))
-(define sending-backtrace (make-emacs-command #\B))
-(define sending-result (make-emacs-command #\x))
-(define end-of-text (make-emacs-command #\.))
-(define no-stack (make-emacs-command #\S))
-(define no-source (make-emacs-command #\R))
-
-;; {Error handling}
-;;
-
-(add-hook! before-backtrace-hook sending-backtrace)
-(add-hook! after-backtrace-hook end-of-text)
-(add-hook! before-error-hook sending-error)
-(add-hook! after-error-hook end-of-text)
-
-;; {Repl}
-;;
-
-(set-current-error-port emacs-output-port)
-
-(add-hook! before-read-hook
- (lambda ()
- (enter-input-wait)
- (force-output emacs-output-port)))
-
-(add-hook! after-read-hook
- (lambda ()
- (exit-input-wait)
- (force-output emacs-output-port)))
-
-;;; {Misc.}
-
-(define (make-emacs-load-port orig-port)
- (letrec ((read-char-fn (lambda args
- (let ((c (read-char orig-port)))
- (if (eq? c #\soh)
- (throw 'end-of-chunk)
- c)))))
-
- (make-soft-port
- (vector #f #f #f
- read-char-fn
- (lambda () (close-port orig-port)))
- "r")))
-
-(set-current-input-port (make-emacs-load-port (current-input-port)))
-
-(define (result-to-emacs exp)
- (sending-result)
- (write exp emacs-output-port)
- (end-of-text)
- (force-output emacs-output-port))
-
-(define load-acknowledge (make-emacs-command #\l))
-
-(define load-port (current-input-port))
-
-(define (flush-line port)
- (let loop ((c (read-char port)))
- (if (not (eq? c #\nl))
- (loop (read-char port)))))
-
-(define whitespace-chars (list #\space #\tab #\nl #\np))
-
-(define (flush-whitespace port)
- (catch 'end-of-chunk
- (lambda ()
- (let loop ((c (read-char port)))
- (cond ((eq? c the-eof-object)
- (error "End of file while receiving Emacs data"))
- ((memq c whitespace-chars) (loop (read-char port)))
- ((eq? c #\;) (flush-line port) (loop (read-char port)))
- (else (unread-char c port))))
- #f)
- (lambda args
- (read-char port) ; Read final newline
- #t)))
-
-(define (emacs-load filename linum colnum module interactivep)
- (set-port-filename! %%load-port filename)
- (set-port-line! %%load-port linum)
- (set-port-column! %%load-port colnum)
- (lazy-catch #t
- (lambda ()
- (let loop ((endp (flush-whitespace %%load-port)))
- (if (not endp)
- (begin
- (save-module-excursion
- (lambda ()
- (if module
- (set-current-module (resolve-module module #f)))
- (let ((result
- (start-stack read-and-eval!
- (read-and-eval! %%load-port))))
- (if interactivep
- (result-to-emacs result)))))
- (loop (flush-whitespace %%load-port)))
- (begin
- (load-acknowledge)))
- (set-port-filename! %%load-port #f))) ;reset port filename
- (lambda (key . args)
- (set-port-filename! %%load-port #f)
- (cond ((eq? key 'end-of-chunk)
- (fluid-set! the-last-stack #f)
- (set! stack-saved? #t)
- (scm-error 'misc-error
- #f
- "Incomplete expression"
- '()
- '()))
- ((eq? key 'exit))
- (else
- (save-stack 2)
- (catch 'end-of-chunk
- (lambda ()
- (let loop ()
- (read-char %%load-port)
- (loop)))
- (lambda args
- #f))
- (apply throw key args))))))
-
-(define (emacs-eval-request form)
- (result-to-emacs (eval form (interaction-environment))))
-
-;;*fixme* Not necessary to use flags no-stack and no-source
-(define (get-frame-source frame)
- (if (or (not (fluid-ref the-last-stack))
- (>= frame (stack-length (fluid-ref the-last-stack))))
- (begin
- (no-stack)
- #f)
- (let* ((frame (stack-ref (fluid-ref the-last-stack)
- (frame-number->index frame)))
- (source (frame-source frame)))
- (or source
- (begin (no-source)
- #f)))))
-
-(define (emacs-select-frame frame)
- (let ((source (get-frame-source frame)))
- (if source
- (let ((fname (source-property source 'filename))
- (line (source-property source 'line))
- (column (source-property source 'column)))
- (if (and fname line column)
- (list fname line column)
- (begin (no-source)
- '())))
- '())))
-
-(define (object->string x . method)
- (with-output-to-string
- (lambda ()
- ((if (null? method)
- write
- (car method))
- x))))
-
-(define (format template . rest)
- (let loop ((chars (string->list template))
- (result '())
- (rest rest))
- (cond ((null? chars) (list->string (reverse result)))
- ((char=? (car chars) #\%)
- (loop (cddr chars)
- (append (reverse
- (string->list
- (case (cadr chars)
- ((#\S) (object->string (car rest)))
- ((#\s) (object->string (car rest) display)))))
- result)
- (cdr rest)))
- (else (loop (cdr chars) (cons (car chars) result) rest)))))
-
-(define (error-args->string args)
- (let ((msg (apply format (caddr args) (cadddr args))))
- (if (symbol? (cadr args))
- (string-append (symbol->string (cadr args))
- ": "
- msg)
- msg)))
-
-(define (emacs-frame-eval frame form)
- (let ((source (get-frame-source frame)))
- (if source
- (catch #t
- (lambda ()
- (list 'result
- (object->string
- (local-eval (with-input-from-string form read)
- (memoized-environment source)))))
- (lambda args
- (list (car args)
- (error-args->string args))))
- (begin
- (no-source)
- '()))))
-
-(define (emacs-symdoc symbol)
- (if (or (not (module-bound? (current-module) symbol))
- (not (procedure? (eval symbol (interaction-environment)))))
- 'nil
- (procedure-documentation (eval symbol (interaction-environment)))))
-
-;;; A fix to get the emacs interface to work together with the module system.
-;;;
-(for-each (lambda (name value)
- (module-define! the-root-module name value))
- '(%%load-port
- %%emacs-load
- %%emacs-eval-request
- %%emacs-select-frame
- %%emacs-frame-eval
- %%emacs-symdoc
- %%apropos-internal)
- (list load-port
- emacs-load
- emacs-eval-request
- emacs-select-frame
- emacs-frame-eval
- emacs-symdoc
- apropos-internal))
diff --git a/ice-9/expect.scm b/ice-9/expect.scm
deleted file mode 100644
index ba12b2ab0..000000000
--- a/ice-9/expect.scm
+++ /dev/null
@@ -1,196 +0,0 @@
-;;;; Copyright (C) 1996, 1998, 1999, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-;;; Commentary:
-
-;; This module is documented in the Guile Reference Manual.
-;; Briefly, these are exported:
-;; procedures: expect-select, expect-regexec
-;; variables: expect-port, expect-timeout, expect-timeout-proc,
-;; expect-eof-proc, expect-char-proc,
-;; expect-strings-compile-flags, expect-strings-exec-flags,
-;; macros: expect, expect-strings
-
-;;; Code:
-
-(define-module (ice-9 expect)
- :use-module (ice-9 regex)
- :export-syntax (expect expect-strings)
- :export (expect-port expect-timeout expect-timeout-proc
- expect-eof-proc expect-char-proc expect-strings-compile-flags
- expect-strings-exec-flags expect-select expect-regexec))
-
-;;; Expect: a macro for selecting actions based on what it reads from a port.
-;;; The idea is from Don Libes' expect based on Tcl.
-;;; This version by Gary Houston incorporating ideas from Aubrey Jaffer.
-
-
-(define expect-port #f)
-(define expect-timeout #f)
-(define expect-timeout-proc #f)
-(define expect-eof-proc #f)
-(define expect-char-proc #f)
-
-;;; expect: each test is a procedure which is applied to the accumulating
-;;; string.
-(defmacro expect clauses
- (let ((s (gensym))
- (c (gensym))
- (port (gensym))
- (timeout (gensym)))
- `(let ((,s "")
- (,port (or expect-port (current-input-port)))
- ;; when timeout occurs, in floating point seconds.
- (,timeout (if expect-timeout
- (let* ((secs-usecs (gettimeofday)))
- (+ (car secs-usecs)
- expect-timeout
- (/ (cdr secs-usecs)
- 1000000))) ; one million.
- #f)))
- (let next-char ()
- (if (and expect-timeout
- (not (expect-select ,port ,timeout)))
- (if expect-timeout-proc
- (expect-timeout-proc ,s)
- #f)
- (let ((,c (read-char ,port)))
- (if expect-char-proc
- (expect-char-proc ,c))
- (if (not (eof-object? ,c))
- (set! ,s (string-append ,s (string ,c))))
- (cond
- ;; this expands to clauses where the car invokes the
- ;; match proc and the cdr is the return value from expect
- ;; if the proc matched.
- ,@(let next-expr ((tests (map car clauses))
- (exprs (map cdr clauses))
- (body '()))
- (cond
- ((null? tests)
- (reverse body))
- (else
- (next-expr
- (cdr tests)
- (cdr exprs)
- (cons
- `((,(car tests) ,s (eof-object? ,c))
- ,@(cond ((null? (car exprs))
- '())
- ((eq? (caar exprs) '=>)
- (if (not (= (length (car exprs))
- 2))
- (scm-error 'misc-error
- "expect"
- "bad recipient: ~S"
- (list (car exprs))
- #f)
- `((apply ,(cadar exprs)
- (,(car tests) ,s ,port)))))
- (else
- (car exprs))))
- body)))))
- ;; if none of the clauses matched the current string.
- (else (cond ((eof-object? ,c)
- (if expect-eof-proc
- (expect-eof-proc ,s)
- #f))
- (else
- (next-char)))))))))))
-
-
-(define expect-strings-compile-flags regexp/newline)
-(define expect-strings-exec-flags regexp/noteol)
-
-;;; the regexec front-end to expect:
-;;; each test must evaluate to a regular expression.
-(defmacro expect-strings clauses
- `(let ,@(let next-test ((tests (map car clauses))
- (exprs (map cdr clauses))
- (defs '())
- (body '()))
- (cond ((null? tests)
- (list (reverse defs) `(expect ,@(reverse body))))
- (else
- (let ((rxname (gensym)))
- (next-test (cdr tests)
- (cdr exprs)
- (cons `(,rxname (make-regexp
- ,(car tests)
- expect-strings-compile-flags))
- defs)
- (cons `((lambda (s eof?)
- (expect-regexec ,rxname s eof?))
- ,@(car exprs))
- body))))))))
-
-;;; simplified select: returns #t if input is waiting or #f if timed out or
-;;; select was interrupted by a signal.
-;;; timeout is an absolute time in floating point seconds.
-(define (expect-select port timeout)
- (let* ((secs-usecs (gettimeofday))
- (relative (- timeout
- (car secs-usecs)
- (/ (cdr secs-usecs)
- 1000000)))) ; one million.
- (and (> relative 0)
- (pair? (car (select (list port) '() '()
- relative))))))
-
-;;; match a string against a regexp, returning a list of strings (required
-;;; by the => syntax) or #f. called once each time a character is added
-;;; to s (eof? will be #f), and once when eof is reached (with eof? #t).
-(define (expect-regexec rx s eof?)
- ;; if expect-strings-exec-flags contains regexp/noteol,
- ;; remove it for the eof test.
- (let* ((flags (if (and eof?
- (logand expect-strings-exec-flags regexp/noteol))
- (logxor expect-strings-exec-flags regexp/noteol)
- expect-strings-exec-flags))
- (match (regexp-exec rx s 0 flags)))
- (if match
- (do ((i (- (match:count match) 1) (- i 1))
- (result '() (cons (match:substring match i) result)))
- ((< i 0) result))
- #f)))
-
-;;; expect.scm ends here
diff --git a/ice-9/format.scm b/ice-9/format.scm
deleted file mode 100644
index 35caeedfb..000000000
--- a/ice-9/format.scm
+++ /dev/null
@@ -1,1745 +0,0 @@
-;;;; "format.scm" Common LISP text output formatter for SLIB
-;;; Written 1992-1994 by Dirk Lutzebaeck (lutzeb@cs.tu-berlin.de)
-;;; Assimilated into Guile May 1999
-;
-; This code is in the public domain.
-
-; Authors of the original version (< 1.4) were Ken Dickey and Aubrey Jaffer.
-; Please send error reports to bug-guile@gnu.org.
-; For documentation see slib.texi and format.doc.
-; For testing load formatst.scm.
-;
-; Version 3.0
-
-(define-module (ice-9 format)
- :use-module (ice-9 and-let-star)
- :autoload (ice-9 pretty-print) (pretty-print))
-
-(export format
- format:symbol-case-conv
- format:iobj-case-conv
- format:expch)
-
-;;; Configuration ------------------------------------------------------------
-
-(define format:symbol-case-conv #f)
-;; Symbols are converted by symbol->string so the case of the printed
-;; symbols is implementation dependent. format:symbol-case-conv is a
-;; one arg closure which is either #f (no conversion), string-upcase!,
-;; string-downcase! or string-capitalize!.
-
-(define format:iobj-case-conv #f)
-;; As format:symbol-case-conv but applies for the representation of
-;; implementation internal objects.
-
-(define format:expch #\E)
-;; The character prefixing the exponent value in ~e printing.
-
-(define format:floats (provided? 'inexact))
-;; Detects if the scheme system implements flonums (see at eof).
-
-(define format:complex-numbers (provided? 'complex))
-;; Detects if the scheme system implements complex numbers.
-
-(define format:radix-pref (char=? #\# (string-ref (number->string 8 8) 0)))
-;; Detects if number->string adds a radix prefix.
-
-(define format:ascii-non-printable-charnames
- '#("nul" "soh" "stx" "etx" "eot" "enq" "ack" "bel"
- "bs" "ht" "nl" "vt" "np" "cr" "so" "si"
- "dle" "dc1" "dc2" "dc3" "dc4" "nak" "syn" "etb"
- "can" "em" "sub" "esc" "fs" "gs" "rs" "us" "space"))
-
-;;; End of configuration ----------------------------------------------------
-
-(define format:version "3.0")
-(define format:port #f) ; curr. format output port
-(define format:output-col 0) ; curr. format output tty column
-(define format:flush-output #f) ; flush output at end of formatting
-(define format:case-conversion #f)
-(define format:error-continuation #f)
-(define format:args #f)
-(define format:pos 0) ; curr. format string parsing position
-(define format:arg-pos 0) ; curr. format argument position
- ; this is global for error presentation
-
-; format string and char output routines on format:port
-
-(define (format:out-str str)
- (if format:case-conversion
- (display (format:case-conversion str) format:port)
- (display str format:port))
- (set! format:output-col
- (+ format:output-col (string-length str))))
-
-(define (format:out-char ch)
- (if format:case-conversion
- (display (format:case-conversion (string ch)) format:port)
- (write-char ch format:port))
- (set! format:output-col
- (if (char=? ch #\newline)
- 0
- (+ format:output-col 1))))
-
-;(define (format:out-substr str i n) ; this allocates a new string
-; (display (substring str i n) format:port)
-; (set! format:output-col (+ format:output-col n)))
-
-(define (format:out-substr str i n)
- (do ((k i (+ k 1)))
- ((= k n))
- (write-char (string-ref str k) format:port))
- (set! format:output-col (+ format:output-col n)))
-
-;(define (format:out-fill n ch) ; this allocates a new string
-; (format:out-str (make-string n ch)))
-
-(define (format:out-fill n ch)
- (do ((i 0 (+ i 1)))
- ((= i n))
- (write-char ch format:port))
- (set! format:output-col (+ format:output-col n)))
-
-; format's user error handler
-
-(define (format:error . args) ; never returns!
- (let ((error-continuation format:error-continuation)
- (format-args format:args)
- (port (current-error-port)))
- (set! format:error format:intern-error)
- (if (and (>= (length format:args) 2)
- (string? (cadr format:args)))
- (let ((format-string (cadr format-args)))
- (if (not (zero? format:arg-pos))
- (set! format:arg-pos (- format:arg-pos 1)))
- (format port "~%FORMAT: error with call: (format ~a \"~a<===~a\" ~
- ~{~a ~}===>~{~a ~})~% "
- (car format:args)
- (substring format-string 0 format:pos)
- (substring format-string format:pos
- (string-length format-string))
- (list-head (cddr format:args) format:arg-pos)
- (list-tail (cddr format:args) format:arg-pos)))
- (format port
- "~%FORMAT: error with call: (format~{ ~a~})~% "
- format:args))
- (apply format port args)
- (newline port)
- (set! format:error format:error-save)
- (set! format:error-continuation error-continuation)
- (format:abort)
- (format:intern-error "format:abort does not jump to toplevel!")))
-
-(define format:error-save format:error)
-
-(define (format:intern-error . args) ;if something goes wrong in format:error
- (display "FORMAT: INTERNAL ERROR IN FORMAT:ERROR!") (newline)
- (display " format args: ") (write format:args) (newline)
- (display " error args: ") (write args) (newline)
- (set! format:error format:error-save)
- (format:abort))
-
-(define (format:format . args) ; the formatter entry
- (set! format:args args)
- (set! format:arg-pos 0)
- (set! format:pos 0)
- (if (< (length args) 1)
- (format:error "not enough arguments"))
-
- ;; If the first argument is a string, then that's the format string.
- ;; (Scheme->C)
- ;; In this case, put the argument list in canonical form.
- (let ((args (if (string? (car args))
- (cons #f args)
- args)))
- ;; Use this canonicalized version when reporting errors.
- (set! format:args args)
-
- (let ((destination (car args))
- (arglist (cdr args)))
- (cond
- ((or (and (boolean? destination) ; port output
- destination)
- (output-port? destination)
- (number? destination))
- (format:out (cond
- ((boolean? destination) (current-output-port))
- ((output-port? destination) destination)
- ((number? destination) (current-error-port)))
- (car arglist) (cdr arglist)))
- ((and (boolean? destination) ; string output
- (not destination))
- (call-with-output-string
- (lambda (port) (format:out port (car arglist) (cdr arglist)))))
- (else
- (format:error "illegal destination `~a'" destination))))))
-
-(define (format:out port fmt args) ; the output handler for a port
- (set! format:port port) ; global port for output routines
- (set! format:case-conversion #f) ; modifier case conversion procedure
- (set! format:flush-output #f) ; ~! reset
- (and-let* ((col (port-column port))) ; get current column from port
- (set! format:output-col col))
- (let ((arg-pos (format:format-work fmt args))
- (arg-len (length args)))
- (cond
- ((< arg-pos arg-len)
- (set! format:arg-pos (+ arg-pos 1))
- (set! format:pos (string-length fmt))
- (format:error "~a superfluous argument~:p" (- arg-len arg-pos)))
- ((> arg-pos arg-len)
- (set! format:arg-pos (+ arg-len 1))
- (display format:arg-pos)
- (format:error "~a missing argument~:p" (- arg-pos arg-len)))
- (else
- (if format:flush-output (force-output port))
- #t))))
-
-(define format:parameter-characters
- '(#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\- #\+ #\v #\# #\'))
-
-(define (format:format-work format-string arglist) ; does the formatting work
- (letrec
- ((format-string-len (string-length format-string))
- (arg-pos 0) ; argument position in arglist
- (arg-len (length arglist)) ; number of arguments
- (modifier #f) ; 'colon | 'at | 'colon-at | #f
- (params '()) ; directive parameter list
- (param-value-found #f) ; a directive parameter value found
- (conditional-nest 0) ; conditional nesting level
- (clause-pos 0) ; last cond. clause beginning char pos
- (clause-default #f) ; conditional default clause string
- (clauses '()) ; conditional clause string list
- (conditional-type #f) ; reflects the contional modifiers
- (conditional-arg #f) ; argument to apply the conditional
- (iteration-nest 0) ; iteration nesting level
- (iteration-pos 0) ; iteration string beginning char pos
- (iteration-type #f) ; reflects the iteration modifiers
- (max-iterations #f) ; maximum number of iterations
- (recursive-pos-save format:pos)
-
- (next-char ; gets the next char from format-string
- (lambda ()
- (let ((ch (peek-next-char)))
- (set! format:pos (+ 1 format:pos))
- ch)))
-
- (peek-next-char
- (lambda ()
- (if (>= format:pos format-string-len)
- (format:error "illegal format string")
- (string-ref format-string format:pos))))
-
- (one-positive-integer?
- (lambda (params)
- (cond
- ((null? params) #f)
- ((and (integer? (car params))
- (>= (car params) 0)
- (= (length params) 1)) #t)
- (else (format:error "one positive integer parameter expected")))))
-
- (next-arg
- (lambda ()
- (if (>= arg-pos arg-len)
- (begin
- (set! format:arg-pos (+ arg-len 1))
- (format:error "missing argument(s)")))
- (add-arg-pos 1)
- (list-ref arglist (- arg-pos 1))))
-
- (prev-arg
- (lambda ()
- (add-arg-pos -1)
- (if (negative? arg-pos)
- (format:error "missing backward argument(s)"))
- (list-ref arglist arg-pos)))
-
- (rest-args
- (lambda ()
- (let loop ((l arglist) (k arg-pos)) ; list-tail definition
- (if (= k 0) l (loop (cdr l) (- k 1))))))
-
- (add-arg-pos
- (lambda (n)
- (set! arg-pos (+ n arg-pos))
- (set! format:arg-pos arg-pos)))
-
- (anychar-dispatch ; dispatches the format-string
- (lambda ()
- (if (>= format:pos format-string-len)
- arg-pos ; used for ~? continuance
- (let ((char (next-char)))
- (cond
- ((char=? char #\~)
- (set! modifier #f)
- (set! params '())
- (set! param-value-found #f)
- (tilde-dispatch))
- (else
- (if (and (zero? conditional-nest)
- (zero? iteration-nest))
- (format:out-char char))
- (anychar-dispatch)))))))
-
- (tilde-dispatch
- (lambda ()
- (cond
- ((>= format:pos format-string-len)
- (format:out-str "~") ; tilde at end of string is just output
- arg-pos) ; used for ~? continuance
- ((and (or (zero? conditional-nest)
- (memv (peek-next-char) ; find conditional directives
- (append '(#\[ #\] #\; #\: #\@ #\^)
- format:parameter-characters)))
- (or (zero? iteration-nest)
- (memv (peek-next-char) ; find iteration directives
- (append '(#\{ #\} #\: #\@ #\^)
- format:parameter-characters))))
- (case (char-upcase (next-char))
-
- ;; format directives
-
- ((#\A) ; Any -- for humans
- (set! format:read-proof (memq modifier '(colon colon-at)))
- (format:out-obj-padded (memq modifier '(at colon-at))
- (next-arg) #f params)
- (anychar-dispatch))
- ((#\S) ; Slashified -- for parsers
- (set! format:read-proof (memq modifier '(colon colon-at)))
- (format:out-obj-padded (memq modifier '(at colon-at))
- (next-arg) #t params)
- (anychar-dispatch))
- ((#\D) ; Decimal
- (format:out-num-padded modifier (next-arg) params 10)
- (anychar-dispatch))
- ((#\X) ; Hexadecimal
- (format:out-num-padded modifier (next-arg) params 16)
- (anychar-dispatch))
- ((#\O) ; Octal
- (format:out-num-padded modifier (next-arg) params 8)
- (anychar-dispatch))
- ((#\B) ; Binary
- (format:out-num-padded modifier (next-arg) params 2)
- (anychar-dispatch))
- ((#\R)
- (if (null? params)
- (format:out-obj-padded ; Roman, cardinal, ordinal numerals
- #f
- ((case modifier
- ((at) format:num->roman)
- ((colon-at) format:num->old-roman)
- ((colon) format:num->ordinal)
- (else format:num->cardinal))
- (next-arg))
- #f params)
- (format:out-num-padded ; any Radix
- modifier (next-arg) (cdr params) (car params)))
- (anychar-dispatch))
- ((#\F) ; Fixed-format floating-point
- (if format:floats
- (format:out-fixed modifier (next-arg) params)
- (format:out-str (number->string (next-arg))))
- (anychar-dispatch))
- ((#\E) ; Exponential floating-point
- (if format:floats
- (format:out-expon modifier (next-arg) params)
- (format:out-str (number->string (next-arg))))
- (anychar-dispatch))
- ((#\G) ; General floating-point
- (if format:floats
- (format:out-general modifier (next-arg) params)
- (format:out-str (number->string (next-arg))))
- (anychar-dispatch))
- ((#\$) ; Dollars floating-point
- (if format:floats
- (format:out-dollar modifier (next-arg) params)
- (format:out-str (number->string (next-arg))))
- (anychar-dispatch))
- ((#\I) ; Complex numbers
- (if (not format:complex-numbers)
- (format:error
- "complex numbers not supported by this scheme system"))
- (let ((z (next-arg)))
- (if (not (complex? z))
- (format:error "argument not a complex number"))
- (format:out-fixed modifier (real-part z) params)
- (format:out-fixed 'at (imag-part z) params)
- (format:out-char #\i))
- (anychar-dispatch))
- ((#\C) ; Character
- (let ((ch (if (one-positive-integer? params)
- (integer->char (car params))
- (next-arg))))
- (if (not (char? ch)) (format:error "~~c expects a character"))
- (case modifier
- ((at)
- (format:out-str (format:char->str ch)))
- ((colon)
- (let ((c (char->integer ch)))
- (if (< c 0)
- (set! c (+ c 256))) ; compensate complement impl.
- (cond
- ((< c #x20) ; assumes that control chars are < #x20
- (format:out-char #\^)
- (format:out-char
- (integer->char (+ c #x40))))
- ((>= c #x7f)
- (format:out-str "#\\")
- (format:out-str
- (if format:radix-pref
- (let ((s (number->string c 8)))
- (substring s 2 (string-length s)))
- (number->string c 8))))
- (else
- (format:out-char ch)))))
- (else (format:out-char ch))))
- (anychar-dispatch))
- ((#\P) ; Plural
- (if (memq modifier '(colon colon-at))
- (prev-arg))
- (let ((arg (next-arg)))
- (if (not (number? arg))
- (format:error "~~p expects a number argument"))
- (if (= arg 1)
- (if (memq modifier '(at colon-at))
- (format:out-char #\y))
- (if (memq modifier '(at colon-at))
- (format:out-str "ies")
- (format:out-char #\s))))
- (anychar-dispatch))
- ((#\~) ; Tilde
- (if (one-positive-integer? params)
- (format:out-fill (car params) #\~)
- (format:out-char #\~))
- (anychar-dispatch))
- ((#\%) ; Newline
- (if (one-positive-integer? params)
- (format:out-fill (car params) #\newline)
- (format:out-char #\newline))
- (set! format:output-col 0)
- (anychar-dispatch))
- ((#\&) ; Fresh line
- (if (one-positive-integer? params)
- (begin
- (if (> (car params) 0)
- (format:out-fill (- (car params)
- (if (> format:output-col 0) 0 1))
- #\newline))
- (set! format:output-col 0))
- (if (> format:output-col 0)
- (format:out-char #\newline)))
- (anychar-dispatch))
- ((#\_) ; Space character
- (if (one-positive-integer? params)
- (format:out-fill (car params) #\space)
- (format:out-char #\space))
- (anychar-dispatch))
- ((#\/) ; Tabulator character
- (if (one-positive-integer? params)
- (format:out-fill (car params) #\tab)
- (format:out-char #\tab))
- (anychar-dispatch))
- ((#\|) ; Page seperator
- (if (one-positive-integer? params)
- (format:out-fill (car params) #\page)
- (format:out-char #\page))
- (set! format:output-col 0)
- (anychar-dispatch))
- ((#\T) ; Tabulate
- (format:tabulate modifier params)
- (anychar-dispatch))
- ((#\Y) ; Pretty-print
- (pretty-print (next-arg) format:port)
- (set! format:output-col 0)
- (anychar-dispatch))
- ((#\? #\K) ; Indirection (is "~K" in T-Scheme)
- (cond
- ((memq modifier '(colon colon-at))
- (format:error "illegal modifier in ~~?"))
- ((eq? modifier 'at)
- (let* ((frmt (next-arg))
- (args (rest-args)))
- (add-arg-pos (format:format-work frmt args))))
- (else
- (let* ((frmt (next-arg))
- (args (next-arg)))
- (format:format-work frmt args))))
- (anychar-dispatch))
- ((#\!) ; Flush output
- (set! format:flush-output #t)
- (anychar-dispatch))
- ((#\newline) ; Continuation lines
- (if (eq? modifier 'at)
- (format:out-char #\newline))
- (if (< format:pos format-string-len)
- (do ((ch (peek-next-char) (peek-next-char)))
- ((or (not (char-whitespace? ch))
- (= format:pos (- format-string-len 1))))
- (if (eq? modifier 'colon)
- (format:out-char (next-char))
- (next-char))))
- (anychar-dispatch))
- ((#\*) ; Argument jumping
- (case modifier
- ((colon) ; jump backwards
- (if (one-positive-integer? params)
- (do ((i 0 (+ i 1)))
- ((= i (car params)))
- (prev-arg))
- (prev-arg)))
- ((at) ; jump absolute
- (set! arg-pos (if (one-positive-integer? params)
- (car params) 0)))
- ((colon-at)
- (format:error "illegal modifier `:@' in ~~* directive"))
- (else ; jump forward
- (if (one-positive-integer? params)
- (do ((i 0 (+ i 1)))
- ((= i (car params)))
- (next-arg))
- (next-arg))))
- (anychar-dispatch))
- ((#\() ; Case conversion begin
- (set! format:case-conversion
- (case modifier
- ((at) string-capitalize-first)
- ((colon) string-capitalize)
- ((colon-at) string-upcase)
- (else string-downcase)))
- (anychar-dispatch))
- ((#\)) ; Case conversion end
- (if (not format:case-conversion)
- (format:error "missing ~~("))
- (set! format:case-conversion #f)
- (anychar-dispatch))
- ((#\[) ; Conditional begin
- (set! conditional-nest (+ conditional-nest 1))
- (cond
- ((= conditional-nest 1)
- (set! clause-pos format:pos)
- (set! clause-default #f)
- (set! clauses '())
- (set! conditional-type
- (case modifier
- ((at) 'if-then)
- ((colon) 'if-else-then)
- ((colon-at) (format:error "illegal modifier in ~~["))
- (else 'num-case)))
- (set! conditional-arg
- (if (one-positive-integer? params)
- (car params)
- (next-arg)))))
- (anychar-dispatch))
- ((#\;) ; Conditional separator
- (if (zero? conditional-nest)
- (format:error "~~; not in ~~[~~] conditional"))
- (if (not (null? params))
- (format:error "no parameter allowed in ~~;"))
- (if (= conditional-nest 1)
- (let ((clause-str
- (cond
- ((eq? modifier 'colon)
- (set! clause-default #t)
- (substring format-string clause-pos
- (- format:pos 3)))
- ((memq modifier '(at colon-at))
- (format:error "illegal modifier in ~~;"))
- (else
- (substring format-string clause-pos
- (- format:pos 2))))))
- (set! clauses (append clauses (list clause-str)))
- (set! clause-pos format:pos)))
- (anychar-dispatch))
- ((#\]) ; Conditional end
- (if (zero? conditional-nest) (format:error "missing ~~["))
- (set! conditional-nest (- conditional-nest 1))
- (if modifier
- (format:error "no modifier allowed in ~~]"))
- (if (not (null? params))
- (format:error "no parameter allowed in ~~]"))
- (cond
- ((zero? conditional-nest)
- (let ((clause-str (substring format-string clause-pos
- (- format:pos 2))))
- (if clause-default
- (set! clause-default clause-str)
- (set! clauses (append clauses (list clause-str)))))
- (case conditional-type
- ((if-then)
- (if conditional-arg
- (format:format-work (car clauses)
- (list conditional-arg))))
- ((if-else-then)
- (add-arg-pos
- (format:format-work (if conditional-arg
- (cadr clauses)
- (car clauses))
- (rest-args))))
- ((num-case)
- (if (or (not (integer? conditional-arg))
- (< conditional-arg 0))
- (format:error "argument not a positive integer"))
- (if (not (and (>= conditional-arg (length clauses))
- (not clause-default)))
- (add-arg-pos
- (format:format-work
- (if (>= conditional-arg (length clauses))
- clause-default
- (list-ref clauses conditional-arg))
- (rest-args))))))))
- (anychar-dispatch))
- ((#\{) ; Iteration begin
- (set! iteration-nest (+ iteration-nest 1))
- (cond
- ((= iteration-nest 1)
- (set! iteration-pos format:pos)
- (set! iteration-type
- (case modifier
- ((at) 'rest-args)
- ((colon) 'sublists)
- ((colon-at) 'rest-sublists)
- (else 'list)))
- (set! max-iterations (if (one-positive-integer? params)
- (car params) #f))))
- (anychar-dispatch))
- ((#\}) ; Iteration end
- (if (zero? iteration-nest) (format:error "missing ~~{"))
- (set! iteration-nest (- iteration-nest 1))
- (case modifier
- ((colon)
- (if (not max-iterations) (set! max-iterations 1)))
- ((colon-at at) (format:error "illegal modifier"))
- (else (if (not max-iterations) (set! max-iterations 100))))
- (if (not (null? params))
- (format:error "no parameters allowed in ~~}"))
- (if (zero? iteration-nest)
- (let ((iteration-str
- (substring format-string iteration-pos
- (- format:pos (if modifier 3 2)))))
- (if (string=? iteration-str "")
- (set! iteration-str (next-arg)))
- (case iteration-type
- ((list)
- (let ((args (next-arg))
- (args-len 0))
- (if (not (list? args))
- (format:error "expected a list argument"))
- (set! args-len (length args))
- (do ((arg-pos 0 (+ arg-pos
- (format:format-work
- iteration-str
- (list-tail args arg-pos))))
- (i 0 (+ i 1)))
- ((or (>= arg-pos args-len)
- (>= i max-iterations))))))
- ((sublists)
- (let ((args (next-arg))
- (args-len 0))
- (if (not (list? args))
- (format:error "expected a list argument"))
- (set! args-len (length args))
- (do ((arg-pos 0 (+ arg-pos 1)))
- ((or (>= arg-pos args-len)
- (>= arg-pos max-iterations)))
- (let ((sublist (list-ref args arg-pos)))
- (if (not (list? sublist))
- (format:error
- "expected a list of lists argument"))
- (format:format-work iteration-str sublist)))))
- ((rest-args)
- (let* ((args (rest-args))
- (args-len (length args))
- (usedup-args
- (do ((arg-pos 0 (+ arg-pos
- (format:format-work
- iteration-str
- (list-tail
- args arg-pos))))
- (i 0 (+ i 1)))
- ((or (>= arg-pos args-len)
- (>= i max-iterations))
- arg-pos))))
- (add-arg-pos usedup-args)))
- ((rest-sublists)
- (let* ((args (rest-args))
- (args-len (length args))
- (usedup-args
- (do ((arg-pos 0 (+ arg-pos 1)))
- ((or (>= arg-pos args-len)
- (>= arg-pos max-iterations))
- arg-pos)
- (let ((sublist (list-ref args arg-pos)))
- (if (not (list? sublist))
- (format:error "expected list arguments"))
- (format:format-work iteration-str sublist)))))
- (add-arg-pos usedup-args)))
- (else (format:error "internal error in ~~}")))))
- (anychar-dispatch))
- ((#\^) ; Up and out
- (let* ((continue
- (cond
- ((not (null? params))
- (not
- (case (length params)
- ((1) (zero? (car params)))
- ((2) (= (list-ref params 0) (list-ref params 1)))
- ((3) (<= (list-ref params 0)
- (list-ref params 1)
- (list-ref params 2)))
- (else (format:error "too much parameters")))))
- (format:case-conversion ; if conversion stop conversion
- (set! format:case-conversion string-copy) #t)
- ((= iteration-nest 1) #t)
- ((= conditional-nest 1) #t)
- ((>= arg-pos arg-len)
- (set! format:pos format-string-len) #f)
- (else #t))))
- (if continue
- (anychar-dispatch))))
-
- ;; format directive modifiers and parameters
-
- ((#\@) ; `@' modifier
- (if (memq modifier '(at colon-at))
- (format:error "double `@' modifier"))
- (set! modifier (if (eq? modifier 'colon) 'colon-at 'at))
- (tilde-dispatch))
- ((#\:) ; `:' modifier
- (if (memq modifier '(colon colon-at))
- (format:error "double `:' modifier"))
- (set! modifier (if (eq? modifier 'at) 'colon-at 'colon))
- (tilde-dispatch))
- ((#\') ; Character parameter
- (if modifier (format:error "misplaced modifier"))
- (set! params (append params (list (char->integer (next-char)))))
- (set! param-value-found #t)
- (tilde-dispatch))
- ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\- #\+) ; num. paramtr
- (if modifier (format:error "misplaced modifier"))
- (let ((num-str-beg (- format:pos 1))
- (num-str-end format:pos))
- (do ((ch (peek-next-char) (peek-next-char)))
- ((not (char-numeric? ch)))
- (next-char)
- (set! num-str-end (+ 1 num-str-end)))
- (set! params
- (append params
- (list (string->number
- (substring format-string
- num-str-beg
- num-str-end))))))
- (set! param-value-found #t)
- (tilde-dispatch))
- ((#\V) ; Variable parameter from next argum.
- (if modifier (format:error "misplaced modifier"))
- (set! params (append params (list (next-arg))))
- (set! param-value-found #t)
- (tilde-dispatch))
- ((#\#) ; Parameter is number of remaining args
- (if modifier (format:error "misplaced modifier"))
- (set! params (append params (list (length (rest-args)))))
- (set! param-value-found #t)
- (tilde-dispatch))
- ((#\,) ; Parameter separators
- (if modifier (format:error "misplaced modifier"))
- (if (not param-value-found)
- (set! params (append params '(#f)))) ; append empty paramtr
- (set! param-value-found #f)
- (tilde-dispatch))
- ((#\Q) ; Inquiry messages
- (if (eq? modifier 'colon)
- (format:out-str format:version)
- (let ((nl (string #\newline)))
- (format:out-str
- (string-append
- "SLIB Common LISP format version " format:version nl
- " (C) copyright 1992-1994 by Dirk Lutzebaeck" nl
- " please send bug reports to `lutzeb@cs.tu-berlin.de'"
- nl))))
- (anychar-dispatch))
- (else ; Unknown tilde directive
- (format:error "unknown control character `~c'"
- (string-ref format-string (- format:pos 1))))))
- (else (anychar-dispatch)))))) ; in case of conditional
-
- (set! format:pos 0)
- (set! format:arg-pos 0)
- (anychar-dispatch) ; start the formatting
- (set! format:pos recursive-pos-save)
- arg-pos)) ; return the position in the arg. list
-
-;; format:obj->str returns a R4RS representation as a string of an arbitrary
-;; scheme object.
-;; First parameter is the object, second parameter is a boolean if the
-;; representation should be slashified as `write' does.
-;; It uses format:char->str which converts a character into
-;; a slashified string as `write' does and which is implementation dependent.
-;; It uses format:iobj->str to print out internal objects as
-;; quoted strings so that the output can always be processed by (read)
-
-(define (format:obj->str obj slashify)
- (define (obj->str obj slashify visited)
- (if (memq obj (cdr visited))
- (let ((n (- (list-index (cdr visited) (cdr obj)))))
- (string-append "#" (number->string n) "#"))
- (cond
- ((string? obj)
- (if slashify
- (let ((obj-len (string-length obj)))
- (string-append
- "\""
- (let loop ((i 0) (j 0)) ; taken from Marc Feeley's pp.scm
- (if (= j obj-len)
- (string-append (substring obj i j) "\"")
- (let ((c (string-ref obj j)))
- (if (or (char=? c #\\)
- (char=? c #\"))
- (string-append (substring obj i j) "\\"
- (loop j (+ j 1)))
- (loop i (+ j 1))))))))
- obj))
-
- ((boolean? obj) (if obj "#t" "#f"))
-
- ((number? obj) (number->string obj))
-
- ((symbol? obj)
- (if format:symbol-case-conv
- (format:symbol-case-conv (symbol->string obj))
- (symbol->string obj)))
-
- ((char? obj)
- (if slashify
- (format:char->str obj)
- (string obj)))
-
- ((null? obj) "()")
-
- ((input-port? obj)
- (format:iobj->str obj))
-
- ((output-port? obj)
- (format:iobj->str obj))
-
- ((pair? obj)
- (string-append "("
- (let loop ((obj-list obj)
- (visited visited)
- (offset 0)
- (prefix ""))
- (cond ((null? (cdr obj-list))
- (string-append
- prefix
- (obj->str (car obj-list)
- #t
- (cons (car obj-list) visited))))
- ((memq (cdr obj-list) visited)
- (string-append
- prefix
- (obj->str (car obj-list)
- #t
- (cons (car obj-list) visited))
- " . #"
- (number->string
- (- offset
- (list-index visited (cdr obj-list))))
- "#"))
- ((pair? (cdr obj-list))
- (loop (cdr obj-list)
- (cons (cdr obj-list) visited)
- (+ 1 offset)
- (string-append
- prefix
- (obj->str (car obj-list)
- #t
- (cons (car obj-list) visited))
- " ")))
- (else
- (string-append
- prefix
- (obj->str (car obj-list)
- #t
- (cons (car obj-list) visited))
- " . "
- (obj->str (cdr obj-list)
- #t
- (cons (cdr obj-list) visited))))))
- ")"))
-
- ((vector? obj)
- (string-append "#" (obj->str (vector->list obj) #t visited)))
-
- (else ; only objects with an #<...>
- (format:iobj->str obj))))) ; representation should fall in here
- (obj->str obj slashify (list obj)))
-
-;; format:iobj->str reveals the implementation dependent representation of
-;; #<...> objects with the use of display and call-with-output-string.
-;; If format:read-proof is set to #t the resulting string is additionally
-;; set into string quotes.
-
-(define format:read-proof #f)
-
-(define (format:iobj->str iobj)
- (if (or format:read-proof
- format:iobj-case-conv)
- (string-append
- (if format:read-proof "\"" "")
- (if format:iobj-case-conv
- (format:iobj-case-conv
- (call-with-output-string (lambda (p) (display iobj p))))
- (call-with-output-string (lambda (p) (display iobj p))))
- (if format:read-proof "\"" ""))
- (call-with-output-string (lambda (p) (display iobj p)))))
-
-
-;; format:char->str converts a character into a slashified string as
-;; done by `write'. The procedure is dependent on the integer
-;; representation of characters and assumes a character number according to
-;; the ASCII character set.
-
-(define (format:char->str ch)
- (let ((int-rep (char->integer ch)))
- (if (< int-rep 0) ; if chars are [-128...+127]
- (set! int-rep (+ int-rep 256)))
- (string-append
- "#\\"
- (cond
- ((char=? ch #\newline) "newline")
- ((and (>= int-rep 0) (<= int-rep 32))
- (vector-ref format:ascii-non-printable-charnames int-rep))
- ((= int-rep 127) "del")
- ((>= int-rep 128) ; octal representation
- (if format:radix-pref
- (let ((s (number->string int-rep 8)))
- (substring s 2 (string-length s)))
- (number->string int-rep 8)))
- (else (string ch))))))
-
-(define format:space-ch (char->integer #\space))
-(define format:zero-ch (char->integer #\0))
-
-(define (format:par pars length index default name)
- (if (> length index)
- (let ((par (list-ref pars index)))
- (if par
- (if name
- (if (< par 0)
- (format:error
- "~s parameter must be a positive integer" name)
- par)
- par)
- default))
- default))
-
-(define (format:out-obj-padded pad-left obj slashify pars)
- (if (null? pars)
- (format:out-str (format:obj->str obj slashify))
- (let ((l (length pars)))
- (let ((mincol (format:par pars l 0 0 "mincol"))
- (colinc (format:par pars l 1 1 "colinc"))
- (minpad (format:par pars l 2 0 "minpad"))
- (padchar (integer->char
- (format:par pars l 3 format:space-ch #f)))
- (objstr (format:obj->str obj slashify)))
- (if (not pad-left)
- (format:out-str objstr))
- (do ((objstr-len (string-length objstr))
- (i minpad (+ i colinc)))
- ((>= (+ objstr-len i) mincol)
- (format:out-fill i padchar)))
- (if pad-left
- (format:out-str objstr))))))
-
-(define (format:out-num-padded modifier number pars radix)
- (if (not (integer? number)) (format:error "argument not an integer"))
- (let ((numstr (number->string number radix)))
- (if (and format:radix-pref (not (= radix 10)))
- (set! numstr (substring numstr 2 (string-length numstr))))
- (if (and (null? pars) (not modifier))
- (format:out-str numstr)
- (let ((l (length pars))
- (numstr-len (string-length numstr)))
- (let ((mincol (format:par pars l 0 #f "mincol"))
- (padchar (integer->char
- (format:par pars l 1 format:space-ch #f)))
- (commachar (integer->char
- (format:par pars l 2 (char->integer #\,) #f)))
- (commawidth (format:par pars l 3 3 "commawidth")))
- (if mincol
- (let ((numlen numstr-len)) ; calc. the output len of number
- (if (and (memq modifier '(at colon-at)) (> number 0))
- (set! numlen (+ numlen 1)))
- (if (memq modifier '(colon colon-at))
- (set! numlen (+ (quotient (- numstr-len
- (if (< number 0) 2 1))
- commawidth)
- numlen)))
- (if (> mincol numlen)
- (format:out-fill (- mincol numlen) padchar))))
- (if (and (memq modifier '(at colon-at))
- (> number 0))
- (format:out-char #\+))
- (if (memq modifier '(colon colon-at)) ; insert comma character
- (let ((start (remainder numstr-len commawidth))
- (ns (if (< number 0) 1 0)))
- (format:out-substr numstr 0 start)
- (do ((i start (+ i commawidth)))
- ((>= i numstr-len))
- (if (> i ns)
- (format:out-char commachar))
- (format:out-substr numstr i (+ i commawidth))))
- (format:out-str numstr)))))))
-
-(define (format:tabulate modifier pars)
- (let ((l (length pars)))
- (let ((colnum (format:par pars l 0 1 "colnum"))
- (colinc (format:par pars l 1 1 "colinc"))
- (padch (integer->char (format:par pars l 2 format:space-ch #f))))
- (case modifier
- ((colon colon-at)
- (format:error "unsupported modifier for ~~t"))
- ((at) ; relative tabulation
- (format:out-fill
- (if (= colinc 0)
- colnum ; colnum = colrel
- (do ((c 0 (+ c colinc))
- (col (+ format:output-col colnum)))
- ((>= c col)
- (- c format:output-col))))
- padch))
- (else ; absolute tabulation
- (format:out-fill
- (cond
- ((< format:output-col colnum)
- (- colnum format:output-col))
- ((= colinc 0)
- 0)
- (else
- (do ((c colnum (+ c colinc)))
- ((>= c format:output-col)
- (- c format:output-col)))))
- padch))))))
-
-
-;; roman numerals (from dorai@cs.rice.edu).
-
-(define format:roman-alist
- '((1000 #\M) (500 #\D) (100 #\C) (50 #\L)
- (10 #\X) (5 #\V) (1 #\I)))
-
-(define format:roman-boundary-values
- '(100 100 10 10 1 1 #f))
-
-(define format:num->old-roman
- (lambda (n)
- (if (and (integer? n) (>= n 1))
- (let loop ((n n)
- (romans format:roman-alist)
- (s '()))
- (if (null? romans) (list->string (reverse s))
- (let ((roman-val (caar romans))
- (roman-dgt (cadar romans)))
- (do ((q (quotient n roman-val) (- q 1))
- (s s (cons roman-dgt s)))
- ((= q 0)
- (loop (remainder n roman-val)
- (cdr romans) s))))))
- (format:error "only positive integers can be romanized"))))
-
-(define format:num->roman
- (lambda (n)
- (if (and (integer? n) (> n 0))
- (let loop ((n n)
- (romans format:roman-alist)
- (boundaries format:roman-boundary-values)
- (s '()))
- (if (null? romans)
- (list->string (reverse s))
- (let ((roman-val (caar romans))
- (roman-dgt (cadar romans))
- (bdry (car boundaries)))
- (let loop2 ((q (quotient n roman-val))
- (r (remainder n roman-val))
- (s s))
- (if (= q 0)
- (if (and bdry (>= r (- roman-val bdry)))
- (loop (remainder r bdry) (cdr romans)
- (cdr boundaries)
- (cons roman-dgt
- (append
- (cdr (assv bdry romans))
- s)))
- (loop r (cdr romans) (cdr boundaries) s))
- (loop2 (- q 1) r (cons roman-dgt s)))))))
- (format:error "only positive integers can be romanized"))))
-
-;; cardinals & ordinals (from dorai@cs.rice.edu)
-
-(define format:cardinal-ones-list
- '(#f "one" "two" "three" "four" "five"
- "six" "seven" "eight" "nine" "ten" "eleven" "twelve" "thirteen"
- "fourteen" "fifteen" "sixteen" "seventeen" "eighteen"
- "nineteen"))
-
-(define format:cardinal-tens-list
- '(#f #f "twenty" "thirty" "forty" "fifty" "sixty" "seventy" "eighty"
- "ninety"))
-
-(define format:num->cardinal999
- (lambda (n)
- ;this procedure is inspired by the Bruno Haible's CLisp
- ;function format-small-cardinal, which converts numbers
- ;in the range 1 to 999, and is used for converting each
- ;thousand-block in a larger number
- (let* ((hundreds (quotient n 100))
- (tens+ones (remainder n 100))
- (tens (quotient tens+ones 10))
- (ones (remainder tens+ones 10)))
- (append
- (if (> hundreds 0)
- (append
- (string->list
- (list-ref format:cardinal-ones-list hundreds))
- (string->list" hundred")
- (if (> tens+ones 0) '(#\space) '()))
- '())
- (if (< tens+ones 20)
- (if (> tens+ones 0)
- (string->list
- (list-ref format:cardinal-ones-list tens+ones))
- '())
- (append
- (string->list
- (list-ref format:cardinal-tens-list tens))
- (if (> ones 0)
- (cons #\-
- (string->list
- (list-ref format:cardinal-ones-list ones)))
- '())))))))
-
-(define format:cardinal-thousand-block-list
- '("" " thousand" " million" " billion" " trillion" " quadrillion"
- " quintillion" " sextillion" " septillion" " octillion" " nonillion"
- " decillion" " undecillion" " duodecillion" " tredecillion"
- " quattuordecillion" " quindecillion" " sexdecillion" " septendecillion"
- " octodecillion" " novemdecillion" " vigintillion"))
-
-(define format:num->cardinal
- (lambda (n)
- (cond ((not (integer? n))
- (format:error
- "only integers can be converted to English cardinals"))
- ((= n 0) "zero")
- ((< n 0) (string-append "minus " (format:num->cardinal (- n))))
- (else
- (let ((power3-word-limit
- (length format:cardinal-thousand-block-list)))
- (let loop ((n n)
- (power3 0)
- (s '()))
- (if (= n 0)
- (list->string s)
- (let ((n-before-block (quotient n 1000))
- (n-after-block (remainder n 1000)))
- (loop n-before-block
- (+ power3 1)
- (if (> n-after-block 0)
- (append
- (if (> n-before-block 0)
- (string->list ", ") '())
- (format:num->cardinal999 n-after-block)
- (if (< power3 power3-word-limit)
- (string->list
- (list-ref
- format:cardinal-thousand-block-list
- power3))
- (append
- (string->list " times ten to the ")
- (string->list
- (format:num->ordinal
- (* power3 3)))
- (string->list " power")))
- s)
- s))))))))))
-
-(define format:ordinal-ones-list
- '(#f "first" "second" "third" "fourth" "fifth"
- "sixth" "seventh" "eighth" "ninth" "tenth" "eleventh" "twelfth"
- "thirteenth" "fourteenth" "fifteenth" "sixteenth" "seventeenth"
- "eighteenth" "nineteenth"))
-
-(define format:ordinal-tens-list
- '(#f #f "twentieth" "thirtieth" "fortieth" "fiftieth" "sixtieth"
- "seventieth" "eightieth" "ninetieth"))
-
-(define format:num->ordinal
- (lambda (n)
- (cond ((not (integer? n))
- (format:error
- "only integers can be converted to English ordinals"))
- ((= n 0) "zeroth")
- ((< n 0) (string-append "minus " (format:num->ordinal (- n))))
- (else
- (let ((hundreds (quotient n 100))
- (tens+ones (remainder n 100)))
- (string-append
- (if (> hundreds 0)
- (string-append
- (format:num->cardinal (* hundreds 100))
- (if (= tens+ones 0) "th" " "))
- "")
- (if (= tens+ones 0) ""
- (if (< tens+ones 20)
- (list-ref format:ordinal-ones-list tens+ones)
- (let ((tens (quotient tens+ones 10))
- (ones (remainder tens+ones 10)))
- (if (= ones 0)
- (list-ref format:ordinal-tens-list tens)
- (string-append
- (list-ref format:cardinal-tens-list tens)
- "-"
- (list-ref format:ordinal-ones-list ones))))
- ))))))))
-
-;; format inf and nan.
-
-(define (format:out-inf-nan number width digits edigits overch padch)
- ;; inf and nan are always printed exactly as "+inf.0", "-inf.0" or
- ;; "+nan.0", suitably justified in their field. We insist on
- ;; printing this exact form so that the numbers can be read back in.
-
- (let* ((str (number->string number))
- (len (string-length str))
- (dot (string-index str #\.))
- (digits (+ (or digits 0)
- (if edigits (+ edigits 2) 0))))
- (if (and width overch (< width len))
- (format:out-fill width (integer->char overch))
- (let* ((leftpad (if width
- (max (- width (max len (+ dot 1 digits))) 0)
- 0))
- (rightpad (if width
- (max (- width leftpad len) 0)
- 0))
- (padch (integer->char (or padch format:space-ch))))
- (format:out-fill leftpad padch)
- (format:out-str str)
- (format:out-fill rightpad padch)))))
-
-;; format fixed flonums (~F)
-
-(define (format:out-fixed modifier number pars)
- (if (not (or (number? number) (string? number)))
- (format:error "argument is not a number or a number string"))
-
- (let ((l (length pars)))
- (let ((width (format:par pars l 0 #f "width"))
- (digits (format:par pars l 1 #f "digits"))
- (scale (format:par pars l 2 0 #f))
- (overch (format:par pars l 3 #f #f))
- (padch (format:par pars l 4 format:space-ch #f)))
-
- (cond
- ((or (inf? number) (nan? number))
- (format:out-inf-nan number width digits #f overch padch))
-
- (digits
- (format:parse-float
- (if (string? number) number (number->string number)) #t scale)
- (if (<= (- format:fn-len format:fn-dot) digits)
- (format:fn-zfill #f (- digits (- format:fn-len format:fn-dot)))
- (format:fn-round digits))
- (if width
- (let ((numlen (+ format:fn-len 1)))
- (if (or (not format:fn-pos?) (eq? modifier 'at))
- (set! numlen (+ numlen 1)))
- (if (and (= format:fn-dot 0) (> width (+ digits 1)))
- (set! numlen (+ numlen 1)))
- (if (< numlen width)
- (format:out-fill (- width numlen) (integer->char padch)))
- (if (and overch (> numlen width))
- (format:out-fill width (integer->char overch))
- (format:fn-out modifier (> width (+ digits 1)))))
- (format:fn-out modifier #t)))
-
- (else
- (format:parse-float
- (if (string? number) number (number->string number)) #t scale)
- (format:fn-strip)
- (if width
- (let ((numlen (+ format:fn-len 1)))
- (if (or (not format:fn-pos?) (eq? modifier 'at))
- (set! numlen (+ numlen 1)))
- (if (= format:fn-dot 0)
- (set! numlen (+ numlen 1)))
- (if (< numlen width)
- (format:out-fill (- width numlen) (integer->char padch)))
- (if (> numlen width) ; adjust precision if possible
- (let ((dot-index (- numlen
- (- format:fn-len format:fn-dot))))
- (if (> dot-index width)
- (if overch ; numstr too big for required width
- (format:out-fill width (integer->char overch))
- (format:fn-out modifier #t))
- (begin
- (format:fn-round (- width dot-index))
- (format:fn-out modifier #t))))
- (format:fn-out modifier #t)))
- (format:fn-out modifier #t)))))))
-
-;; format exponential flonums (~E)
-
-(define (format:out-expon modifier number pars)
- (if (not (or (number? number) (string? number)))
- (format:error "argument is not a number"))
-
- (let ((l (length pars)))
- (let ((width (format:par pars l 0 #f "width"))
- (digits (format:par pars l 1 #f "digits"))
- (edigits (format:par pars l 2 #f "exponent digits"))
- (scale (format:par pars l 3 1 #f))
- (overch (format:par pars l 4 #f #f))
- (padch (format:par pars l 5 format:space-ch #f))
- (expch (format:par pars l 6 #f #f)))
-
- (cond
- ((or (inf? number) (nan? number))
- (format:out-inf-nan number width digits edigits overch padch))
-
- (digits ; fixed precision
-
- (let ((digits (if (> scale 0)
- (if (< scale (+ digits 2))
- (+ (- digits scale) 1)
- 0)
- digits)))
- (format:parse-float
- (if (string? number) number (number->string number)) #f scale)
- (if (<= (- format:fn-len format:fn-dot) digits)
- (format:fn-zfill #f (- digits (- format:fn-len format:fn-dot)))
- (format:fn-round digits))
- (if width
- (if (and edigits overch (> format:en-len edigits))
- (format:out-fill width (integer->char overch))
- (let ((numlen (+ format:fn-len 3))) ; .E+
- (if (or (not format:fn-pos?) (eq? modifier 'at))
- (set! numlen (+ numlen 1)))
- (if (and (= format:fn-dot 0) (> width (+ digits 1)))
- (set! numlen (+ numlen 1)))
- (set! numlen
- (+ numlen
- (if (and edigits (>= edigits format:en-len))
- edigits
- format:en-len)))
- (if (< numlen width)
- (format:out-fill (- width numlen)
- (integer->char padch)))
- (if (and overch (> numlen width))
- (format:out-fill width (integer->char overch))
- (begin
- (format:fn-out modifier (> width (- numlen 1)))
- (format:en-out edigits expch)))))
- (begin
- (format:fn-out modifier #t)
- (format:en-out edigits expch)))))
-
- (else
- (format:parse-float
- (if (string? number) number (number->string number)) #f scale)
- (format:fn-strip)
- (if width
- (if (and edigits overch (> format:en-len edigits))
- (format:out-fill width (integer->char overch))
- (let ((numlen (+ format:fn-len 3))) ; .E+
- (if (or (not format:fn-pos?) (eq? modifier 'at))
- (set! numlen (+ numlen 1)))
- (if (= format:fn-dot 0)
- (set! numlen (+ numlen 1)))
- (set! numlen
- (+ numlen
- (if (and edigits (>= edigits format:en-len))
- edigits
- format:en-len)))
- (if (< numlen width)
- (format:out-fill (- width numlen)
- (integer->char padch)))
- (if (> numlen width) ; adjust precision if possible
- (let ((f (- format:fn-len format:fn-dot))) ; fract len
- (if (> (- numlen f) width)
- (if overch ; numstr too big for required width
- (format:out-fill width
- (integer->char overch))
- (begin
- (format:fn-out modifier #t)
- (format:en-out edigits expch)))
- (begin
- (format:fn-round (+ (- f numlen) width))
- (format:fn-out modifier #t)
- (format:en-out edigits expch))))
- (begin
- (format:fn-out modifier #t)
- (format:en-out edigits expch)))))
- (begin
- (format:fn-out modifier #t)
- (format:en-out edigits expch))))))))
-
-;; format general flonums (~G)
-
-(define (format:out-general modifier number pars)
- (if (not (or (number? number) (string? number)))
- (format:error "argument is not a number or a number string"))
-
- (let ((l (length pars)))
- (let ((width (if (> l 0) (list-ref pars 0) #f))
- (digits (if (> l 1) (list-ref pars 1) #f))
- (edigits (if (> l 2) (list-ref pars 2) #f))
- (overch (if (> l 4) (list-ref pars 4) #f))
- (padch (if (> l 5) (list-ref pars 5) #f)))
- (cond
- ((or (inf? number) (nan? number))
- ;; FIXME: this isn't right.
- (format:out-inf-nan number width digits edigits overch padch))
- (else
- (format:parse-float
- (if (string? number) number (number->string number)) #t 0)
- (format:fn-strip)
- (let* ((ee (if edigits (+ edigits 2) 4)) ; for the following algorithm
- (ww (if width (- width ee) #f)) ; see Steele's CL book p.395
- (n (if (= format:fn-dot 0) ; number less than (abs 1.0) ?
- (- (format:fn-zlead))
- format:fn-dot))
- (d (if digits
- digits
- (max format:fn-len (min n 7)))) ; q = format:fn-len
- (dd (- d n)))
- (if (<= 0 dd d)
- (begin
- (format:out-fixed modifier number (list ww dd #f overch padch))
- (format:out-fill ee #\space)) ;~@T not implemented yet
- (format:out-expon modifier number pars))))))))
-
-;; format dollar flonums (~$)
-
-(define (format:out-dollar modifier number pars)
- (if (not (or (number? number) (string? number)))
- (format:error "argument is not a number or a number string"))
-
- (let ((l (length pars)))
- (let ((digits (format:par pars l 0 2 "digits"))
- (mindig (format:par pars l 1 1 "mindig"))
- (width (format:par pars l 2 0 "width"))
- (padch (format:par pars l 3 format:space-ch #f)))
-
- (format:parse-float
- (if (string? number) number (number->string number)) #t 0)
- (if (<= (- format:fn-len format:fn-dot) digits)
- (format:fn-zfill #f (- digits (- format:fn-len format:fn-dot)))
- (format:fn-round digits))
- (let ((numlen (+ format:fn-len 1)))
- (if (or (not format:fn-pos?) (memq modifier '(at colon-at)))
- (set! numlen (+ numlen 1)))
- (if (and mindig (> mindig format:fn-dot))
- (set! numlen (+ numlen (- mindig format:fn-dot))))
- (if (and (= format:fn-dot 0) (not mindig))
- (set! numlen (+ numlen 1)))
- (if (< numlen width)
- (case modifier
- ((colon)
- (if (not format:fn-pos?)
- (format:out-char #\-))
- (format:out-fill (- width numlen) (integer->char padch)))
- ((at)
- (format:out-fill (- width numlen) (integer->char padch))
- (format:out-char (if format:fn-pos? #\+ #\-)))
- ((colon-at)
- (format:out-char (if format:fn-pos? #\+ #\-))
- (format:out-fill (- width numlen) (integer->char padch)))
- (else
- (format:out-fill (- width numlen) (integer->char padch))
- (if (not format:fn-pos?)
- (format:out-char #\-))))
- (if format:fn-pos?
- (if (memq modifier '(at colon-at)) (format:out-char #\+))
- (format:out-char #\-))))
- (if (and mindig (> mindig format:fn-dot))
- (format:out-fill (- mindig format:fn-dot) #\0))
- (if (and (= format:fn-dot 0) (not mindig))
- (format:out-char #\0))
- (format:out-substr format:fn-str 0 format:fn-dot)
- (format:out-char #\.)
- (format:out-substr format:fn-str format:fn-dot format:fn-len))))
-
-; the flonum buffers
-
-(define format:fn-max 400) ; max. number of number digits
-(define format:fn-str (make-string format:fn-max)) ; number buffer
-(define format:fn-len 0) ; digit length of number
-(define format:fn-dot #f) ; dot position of number
-(define format:fn-pos? #t) ; number positive?
-(define format:en-max 10) ; max. number of exponent digits
-(define format:en-str (make-string format:en-max)) ; exponent buffer
-(define format:en-len 0) ; digit length of exponent
-(define format:en-pos? #t) ; exponent positive?
-
-(define (format:parse-float num-str fixed? scale)
- (set! format:fn-pos? #t)
- (set! format:fn-len 0)
- (set! format:fn-dot #f)
- (set! format:en-pos? #t)
- (set! format:en-len 0)
- (do ((i 0 (+ i 1))
- (left-zeros 0)
- (mantissa? #t)
- (all-zeros? #t)
- (num-len (string-length num-str))
- (c #f)) ; current exam. character in num-str
- ((= i num-len)
- (if (not format:fn-dot)
- (set! format:fn-dot format:fn-len))
-
- (if all-zeros?
- (begin
- (set! left-zeros 0)
- (set! format:fn-dot 0)
- (set! format:fn-len 1)))
-
- ;; now format the parsed values according to format's need
-
- (if fixed?
-
- (begin ; fixed format m.nnn or .nnn
- (if (and (> left-zeros 0) (> format:fn-dot 0))
- (if (> format:fn-dot left-zeros)
- (begin ; norm 0{0}nn.mm to nn.mm
- (format:fn-shiftleft left-zeros)
- (set! left-zeros 0)
- (set! format:fn-dot (- format:fn-dot left-zeros)))
- (begin ; normalize 0{0}.nnn to .nnn
- (format:fn-shiftleft format:fn-dot)
- (set! left-zeros (- left-zeros format:fn-dot))
- (set! format:fn-dot 0))))
- (if (or (not (= scale 0)) (> format:en-len 0))
- (let ((shift (+ scale (format:en-int))))
- (cond
- (all-zeros? #t)
- ((> (+ format:fn-dot shift) format:fn-len)
- (format:fn-zfill
- #f (- shift (- format:fn-len format:fn-dot)))
- (set! format:fn-dot format:fn-len))
- ((< (+ format:fn-dot shift) 0)
- (format:fn-zfill #t (- (- shift) format:fn-dot))
- (set! format:fn-dot 0))
- (else
- (if (> left-zeros 0)
- (if (<= left-zeros shift) ; shift always > 0 here
- (format:fn-shiftleft shift) ; shift out 0s
- (begin
- (format:fn-shiftleft left-zeros)
- (set! format:fn-dot (- shift left-zeros))))
- (set! format:fn-dot (+ format:fn-dot shift))))))))
-
- (let ((negexp ; expon format m.nnnEee
- (if (> left-zeros 0)
- (- left-zeros format:fn-dot -1)
- (if (= format:fn-dot 0) 1 0))))
- (if (> left-zeros 0)
- (begin ; normalize 0{0}.nnn to n.nn
- (format:fn-shiftleft left-zeros)
- (set! format:fn-dot 1))
- (if (= format:fn-dot 0)
- (set! format:fn-dot 1)))
- (format:en-set (- (+ (- format:fn-dot scale) (format:en-int))
- negexp))
- (cond
- (all-zeros?
- (format:en-set 0)
- (set! format:fn-dot 1))
- ((< scale 0) ; leading zero
- (format:fn-zfill #t (- scale))
- (set! format:fn-dot 0))
- ((> scale format:fn-dot)
- (format:fn-zfill #f (- scale format:fn-dot))
- (set! format:fn-dot scale))
- (else
- (set! format:fn-dot scale)))))
- #t)
-
- ;; do body
- (set! c (string-ref num-str i)) ; parse the output of number->string
- (cond ; which can be any valid number
- ((char-numeric? c) ; representation of R4RS except
- (if mantissa? ; complex numbers
- (begin
- (if (char=? c #\0)
- (if all-zeros?
- (set! left-zeros (+ left-zeros 1)))
- (begin
- (set! all-zeros? #f)))
- (string-set! format:fn-str format:fn-len c)
- (set! format:fn-len (+ format:fn-len 1)))
- (begin
- (string-set! format:en-str format:en-len c)
- (set! format:en-len (+ format:en-len 1)))))
- ((or (char=? c #\-) (char=? c #\+))
- (if mantissa?
- (set! format:fn-pos? (char=? c #\+))
- (set! format:en-pos? (char=? c #\+))))
- ((char=? c #\.)
- (set! format:fn-dot format:fn-len))
- ((char=? c #\e)
- (set! mantissa? #f))
- ((char=? c #\E)
- (set! mantissa? #f))
- ((char-whitespace? c) #t)
- ((char=? c #\d) #t) ; decimal radix prefix
- ((char=? c #\#) #t)
- (else
- (format:error "illegal character `~c' in number->string" c)))))
-
-(define (format:en-int) ; convert exponent string to integer
- (if (= format:en-len 0)
- 0
- (do ((i 0 (+ i 1))
- (n 0))
- ((= i format:en-len)
- (if format:en-pos?
- n
- (- n)))
- (set! n (+ (* n 10) (- (char->integer (string-ref format:en-str i))
- format:zero-ch))))))
-
-(define (format:en-set en) ; set exponent string number
- (set! format:en-len 0)
- (set! format:en-pos? (>= en 0))
- (let ((en-str (number->string en)))
- (do ((i 0 (+ i 1))
- (en-len (string-length en-str))
- (c #f))
- ((= i en-len))
- (set! c (string-ref en-str i))
- (if (char-numeric? c)
- (begin
- (string-set! format:en-str format:en-len c)
- (set! format:en-len (+ format:en-len 1)))))))
-
-(define (format:fn-zfill left? n) ; fill current number string with 0s
- (if (> (+ n format:fn-len) format:fn-max) ; from the left or right
- (format:error "number is too long to format (enlarge format:fn-max)"))
- (set! format:fn-len (+ format:fn-len n))
- (if left?
- (do ((i format:fn-len (- i 1))) ; fill n 0s to left
- ((< i 0))
- (string-set! format:fn-str i
- (if (< i n)
- #\0
- (string-ref format:fn-str (- i n)))))
- (do ((i (- format:fn-len n) (+ i 1))) ; fill n 0s to the right
- ((= i format:fn-len))
- (string-set! format:fn-str i #\0))))
-
-(define (format:fn-shiftleft n) ; shift left current number n positions
- (if (> n format:fn-len)
- (format:error "internal error in format:fn-shiftleft (~d,~d)"
- n format:fn-len))
- (do ((i n (+ i 1)))
- ((= i format:fn-len)
- (set! format:fn-len (- format:fn-len n)))
- (string-set! format:fn-str (- i n) (string-ref format:fn-str i))))
-
-(define (format:fn-round digits) ; round format:fn-str
- (set! digits (+ digits format:fn-dot))
- (do ((i digits (- i 1)) ; "099",2 -> "10"
- (c 5)) ; "023",2 -> "02"
- ((or (= c 0) (< i 0)) ; "999",2 -> "100"
- (if (= c 1) ; "005",2 -> "01"
- (begin ; carry overflow
- (set! format:fn-len digits)
- (format:fn-zfill #t 1) ; add a 1 before fn-str
- (string-set! format:fn-str 0 #\1)
- (set! format:fn-dot (+ format:fn-dot 1)))
- (set! format:fn-len digits)))
- (set! c (+ (- (char->integer (string-ref format:fn-str i))
- format:zero-ch) c))
- (string-set! format:fn-str i (integer->char
- (if (< c 10)
- (+ c format:zero-ch)
- (+ (- c 10) format:zero-ch))))
- (set! c (if (< c 10) 0 1))))
-
-(define (format:fn-out modifier add-leading-zero?)
- (if format:fn-pos?
- (if (eq? modifier 'at)
- (format:out-char #\+))
- (format:out-char #\-))
- (if (= format:fn-dot 0)
- (if add-leading-zero?
- (format:out-char #\0))
- (format:out-substr format:fn-str 0 format:fn-dot))
- (format:out-char #\.)
- (format:out-substr format:fn-str format:fn-dot format:fn-len))
-
-(define (format:en-out edigits expch)
- (format:out-char (if expch (integer->char expch) format:expch))
- (format:out-char (if format:en-pos? #\+ #\-))
- (if edigits
- (if (< format:en-len edigits)
- (format:out-fill (- edigits format:en-len) #\0)))
- (format:out-substr format:en-str 0 format:en-len))
-
-(define (format:fn-strip) ; strip trailing zeros but one
- (string-set! format:fn-str format:fn-len #\0)
- (do ((i format:fn-len (- i 1)))
- ((or (not (char=? (string-ref format:fn-str i) #\0))
- (<= i format:fn-dot))
- (set! format:fn-len (+ i 1)))))
-
-(define (format:fn-zlead) ; count leading zeros
- (do ((i 0 (+ i 1)))
- ((or (= i format:fn-len)
- (not (char=? (string-ref format:fn-str i) #\0)))
- (if (= i format:fn-len) ; found a real zero
- 0
- i))))
-
-
-;;; some global functions not found in SLIB
-
-(define (string-capitalize-first str) ; "hello" -> "Hello"
- (let ((cap-str (string-copy str)) ; "hELLO" -> "Hello"
- (non-first-alpha #f) ; "*hello" -> "*Hello"
- (str-len (string-length str))) ; "hello you" -> "Hello you"
- (do ((i 0 (+ i 1)))
- ((= i str-len) cap-str)
- (let ((c (string-ref str i)))
- (if (char-alphabetic? c)
- (if non-first-alpha
- (string-set! cap-str i (char-downcase c))
- (begin
- (set! non-first-alpha #t)
- (string-set! cap-str i (char-upcase c)))))))))
-
-;; Aborts the program when a formatting error occures. This is a null
-;; argument closure to jump to the interpreters toplevel continuation.
-
-(define format:abort (lambda () (error "error in format")))
-
-(define format format:format)
-;; Thanks to Shuji Narazaki
-(module-set! the-root-module 'format format)
-
-;; If this is not possible then a continuation is used to recover
-;; properly from a format error. In this case format returns #f.
-
-;(define format:abort
-; (lambda () (format:error-continuation #f)))
-
-;(define format
-; (lambda args ; wraps format:format with an error
-; (call-with-current-continuation ; continuation
-; (lambda (cont)
-; (set! format:error-continuation cont)
-; (apply format:format args)))))
-
-;eof
diff --git a/ice-9/ftw.scm b/ice-9/ftw.scm
deleted file mode 100644
index 1d2ec5e93..000000000
--- a/ice-9/ftw.scm
+++ /dev/null
@@ -1,384 +0,0 @@
-;;;; ftw.scm --- filesystem tree walk
-
-;;;; Copyright (C) 2002 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-
-;;; Author: Thien-Thi Nguyen <ttn@gnu.org>
-
-;;; Commentary:
-
-;; Two procedures are provided: `ftw' and `nftw'.
-
-;; NOTE: The following description was adapted from the GNU libc info page, w/
-;; significant modifications for a more "Schemey" interface. Most noticible
-;; are the inlining of `struct FTW *' parameters `base' and `level' and the
-;; omission of `descriptors' parameters.
-
-;; * Types
-;;
-;; The X/Open specification defines two procedures to process whole
-;; hierarchies of directories and the contained files. Both procedures
-;; of this `ftw' family take as one of the arguments a callback procedure
-;; which must be of these types.
-;;
-;; - Data Type: __ftw_proc_t
-;; (lambda (filename statinfo flag) ...) => status
-;;
-;; Type for callback procedures given to the `ftw' procedure. The
-;; first parameter is a filename, the second parameter is the
-;; vector value as returned by calling `stat' on FILENAME.
-;;
-;; The last parameter is a symbol giving more information about
-;; FILENAM. It can have one of the following values:
-;;
-;; `regular'
-;; The current item is a normal file or files which do not fit
-;; into one of the following categories. This means
-;; especially special files, sockets etc.
-;;
-;; `directory'
-;; The current item is a directory.
-;;
-;; `invalid-stat'
-;; The `stat' call to fill the object pointed to by the second
-;; parameter failed and so the information is invalid.
-;;
-;; `directory-not-readable'
-;; The item is a directory which cannot be read.
-;;
-;; `symlink'
-;; The item is a symbolic link. Since symbolic links are
-;; normally followed seeing this value in a `ftw' callback
-;; procedure means the referenced file does not exist. The
-;; situation for `nftw' is different.
-;;
-;; - Data Type: __nftw_proc_t
-;; (lambda (filename statinfo flag base level) ...) => status
-;;
-;; The first three arguments have the same as for the
-;; `__ftw_proc_t' type. A difference is that for the third
-;; argument some additional values are defined to allow finer
-;; differentiation:
-;;
-;; `directory-processed'
-;; The current item is a directory and all subdirectories have
-;; already been visited and reported. This flag is returned
-;; instead of `directory' if the `depth' flag is given to
-;; `nftw' (see below).
-;;
-;; `stale-symlink'
-;; The current item is a stale symbolic link. The file it
-;; points to does not exist.
-;;
-;; The last two parameters are described below. They contain
-;; information to help interpret FILENAME and give some information
-;; about current state of the traversal of the directory hierarchy.
-;;
-;; `base'
-;; The value specifies which part of the filename argument
-;; given in the first parameter to the callback procedure is
-;; the name of the file. The rest of the string is the path
-;; to locate the file. This information is especially
-;; important if the `chdir' flag for `nftw' was set since then
-;; the current directory is the one the current item is found
-;; in.
-;;
-;; `level'
-;; While processing the directory the procedures tracks how
-;; many directories have been examined to find the current
-;; item. This nesting level is 0 for the item given starting
-;; item (file or directory) and is incremented by one for each
-;; entered directory.
-;;
-;; * Procedure: (ftw filename proc . options)
-;; Do a filesystem tree walk starting at FILENAME using PROC.
-;;
-;; The `ftw' procedure calls the callback procedure given in the
-;; parameter PROC for every item which is found in the directory
-;; specified by FILENAME and all directories below. The procedure
-;; follows symbolic links if necessary but does not process an item
-;; twice. If FILENAME names no directory this item is the only
-;; object reported by calling the callback procedure.
-;;
-;; The filename given to the callback procedure is constructed by
-;; taking the FILENAME parameter and appending the names of all
-;; passed directories and then the local file name. So the
-;; callback procedure can use this parameter to access the file.
-;; Before the callback procedure is called `ftw' calls `stat' for
-;; this file and passes the information up to the callback
-;; procedure. If this `stat' call was not successful the failure is
-;; indicated by setting the flag argument of the callback procedure
-;; to `invalid-stat'. Otherwise the flag is set according to the
-;; description given in the description of `__ftw_proc_t' above.
-;;
-;; The callback procedure is expected to return non-#f to indicate
-;; that no error occurred and the processing should be continued.
-;; If an error occurred in the callback procedure or the call to
-;; `ftw' shall return immediately the callback procedure can return
-;; #f. This is the only correct way to stop the procedure. The
-;; program must not use `throw' or similar techniques to continue
-;; the program in another place. [Can we relax this? --ttn]
-;;
-;; The return value of the `ftw' procedure is #t if all callback
-;; procedure calls returned #t and all actions performed by the
-;; `ftw' succeeded. If some procedure call failed (other than
-;; calling `stat' on an item) the procedure returns #f. If a
-;; callback procedure returns a value other than #t this value is
-;; returned as the return value of `ftw'.
-;;
-;; * Procedure: (nftw filename proc . control-flags)
-;; Do a new-style filesystem tree walk starting at FILENAME using PROC.
-;; Various optional CONTROL-FLAGS alter the default behavior.
-;;
-;; The `nftw' procedures works like the `ftw' procedures. It calls
-;; the callback procedure PROC for all items it finds in the
-;; directory FILENAME and below.
-;;
-;; The differences are that for one the callback procedure is of a
-;; different type. It takes also `base' and `level' parameters as
-;; described above.
-;;
-;; The second difference is that `nftw' takes additional optional
-;; arguments which are zero or more of the following symbols:
-;;
-;; physical'
-;; While traversing the directory symbolic links are not
-;; followed. I.e., if this flag is given symbolic links are
-;; reported using the `symlink' value for the type parameter
-;; to the callback procedure. Please note that if this flag is
-;; used the appearance of `symlink' in a callback procedure
-;; does not mean the referenced file does not exist. To
-;; indicate this the extra value `stale-symlink' exists.
-;;
-;; mount'
-;; The callback procedure is only called for items which are on
-;; the same mounted filesystem as the directory given as the
-;; FILENAME parameter to `nftw'.
-;;
-;; chdir'
-;; If this flag is given the current working directory is
-;; changed to the directory containing the reported object
-;; before the callback procedure is called.
-;;
-;; depth'
-;; If this option is given the procedure visits first all files
-;; and subdirectories before the callback procedure is called
-;; for the directory itself (depth-first processing). This
-;; also means the type flag given to the callback procedure is
-;; `directory-processed' and not `directory'.
-;;
-;; The return value is computed in the same way as for `ftw'.
-;; `nftw' returns #t if no failure occurred in `nftw' and all
-;; callback procedure call return values are also #t. For internal
-;; errors such as memory problems the error `ftw-error' is thrown.
-;; If the return value of a callback invocation is not #t this
-;; very same value is returned.
-
-;;; Code:
-
-(define-module (ice-9 ftw)
- :export (ftw nftw))
-
-(define (directory-files dir)
- (let ((dir-stream (opendir dir)))
- (let loop ((new (readdir dir-stream))
- (acc '()))
- (if (eof-object? new)
- acc
- (loop (readdir dir-stream)
- (if (or (string=? "." new) ;;; ignore
- (string=? ".." new)) ;;; ignore
- acc
- (cons new acc)))))))
-
-(define (pathify . nodes)
- (let loop ((nodes nodes)
- (result ""))
- (if (null? nodes)
- (or (and (string=? "" result) "")
- (substring result 1 (string-length result)))
- (loop (cdr nodes) (string-append result "/" (car nodes))))))
-
-(define (abs? filename)
- (char=? #\/ (string-ref filename 0)))
-
-(define (visited?-proc size)
- (let ((visited (make-hash-table size)))
- (lambda (s)
- (and s (let ((ino (stat:ino s)))
- (or (hash-ref visited ino)
- (begin
- (hash-set! visited ino #t)
- #f)))))))
-
-(define (stat-dir-readable?-proc uid gid)
- (let ((uid (getuid))
- (gid (getgid)))
- (lambda (s)
- (let* ((perms (stat:perms s))
- (perms-bit-set? (lambda (mask)
- (not (= 0 (logand mask perms))))))
- (or (and (= uid (stat:uid s))
- (perms-bit-set? #o400))
- (and (= gid (stat:gid s))
- (perms-bit-set? #o040))
- (perms-bit-set? #o004))))))
-
-(define (stat&flag-proc dir-readable? . control-flags)
- (let* ((directory-flag (if (memq 'depth control-flags)
- 'directory-processed
- 'directory))
- (stale-symlink-flag (if (memq 'nftw-style control-flags)
- 'stale-symlink
- 'symlink))
- (physical? (memq 'physical control-flags))
- (easy-flag (lambda (s)
- (let ((type (stat:type s)))
- (if (eq? 'directory type)
- (if (dir-readable? s)
- directory-flag
- 'directory-not-readable)
- 'regular)))))
- (lambda (name)
- (let ((s (false-if-exception (lstat name))))
- (cond ((not s)
- (values s 'invalid-stat))
- ((eq? 'symlink (stat:type s))
- (let ((s-follow (false-if-exception (stat name))))
- (cond ((not s-follow)
- (values s stale-symlink-flag))
- ((and s-follow physical?)
- (values s 'symlink))
- ((and s-follow (not physical?))
- (values s-follow (easy-flag s-follow))))))
- (else (values s (easy-flag s))))))))
-
-(define (clean name)
- (let ((last-char-index (1- (string-length name))))
- (if (char=? #\/ (string-ref name last-char-index))
- (substring name 0 last-char-index)
- name)))
-
-(define (ftw filename proc . options)
- (let* ((visited? (visited?-proc (cond ((memq 'hash-size options) => cadr)
- (else 211))))
- (stat&flag (stat&flag-proc
- (stat-dir-readable?-proc (getuid) (getgid)))))
- (letrec ((go (lambda (fullname)
- (call-with-values (lambda () (stat&flag fullname))
- (lambda (s flag)
- (or (visited? s)
- (let ((ret (proc fullname s flag))) ; callback
- (or (eq? #t ret)
- (throw 'ftw-early-exit ret))
- (and (eq? 'directory flag)
- (for-each
- (lambda (child)
- (go (pathify fullname child)))
- (directory-files fullname)))
- #t)))))))
- (catch 'ftw-early-exit
- (lambda () (go (clean filename)))
- (lambda (key val) val)))))
-
-(define (nftw filename proc . control-flags)
- (let* ((od (getcwd)) ; orig dir
- (odev (let ((s (false-if-exception (lstat filename))))
- (if s (stat:dev s) -1)))
- (same-dev? (if (memq 'mount control-flags)
- (lambda (s) (= (stat:dev s) odev))
- (lambda (s) #t)))
- (base-sub (lambda (name base) (substring name 0 base)))
- (maybe-cd (if (memq 'chdir control-flags)
- (if (abs? filename)
- (lambda (fullname base)
- (or (= 0 base)
- (chdir (base-sub fullname base))))
- (lambda (fullname base)
- (chdir
- (pathify od (base-sub fullname base)))))
- (lambda (fullname base) #t)))
- (maybe-cd-back (if (memq 'chdir control-flags)
- (lambda () (chdir od))
- (lambda () #t)))
- (depth-first? (memq 'depth control-flags))
- (visited? (visited?-proc
- (cond ((memq 'hash-size control-flags) => cadr)
- (else 211))))
- (has-kids? (if depth-first?
- (lambda (flag) (eq? flag 'directory-processed))
- (lambda (flag) (eq? flag 'directory))))
- (stat&flag (apply stat&flag-proc
- (stat-dir-readable?-proc (getuid) (getgid))
- (cons 'nftw-style control-flags))))
- (letrec ((go (lambda (fullname base level)
- (call-with-values (lambda () (stat&flag fullname))
- (lambda (s flag)
- (letrec ((self (lambda ()
- (maybe-cd fullname base)
- ;; the callback
- (let ((ret (proc fullname s flag
- base level)))
- (maybe-cd-back)
- (or (eq? #t ret)
- (throw 'nftw-early-exit ret)))))
- (kids (lambda ()
- (and (has-kids? flag)
- (for-each
- (lambda (child)
- (go (pathify fullname child)
- (1+ (string-length
- fullname))
- (1+ level)))
- (directory-files fullname))))))
- (or (visited? s)
- (not (same-dev? s))
- (if depth-first?
- (begin (kids) (self))
- (begin (self) (kids)))))))
- #t)))
- (let ((ret (catch 'nftw-early-exit
- (lambda () (go (clean filename) 0 0))
- (lambda (key val) val))))
- (chdir od)
- ret))))
-
-;;; ftw.scm ends here
diff --git a/ice-9/gap-buffer.scm b/ice-9/gap-buffer.scm
deleted file mode 100644
index d3c2f167f..000000000
--- a/ice-9/gap-buffer.scm
+++ /dev/null
@@ -1,308 +0,0 @@
-;;; gap-buffer.scm --- String buffer that supports point
-
-;;; Copyright (C) 2002 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, 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 GUILE.
-;;;
-;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;; code from other Free Software Foundation releases into a copy of
-;;; GUILE, 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 GUILE, it is your choice
-;;; whether to permit this exception to apply to your modifications.
-;;; If you do not wish that, delete this exception notice.
-;;;
-
-;;; Author: Thien-Thi Nguyen <ttn@gnu.org>
-
-;;; Commentary:
-
-;; A gap buffer is a structure that models a string but allows relatively
-;; efficient insertion of text somewhere in the middle. The insertion
-;; location is called `point' with minimum value 1, and a maximum value of the
-;; length of the string (which is not fixed).
-;;
-;; Specifically, we allocate a continuous buffer of characters that is
-;; composed of the BEFORE, the GAP and the AFTER (reading L->R), like so:
-;;
-;; +--- POINT
-;; v
-;; +--------------------+--------------------+--------------------+
-;; | BEFORE | GAP | AFTER |
-;; +--------------------+--------------------+--------------------+
-;;
-;; <----- bef-sz ----->|<----- gap-sz ----->|<----- aft-sz ----->
-;;
-;; <-------------------| usr-sz |------------------->
-;;
-;; <-------------------------- all-sz -------------------------->
-;;
-;; This diagram also shows how the different sizes are computed, and the
-;; location of POINT. Note that the user-visible buffer size `usr-sz' does
-;; NOT include the GAP, while the allocation `all-sz' DOES.
-;;
-;; The consequence of this arrangement is that "moving point" is simply a
-;; matter of kicking characters across the GAP, while insertion can be viewed
-;; as filling up the gap, increasing `bef-sz' and decreasing `gap-sz'. When
-;; `gap-sz' falls below some threshold, we reallocate with a larger `all-sz'.
-;;
-;; In the implementation, we actually keep track of the AFTER start offset
-;; `aft-ofs' since it is used more often than `gap-sz'. In fact, most of the
-;; variables in the diagram are for conceptualization only.
-;;
-;; A gap buffer port is a soft port (see Guile manual) that wraps a gap
-;; buffer. Character and string writes, as well as character reads, are
-;; supported. Flushing and closing are not supported.
-;;
-;; These procedures are exported:
-;; (gb? OBJ)
-;; (make-gap-buffer . INIT)
-;; (gb-point GB)
-;; (gb-point-min GB)
-;; (gb-point-max GB)
-;; (gb-insert-string! GB STRING)
-;; (gb-insert-char! GB CHAR)
-;; (gb-delete-char! GB COUNT)
-;; (gb-goto-char GB LOCATION)
-;; (gb->string GB)
-;; (gb-filter! GB STRING-PROC)
-;; (gb->lines GB)
-;; (gb-filter-lines! GB LINES-PROC)
-;; (make-gap-buffer-port GB)
-;;
-;; INIT is an optional port or a string. COUNT and LOCATION are integers.
-;; STRING-PROC is a procedure that takes and returns a string. LINES-PROC is
-;; a procedure that takes and returns a list of strings, each representing a
-;; line of text (newlines are stripped and added back automatically).
-;;
-;; (The term and concept of "gap buffer" are borrowed from Emacs. We will
-;; gladly return them when libemacs.so is available. ;-)
-;;
-;; Notes:
-;; - overrun errors are suppressed silently
-
-;;; Code:
-
-(define-module (ice-9 gap-buffer)
- :autoload (srfi srfi-13) (string-join)
- :export (gb?
- make-gap-buffer
- gb-point
- gb-point-min
- gb-point-max
- gb-insert-string!
- gb-insert-char!
- gb-delete-char!
- gb-erase!
- gb-goto-char
- gb->string
- gb-filter!
- gb->lines
- gb-filter-lines!
- make-gap-buffer-port))
-
-(define gap-buffer
- (make-record-type 'gap-buffer
- '(s ; the buffer, a string
- all-sz ; total allocation
- gap-ofs ; GAP starts, aka (1- point)
- aft-ofs ; AFTER starts
- )))
-
-(define gb? (record-predicate gap-buffer))
-
-(define s: (record-accessor gap-buffer 's))
-(define all-sz: (record-accessor gap-buffer 'all-sz))
-(define gap-ofs: (record-accessor gap-buffer 'gap-ofs))
-(define aft-ofs: (record-accessor gap-buffer 'aft-ofs))
-
-(define s! (record-modifier gap-buffer 's))
-(define all-sz! (record-modifier gap-buffer 'all-sz))
-(define gap-ofs! (record-modifier gap-buffer 'gap-ofs))
-(define aft-ofs! (record-modifier gap-buffer 'aft-ofs))
-
-;; todo: expose
-(define default-initial-allocation 128)
-(define default-chunk-size 128)
-(define default-realloc-threshold 32)
-
-(define (round-up n)
- (* default-chunk-size (+ 1 (quotient n default-chunk-size))))
-
-(define new (record-constructor gap-buffer '()))
-
-(define (realloc gb inc)
- (let* ((old-s (s: gb))
- (all-sz (all-sz: gb))
- (new-sz (+ all-sz inc))
- (gap-ofs (gap-ofs: gb))
- (aft-ofs (aft-ofs: gb))
- (new-s (make-string new-sz))
- (new-aft-ofs (+ aft-ofs inc)))
- (substring-move! old-s 0 gap-ofs new-s 0)
- (substring-move! old-s aft-ofs all-sz new-s new-aft-ofs)
- (s! gb new-s)
- (all-sz! gb new-sz)
- (aft-ofs! gb new-aft-ofs)))
-
-(define (make-gap-buffer . init) ; port/string
- (let ((gb (new)))
- (cond ((null? init)
- (s! gb (make-string default-initial-allocation))
- (all-sz! gb default-initial-allocation)
- (gap-ofs! gb 0)
- (aft-ofs! gb default-initial-allocation))
- (else (let ((jam! (lambda (string len)
- (let ((alloc (round-up len)))
- (s! gb (make-string alloc))
- (all-sz! gb alloc)
- (substring-move! string 0 len (s: gb) 0)
- (gap-ofs! gb len)
- (aft-ofs! gb alloc))))
- (v (car init)))
- (cond ((port? v)
- (let ((next (lambda () (read-char v))))
- (let loop ((c (next)) (acc '()) (len 0))
- (if (eof-object? c)
- (jam! (list->string (reverse acc)) len)
- (loop (next) (cons c acc) (1+ len))))))
- ((string? v)
- (jam! v (string-length v)))
- (else (error "bad init type"))))))
- gb))
-
-(define (gb-point gb)
- (1+ (gap-ofs: gb)))
-
-(define (gb-point-min gb) 1) ; no narrowing (for now)
-
-(define (gb-point-max gb)
- (1+ (- (all-sz: gb) (- (aft-ofs: gb) (gap-ofs: gb)))))
-
-(define (insert-prep gb len)
- (let* ((gap-ofs (gap-ofs: gb))
- (aft-ofs (aft-ofs: gb))
- (slack (- (- aft-ofs gap-ofs) len)))
- (and (< slack default-realloc-threshold)
- (realloc gb (round-up (- slack))))
- gap-ofs))
-
-(define (gb-insert-string! gb string)
- (let* ((len (string-length string))
- (gap-ofs (insert-prep gb len)))
- (substring-move! string 0 len (s: gb) gap-ofs)
- (gap-ofs! gb (+ gap-ofs len))))
-
-(define (gb-insert-char! gb char)
- (let ((gap-ofs (insert-prep gb 1)))
- (string-set! (s: gb) gap-ofs char)
- (gap-ofs! gb (+ gap-ofs 1))))
-
-(define (gb-delete-char! gb count)
- (cond ((< count 0) ; backwards
- (gap-ofs! gb (max 0 (+ (gap-ofs: gb) count))))
- ((> count 0) ; forwards
- (aft-ofs! gb (min (all-sz: gb) (+ (aft-ofs: gb) count))))
- ((= count 0) ; do nothing
- #t)))
-
-(define (gb-erase! gb)
- (gap-ofs! gb 0)
- (aft-ofs! gb (all-sz: gb)))
-
-(define (point++n! gb n s gap-ofs aft-ofs) ; n>0; warning: reckless
- (substring-move-left! s aft-ofs (+ aft-ofs n) s gap-ofs)
- (gap-ofs! gb (+ gap-ofs n))
- (aft-ofs! gb (+ aft-ofs n)))
-
-(define (point+-n! gb n s gap-ofs aft-ofs) ; n<0; warning: reckless
- (substring-move-right! s (+ gap-ofs n) gap-ofs s (+ aft-ofs n))
- (gap-ofs! gb (+ gap-ofs n))
- (aft-ofs! gb (+ aft-ofs n)))
-
-(define (gb-goto-char gb new-point)
- (let ((pmax (gb-point-max gb)))
- (or (and (< new-point 1) (gb-goto-char gb 1))
- (and (> new-point pmax) (gb-goto-char gb pmax))
- (let ((delta (- new-point (gb-point gb))))
- (or (= delta 0)
- ((if (< delta 0)
- point+-n!
- point++n!)
- gb delta (s: gb) (gap-ofs: gb) (aft-ofs: gb))))))
- new-point)
-
-(define (gb->string gb)
- (let ((s (s: gb)))
- (string-append (substring s 0 (gap-ofs: gb))
- (substring s (aft-ofs: gb)))))
-
-(define (gb-filter! gb string-proc)
- (let ((new (string-proc (gb->string gb))))
- (gb-erase! gb)
- (gb-insert-string! gb new)))
-
-(define (gb->lines gb)
- (let ((str (gb->string gb)))
- (let loop ((start 0) (acc '()))
- (cond ((string-index str #\newline start)
- => (lambda (w)
- (loop (1+ w) (cons (substring str start w) acc))))
- (else (reverse (cons (substring str start) acc)))))))
-
-(define (gb-filter-lines! gb lines-proc)
- (let ((new-lines (lines-proc (gb->lines gb))))
- (gb-erase! gb)
- (gb-insert-string! gb (string-join new-lines #\newline))))
-
-(define (make-gap-buffer-port gb)
- (or (gb? gb)
- (error "not a gap-buffer:" gb))
- (make-soft-port
- (vector
- (lambda (c) (gb-insert-char! gb c))
- (lambda (s) (gb-insert-string! gb s))
- #f
- (lambda () (let ((gap-ofs (gap-ofs: gb))
- (aft-ofs (aft-ofs: gb)))
- (if (= aft-ofs (all-sz: gb))
- #f
- (let* ((s (s: gb))
- (c (string-ref s aft-ofs)))
- (string-set! s gap-ofs c)
- (gap-ofs! gb (1+ gap-ofs))
- (aft-ofs! gb (1+ aft-ofs))
- c))))
- #f)
- "rw"))
-
-;;; gap-buffer.scm ends here
diff --git a/ice-9/getopt-long.scm b/ice-9/getopt-long.scm
deleted file mode 100644
index 66a723ee5..000000000
--- a/ice-9/getopt-long.scm
+++ /dev/null
@@ -1,449 +0,0 @@
-;;; Copyright (C) 1998, 2001 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 of the License, 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 program; 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 GUILE.
-;;;
-;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;; code from other Free Software Foundation releases into a copy of
-;;; GUILE, 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 GUILE, it is your choice
-;;; whether to permit this exception to apply to your modifications.
-;;; If you do not wish that, delete this exception notice.
-
-;;; Author: Russ McManus (rewritten by Thien-Thi Nguyen)
-
-;;; Commentary:
-
-;;; This module implements some complex command line option parsing, in
-;;; the spirit of the GNU C library function `getopt_long'. Both long
-;;; and short options are supported.
-;;;
-;;; The theory is that people should be able to constrain the set of
-;;; options they want to process using a grammar, rather than some arbitrary
-;;; structure. The grammar makes the option descriptions easy to read.
-;;;
-;;; `getopt-long' is a procedure for parsing command-line arguments in a
-;;; manner consistent with other GNU programs. `option-ref' is a procedure
-;;; that facilitates processing of the `getopt-long' return value.
-
-;;; (getopt-long ARGS GRAMMAR)
-;;; Parse the arguments ARGS according to the argument list grammar GRAMMAR.
-;;;
-;;; ARGS should be a list of strings. Its first element should be the
-;;; name of the program; subsequent elements should be the arguments
-;;; that were passed to the program on the command line. The
-;;; `program-arguments' procedure returns a list of this form.
-;;;
-;;; GRAMMAR is a list of the form:
-;;; ((OPTION (PROPERTY VALUE) ...) ...)
-;;;
-;;; Each OPTION should be a symbol. `getopt-long' will accept a
-;;; command-line option named `--OPTION'.
-;;; Each option can have the following (PROPERTY VALUE) pairs:
-;;;
-;;; (single-char CHAR) --- Accept `-CHAR' as a single-character
-;;; equivalent to `--OPTION'. This is how to specify traditional
-;;; Unix-style flags.
-;;; (required? BOOL) --- If BOOL is true, the option is required.
-;;; getopt-long will raise an error if it is not found in ARGS.
-;;; (value BOOL) --- If BOOL is #t, the option accepts a value; if
-;;; it is #f, it does not; and if it is the symbol
-;;; `optional', the option may appear in ARGS with or
-;;; without a value.
-;;; (predicate FUNC) --- If the option accepts a value (i.e. you
-;;; specified `(value #t)' for this option), then getopt
-;;; will apply FUNC to the value, and throw an exception
-;;; if it returns #f. FUNC should be a procedure which
-;;; accepts a string and returns a boolean value; you may
-;;; need to use quasiquotes to get it into GRAMMAR.
-;;;
-;;; The (PROPERTY VALUE) pairs may occur in any order, but each
-;;; property may occur only once. By default, options do not have
-;;; single-character equivalents, are not required, and do not take
-;;; values.
-;;;
-;;; In ARGS, single-character options may be combined, in the usual
-;;; Unix fashion: ("-x" "-y") is equivalent to ("-xy"). If an option
-;;; accepts values, then it must be the last option in the
-;;; combination; the value is the next argument. So, for example, using
-;;; the following grammar:
-;;; ((apples (single-char #\a))
-;;; (blimps (single-char #\b) (value #t))
-;;; (catalexis (single-char #\c) (value #t)))
-;;; the following argument lists would be acceptable:
-;;; ("-a" "-b" "bang" "-c" "couth") ("bang" and "couth" are the values
-;;; for "blimps" and "catalexis")
-;;; ("-ab" "bang" "-c" "couth") (same)
-;;; ("-ac" "couth" "-b" "bang") (same)
-;;; ("-abc" "couth" "bang") (an error, since `-b' is not the
-;;; last option in its combination)
-;;;
-;;; If an option's value is optional, then `getopt-long' decides
-;;; whether it has a value by looking at what follows it in ARGS. If
-;;; the next element is does not appear to be an option itself, then
-;;; that element is the option's value.
-;;;
-;;; The value of a long option can appear as the next element in ARGS,
-;;; or it can follow the option name, separated by an `=' character.
-;;; Thus, using the same grammar as above, the following argument lists
-;;; are equivalent:
-;;; ("--apples" "Braeburn" "--blimps" "Goodyear")
-;;; ("--apples=Braeburn" "--blimps" "Goodyear")
-;;; ("--blimps" "Goodyear" "--apples=Braeburn")
-;;;
-;;; If the option "--" appears in ARGS, argument parsing stops there;
-;;; subsequent arguments are returned as ordinary arguments, even if
-;;; they resemble options. So, in the argument list:
-;;; ("--apples" "Granny Smith" "--" "--blimp" "Goodyear")
-;;; `getopt-long' will recognize the `apples' option as having the
-;;; value "Granny Smith", but it will not recognize the `blimp'
-;;; option; it will return the strings "--blimp" and "Goodyear" as
-;;; ordinary argument strings.
-;;;
-;;; The `getopt-long' function returns the parsed argument list as an
-;;; assocation list, mapping option names --- the symbols from GRAMMAR
-;;; --- onto their values, or #t if the option does not accept a value.
-;;; Unused options do not appear in the alist.
-;;;
-;;; All arguments that are not the value of any option are returned
-;;; as a list, associated with the empty list.
-;;;
-;;; `getopt-long' throws an exception if:
-;;; - it finds an unrecognized property in GRAMMAR
-;;; - the value of the `single-char' property is not a character
-;;; - it finds an unrecognized option in ARGS
-;;; - a required option is omitted
-;;; - an option that requires an argument doesn't get one
-;;; - an option that doesn't accept an argument does get one (this can
-;;; only happen using the long option `--opt=value' syntax)
-;;; - an option predicate fails
-;;;
-;;; So, for example:
-;;;
-;;; (define grammar
-;;; `((lockfile-dir (required? #t)
-;;; (value #t)
-;;; (single-char #\k)
-;;; (predicate ,file-is-directory?))
-;;; (verbose (required? #f)
-;;; (single-char #\v)
-;;; (value #f))
-;;; (x-includes (single-char #\x))
-;;; (rnet-server (single-char #\y)
-;;; (predicate ,string?))))
-;;;
-;;; (getopt-long '("my-prog" "-vk" "/tmp" "foo1" "--x-includes=/usr/include"
-;;; "--rnet-server=lamprod" "--" "-fred" "foo2" "foo3")
-;;; grammar)
-;;; => ((() "foo1" "-fred" "foo2" "foo3")
-;;; (rnet-server . "lamprod")
-;;; (x-includes . "/usr/include")
-;;; (lockfile-dir . "/tmp")
-;;; (verbose . #t))
-
-;;; (option-ref OPTIONS KEY DEFAULT)
-;;; Return value in alist OPTIONS using KEY, a symbol; or DEFAULT if not
-;;; found. The value is either a string or `#t'.
-;;;
-;;; For example, using the `getopt-long' return value from above:
-;;;
-;;; (option-ref (getopt-long ...) 'x-includes 42) => "/usr/include"
-;;; (option-ref (getopt-long ...) 'not-a-key! 31) => 31
-
-;;; Code:
-
-(define-module (ice-9 getopt-long)
- :use-module ((ice-9 common-list) :select (some remove-if-not))
- :export (getopt-long option-ref))
-
-(define option-spec-fields '(name
- value
- required?
- single-char
- predicate
- value-policy))
-
-(define option-spec (make-record-type 'option-spec option-spec-fields))
-(define make-option-spec (record-constructor option-spec option-spec-fields))
-
-(define (define-one-option-spec-field-accessor field)
- `(define ,(symbol-append 'option-spec-> field) ;;; name slib-compat
- (record-accessor option-spec ',field)))
-
-(define (define-one-option-spec-field-modifier field)
- `(define ,(symbol-append 'set-option-spec- field '!) ;;; name slib-compat
- (record-modifier option-spec ',field)))
-
-(defmacro define-all-option-spec-accessors/modifiers ()
- `(begin
- ,@(map define-one-option-spec-field-accessor option-spec-fields)
- ,@(map define-one-option-spec-field-modifier option-spec-fields)))
-
-(define-all-option-spec-accessors/modifiers)
-
-(define make-option-spec
- (let ((ctor (record-constructor option-spec '(name))))
- (lambda (name)
- (ctor name))))
-
-(define (parse-option-spec desc)
- (let ((spec (make-option-spec (symbol->string (car desc)))))
- (for-each (lambda (desc-elem)
- (let ((given (lambda () (cadr desc-elem))))
- (case (car desc-elem)
- ((required?)
- (set-option-spec-required?! spec (given)))
- ((value)
- (set-option-spec-value-policy! spec (given)))
- ((single-char)
- (or (char? (given))
- (error "`single-char' value must be a char!"))
- (set-option-spec-single-char! spec (given)))
- ((predicate)
- (set-option-spec-predicate!
- spec ((lambda (pred)
- (lambda (name val)
- (or (not val)
- (pred val)
- (error "option predicate failed:" name))))
- (given))))
- (else
- (error "invalid getopt-long option property:"
- (car desc-elem))))))
- (cdr desc))
- spec))
-
-(define (split-arg-list argument-list)
- ;; Scan ARGUMENT-LIST for "--" and return (BEFORE-LS . AFTER-LS).
- ;; Discard the "--". If no "--" is found, AFTER-LS is empty.
- (let loop ((yes '()) (no argument-list))
- (cond ((null? no) (cons (reverse yes) no))
- ((string=? "--" (car no)) (cons (reverse yes) (cdr no)))
- (else (loop (cons (car no) yes) (cdr no))))))
-
-(define short-opt-rx (make-regexp "^-([a-zA-Z]+)(.*)"))
-(define long-opt-no-value-rx (make-regexp "^--([^=]+)$"))
-(define long-opt-with-value-rx (make-regexp "^--([^=]+)=(.*)"))
-
-(define (match-substring match which)
- ;; condensed from (ice-9 regex) `match:{substring,start,end}'
- (let ((sel (vector-ref match (1+ which))))
- (substring (vector-ref match 0) (car sel) (cdr sel))))
-
-(define (expand-clumped-singles opt-ls)
- ;; example: ("--xyz" "-abc5d") => ("--xyz" "-a" "-b" "-c" "5d")
- (let loop ((opt-ls opt-ls) (ret-ls '()))
- (cond ((null? opt-ls)
- (reverse ret-ls)) ;;; retval
- ((regexp-exec short-opt-rx (car opt-ls))
- => (lambda (match)
- (let ((singles (reverse
- (map (lambda (c)
- (string-append "-" (make-string 1 c)))
- (string->list
- (match-substring match 1)))))
- (extra (match-substring match 2)))
- (loop (cdr opt-ls)
- (append (if (string=? "" extra)
- singles
- (cons extra singles))
- ret-ls)))))
- (else (loop (cdr opt-ls)
- (cons (car opt-ls) ret-ls))))))
-
-(define (looks-like-an-option string)
- (some (lambda (rx)
- (regexp-exec rx string))
- `(,short-opt-rx
- ,long-opt-with-value-rx
- ,long-opt-no-value-rx)))
-
-(define (process-options specs argument-ls)
- ;; Use SPECS to scan ARGUMENT-LS; return (FOUND . ETC).
- ;; FOUND is an unordered list of option specs for found options, while ETC
- ;; is an order-maintained list of elements in ARGUMENT-LS that are neither
- ;; options nor their values.
- (let ((idx (map (lambda (spec)
- (cons (option-spec->name spec) spec))
- specs))
- (sc-idx (map (lambda (spec)
- (cons (make-string 1 (option-spec->single-char spec))
- spec))
- (remove-if-not option-spec->single-char specs))))
- (let loop ((argument-ls argument-ls) (found '()) (etc '()))
- (let ((eat! (lambda (spec ls)
- (let ((val!loop (lambda (val n-ls n-found n-etc)
- (set-option-spec-value!
- spec
- ;; handle multiple occurrances
- (cond ((option-spec->value spec)
- => (lambda (cur)
- ((if (list? cur) cons list)
- val cur)))
- (else val)))
- (loop n-ls n-found n-etc)))
- (ERR:no-arg (lambda ()
- (error (string-append
- "option must be specified"
- " with argument:")
- (option-spec->name spec)))))
- (cond
- ((eq? 'optional (option-spec->value-policy spec))
- (if (or (null? (cdr ls))
- (looks-like-an-option (cadr ls)))
- (val!loop #t
- (cdr ls)
- (cons spec found)
- etc)
- (val!loop (cadr ls)
- (cddr ls)
- (cons spec found)
- etc)))
- ((eq? #t (option-spec->value-policy spec))
- (if (or (null? (cdr ls))
- (looks-like-an-option (cadr ls)))
- (ERR:no-arg)
- (val!loop (cadr ls)
- (cddr ls)
- (cons spec found)
- etc)))
- (else
- (val!loop #t
- (cdr ls)
- (cons spec found)
- etc)))))))
- (if (null? argument-ls)
- (cons found (reverse etc)) ;;; retval
- (cond ((regexp-exec short-opt-rx (car argument-ls))
- => (lambda (match)
- (let* ((c (match-substring match 1))
- (spec (or (assoc-ref sc-idx c)
- (error "no such option:" c))))
- (eat! spec argument-ls))))
- ((regexp-exec long-opt-no-value-rx (car argument-ls))
- => (lambda (match)
- (let* ((opt (match-substring match 1))
- (spec (or (assoc-ref idx opt)
- (error "no such option:" opt))))
- (eat! spec argument-ls))))
- ((regexp-exec long-opt-with-value-rx (car argument-ls))
- => (lambda (match)
- (let* ((opt (match-substring match 1))
- (spec (or (assoc-ref idx opt)
- (error "no such option:" opt))))
- (if (option-spec->value-policy spec)
- (eat! spec (append
- (list 'ignored
- (match-substring match 2))
- (cdr argument-ls)))
- (error "option does not support argument:"
- opt)))))
- (else
- (loop (cdr argument-ls)
- found
- (cons (car argument-ls) etc)))))))))
-
-(define (getopt-long program-arguments option-desc-list)
- "Process options, handling both long and short options, similar to
-the glibc function 'getopt_long'. PROGRAM-ARGUMENTS should be a value
-similar to what (program-arguments) returns. OPTION-DESC-LIST is a
-list of option descriptions. Each option description must satisfy the
-following grammar:
-
- <option-spec> :: (<name> . <attribute-ls>)
- <attribute-ls> :: (<attribute> . <attribute-ls>)
- | ()
- <attribute> :: <required-attribute>
- | <arg-required-attribute>
- | <single-char-attribute>
- | <predicate-attribute>
- | <value-attribute>
- <required-attribute> :: (required? <boolean>)
- <single-char-attribute> :: (single-char <char>)
- <value-attribute> :: (value #t)
- (value #f)
- (value optional)
- <predicate-attribute> :: (predicate <1-ary-function>)
-
- The procedure returns an alist of option names and values. Each
-option name is a symbol. The option value will be '#t' if no value
-was specified. There is a special item in the returned alist with a
-key of the empty list, (): the list of arguments that are not options
-or option values.
- By default, options are not required, and option values are not
-required. By default, single character equivalents are not supported;
-if you want to allow the user to use single character options, you need
-to add a `single-char' clause to the option description."
- (let* ((specifications (map parse-option-spec option-desc-list))
- (pair (split-arg-list (cdr program-arguments)))
- (split-ls (expand-clumped-singles (car pair)))
- (non-split-ls (cdr pair))
- (found/etc (process-options specifications split-ls))
- (found (car found/etc))
- (rest-ls (append (cdr found/etc) non-split-ls)))
- (for-each (lambda (spec)
- (let ((name (option-spec->name spec))
- (val (option-spec->value spec)))
- (and (option-spec->required? spec)
- (or (memq spec found)
- (error "option must be specified:" name)))
- (and (memq spec found)
- (eq? #t (option-spec->value-policy spec))
- (or val
- (error "option must be specified with argument:"
- name)))
- (let ((pred (option-spec->predicate spec)))
- (and pred (pred name val)))))
- specifications)
- (cons (cons '() rest-ls)
- (let ((multi-count (map (lambda (desc)
- (cons (car desc) 0))
- option-desc-list)))
- (map (lambda (spec)
- (let ((name (string->symbol (option-spec->name spec))))
- (cons name
- ;; handle multiple occurrances
- (let ((maybe-ls (option-spec->value spec)))
- (if (list? maybe-ls)
- (let* ((look (assq name multi-count))
- (idx (cdr look))
- (val (list-ref maybe-ls idx)))
- (set-cdr! look (1+ idx)) ; ugh!
- val)
- maybe-ls)))))
- found)))))
-
-(define (option-ref options key default)
- "Return value in alist OPTIONS using KEY, a symbol; or DEFAULT if not found.
-The value is either a string or `#t'."
- (or (assq-ref options key) default))
-
-;;; getopt-long.scm ends here
diff --git a/ice-9/hcons.scm b/ice-9/hcons.scm
deleted file mode 100644
index 811f9fd48..000000000
--- a/ice-9/hcons.scm
+++ /dev/null
@@ -1,105 +0,0 @@
-;;; installed-scm-file
-
-;;;; Copyright (C) 1995, 1996, 1998, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-
-(define-module (ice-9 hcons)
- :export (hashq-cons-hash hashq-cons-assoc hashq-cons-get-handle
- hashq-cons-create-handle! hashq-cons-ref hashq-cons-set! hashq-cons
- hashq-conser make-gc-buffer))
-
-
-;;; {Eq? hash-consing}
-;;;
-;;; A hash conser maintains a private universe of pairs s.t. if
-;;; two cons calls pass eq? arguments, the pairs returned are eq?.
-;;;
-;;; A hash conser does not contribute life to the pairs it returns.
-;;;
-
-(define (hashq-cons-hash pair n)
- (modulo (logxor (hashq (car pair) 4194303)
- (hashq (cdr pair) 4194303))
- n))
-
-(define (hashq-cons-assoc key l)
- (and (not (null? l))
- (or (and (pair? l) ; If not a pair, use its cdr?
- (pair? (car l))
- (pair? (caar l))
- (eq? (car key) (caaar l))
- (eq? (cdr key) (cdaar l))
- (car l))
- (hashq-cons-assoc key (cdr l)))))
-
-(define (hashq-cons-get-handle table key)
- (hashx-get-handle hashq-cons-hash hashq-cons-assoc table key #f))
-
-(define (hashq-cons-create-handle! table key init)
- (hashx-create-handle! hashq-cons-hash hashq-cons-assoc table key init))
-
-(define (hashq-cons-ref table key)
- (hashx-ref hashq-cons-hash hashq-cons-assoc table key #f))
-
-(define (hashq-cons-set! table key val)
- (hashx-set! hashq-cons-hash hashq-cons-assoc table key val))
-
-(define (hashq-cons table a d)
- (car (hashq-cons-create-handle! table (cons a d) #f)))
-
-(define (hashq-conser hash-tab-or-size)
- (let ((table (if (vector? hash-tab-or-size)
- hash-tab-or-size
- (make-doubly-weak-hash-table hash-tab-or-size))))
- (lambda (a d) (hashq-cons table a d))))
-
-
-
-
-(define (make-gc-buffer n)
- (let ((ring (make-list n #f)))
- (append! ring ring)
- (lambda (next)
- (set-car! ring next)
- (set! ring (cdr ring))
- next)))
diff --git a/ice-9/history.scm b/ice-9/history.scm
deleted file mode 100644
index 6ff1b25a5..000000000
--- a/ice-9/history.scm
+++ /dev/null
@@ -1,65 +0,0 @@
-;;;; Copyright (C) 2000, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-;;;; A simple value history support
-
-(define-module (ice-9 history))
-
-(process-define-module '((value-history)))
-
-(define (use-value-history x)
- (module-use! (current-module)
- (resolve-module '(value-history))))
-
-(define save-value-history
- (let ((count 0)
- (history (resolve-module '(value-history))))
- (lambda (v)
- (if (not (unspecified? v))
- (let* ((c (1+ count))
- (s (string->symbol (simple-format #f "$~A" c))))
- (simple-format #t "~A = " s)
- (module-define! history s v)
- (set! count c))))))
-
-(add-hook! before-eval-hook use-value-history)
-(add-hook! before-print-hook save-value-history)
diff --git a/ice-9/lineio.scm b/ice-9/lineio.scm
deleted file mode 100644
index c18e87f7e..000000000
--- a/ice-9/lineio.scm
+++ /dev/null
@@ -1,140 +0,0 @@
-;;; installed-scm-file
-
-;;;; Copyright (C) 1996, 1998, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-
-
-(define-module (ice-9 lineio)
- :use-module (ice-9 readline)
- :export (unread-string read-string lineio-port?
- make-line-buffering-input-port))
-
-
-;;; {Line Buffering Input Ports}
-;;;
-;;; [This is a work-around to get past certain deficiencies in the capabilities
-;;; of ports. Eventually, ports should be fixed and this module nuked.]
-;;;
-;;; A line buffering input port supports:
-;;;
-;;; read-string which returns the next line of input
-;;; unread-string which pushes a line back onto the stream
-;;;
-;;; The implementation of unread-string is kind of limited; it doesn't
-;;; interact properly with unread-char, or any of the other port
-;;; reading functions. Only read-string will get you back the things that
-;;; unread-string accepts.
-;;;
-;;; Normally a "line" is all characters up to and including a newline.
-;;; If lines are put back using unread-string, they can be broken arbitrarily
-;;; -- that is, read-string returns strings passed to unread-string (or
-;;; shared substrings of them).
-;;;
-
-;; read-string port
-;; unread-string port str
-;; Read (or buffer) a line from PORT.
-;;
-;; Not all ports support these functions -- only those with
-;; 'unread-string and 'read-string properties, bound to hooks
-;; implementing these functions.
-;;
-(define (unread-string str line-buffering-input-port)
- ((object-property line-buffering-input-port 'unread-string) str))
-
-;;
-(define (read-string line-buffering-input-port)
- ((object-property line-buffering-input-port 'read-string)))
-
-
-(define (lineio-port? port)
- (not (not (object-property port 'read-string))))
-
-;; make-line-buffering-input-port port
-;; Return a wrapper for PORT. The wrapper handles read-string/unread-string.
-;;
-;; The port returned by this function reads newline terminated lines from PORT.
-;; It buffers these characters internally, and parsels them out via calls
-;; to read-char, read-string, and unread-string.
-;;
-
-(define (make-line-buffering-input-port underlying-port)
- (let* (;; buffers - a list of strings put back by unread-string or cached
- ;; using read-line.
- ;;
- (buffers '())
-
- ;; getc - return the next character from a buffer or from the underlying
- ;; port.
- ;;
- (getc (lambda ()
- (if (not buffers)
- (read-char underlying-port)
- (let ((c (string-ref (car buffers))))
- (if (= 1 (string-length (car buffers)))
- (set! buffers (cdr buffers))
- (set-car! buffers (substring (car buffers) 1)))
- c))))
-
- (propogate-close (lambda () (close-port underlying-port)))
-
- (self (make-soft-port (vector #f #f #f getc propogate-close) "r"))
-
- (unread-string (lambda (str)
- (and (< 0 (string-length str))
- (set! buffers (cons str buffers)))))
-
- (read-string (lambda ()
- (cond
- ((not (null? buffers))
- (let ((answer (car buffers)))
- (set! buffers (cdr buffers))
- answer))
- (else
- (read-line underlying-port 'concat)))))) ;handle-newline->concat
-
- (set-object-property! self 'unread-string unread-string)
- (set-object-property! self 'read-string read-string)
- self))
-
-
diff --git a/ice-9/ls.scm b/ice-9/ls.scm
deleted file mode 100644
index 37cdaf019..000000000
--- a/ice-9/ls.scm
+++ /dev/null
@@ -1,121 +0,0 @@
-;;;; ls.scm --- functions for browsing modules
-;;;;
-;;;; Copyright (C) 1995, 1996, 1997, 1999, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-(define-module (ice-9 ls)
- :use-module (ice-9 common-list)
- :export (local-definitions-in definitions-in ls lls
- recursive-local-define))
-
-;;;;
-;;; local-definitions-in root name
-;;; Returns a list of names defined locally in the named
-;;; subdirectory of root.
-;;; definitions-in root name
-;;; Returns a list of all names defined in the named
-;;; subdirectory of root. The list includes alll locally
-;;; defined names as well as all names inherited from a
-;;; member of a use-list.
-;;;
-;;; A convenient interface for examining the nature of things:
-;;;
-;;; ls . various-names
-;;;
-;;; With no arguments, return a list of definitions in
-;;; `(current-module)'.
-;;;
-;;; With just one argument, interpret that argument as the
-;;; name of a subdirectory of the current module and
-;;; return a list of names defined there.
-;;;
-;;; With more than one argument, still compute
-;;; subdirectory lists, but return a list:
-;;; ((<subdir-name> . <names-defined-there>)
-;;; (<subdir-name> . <names-defined-there>)
-;;; ...)
-;;;
-;;; lls . various-names
-;;;
-;;; Analogous to `ls', but with local definitions only.
-
-(define (local-definitions-in root names)
- (let ((m (nested-ref root names))
- (answer '()))
- (if (not (module? m))
- (set! answer m)
- (module-for-each (lambda (k v) (set! answer (cons k answer))) m))
- answer))
-
-(define (definitions-in root names)
- (let ((m (nested-ref root names)))
- (if (not (module? m))
- m
- (reduce union
- (cons (local-definitions-in m '())
- (map (lambda (m2) (definitions-in m2 '()))
- (module-uses m)))))))
-
-(define (ls . various-refs)
- (if (pair? various-refs)
- (if (cdr various-refs)
- (map (lambda (ref)
- (cons ref (definitions-in (current-module) ref)))
- various-refs)
- (definitions-in (current-module) (car various-refs)))
- (definitions-in (current-module) '())))
-
-(define (lls . various-refs)
- (if (pair? various-refs)
- (if (cdr various-refs)
- (map (lambda (ref)
- (cons ref (local-definitions-in (current-module) ref)))
- various-refs)
- (local-definitions-in (current-module) (car various-refs)))
- (local-definitions-in (current-module) '())))
-
-(define (recursive-local-define name value)
- (let ((parent (reverse! (cdr (reverse name)))))
- (and parent (make-modules-in (current-module) parent))
- (local-define name value)))
-
-;;; ls.scm ends here
diff --git a/ice-9/mapping.scm b/ice-9/mapping.scm
deleted file mode 100644
index 34820ee4f..000000000
--- a/ice-9/mapping.scm
+++ /dev/null
@@ -1,153 +0,0 @@
-;;; installed-scm-file
-
-;;;; Copyright (C) 1996, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-
-
-(define-module (ice-9 mapping)
- :use-module (ice-9 poe)
- :export (mapping-hooks-type make-mapping-hooks mapping-hooks?
- mapping-hooks-get-handle mapping-hooks-create-handle
- mapping-hooks-remove mapping-type make-mapping mapping?
- mapping-hooks mapping-data set-mapping-hooks! set-mapping-data!
- mapping-get-handle mapping-create-handle! mapping-remove!
- mapping-ref mapping-set! hash-table-mapping-hooks
- make-hash-table-mapping hash-table-mapping))
-
-(define mapping-hooks-type (make-record-type 'mapping-hooks '(get-handle
- create-handle
- remove)))
-
-
-(define make-mapping-hooks (perfect-funcq 17 (record-constructor mapping-hooks-type)))
-(define mapping-hooks? (record-predicate mapping-hooks-type))
-(define mapping-hooks-get-handle (record-accessor mapping-hooks-type 'get-handle))
-(define mapping-hooks-create-handle (record-accessor mapping-hooks-type 'create-handle))
-(define mapping-hooks-remove (record-accessor mapping-hooks-type 'remove))
-
-(define mapping-type (make-record-type 'mapping '(hooks data)))
-(define make-mapping (record-constructor mapping-type))
-(define mapping? (record-predicate mapping-type))
-(define mapping-hooks (record-accessor mapping-type 'hooks))
-(define mapping-data (record-accessor mapping-type 'data))
-(define set-mapping-hooks! (record-modifier mapping-type 'hooks))
-(define set-mapping-data! (record-modifier mapping-type 'data))
-
-(define (mapping-get-handle map key)
- ((mapping-hooks-get-handle (mapping-hooks map)) map key))
-(define (mapping-create-handle! map key . opts)
- (apply (mapping-hooks-create-handle (mapping-hooks map)) map key opts))
-(define (mapping-remove! map key)
- ((mapping-hooks-remove (mapping-hooks map)) map key))
-
-(define (mapping-ref map key . dflt)
- (cond
- ((mapping-get-handle map key) => cdr)
- (dflt => car)
- (else #f)))
-
-(define (mapping-set! map key val)
- (set-cdr! (mapping-create-handle! map key #f) val))
-
-
-
-(define hash-table-mapping-hooks
- (let ((wrap (lambda (proc) (lambda (1st . rest) (apply proc (mapping-data 1st) rest)))))
-
- (perfect-funcq 17
- (lambda (hash-proc assoc-proc delete-proc)
- (let ((procs (list hash-proc assoc-proc delete-proc)))
- (cond
- ((equal? procs `(,hashq ,assq ,delq!))
- (make-mapping-hooks (wrap hashq-get-handle)
- (wrap hashq-create-handle!)
- (wrap hashq-remove!)))
- ((equal? procs `(,hashv ,assv ,delv!))
- (make-mapping-hooks (wrap hashv-get-handle)
- (wrap hashv-create-handle!)
- (wrap hashv-remove!)))
- ((equal? procs `(,hash ,assoc ,delete!))
- (make-mapping-hooks (wrap hash-get-handle)
- (wrap hash-create-handle!)
- (wrap hash-remove!)))
- (else
- (make-mapping-hooks (wrap
- (lambda (table key)
- (hashx-get-handle hash-proc assoc-proc table key)))
- (wrap
- (lambda (table key)
- (hashx-create-handle hash-proc assoc-proc table key)))
- (wrap
- (lambda (table key)
- (hashx-get-handle hash-proc assoc-proc delete-proc table key)))))))))))
-
-(define (make-hash-table-mapping table hash-proc assoc-proc delete-proc)
- (make-mapping (hash-table-mapping-hooks hash-proc assoc-proc delete-proc) table))
-
-(define (hash-table-mapping . options)
- (let* ((size (or (and options (number? (car options)) (car options))
- 71))
- (hash-proc (or (kw-arg-ref options :hash-proc) hash))
- (assoc-proc (or (kw-arg-ref options :assoc-proc)
- (cond
- ((eq? hash-proc hash) assoc)
- ((eq? hash-proc hashv) assv)
- ((eq? hash-proc hashq) assq)
- (else (error 'hash-table-mapping
- "Hash-procedure specified with no known assoc function."
- hash-proc)))))
- (delete-proc (or (kw-arg-ref options :delete-proc)
- (cond
- ((eq? hash-proc hash) delete!)
- ((eq? hash-proc hashv) delv!)
- ((eq? hash-proc hashq) delq!)
- (else (error 'hash-table-mapping
- "Hash-procedure specified with no known delete function."
- hash-proc)))))
- (table-constructor (or (kw-arg-ref options :table-constructor)
- (lambda (len) (make-vector len '())))))
- (make-hash-table-mapping (table-constructor size)
- hash-proc
- assoc-proc
- delete-proc)))
-
diff --git a/ice-9/match.scm b/ice-9/match.scm
deleted file mode 100644
index d2aeb501d..000000000
--- a/ice-9/match.scm
+++ /dev/null
@@ -1,223 +0,0 @@
-;;; installed-scm-file
-
-;;;; Copyright (C) 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-(define-module (ice-9 match)
- :use-module (ice-9 pretty-print)
- :export (match match-lambda match-lambda* match-define
- match-let match-let* match-letrec
- define-structure define-const-structure
- match:error match:set-error
- match:error-control match:set-error-control
- match:structure-control match:set-structure-control
- match:runtime-structures match:set-runtime-structures))
-
-;; The original code can be found at the Scheme Repository
-;;
-;; http://www.cs.indiana.edu/scheme-repository/code.match.html
-;;
-;; or Andrew K. Wright's web page:
-;;
-;; http://www.star-lab.com/wright/code.html
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Pattern Matching Syntactic Extensions for Scheme
-;;
-(define match:version "Version 1.19, Sep 15, 1995")
-;;
-;; Written by Andrew K. Wright, 1993 (wright@research.nj.nec.com).
-;; Adapted from code originally written by Bruce F. Duba, 1991.
-;; This package also includes a modified version of Kent Dybvig's
-;; define-structure (see Dybvig, R.K., The Scheme Programming Language,
-;; Prentice-Hall, NJ, 1987).
-;;
-;; This macro package extends Scheme with several new expression forms.
-;; Following is a brief summary of the new forms. See the associated
-;; LaTeX documentation for a full description of their functionality.
-;;
-;;
-;; match expressions:
-;;
-;; exp ::= ...
-;; | (match exp clause ...)
-;; | (match-lambda clause ...)
-;; | (match-lambda* clause ...)
-;; | (match-let ((pat exp) ...) body)
-;; | (match-let* ((pat exp) ...) body)
-;; | (match-letrec ((pat exp) ...) body)
-;; | (match-define pat exp)
-;;
-;; clause ::= (pat body) | (pat => exp)
-;;
-;; patterns: matches:
-;;
-;; pat ::= identifier anything, and binds identifier
-;; | _ anything
-;; | () the empty list
-;; | #t #t
-;; | #f #f
-;; | string a string
-;; | number a number
-;; | character a character
-;; | 'sexp an s-expression
-;; | 'symbol a symbol (special case of s-expr)
-;; | (pat_1 ... pat_n) list of n elements
-;; | (pat_1 ... pat_n . pat_{n+1}) list of n or more
-;; | (pat_1 ... pat_n pat_n+1 ooo) list of n or more, each element
-;; of remainder must match pat_n+1
-;; | #(pat_1 ... pat_n) vector of n elements
-;; | #(pat_1 ... pat_n pat_n+1 ooo) vector of n or more, each element
-;; of remainder must match pat_n+1
-;; | #&pat box
-;; | ($ struct-name pat_1 ... pat_n) a structure
-;; | (= field pat) a field of a structure
-;; | (and pat_1 ... pat_n) if all of pat_1 thru pat_n match
-;; | (or pat_1 ... pat_n) if any of pat_1 thru pat_n match
-;; | (not pat_1 ... pat_n) if all pat_1 thru pat_n don't match
-;; | (? predicate pat_1 ... pat_n) if predicate true and all of
-;; pat_1 thru pat_n match
-;; | (set! identifier) anything, and binds setter
-;; | (get! identifier) anything, and binds getter
-;; | `qp a quasi-pattern
-;;
-;; ooo ::= ... zero or more
-;; | ___ zero or more
-;; | ..k k or more
-;; | __k k or more
-;;
-;; quasi-patterns: matches:
-;;
-;; qp ::= () the empty list
-;; | #t #t
-;; | #f #f
-;; | string a string
-;; | number a number
-;; | character a character
-;; | identifier a symbol
-;; | (qp_1 ... qp_n) list of n elements
-;; | (qp_1 ... qp_n . qp_{n+1}) list of n or more
-;; | (qp_1 ... qp_n qp_n+1 ooo) list of n or more, each element
-;; of remainder must match qp_n+1
-;; | #(qp_1 ... qp_n) vector of n elements
-;; | #(qp_1 ... qp_n qp_n+1 ooo) vector of n or more, each element
-;; of remainder must match qp_n+1
-;; | #&qp box
-;; | ,pat a pattern
-;; | ,@pat a pattern
-;;
-;; The names (quote, quasiquote, unquote, unquote-splicing, ?, _, $,
-;; and, or, not, set!, get!, ..., ___) cannot be used as pattern variables.
-;;
-;;
-;; structure expressions:
-;;
-;; exp ::= ...
-;; | (define-structure (id_0 id_1 ... id_n))
-;; | (define-structure (id_0 id_1 ... id_n)
-;; ((id_{n+1} exp_1) ... (id_{n+m} exp_m)))
-;; | (define-const-structure (id_0 arg_1 ... arg_n))
-;; | (define-const-structure (id_0 arg_1 ... arg_n)
-;; ((arg_{n+1} exp_1) ... (arg_{n+m} exp_m)))
-;;
-;; arg ::= id | (! id) | (@ id)
-;;
-;;
-;; match:error-control controls what code is generated for failed matches.
-;; Possible values:
-;; 'unspecified - do nothing, ie., evaluate (cond [#f #f])
-;; 'fail - call match:error, or die at car or cdr
-;; 'error - call match:error with the unmatched value
-;; 'match - call match:error with the unmatched value _and_
-;; the quoted match expression
-;; match:error-control is set by calling match:set-error-control with
-;; the new value.
-;;
-;; match:error is called for a failed match.
-;; match:error is set by calling match:set-error with the new value.
-;;
-;; match:structure-control controls the uniqueness of structures
-;; (does not exist for Scheme 48 version).
-;; Possible values:
-;; 'vector - (default) structures are vectors with a symbol in position 0
-;; 'disjoint - structures are fully disjoint from all other values
-;; match:structure-control is set by calling match:set-structure-control
-;; with the new value.
-;;
-;; match:runtime-structures controls whether local structure declarations
-;; generate new structures each time they are reached
-;; (does not exist for Scheme 48 version).
-;; Possible values:
-;; #t - (default) each runtime occurrence generates a new structure
-;; #f - each lexical occurrence generates a new structure
-;;
-;; End of user visible/modifiable stuff.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(define match:error (lambda (val . args) (for-each pretty-print args) (error "no matching clause for " val)))
-(define match:andmap (lambda (f l) (if (null? l) (and) (and (f (car l)) (match:andmap f (cdr l))))))
-(define match:syntax-err (lambda (obj msg) (error msg obj)))
-(define match:disjoint-structure-tags (quote ()))
-(define match:make-structure-tag (lambda (name) (if (or (eq? match:structure-control (quote disjoint)) match:runtime-structures) (let ((tag (gensym))) (set! match:disjoint-structure-tags (cons tag match:disjoint-structure-tags)) tag) (string->symbol (string-append "<" (symbol->string name) ">")))))
-(define match:structure? (lambda (tag) (memq tag match:disjoint-structure-tags)))
-(define match:structure-control (quote vector))
-(define match:set-structure-control (lambda (v) (set! match:structure-control v)))
-(define match:set-error (lambda (v) (set! match:error v)))
-(define match:error-control (quote error))
-(define match:set-error-control (lambda (v) (set! match:error-control v)))
-(define match:disjoint-predicates (cons (quote null) (quote (pair? symbol? boolean? number? string? char? procedure? vector?))))
-(define match:vector-structures (quote ()))
-(define match:expanders (letrec ((genmatch (lambda (x clauses match-expr) (let* ((length>= (gensym)) (eb-errf (error-maker match-expr)) (blist (car eb-errf)) (plist (map (lambda (c) (let* ((x (bound (validate-pattern (car c)))) (p (car x)) (bv (cadr x)) (bindings (caddr x)) (code (gensym)) (fail (and (pair? (cdr c)) (pair? (cadr c)) (eq? (caadr c) (quote =>)) (symbol? (cadadr c)) (pair? (cdadr c)) (null? (cddadr c)) (pair? (cddr c)) (cadadr c))) (bv2 (if fail (cons fail bv) bv)) (body (if fail (cddr c) (cdr c)))) (set! blist (cons (quasiquote ((unquote code) (lambda (unquote bv2) (unquote-splicing body)))) (append bindings blist))) (list p code bv (and fail (gensym)) #f))) clauses)) (code (gen x (quote ()) plist (cdr eb-errf) length>= (gensym)))) (unreachable plist match-expr) (inline-let (quasiquote (let (((unquote length>=) (lambda (n) (lambda (l) (>= (length l) n)))) (unquote-splicing blist)) (unquote code))))))) (genletrec (lambda (pat exp body match-expr) (let* ((length>= (gensym)) (eb-errf (error-maker match-expr)) (x (bound (validate-pattern pat))) (p (car x)) (bv (cadr x)) (bindings (caddr x)) (code (gensym)) (plist (list (list p code bv #f #f))) (x (gensym)) (m (gen x (quote ()) plist (cdr eb-errf) length>= (gensym))) (gs (map (lambda (_) (gensym)) bv))) (unreachable plist match-expr) (quasiquote (letrec (((unquote length>=) (lambda (n) (lambda (l) (>= (length l) n)))) (unquote-splicing (map (lambda (v) (quasiquote ((unquote v) #f))) bv)) ((unquote x) (unquote exp)) ((unquote code) (lambda (unquote gs) (unquote-splicing (map (lambda (v g) (quasiquote (set! (unquote v) (unquote g)))) bv gs)) (unquote-splicing body))) (unquote-splicing bindings) (unquote-splicing (car eb-errf))) (unquote m)))))) (gendefine (lambda (pat exp match-expr) (let* ((length>= (gensym)) (eb-errf (error-maker match-expr)) (x (bound (validate-pattern pat))) (p (car x)) (bv (cadr x)) (bindings (caddr x)) (code (gensym)) (plist (list (list p code bv #f #f))) (x (gensym)) (m (gen x (quote ()) plist (cdr eb-errf) length>= (gensym))) (gs (map (lambda (_) (gensym)) bv))) (unreachable plist match-expr) (quasiquote (begin (unquote-splicing (map (lambda (v) (quasiquote (define (unquote v) #f))) bv)) (unquote (inline-let (quasiquote (let (((unquote length>=) (lambda (n) (lambda (l) (>= (length l) n)))) ((unquote x) (unquote exp)) ((unquote code) (lambda (unquote gs) (unquote-splicing (map (lambda (v g) (quasiquote (set! (unquote v) (unquote g)))) bv gs)) (cond (#f #f)))) (unquote-splicing bindings) (unquote-splicing (car eb-errf))) (unquote m)))))))))) (pattern-var? (lambda (x) (and (symbol? x) (not (dot-dot-k? x)) (not (memq x (quote (quasiquote quote unquote unquote-splicing ? _ $ = and or not set! get! ... ___))))))) (dot-dot-k? (lambda (s) (and (symbol? s) (if (memq s (quote (... ___))) 0 (let* ((s (symbol->string s)) (n (string-length s))) (and (<= 3 n) (memq (string-ref s 0) (quote (#\. #\_))) (memq (string-ref s 1) (quote (#\. #\_))) (match:andmap char-numeric? (string->list (substring s 2 n))) (string->number (substring s 2 n)))))))) (error-maker (lambda (match-expr) (cond ((eq? match:error-control (quote unspecified)) (cons (quote ()) (lambda (x) (quasiquote (cond (#f #f)))))) ((memq match:error-control (quote (error fail))) (cons (quote ()) (lambda (x) (quasiquote (match:error (unquote x)))))) ((eq? match:error-control (quote match)) (let ((errf (gensym)) (arg (gensym))) (cons (quasiquote (((unquote errf) (lambda ((unquote arg)) (match:error (unquote arg) (quote (unquote match-expr))))))) (lambda (x) (quasiquote ((unquote errf) (unquote x))))))) (else (match:syntax-err (quote (unspecified error fail match)) "invalid value for match:error-control, legal values are"))))) (unreachable (lambda (plist match-expr) (for-each (lambda (x) (if (not (car (cddddr x))) (begin (display "Warning: unreachable pattern ") (display (car x)) (display " in ") (display match-expr) (newline)))) plist))) (validate-pattern (lambda (pattern) (letrec ((simple? (lambda (x) (or (string? x) (boolean? x) (char? x) (number? x) (null? x)))) (ordinary (lambda (p) (let ((g157 (lambda (x y) (cons (ordinary x) (ordinary y))))) (if (simple? p) ((lambda (p) p) p) (if (equal? p (quote _)) ((lambda () (quote _))) (if (pattern-var? p) ((lambda (p) p) p) (if (pair? p) (if (equal? (car p) (quote quasiquote)) (if (and (pair? (cdr p)) (null? (cddr p))) ((lambda (p) (quasi p)) (cadr p)) (g157 (car p) (cdr p))) (if (equal? (car p) (quote quote)) (if (and (pair? (cdr p)) (null? (cddr p))) ((lambda (p) p) p) (g157 (car p) (cdr p))) (if (equal? (car p) (quote ?)) (if (and (pair? (cdr p)) (list? (cddr p))) ((lambda (pred ps) (quasiquote (? (unquote pred) (unquote-splicing (map ordinary ps))))) (cadr p) (cddr p)) (g157 (car p) (cdr p))) (if (equal? (car p) (quote =)) (if (and (pair? (cdr p)) (pair? (cddr p)) (null? (cdddr p))) ((lambda (sel p) (quasiquote (= (unquote sel) (unquote (ordinary p))))) (cadr p) (caddr p)) (g157 (car p) (cdr p))) (if (equal? (car p) (quote and)) (if (and (list? (cdr p)) (pair? (cdr p))) ((lambda (ps) (quasiquote (and (unquote-splicing (map ordinary ps))))) (cdr p)) (g157 (car p) (cdr p))) (if (equal? (car p) (quote or)) (if (and (list? (cdr p)) (pair? (cdr p))) ((lambda (ps) (quasiquote (or (unquote-splicing (map ordinary ps))))) (cdr p)) (g157 (car p) (cdr p))) (if (equal? (car p) (quote not)) (if (and (list? (cdr p)) (pair? (cdr p))) ((lambda (ps) (quasiquote (not (unquote-splicing (map ordinary ps))))) (cdr p)) (g157 (car p) (cdr p))) (if (equal? (car p) (quote $)) (if (and (pair? (cdr p)) (symbol? (cadr p)) (list? (cddr p))) ((lambda (r ps) (quasiquote ($ (unquote r) (unquote-splicing (map ordinary ps))))) (cadr p) (cddr p)) (g157 (car p) (cdr p))) (if (equal? (car p) (quote set!)) (if (and (pair? (cdr p)) (pattern-var? (cadr p)) (null? (cddr p))) ((lambda (p) p) p) (g157 (car p) (cdr p))) (if (equal? (car p) (quote get!)) (if (and (pair? (cdr p)) (pattern-var? (cadr p)) (null? (cddr p))) ((lambda (p) p) p) (g157 (car p) (cdr p))) (if (equal? (car p) (quote unquote)) (g157 (car p) (cdr p)) (if (equal? (car p) (quote unquote-splicing)) (g157 (car p) (cdr p)) (if (and (pair? (cdr p)) (dot-dot-k? (cadr p)) (null? (cddr p))) ((lambda (p ddk) (quasiquote ((unquote (ordinary p)) (unquote ddk)))) (car p) (cadr p)) (g157 (car p) (cdr p))))))))))))))) (if (vector? p) ((lambda (p) (let* ((pl (vector->list p)) (rpl (reverse pl))) (apply vector (if (and (not (null? rpl)) (dot-dot-k? (car rpl))) (reverse (cons (car rpl) (map ordinary (cdr rpl)))) (map ordinary pl))))) p) ((lambda () (match:syntax-err pattern "syntax error in pattern"))))))))))) (quasi (lambda (p) (let ((g178 (lambda (x y) (cons (quasi x) (quasi y))))) (if (simple? p) ((lambda (p) p) p) (if (symbol? p) ((lambda (p) (quasiquote (quote (unquote p)))) p) (if (pair? p) (if (equal? (car p) (quote unquote)) (if (and (pair? (cdr p)) (null? (cddr p))) ((lambda (p) (ordinary p)) (cadr p)) (g178 (car p) (cdr p))) (if (and (pair? (car p)) (equal? (caar p) (quote unquote-splicing)) (pair? (cdar p)) (null? (cddar p))) (if (null? (cdr p)) ((lambda (p) (ordinary p)) (cadar p)) ((lambda (p y) (append (ordlist p) (quasi y))) (cadar p) (cdr p))) (if (and (pair? (cdr p)) (dot-dot-k? (cadr p)) (null? (cddr p))) ((lambda (p ddk) (quasiquote ((unquote (quasi p)) (unquote ddk)))) (car p) (cadr p)) (g178 (car p) (cdr p))))) (if (vector? p) ((lambda (p) (let* ((pl (vector->list p)) (rpl (reverse pl))) (apply vector (if (dot-dot-k? (car rpl)) (reverse (cons (car rpl) (map quasi (cdr rpl)))) (map ordinary pl))))) p) ((lambda () (match:syntax-err pattern "syntax error in pattern")))))))))) (ordlist (lambda (p) (cond ((null? p) (quote ())) ((pair? p) (cons (ordinary (car p)) (ordlist (cdr p)))) (else (match:syntax-err pattern "invalid use of unquote-splicing in pattern")))))) (ordinary pattern)))) (bound (lambda (pattern) (letrec ((pred-bodies (quote ())) (bound (lambda (p a k) (cond ((eq? (quote _) p) (k p a)) ((symbol? p) (if (memq p a) (match:syntax-err pattern "duplicate variable in pattern")) (k p (cons p a))) ((and (pair? p) (eq? (quote quote) (car p))) (k p a)) ((and (pair? p) (eq? (quote ?) (car p))) (cond ((not (null? (cddr p))) (bound (quasiquote (and (? (unquote (cadr p))) (unquote-splicing (cddr p)))) a k)) ((or (not (symbol? (cadr p))) (memq (cadr p) a)) (let ((g (gensym))) (set! pred-bodies (cons (quasiquote ((unquote g) (unquote (cadr p)))) pred-bodies)) (k (quasiquote (? (unquote g))) a))) (else (k p a)))) ((and (pair? p) (eq? (quote =) (car p))) (cond ((or (not (symbol? (cadr p))) (memq (cadr p) a)) (let ((g (gensym))) (set! pred-bodies (cons (quasiquote ((unquote g) (unquote (cadr p)))) pred-bodies)) (bound (quasiquote (= (unquote g) (unquote (caddr p)))) a k))) (else (bound (caddr p) a (lambda (p2 a) (k (quasiquote (= (unquote (cadr p)) (unquote p2))) a)))))) ((and (pair? p) (eq? (quote and) (car p))) (bound* (cdr p) a (lambda (p a) (k (quasiquote (and (unquote-splicing p))) a)))) ((and (pair? p) (eq? (quote or) (car p))) (bound (cadr p) a (lambda (first-p first-a) (let or* ((plist (cddr p)) (k (lambda (plist) (k (quasiquote (or (unquote first-p) (unquote-splicing plist))) first-a)))) (if (null? plist) (k plist) (bound (car plist) a (lambda (car-p car-a) (if (not (permutation car-a first-a)) (match:syntax-err pattern "variables of or-pattern differ in")) (or* (cdr plist) (lambda (cdr-p) (k (cons car-p cdr-p))))))))))) ((and (pair? p) (eq? (quote not) (car p))) (cond ((not (null? (cddr p))) (bound (quasiquote (not (or (unquote-splicing (cdr p))))) a k)) (else (bound (cadr p) a (lambda (p2 a2) (if (not (permutation a a2)) (match:syntax-err p "no variables allowed in")) (k (quasiquote (not (unquote p2))) a)))))) ((and (pair? p) (pair? (cdr p)) (dot-dot-k? (cadr p))) (bound (car p) a (lambda (q b) (let ((bvars (find-prefix b a))) (k (quasiquote ((unquote q) (unquote (cadr p)) (unquote bvars) (unquote (gensym)) (unquote (gensym)) (unquote (map (lambda (_) (gensym)) bvars)))) b))))) ((and (pair? p) (eq? (quote $) (car p))) (bound* (cddr p) a (lambda (p1 a) (k (quasiquote ($ (unquote (cadr p)) (unquote-splicing p1))) a)))) ((and (pair? p) (eq? (quote set!) (car p))) (if (memq (cadr p) a) (k p a) (k p (cons (cadr p) a)))) ((and (pair? p) (eq? (quote get!) (car p))) (if (memq (cadr p) a) (k p a) (k p (cons (cadr p) a)))) ((pair? p) (bound (car p) a (lambda (car-p a) (bound (cdr p) a (lambda (cdr-p a) (k (cons car-p cdr-p) a)))))) ((vector? p) (boundv (vector->list p) a (lambda (pl a) (k (list->vector pl) a)))) (else (k p a))))) (boundv (lambda (plist a k) (let ((g184 (lambda () (k plist a)))) (if (pair? plist) (if (and (pair? (cdr plist)) (dot-dot-k? (cadr plist)) (null? (cddr plist))) ((lambda () (bound plist a k))) (if (null? plist) (g184) ((lambda (x y) (bound x a (lambda (car-p a) (boundv y a (lambda (cdr-p a) (k (cons car-p cdr-p) a)))))) (car plist) (cdr plist)))) (if (null? plist) (g184) (match:error plist)))))) (bound* (lambda (plist a k) (if (null? plist) (k plist a) (bound (car plist) a (lambda (car-p a) (bound* (cdr plist) a (lambda (cdr-p a) (k (cons car-p cdr-p) a)))))))) (find-prefix (lambda (b a) (if (eq? b a) (quote ()) (cons (car b) (find-prefix (cdr b) a))))) (permutation (lambda (p1 p2) (and (= (length p1) (length p2)) (match:andmap (lambda (x1) (memq x1 p2)) p1))))) (bound pattern (quote ()) (lambda (p a) (list p (reverse a) pred-bodies)))))) (inline-let (lambda (let-exp) (letrec ((occ (lambda (x e) (let loop ((e e)) (cond ((pair? e) (+ (loop (car e)) (loop (cdr e)))) ((eq? x e) 1) (else 0))))) (subst (lambda (e old new) (let loop ((e e)) (cond ((pair? e) (cons (loop (car e)) (loop (cdr e)))) ((eq? old e) new) (else e))))) (const? (lambda (sexp) (or (symbol? sexp) (boolean? sexp) (string? sexp) (char? sexp) (number? sexp) (null? sexp) (and (pair? sexp) (eq? (car sexp) (quote quote)) (pair? (cdr sexp)) (symbol? (cadr sexp)) (null? (cddr sexp)))))) (isval? (lambda (sexp) (or (const? sexp) (and (pair? sexp) (memq (car sexp) (quote (lambda quote match-lambda match-lambda*))))))) (small? (lambda (sexp) (or (const? sexp) (and (pair? sexp) (eq? (car sexp) (quote lambda)) (pair? (cdr sexp)) (pair? (cddr sexp)) (const? (caddr sexp)) (null? (cdddr sexp))))))) (let loop ((b (cadr let-exp)) (new-b (quote ())) (e (caddr let-exp))) (cond ((null? b) (if (null? new-b) e (quasiquote (let (unquote (reverse new-b)) (unquote e))))) ((isval? (cadr (car b))) (let* ((x (caar b)) (n (occ x e))) (cond ((= 0 n) (loop (cdr b) new-b e)) ((or (= 1 n) (small? (cadr (car b)))) (loop (cdr b) new-b (subst e x (cadr (car b))))) (else (loop (cdr b) (cons (car b) new-b) e))))) (else (loop (cdr b) (cons (car b) new-b) e))))))) (gen (lambda (x sf plist erract length>= eta) (if (null? plist) (erract x) (let* ((v (quote ())) (val (lambda (x) (cdr (assq x v)))) (fail (lambda (sf) (gen x sf (cdr plist) erract length>= eta))) (success (lambda (sf) (set-car! (cddddr (car plist)) #t) (let* ((code (cadr (car plist))) (bv (caddr (car plist))) (fail-sym (cadddr (car plist)))) (if fail-sym (let ((ap (quasiquote ((unquote code) (unquote fail-sym) (unquote-splicing (map val bv)))))) (quasiquote (call-with-current-continuation (lambda ((unquote fail-sym)) (let (((unquote fail-sym) (lambda () ((unquote fail-sym) (unquote (fail sf)))))) (unquote ap)))))) (quasiquote ((unquote code) (unquote-splicing (map val bv))))))))) (let next ((p (caar plist)) (e x) (sf sf) (kf fail) (ks success)) (cond ((eq? (quote _) p) (ks sf)) ((symbol? p) (set! v (cons (cons p e) v)) (ks sf)) ((null? p) (emit (quasiquote (null? (unquote e))) sf kf ks)) ((equal? p (quote (quote ()))) (emit (quasiquote (null? (unquote e))) sf kf ks)) ((string? p) (emit (quasiquote (equal? (unquote e) (unquote p))) sf kf ks)) ((boolean? p) (emit (quasiquote (equal? (unquote e) (unquote p))) sf kf ks)) ((char? p) (emit (quasiquote (equal? (unquote e) (unquote p))) sf kf ks)) ((number? p) (emit (quasiquote (equal? (unquote e) (unquote p))) sf kf ks)) ((and (pair? p) (eq? (quote quote) (car p))) (emit (quasiquote (equal? (unquote e) (unquote p))) sf kf ks)) ((and (pair? p) (eq? (quote ?) (car p))) (let ((tst (quasiquote ((unquote (cadr p)) (unquote e))))) (emit tst sf kf ks))) ((and (pair? p) (eq? (quote =) (car p))) (next (caddr p) (quasiquote ((unquote (cadr p)) (unquote e))) sf kf ks)) ((and (pair? p) (eq? (quote and) (car p))) (let loop ((p (cdr p)) (sf sf)) (if (null? p) (ks sf) (next (car p) e sf kf (lambda (sf) (loop (cdr p) sf)))))) ((and (pair? p) (eq? (quote or) (car p))) (let ((or-v v)) (let loop ((p (cdr p)) (sf sf)) (if (null? p) (kf sf) (begin (set! v or-v) (next (car p) e sf (lambda (sf) (loop (cdr p) sf)) ks)))))) ((and (pair? p) (eq? (quote not) (car p))) (next (cadr p) e sf ks kf)) ((and (pair? p) (eq? (quote $) (car p))) (let* ((tag (cadr p)) (fields (cdr p)) (rlen (length fields)) (tst (quasiquote ((unquote (symbol-append tag (quote ?))) (unquote e))))) (emit tst sf kf (let rloop ((n 1)) (lambda (sf) (if (= n rlen) (ks sf) (next (list-ref fields n) (quasiquote ((unquote (symbol-append tag (quote -) n)) (unquote e))) sf kf (rloop (+ 1 n))))))))) ((and (pair? p) (eq? (quote set!) (car p))) (set! v (cons (cons (cadr p) (setter e p)) v)) (ks sf)) ((and (pair? p) (eq? (quote get!) (car p))) (set! v (cons (cons (cadr p) (getter e p)) v)) (ks sf)) ((and (pair? p) (pair? (cdr p)) (dot-dot-k? (cadr p))) (emit (quasiquote (list? (unquote e))) sf kf (lambda (sf) (let* ((k (dot-dot-k? (cadr p))) (ks (lambda (sf) (let ((bound (list-ref p 2))) (cond ((eq? (car p) (quote _)) (ks sf)) ((null? bound) (let* ((ptst (next (car p) eta sf (lambda (sf) #f) (lambda (sf) #t))) (tst (if (and (pair? ptst) (symbol? (car ptst)) (pair? (cdr ptst)) (eq? eta (cadr ptst)) (null? (cddr ptst))) (car ptst) (quasiquote (lambda ((unquote eta)) (unquote ptst)))))) (assm (quasiquote (match:andmap (unquote tst) (unquote e))) (kf sf) (ks sf)))) ((and (symbol? (car p)) (equal? (list (car p)) bound)) (next (car p) e sf kf ks)) (else (let* ((gloop (list-ref p 3)) (ge (list-ref p 4)) (fresh (list-ref p 5)) (p1 (next (car p) (quasiquote (car (unquote ge))) sf kf (lambda (sf) (quasiquote ((unquote gloop) (cdr (unquote ge)) (unquote-splicing (map (lambda (b f) (quasiquote (cons (unquote (val b)) (unquote f)))) bound fresh)))))))) (set! v (append (map cons bound (map (lambda (x) (quasiquote (reverse (unquote x)))) fresh)) v)) (quasiquote (let (unquote gloop) (((unquote ge) (unquote e)) (unquote-splicing (map (lambda (x) (quasiquote ((unquote x) (quote ())))) fresh))) (if (null? (unquote ge)) (unquote (ks sf)) (unquote p1))))))))))) (case k ((0) (ks sf)) ((1) (emit (quasiquote (pair? (unquote e))) sf kf ks)) (else (emit (quasiquote (((unquote length>=) (unquote k)) (unquote e))) sf kf ks))))))) ((pair? p) (emit (quasiquote (pair? (unquote e))) sf kf (lambda (sf) (next (car p) (add-a e) sf kf (lambda (sf) (next (cdr p) (add-d e) sf kf ks)))))) ((and (vector? p) (>= (vector-length p) 6) (dot-dot-k? (vector-ref p (- (vector-length p) 5)))) (let* ((vlen (- (vector-length p) 6)) (k (dot-dot-k? (vector-ref p (+ vlen 1)))) (minlen (+ vlen k)) (bound (vector-ref p (+ vlen 2)))) (emit (quasiquote (vector? (unquote e))) sf kf (lambda (sf) (assm (quasiquote (>= (vector-length (unquote e)) (unquote minlen))) (kf sf) ((let vloop ((n 0)) (lambda (sf) (cond ((not (= n vlen)) (next (vector-ref p n) (quasiquote (vector-ref (unquote e) (unquote n))) sf kf (vloop (+ 1 n)))) ((eq? (vector-ref p vlen) (quote _)) (ks sf)) (else (let* ((gloop (vector-ref p (+ vlen 3))) (ind (vector-ref p (+ vlen 4))) (fresh (vector-ref p (+ vlen 5))) (p1 (next (vector-ref p vlen) (quasiquote (vector-ref (unquote e) (unquote ind))) sf kf (lambda (sf) (quasiquote ((unquote gloop) (- (unquote ind) 1) (unquote-splicing (map (lambda (b f) (quasiquote (cons (unquote (val b)) (unquote f)))) bound fresh)))))))) (set! v (append (map cons bound fresh) v)) (quasiquote (let (unquote gloop) (((unquote ind) (- (vector-length (unquote e)) 1)) (unquote-splicing (map (lambda (x) (quasiquote ((unquote x) (quote ())))) fresh))) (if (> (unquote minlen) (unquote ind)) (unquote (ks sf)) (unquote p1))))))))) sf)))))) ((vector? p) (let ((vlen (vector-length p))) (emit (quasiquote (vector? (unquote e))) sf kf (lambda (sf) (emit (quasiquote (equal? (vector-length (unquote e)) (unquote vlen))) sf kf (let vloop ((n 0)) (lambda (sf) (if (= n vlen) (ks sf) (next (vector-ref p n) (quasiquote (vector-ref (unquote e) (unquote n))) sf kf (vloop (+ 1 n))))))))))) (else (display "FATAL ERROR IN PATTERN MATCHER") (newline) (error #f "THIS NEVER HAPPENS")))))))) (emit (lambda (tst sf kf ks) (cond ((in tst sf) (ks sf)) ((in (quasiquote (not (unquote tst))) sf) (kf sf)) (else (let* ((e (cadr tst)) (implied (cond ((eq? (car tst) (quote equal?)) (let ((p (caddr tst))) (cond ((string? p) (quasiquote ((string? (unquote e))))) ((boolean? p) (quasiquote ((boolean? (unquote e))))) ((char? p) (quasiquote ((char? (unquote e))))) ((number? p) (quasiquote ((number? (unquote e))))) ((and (pair? p) (eq? (quote quote) (car p))) (quasiquote ((symbol? (unquote e))))) (else (quote ()))))) ((eq? (car tst) (quote null?)) (quasiquote ((list? (unquote e))))) ((vec-structure? tst) (quasiquote ((vector? (unquote e))))) (else (quote ())))) (not-imp (case (car tst) ((list?) (quasiquote ((not (null? (unquote e)))))) (else (quote ())))) (s (ks (cons tst (append implied sf)))) (k (kf (cons (quasiquote (not (unquote tst))) (append not-imp sf))))) (assm tst k s)))))) (assm (lambda (tst f s) (cond ((equal? s f) s) ((and (eq? s #t) (eq? f #f)) tst) ((and (eq? (car tst) (quote pair?)) (memq match:error-control (quote (unspecified fail))) (memq (car f) (quote (cond match:error))) (guarantees s (cadr tst))) s) ((and (pair? s) (eq? (car s) (quote if)) (equal? (cadddr s) f)) (if (eq? (car (cadr s)) (quote and)) (quasiquote (if (and (unquote tst) (unquote-splicing (cdr (cadr s)))) (unquote (caddr s)) (unquote f))) (quasiquote (if (and (unquote tst) (unquote (cadr s))) (unquote (caddr s)) (unquote f))))) ((and (pair? s) (equal? (car s) (quote call-with-current-continuation)) (pair? (cdr s)) (pair? (cadr s)) (equal? (caadr s) (quote lambda)) (pair? (cdadr s)) (pair? (cadadr s)) (null? (cdr (cadadr s))) (pair? (cddadr s)) (pair? (car (cddadr s))) (equal? (caar (cddadr s)) (quote let)) (pair? (cdar (cddadr s))) (pair? (cadar (cddadr s))) (pair? (caadar (cddadr s))) (pair? (cdr (caadar (cddadr s)))) (pair? (cadr (caadar (cddadr s)))) (equal? (caadr (caadar (cddadr s))) (quote lambda)) (pair? (cdadr (caadar (cddadr s)))) (null? (cadadr (caadar (cddadr s)))) (pair? (cddadr (caadar (cddadr s)))) (pair? (car (cddadr (caadar (cddadr s))))) (pair? (cdar (cddadr (caadar (cddadr s))))) (null? (cddar (cddadr (caadar (cddadr s))))) (null? (cdr (cddadr (caadar (cddadr s))))) (null? (cddr (caadar (cddadr s)))) (null? (cdadar (cddadr s))) (pair? (cddar (cddadr s))) (null? (cdddar (cddadr s))) (null? (cdr (cddadr s))) (null? (cddr s)) (equal? f (cadar (cddadr (caadar (cddadr s)))))) (let ((k (car (cadadr s))) (fail (car (caadar (cddadr s)))) (s2 (caddar (cddadr s)))) (quasiquote (call-with-current-continuation (lambda ((unquote k)) (let (((unquote fail) (lambda () ((unquote k) (unquote f))))) (unquote (assm tst (quasiquote ((unquote fail))) s2)))))))) ((and #f (pair? s) (equal? (car s) (quote let)) (pair? (cdr s)) (pair? (cadr s)) (pair? (caadr s)) (pair? (cdaadr s)) (pair? (car (cdaadr s))) (equal? (caar (cdaadr s)) (quote lambda)) (pair? (cdar (cdaadr s))) (null? (cadar (cdaadr s))) (pair? (cddar (cdaadr s))) (null? (cdddar (cdaadr s))) (null? (cdr (cdaadr s))) (null? (cdadr s)) (pair? (cddr s)) (null? (cdddr s)) (equal? (caddar (cdaadr s)) f)) (let ((fail (caaadr s)) (s2 (caddr s))) (quasiquote (let (((unquote fail) (lambda () (unquote f)))) (unquote (assm tst (quasiquote ((unquote fail))) s2)))))) (else (quasiquote (if (unquote tst) (unquote s) (unquote f))))))) (guarantees (lambda (code x) (let ((a (add-a x)) (d (add-d x))) (let loop ((code code)) (cond ((not (pair? code)) #f) ((memq (car code) (quote (cond match:error))) #t) ((or (equal? code a) (equal? code d)) #t) ((eq? (car code) (quote if)) (or (loop (cadr code)) (and (loop (caddr code)) (loop (cadddr code))))) ((eq? (car code) (quote lambda)) #f) ((and (eq? (car code) (quote let)) (symbol? (cadr code))) #f) (else (or (loop (car code)) (loop (cdr code))))))))) (in (lambda (e l) (or (member e l) (and (eq? (car e) (quote list?)) (or (member (quasiquote (null? (unquote (cadr e)))) l) (member (quasiquote (pair? (unquote (cadr e)))) l))) (and (eq? (car e) (quote not)) (let* ((srch (cadr e)) (const-class (equal-test? srch))) (cond (const-class (let mem ((l l)) (if (null? l) #f (let ((x (car l))) (or (and (equal? (cadr x) (cadr srch)) (disjoint? x) (not (equal? const-class (car x)))) (equal? x (quasiquote (not ((unquote const-class) (unquote (cadr srch)))))) (and (equal? (cadr x) (cadr srch)) (equal-test? x) (not (equal? (caddr srch) (caddr x)))) (mem (cdr l))))))) ((disjoint? srch) (let mem ((l l)) (if (null? l) #f (let ((x (car l))) (or (and (equal? (cadr x) (cadr srch)) (disjoint? x) (not (equal? (car x) (car srch)))) (mem (cdr l))))))) ((eq? (car srch) (quote list?)) (let mem ((l l)) (if (null? l) #f (let ((x (car l))) (or (and (equal? (cadr x) (cadr srch)) (disjoint? x) (not (memq (car x) (quote (list? pair? null?))))) (mem (cdr l))))))) ((vec-structure? srch) (let mem ((l l)) (if (null? l) #f (let ((x (car l))) (or (and (equal? (cadr x) (cadr srch)) (or (disjoint? x) (vec-structure? x)) (not (equal? (car x) (quote vector?))) (not (equal? (car x) (car srch)))) (equal? x (quasiquote (not (vector? (unquote (cadr srch)))))) (mem (cdr l))))))) (else #f))))))) (equal-test? (lambda (tst) (and (eq? (car tst) (quote equal?)) (let ((p (caddr tst))) (cond ((string? p) (quote string?)) ((boolean? p) (quote boolean?)) ((char? p) (quote char?)) ((number? p) (quote number?)) ((and (pair? p) (pair? (cdr p)) (null? (cddr p)) (eq? (quote quote) (car p)) (symbol? (cadr p))) (quote symbol?)) (else #f)))))) (disjoint? (lambda (tst) (memq (car tst) match:disjoint-predicates))) (vec-structure? (lambda (tst) (memq (car tst) match:vector-structures))) (add-a (lambda (a) (let ((new (and (pair? a) (assq (car a) c---rs)))) (if new (cons (cadr new) (cdr a)) (quasiquote (car (unquote a))))))) (add-d (lambda (a) (let ((new (and (pair? a) (assq (car a) c---rs)))) (if new (cons (cddr new) (cdr a)) (quasiquote (cdr (unquote a))))))) (c---rs (quote ((car caar . cdar) (cdr cadr . cddr) (caar caaar . cdaar) (cadr caadr . cdadr) (cdar cadar . cddar) (cddr caddr . cdddr) (caaar caaaar . cdaaar) (caadr caaadr . cdaadr) (cadar caadar . cdadar) (caddr caaddr . cdaddr) (cdaar cadaar . cddaar) (cdadr cadadr . cddadr) (cddar caddar . cdddar) (cdddr cadddr . cddddr)))) (setter (lambda (e p) (let ((mk-setter (lambda (s) (symbol-append (quote set-) s (quote !))))) (cond ((not (pair? e)) (match:syntax-err p "unnested set! pattern")) ((eq? (car e) (quote vector-ref)) (quasiquote (let ((x (unquote (cadr e)))) (lambda (y) (vector-set! x (unquote (caddr e)) y))))) ((eq? (car e) (quote unbox)) (quasiquote (let ((x (unquote (cadr e)))) (lambda (y) (set-box! x y))))) ((eq? (car e) (quote car)) (quasiquote (let ((x (unquote (cadr e)))) (lambda (y) (set-car! x y))))) ((eq? (car e) (quote cdr)) (quasiquote (let ((x (unquote (cadr e)))) (lambda (y) (set-cdr! x y))))) ((let ((a (assq (car e) get-c---rs))) (and a (quasiquote (let ((x ((unquote (cadr a)) (unquote (cadr e))))) (lambda (y) ((unquote (mk-setter (cddr a))) x y))))))) (else (quasiquote (let ((x (unquote (cadr e)))) (lambda (y) ((unquote (mk-setter (car e))) x y))))))))) (getter (lambda (e p) (cond ((not (pair? e)) (match:syntax-err p "unnested get! pattern")) ((eq? (car e) (quote vector-ref)) (quasiquote (let ((x (unquote (cadr e)))) (lambda () (vector-ref x (unquote (caddr e))))))) ((eq? (car e) (quote unbox)) (quasiquote (let ((x (unquote (cadr e)))) (lambda () (unbox x))))) ((eq? (car e) (quote car)) (quasiquote (let ((x (unquote (cadr e)))) (lambda () (car x))))) ((eq? (car e) (quote cdr)) (quasiquote (let ((x (unquote (cadr e)))) (lambda () (cdr x))))) ((let ((a (assq (car e) get-c---rs))) (and a (quasiquote (let ((x ((unquote (cadr a)) (unquote (cadr e))))) (lambda () ((unquote (cddr a)) x))))))) (else (quasiquote (let ((x (unquote (cadr e)))) (lambda () ((unquote (car e)) x)))))))) (get-c---rs (quote ((caar car . car) (cadr cdr . car) (cdar car . cdr) (cddr cdr . cdr) (caaar caar . car) (caadr cadr . car) (cadar cdar . car) (caddr cddr . car) (cdaar caar . cdr) (cdadr cadr . cdr) (cddar cdar . cdr) (cdddr cddr . cdr) (caaaar caaar . car) (caaadr caadr . car) (caadar cadar . car) (caaddr caddr . car) (cadaar cdaar . car) (cadadr cdadr . car) (caddar cddar . car) (cadddr cdddr . car) (cdaaar caaar . cdr) (cdaadr caadr . cdr) (cdadar cadar . cdr) (cdaddr caddr . cdr) (cddaar cdaar . cdr) (cddadr cdadr . cdr) (cdddar cddar . cdr) (cddddr cdddr . cdr)))) (symbol-append (lambda l (string->symbol (apply string-append (map (lambda (x) (cond ((symbol? x) (symbol->string x)) ((number? x) (number->string x)) (else x))) l))))) (rac (lambda (l) (if (null? (cdr l)) (car l) (rac (cdr l))))) (rdc (lambda (l) (if (null? (cdr l)) (quote ()) (cons (car l) (rdc (cdr l))))))) (list genmatch genletrec gendefine pattern-var?)))
-(defmacro match args (cond ((and (list? args) (<= 1 (length args)) (match:andmap (lambda (y) (and (list? y) (<= 2 (length y)))) (cdr args))) (let* ((exp (car args)) (clauses (cdr args)) (e (if (symbol? exp) exp (gensym)))) (if (symbol? exp) ((car match:expanders) e clauses (quasiquote (match (unquote-splicing args)))) (quasiquote (let (((unquote e) (unquote exp))) (unquote ((car match:expanders) e clauses (quasiquote (match (unquote-splicing args)))))))))) (else (match:syntax-err (quasiquote (match (unquote-splicing args))) "syntax error in"))))
-(defmacro match-lambda args (if (and (list? args) (match:andmap (lambda (g195) (if (and (pair? g195) (list? (cdr g195))) (pair? (cdr g195)) #f)) args)) ((lambda () (let ((e (gensym))) (quasiquote (lambda ((unquote e)) (match (unquote e) (unquote-splicing args))))))) ((lambda () (match:syntax-err (quasiquote (match-lambda (unquote-splicing args))) "syntax error in")))))
-(defmacro match-lambda* args (if (and (list? args) (match:andmap (lambda (g203) (if (and (pair? g203) (list? (cdr g203))) (pair? (cdr g203)) #f)) args)) ((lambda () (let ((e (gensym))) (quasiquote (lambda (unquote e) (match (unquote e) (unquote-splicing args))))))) ((lambda () (match:syntax-err (quasiquote (match-lambda* (unquote-splicing args))) "syntax error in")))))
-(defmacro match-let args (let ((g227 (lambda (pat exp body) (quasiquote (match (unquote exp) ((unquote pat) (unquote-splicing body)))))) (g223 (lambda (pat exp body) (let ((g (map (lambda (x) (gensym)) pat)) (vpattern (list->vector pat))) (quasiquote (let (unquote (map list g exp)) (match (vector (unquote-splicing g)) ((unquote vpattern) (unquote-splicing body)))))))) (g215 (lambda () (match:syntax-err (quasiquote (match-let (unquote-splicing args))) "syntax error in"))) (g214 (lambda (p1 e1 p2 e2 body) (let ((g1 (gensym)) (g2 (gensym))) (quasiquote (let (((unquote g1) (unquote e1)) ((unquote g2) (unquote e2))) (match (cons (unquote g1) (unquote g2)) (((unquote p1) unquote p2) (unquote-splicing body)))))))) (g205 (cadddr match:expanders))) (if (pair? args) (if (symbol? (car args)) (if (and (pair? (cdr args)) (list? (cadr args))) (let g230 ((g231 (cadr args)) (g229 (quote ())) (g228 (quote ()))) (if (null? g231) (if (and (list? (cddr args)) (pair? (cddr args))) ((lambda (name pat exp body) (if (match:andmap (cadddr match:expanders) pat) (quasiquote (let (unquote-splicing args))) (quasiquote (letrec (((unquote name) (match-lambda* ((unquote pat) (unquote-splicing body))))) ((unquote name) (unquote-splicing exp)))))) (car args) (reverse g228) (reverse g229) (cddr args)) (g215)) (if (and (pair? (car g231)) (pair? (cdar g231)) (null? (cddar g231))) (g230 (cdr g231) (cons (cadar g231) g229) (cons (caar g231) g228)) (g215)))) (g215)) (if (list? (car args)) (if (match:andmap (lambda (g236) (if (and (pair? g236) (g205 (car g236)) (pair? (cdr g236))) (null? (cddr g236)) #f)) (car args)) (if (and (list? (cdr args)) (pair? (cdr args))) ((lambda () (quasiquote (let (unquote-splicing args))))) (let g218 ((g219 (car args)) (g217 (quote ())) (g216 (quote ()))) (if (null? g219) (g215) (if (and (pair? (car g219)) (pair? (cdar g219)) (null? (cddar g219))) (g218 (cdr g219) (cons (cadar g219) g217) (cons (caar g219) g216)) (g215))))) (if (and (pair? (car args)) (pair? (caar args)) (pair? (cdaar args)) (null? (cddaar args))) (if (null? (cdar args)) (if (and (list? (cdr args)) (pair? (cdr args))) (g227 (caaar args) (cadaar args) (cdr args)) (let g218 ((g219 (car args)) (g217 (quote ())) (g216 (quote ()))) (if (null? g219) (g215) (if (and (pair? (car g219)) (pair? (cdar g219)) (null? (cddar g219))) (g218 (cdr g219) (cons (cadar g219) g217) (cons (caar g219) g216)) (g215))))) (if (and (pair? (cdar args)) (pair? (cadar args)) (pair? (cdadar args)) (null? (cdr (cdadar args))) (null? (cddar args))) (if (and (list? (cdr args)) (pair? (cdr args))) (g214 (caaar args) (cadaar args) (caadar args) (car (cdadar args)) (cdr args)) (let g218 ((g219 (car args)) (g217 (quote ())) (g216 (quote ()))) (if (null? g219) (g215) (if (and (pair? (car g219)) (pair? (cdar g219)) (null? (cddar g219))) (g218 (cdr g219) (cons (cadar g219) g217) (cons (caar g219) g216)) (g215))))) (let g218 ((g219 (car args)) (g217 (quote ())) (g216 (quote ()))) (if (null? g219) (if (and (list? (cdr args)) (pair? (cdr args))) (g223 (reverse g216) (reverse g217) (cdr args)) (g215)) (if (and (pair? (car g219)) (pair? (cdar g219)) (null? (cddar g219))) (g218 (cdr g219) (cons (cadar g219) g217) (cons (caar g219) g216)) (g215)))))) (let g218 ((g219 (car args)) (g217 (quote ())) (g216 (quote ()))) (if (null? g219) (if (and (list? (cdr args)) (pair? (cdr args))) (g223 (reverse g216) (reverse g217) (cdr args)) (g215)) (if (and (pair? (car g219)) (pair? (cdar g219)) (null? (cddar g219))) (g218 (cdr g219) (cons (cadar g219) g217) (cons (caar g219) g216)) (g215)))))) (if (pair? (car args)) (if (and (pair? (caar args)) (pair? (cdaar args)) (null? (cddaar args))) (if (null? (cdar args)) (if (and (list? (cdr args)) (pair? (cdr args))) (g227 (caaar args) (cadaar args) (cdr args)) (let g218 ((g219 (car args)) (g217 (quote ())) (g216 (quote ()))) (if (null? g219) (g215) (if (and (pair? (car g219)) (pair? (cdar g219)) (null? (cddar g219))) (g218 (cdr g219) (cons (cadar g219) g217) (cons (caar g219) g216)) (g215))))) (if (and (pair? (cdar args)) (pair? (cadar args)) (pair? (cdadar args)) (null? (cdr (cdadar args))) (null? (cddar args))) (if (and (list? (cdr args)) (pair? (cdr args))) (g214 (caaar args) (cadaar args) (caadar args) (car (cdadar args)) (cdr args)) (let g218 ((g219 (car args)) (g217 (quote ())) (g216 (quote ()))) (if (null? g219) (g215) (if (and (pair? (car g219)) (pair? (cdar g219)) (null? (cddar g219))) (g218 (cdr g219) (cons (cadar g219) g217) (cons (caar g219) g216)) (g215))))) (let g218 ((g219 (car args)) (g217 (quote ())) (g216 (quote ()))) (if (null? g219) (if (and (list? (cdr args)) (pair? (cdr args))) (g223 (reverse g216) (reverse g217) (cdr args)) (g215)) (if (and (pair? (car g219)) (pair? (cdar g219)) (null? (cddar g219))) (g218 (cdr g219) (cons (cadar g219) g217) (cons (caar g219) g216)) (g215)))))) (let g218 ((g219 (car args)) (g217 (quote ())) (g216 (quote ()))) (if (null? g219) (if (and (list? (cdr args)) (pair? (cdr args))) (g223 (reverse g216) (reverse g217) (cdr args)) (g215)) (if (and (pair? (car g219)) (pair? (cdar g219)) (null? (cddar g219))) (g218 (cdr g219) (cons (cadar g219) g217) (cons (caar g219) g216)) (g215))))) (g215)))) (g215))))
-(defmacro match-let* args (let ((g245 (lambda () (match:syntax-err (quasiquote (match-let* (unquote-splicing args))) "syntax error in")))) (if (pair? args) (if (null? (car args)) (if (and (list? (cdr args)) (pair? (cdr args))) ((lambda (body) (quasiquote (let* (unquote-splicing args)))) (cdr args)) (g245)) (if (and (pair? (car args)) (pair? (caar args)) (pair? (cdaar args)) (null? (cddaar args)) (list? (cdar args)) (list? (cdr args)) (pair? (cdr args))) ((lambda (pat exp rest body) (if ((cadddr match:expanders) pat) (quasiquote (let (((unquote pat) (unquote exp))) (match-let* (unquote rest) (unquote-splicing body)))) (quasiquote (match (unquote exp) ((unquote pat) (match-let* (unquote rest) (unquote-splicing body))))))) (caaar args) (cadaar args) (cdar args) (cdr args)) (g245))) (g245))))
-(defmacro match-letrec args (let ((g269 (cadddr match:expanders)) (g268 (lambda (p1 e1 p2 e2 body) (quasiquote (match-letrec ((((unquote p1) unquote p2) (cons (unquote e1) (unquote e2)))) (unquote-splicing body))))) (g264 (lambda () (match:syntax-err (quasiquote (match-letrec (unquote-splicing args))) "syntax error in"))) (g263 (lambda (pat exp body) (quasiquote (match-letrec (((unquote (list->vector pat)) (vector (unquote-splicing exp)))) (unquote-splicing body))))) (g255 (lambda (pat exp body) ((cadr match:expanders) pat exp body (quasiquote (match-letrec (((unquote pat) (unquote exp))) (unquote-splicing body))))))) (if (pair? args) (if (list? (car args)) (if (match:andmap (lambda (g275) (if (and (pair? g275) (g269 (car g275)) (pair? (cdr g275))) (null? (cddr g275)) #f)) (car args)) (if (and (list? (cdr args)) (pair? (cdr args))) ((lambda () (quasiquote (letrec (unquote-splicing args))))) (let g258 ((g259 (car args)) (g257 (quote ())) (g256 (quote ()))) (if (null? g259) (g264) (if (and (pair? (car g259)) (pair? (cdar g259)) (null? (cddar g259))) (g258 (cdr g259) (cons (cadar g259) g257) (cons (caar g259) g256)) (g264))))) (if (and (pair? (car args)) (pair? (caar args)) (pair? (cdaar args)) (null? (cddaar args))) (if (null? (cdar args)) (if (and (list? (cdr args)) (pair? (cdr args))) (g255 (caaar args) (cadaar args) (cdr args)) (let g258 ((g259 (car args)) (g257 (quote ())) (g256 (quote ()))) (if (null? g259) (g264) (if (and (pair? (car g259)) (pair? (cdar g259)) (null? (cddar g259))) (g258 (cdr g259) (cons (cadar g259) g257) (cons (caar g259) g256)) (g264))))) (if (and (pair? (cdar args)) (pair? (cadar args)) (pair? (cdadar args)) (null? (cdr (cdadar args))) (null? (cddar args))) (if (and (list? (cdr args)) (pair? (cdr args))) (g268 (caaar args) (cadaar args) (caadar args) (car (cdadar args)) (cdr args)) (let g258 ((g259 (car args)) (g257 (quote ())) (g256 (quote ()))) (if (null? g259) (g264) (if (and (pair? (car g259)) (pair? (cdar g259)) (null? (cddar g259))) (g258 (cdr g259) (cons (cadar g259) g257) (cons (caar g259) g256)) (g264))))) (let g258 ((g259 (car args)) (g257 (quote ())) (g256 (quote ()))) (if (null? g259) (if (and (list? (cdr args)) (pair? (cdr args))) (g263 (reverse g256) (reverse g257) (cdr args)) (g264)) (if (and (pair? (car g259)) (pair? (cdar g259)) (null? (cddar g259))) (g258 (cdr g259) (cons (cadar g259) g257) (cons (caar g259) g256)) (g264)))))) (let g258 ((g259 (car args)) (g257 (quote ())) (g256 (quote ()))) (if (null? g259) (if (and (list? (cdr args)) (pair? (cdr args))) (g263 (reverse g256) (reverse g257) (cdr args)) (g264)) (if (and (pair? (car g259)) (pair? (cdar g259)) (null? (cddar g259))) (g258 (cdr g259) (cons (cadar g259) g257) (cons (caar g259) g256)) (g264)))))) (if (pair? (car args)) (if (and (pair? (caar args)) (pair? (cdaar args)) (null? (cddaar args))) (if (null? (cdar args)) (if (and (list? (cdr args)) (pair? (cdr args))) (g255 (caaar args) (cadaar args) (cdr args)) (let g258 ((g259 (car args)) (g257 (quote ())) (g256 (quote ()))) (if (null? g259) (g264) (if (and (pair? (car g259)) (pair? (cdar g259)) (null? (cddar g259))) (g258 (cdr g259) (cons (cadar g259) g257) (cons (caar g259) g256)) (g264))))) (if (and (pair? (cdar args)) (pair? (cadar args)) (pair? (cdadar args)) (null? (cdr (cdadar args))) (null? (cddar args))) (if (and (list? (cdr args)) (pair? (cdr args))) (g268 (caaar args) (cadaar args) (caadar args) (car (cdadar args)) (cdr args)) (let g258 ((g259 (car args)) (g257 (quote ())) (g256 (quote ()))) (if (null? g259) (g264) (if (and (pair? (car g259)) (pair? (cdar g259)) (null? (cddar g259))) (g258 (cdr g259) (cons (cadar g259) g257) (cons (caar g259) g256)) (g264))))) (let g258 ((g259 (car args)) (g257 (quote ())) (g256 (quote ()))) (if (null? g259) (if (and (list? (cdr args)) (pair? (cdr args))) (g263 (reverse g256) (reverse g257) (cdr args)) (g264)) (if (and (pair? (car g259)) (pair? (cdar g259)) (null? (cddar g259))) (g258 (cdr g259) (cons (cadar g259) g257) (cons (caar g259) g256)) (g264)))))) (let g258 ((g259 (car args)) (g257 (quote ())) (g256 (quote ()))) (if (null? g259) (if (and (list? (cdr args)) (pair? (cdr args))) (g263 (reverse g256) (reverse g257) (cdr args)) (g264)) (if (and (pair? (car g259)) (pair? (cdar g259)) (null? (cddar g259))) (g258 (cdr g259) (cons (cadar g259) g257) (cons (caar g259) g256)) (g264))))) (g264))) (g264))))
-(defmacro match-define args (let ((g279 (cadddr match:expanders)) (g278 (lambda () (match:syntax-err (quasiquote (match-define (unquote-splicing args))) "syntax error in")))) (if (pair? args) (if (g279 (car args)) (if (and (pair? (cdr args)) (null? (cddr args))) ((lambda () (quasiquote (begin (define (unquote-splicing args)))))) (g278)) (if (and (pair? (cdr args)) (null? (cddr args))) ((lambda (pat exp) ((caddr match:expanders) pat exp (quasiquote (match-define (unquote-splicing args))))) (car args) (cadr args)) (g278))) (g278))))
-(define match:runtime-structures #f)
-(define match:set-runtime-structures (lambda (v) (set! match:runtime-structures v)))
-(define match:primitive-vector? vector?)
-(defmacro defstruct args (let ((field? (lambda (x) (if (symbol? x) ((lambda () #t)) (if (and (pair? x) (symbol? (car x)) (pair? (cdr x)) (symbol? (cadr x)) (null? (cddr x))) ((lambda () #t)) ((lambda () #f)))))) (selector-name (lambda (x) (if (symbol? x) ((lambda () x)) (if (and (pair? x) (symbol? (car x)) (pair? (cdr x)) (null? (cddr x))) ((lambda (s) s) (car x)) (match:error x))))) (mutator-name (lambda (x) (if (symbol? x) ((lambda () #f)) (if (and (pair? x) (pair? (cdr x)) (symbol? (cadr x)) (null? (cddr x))) ((lambda (s) s) (cadr x)) (match:error x))))) (filter-map-with-index (lambda (f l) (letrec ((mapi (lambda (l i) (cond ((null? l) (quote ())) ((f (car l) i) => (lambda (x) (cons x (mapi (cdr l) (+ 1 i))))) (else (mapi (cdr l) (+ 1 i))))))) (mapi l 1))))) (let ((g296 (lambda () (match:syntax-err (quasiquote ((unquote defstruct) (unquote-splicing args))) "syntax error in")))) (if (and (pair? args) (symbol? (car args)) (pair? (cdr args)) (symbol? (cadr args)) (pair? (cddr args)) (symbol? (caddr args)) (list? (cdddr args))) (let g298 ((g299 (cdddr args)) (g297 (quote ()))) (if (null? g299) ((lambda (name constructor predicate fields) (let* ((selectors (map selector-name fields)) (mutators (map mutator-name fields)) (tag (if match:runtime-structures (gensym) (quasiquote (quote (unquote (match:make-structure-tag name)))))) (vectorP (cond ((eq? match:structure-control (quote disjoint)) (quote match:primitive-vector?)) ((eq? match:structure-control (quote vector)) (quote vector?))))) (cond ((eq? match:structure-control (quote disjoint)) (if (eq? vector? match:primitive-vector?) (set! vector? (lambda (v) (and (match:primitive-vector? v) (or (zero? (vector-length v)) (not (symbol? (vector-ref v 0))) (not (match:structure? (vector-ref v 0)))))))) (if (not (memq predicate match:disjoint-predicates)) (set! match:disjoint-predicates (cons predicate match:disjoint-predicates)))) ((eq? match:structure-control (quote vector)) (if (not (memq predicate match:vector-structures)) (set! match:vector-structures (cons predicate match:vector-structures)))) (else (match:syntax-err (quote (vector disjoint)) "invalid value for match:structure-control, legal values are"))) (quasiquote (begin (unquote-splicing (if match:runtime-structures (quasiquote ((define (unquote tag) (match:make-structure-tag (quote (unquote name)))))) (quote ()))) (define (unquote constructor) (lambda (unquote selectors) (vector (unquote tag) (unquote-splicing selectors)))) (define (unquote predicate) (lambda (obj) (and ((unquote vectorP) obj) (= (vector-length obj) (unquote (+ 1 (length selectors)))) (eq? (vector-ref obj 0) (unquote tag))))) (unquote-splicing (filter-map-with-index (lambda (n i) (quasiquote (define (unquote n) (lambda (obj) (vector-ref obj (unquote i)))))) selectors)) (unquote-splicing (filter-map-with-index (lambda (n i) (and n (quasiquote (define (unquote n) (lambda (obj newval) (vector-set! obj (unquote i) newval)))))) mutators)))))) (car args) (cadr args) (caddr args) (reverse g297)) (if (field? (car g299)) (g298 (cdr g299) (cons (car g299) g297)) (g296)))) (g296)))))
-(defmacro define-structure args (let ((g311 (lambda () (match:syntax-err (quasiquote (define-structure (unquote-splicing args))) "syntax error in")))) (if (and (pair? args) (pair? (car args)) (list? (cdar args))) (if (null? (cdr args)) ((lambda (name id1) (quasiquote (define-structure ((unquote name) (unquote-splicing id1)) ()))) (caar args) (cdar args)) (if (and (pair? (cdr args)) (list? (cadr args))) (let g308 ((g309 (cadr args)) (g307 (quote ())) (g306 (quote ()))) (if (null? g309) (if (null? (cddr args)) ((lambda (name id1 id2 val) (let ((mk-id (lambda (id) (if (and (pair? id) (equal? (car id) (quote @)) (pair? (cdr id)) (symbol? (cadr id)) (null? (cddr id))) ((lambda (x) x) (cadr id)) ((lambda () (quasiquote (! (unquote id))))))))) (quasiquote (define-const-structure ((unquote name) (unquote-splicing (map mk-id id1))) (unquote (map (lambda (id v) (quasiquote ((unquote (mk-id id)) (unquote v)))) id2 val)))))) (caar args) (cdar args) (reverse g306) (reverse g307)) (g311)) (if (and (pair? (car g309)) (pair? (cdar g309)) (null? (cddar g309))) (g308 (cdr g309) (cons (cadar g309) g307) (cons (caar g309) g306)) (g311)))) (g311))) (g311))))
-(defmacro define-const-structure args (let ((field? (lambda (id) (if (symbol? id) ((lambda () #t)) (if (and (pair? id) (equal? (car id) (quote !)) (pair? (cdr id)) (symbol? (cadr id)) (null? (cddr id))) ((lambda () #t)) ((lambda () #f)))))) (field-name (lambda (x) (if (symbol? x) x (cadr x)))) (has-mutator? (lambda (x) (not (symbol? x)))) (filter-map-with-index (lambda (f l) (letrec ((mapi (lambda (l i) (cond ((null? l) (quote ())) ((f (car l) i) => (lambda (x) (cons x (mapi (cdr l) (+ 1 i))))) (else (mapi (cdr l) (+ 1 i))))))) (mapi l 1)))) (symbol-append (lambda l (string->symbol (apply string-append (map (lambda (x) (cond ((symbol? x) (symbol->string x)) ((number? x) (number->string x)) (else x))) l)))))) (let ((g335 (lambda () (match:syntax-err (quasiquote (define-const-structure (unquote-splicing args))) "syntax error in")))) (if (and (pair? args) (pair? (car args)) (list? (cdar args))) (if (null? (cdr args)) ((lambda (name id1) (quasiquote (define-const-structure ((unquote name) (unquote-splicing id1)) ()))) (caar args) (cdar args)) (if (symbol? (caar args)) (let g328 ((g329 (cdar args)) (g327 (quote ()))) (if (null? g329) (if (and (pair? (cdr args)) (list? (cadr args))) (let g332 ((g333 (cadr args)) (g331 (quote ())) (g330 (quote ()))) (if (null? g333) (if (null? (cddr args)) ((lambda (name id1 id2 val) (let* ((id1id2 (append id1 id2)) (raw-constructor (symbol-append (quote make-raw-) name)) (constructor (symbol-append (quote make-) name)) (predicate (symbol-append name (quote ?)))) (quasiquote (begin ((unquote defstruct) (unquote name) (unquote raw-constructor) (unquote predicate) (unquote-splicing (filter-map-with-index (lambda (arg i) (if (has-mutator? arg) (quasiquote ((unquote (symbol-append name (quote -) i)) (unquote (symbol-append (quote set-) name (quote -) i (quote !))))) (symbol-append name (quote -) i))) id1id2))) (unquote (if (null? id2) (quasiquote (define (unquote constructor) (unquote raw-constructor))) (let* ((make-fresh (lambda (x) (if (eq? (quote _) x) (gensym) x))) (names1 (map make-fresh (map field-name id1))) (names2 (map make-fresh (map field-name id2)))) (quasiquote (define (unquote constructor) (lambda (unquote names1) (let* (unquote (map list names2 val)) ((unquote raw-constructor) (unquote-splicing names1) (unquote-splicing names2))))))))) (unquote-splicing (filter-map-with-index (lambda (field i) (if (eq? (field-name field) (quote _)) #f (quasiquote (define (unquote (symbol-append name (quote -) (field-name field))) (unquote (symbol-append name (quote -) i)))))) id1id2)) (unquote-splicing (filter-map-with-index (lambda (field i) (if (or (eq? (field-name field) (quote _)) (not (has-mutator? field))) #f (quasiquote (define (unquote (symbol-append (quote set-) name (quote -) (field-name field) (quote !))) (unquote (symbol-append (quote set-) name (quote -) i (quote !))))))) id1id2)))))) (caar args) (reverse g327) (reverse g330) (reverse g331)) (g335)) (if (and (pair? (car g333)) (field? (caar g333)) (pair? (cdar g333)) (null? (cddar g333))) (g332 (cdr g333) (cons (cadar g333) g331) (cons (caar g333) g330)) (g335)))) (g335)) (if (field? (car g329)) (g328 (cdr g329) (cons (car g329) g327)) (g335)))) (g335))) (g335)))))
diff --git a/ice-9/networking.scm b/ice-9/networking.scm
deleted file mode 100644
index c9089554e..000000000
--- a/ice-9/networking.scm
+++ /dev/null
@@ -1,107 +0,0 @@
-;;; installed-scm-file
-
-;;;; Copyright (C) 1999 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-(define (gethostbyaddr addr) (gethost addr))
-(define (gethostbyname name) (gethost name))
-
-(define (getnetbyaddr addr) (getnet addr))
-(define (getnetbyname name) (getnet name))
-
-(define (getprotobyname name) (getproto name))
-(define (getprotobynumber addr) (getproto addr))
-
-(define (getservbyname name proto) (getserv name proto))
-(define (getservbyport port proto) (getserv port proto))
-
-(define (sethostent . stayopen)
- (if (pair? stayopen)
- (sethost (car stayopen))
- (sethost #f)))
-(define (setnetent . stayopen)
- (if (pair? stayopen)
- (setnet (car stayopen))
- (setnet #f)))
-(define (setprotoent . stayopen)
- (if (pair? stayopen)
- (setproto (car stayopen))
- (setproto #f)))
-(define (setservent . stayopen)
- (if (pair? stayopen)
- (setserv (car stayopen))
- (setserv #f)))
-
-(define (gethostent) (gethost))
-(define (getnetent) (getnet))
-(define (getprotoent) (getproto))
-(define (getservent) (getserv))
-
-(define (endhostent) (sethost))
-(define (endnetent) (setnet))
-(define (endprotoent) (setproto))
-(define (endservent) (setserv))
-
-(define (hostent:name obj) (vector-ref obj 0))
-(define (hostent:aliases obj) (vector-ref obj 1))
-(define (hostent:addrtype obj) (vector-ref obj 2))
-(define (hostent:length obj) (vector-ref obj 3))
-(define (hostent:addr-list obj) (vector-ref obj 4))
-
-(define (netent:name obj) (vector-ref obj 0))
-(define (netent:aliases obj) (vector-ref obj 1))
-(define (netent:addrtype obj) (vector-ref obj 2))
-(define (netent:net obj) (vector-ref obj 3))
-
-(define (protoent:name obj) (vector-ref obj 0))
-(define (protoent:aliases obj) (vector-ref obj 1))
-(define (protoent:proto obj) (vector-ref obj 2))
-
-(define (servent:name obj) (vector-ref obj 0))
-(define (servent:aliases obj) (vector-ref obj 1))
-(define (servent:port obj) (vector-ref obj 2))
-(define (servent:proto obj) (vector-ref obj 3))
-
-(define (sockaddr:fam obj) (vector-ref obj 0))
-(define (sockaddr:path obj) (vector-ref obj 1))
-(define (sockaddr:addr obj) (vector-ref obj 1))
-(define (sockaddr:port obj) (vector-ref obj 2))
diff --git a/ice-9/null.scm b/ice-9/null.scm
deleted file mode 100644
index 2ca35529c..000000000
--- a/ice-9/null.scm
+++ /dev/null
@@ -1,60 +0,0 @@
-;;;; Copyright (C) 2000, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-;;;; The null environment - only syntactic bindings
-
-(define-module (ice-9 null)
- :use-module (ice-9 syncase)
- :re-export-syntax (define quote lambda if set!
-
- cond case and or
-
- let let* letrec
-
- begin do
-
- delay
-
- quasiquote
-
- define-syntax
- let-syntax letrec-syntax))
diff --git a/ice-9/optargs.scm b/ice-9/optargs.scm
deleted file mode 100644
index bbeab8cf4..000000000
--- a/ice-9/optargs.scm
+++ /dev/null
@@ -1,444 +0,0 @@
-;;;; optargs.scm -- support for optional arguments
-;;;;
-;;;; Copyright (C) 1997, 1998, 1999, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-;;;; Contributed by Maciej Stachowiak <mstachow@alum.mit.edu>
-
-
-
-;;; Commentary:
-
-;;; {Optional Arguments}
-;;;
-;;; The C interface for creating Guile procedures has a very handy
-;;; "optional argument" feature. This module attempts to provide
-;;; similar functionality for procedures defined in Scheme with
-;;; a convenient and attractive syntax.
-;;;
-;;; exported macros are:
-;;; let-optional
-;;; let-optional*
-;;; let-keywords
-;;; let-keywords*
-;;; lambda*
-;;; define*
-;;; define*-public
-;;; defmacro*
-;;; defmacro*-public
-;;;
-;;;
-;;; Summary of the lambda* extended parameter list syntax (brackets
-;;; are used to indicate grouping only):
-;;;
-;;; ext-param-list ::= [identifier]* [#:optional [ext-var-decl]+]?
-;;; [#:key [ext-var-decl]+ [#:allow-other-keys]?]?
-;;; [[#:rest identifier]|[. identifier]]?
-;;;
-;;; ext-var-decl ::= identifier | ( identifier expression )
-;;;
-;;; The characters `*', `+' and `?' are not to be taken literally; they
-;;; mean respectively, zero or more occurences, one or more occurences,
-;;; and one or zero occurences.
-;;;
-
-;;; Code:
-
-(define-module (ice-9 optargs)
- :export-syntax (let-optional
- let-optional*
- let-keywords
- let-keywords*
- define* lambda*
- define*-public
- defmacro*
- defmacro*-public))
-
-;; let-optional rest-arg (binding ...) . body
-;; let-optional* rest-arg (binding ...) . body
-;; macros used to bind optional arguments
-;;
-;; These two macros give you an optional argument interface that is
-;; very "Schemey" and introduces no fancy syntax. They are compatible
-;; with the scsh macros of the same name, but are slightly
-;; extended. Each of binding may be of one of the forms <var> or
-;; (<var> <default-value>). rest-arg should be the rest-argument of
-;; the procedures these are used from. The items in rest-arg are
-;; sequentially bound to the variable namess are given. When rest-arg
-;; runs out, the remaining vars are bound either to the default values
-;; or to `#f' if no default value was specified. rest-arg remains
-;; bound to whatever may have been left of rest-arg.
-;;
-
-(defmacro let-optional (REST-ARG BINDINGS . BODY)
- (let-optional-template REST-ARG BINDINGS BODY 'let))
-
-(defmacro let-optional* (REST-ARG BINDINGS . BODY)
- (let-optional-template REST-ARG BINDINGS BODY 'let*))
-
-
-
-;; let-keywords rest-arg allow-other-keys? (binding ...) . body
-;; let-keywords* rest-arg allow-other-keys? (binding ...) . body
-;; macros used to bind keyword arguments
-;;
-;; These macros pick out keyword arguments from rest-arg, but do not
-;; modify it. This is consistent at least with Common Lisp, which
-;; duplicates keyword args in the rest arg. More explanation of what
-;; keyword arguments in a lambda list look like can be found below in
-;; the documentation for lambda*. Bindings can have the same form as
-;; for let-optional. If allow-other-keys? is false, an error will be
-;; thrown if anything that looks like a keyword argument but does not
-;; match a known keyword parameter will result in an error.
-;;
-
-
-(defmacro let-keywords (REST-ARG ALLOW-OTHER-KEYS? BINDINGS . BODY)
- (let-keywords-template REST-ARG ALLOW-OTHER-KEYS? BINDINGS BODY 'let))
-
-(defmacro let-keywords* (REST-ARG ALLOW-OTHER-KEYS? BINDINGS . BODY)
- (let-keywords-template REST-ARG ALLOW-OTHER-KEYS? BINDINGS BODY 'let*))
-
-
-;; some utility procedures for implementing the various let-forms.
-
-(define (let-o-k-template REST-ARG BINDINGS BODY let-type proc)
- (let ((bindings (map (lambda (x)
- (if (list? x)
- x
- (list x #f)))
- BINDINGS)))
- `(,let-type ,(map proc bindings) ,@BODY)))
-
-(define (let-optional-template REST-ARG BINDINGS BODY let-type)
- (if (null? BINDINGS)
- `(begin ,@BODY)
- (let-o-k-template REST-ARG BINDINGS BODY let-type
- (lambda (optional)
- `(,(car optional)
- (cond
- ((not (null? ,REST-ARG))
- (let ((result (car ,REST-ARG)))
- ,(list 'set! REST-ARG
- `(cdr ,REST-ARG))
- result))
- (else
- ,(cadr optional))))))))
-
-(define (let-keywords-template REST-ARG ALLOW-OTHER-KEYS? BINDINGS BODY let-type)
- (if (null? BINDINGS)
- `(begin ,@BODY)
- (let* ((kb-list-gensym (gensym "kb:G"))
- (bindfilter (lambda (key)
- `(,(car key)
- (cond
- ((assq ',(car key) ,kb-list-gensym)
- => cdr)
- (else
- ,(cadr key)))))))
- `(let* ((ra->kbl ,rest-arg->keyword-binding-list)
- (,kb-list-gensym (ra->kbl ,REST-ARG ',(map
- (lambda (x) (symbol->keyword (if (pair? x) (car x) x)))
- BINDINGS)
- ,ALLOW-OTHER-KEYS?)))
- ,(let-o-k-template REST-ARG BINDINGS BODY let-type bindfilter)))))
-
-
-(define (rest-arg->keyword-binding-list rest-arg keywords allow-other-keys?)
- (if (null? rest-arg)
- '()
- (let loop ((first (car rest-arg))
- (rest (cdr rest-arg))
- (accum '()))
- (let ((next (lambda (a)
- (if (null? (cdr rest))
- a
- (loop (cadr rest) (cddr rest) a)))))
- (if (keyword? first)
- (cond
- ((memq first keywords)
- (if (null? rest)
- (error "Keyword argument has no value.")
- (next (cons (cons (keyword->symbol first)
- (car rest)) accum))))
- ((not allow-other-keys?)
- (error "Unknown keyword in arguments."))
- (else (if (null? rest)
- accum
- (next accum))))
- (if (null? rest)
- accum
- (loop (car rest) (cdr rest) accum)))))))
-
-
-;; lambda* args . body
-;; lambda extended for optional and keyword arguments
-;;
-;; lambda* creates a procedure that takes optional arguments. These
-;; are specified by putting them inside brackets at the end of the
-;; paramater list, but before any dotted rest argument. For example,
-;; (lambda* (a b #:optional c d . e) '())
-;; creates a procedure with fixed arguments a and b, optional arguments c
-;; and d, and rest argument e. If the optional arguments are omitted
-;; in a call, the variables for them are bound to `#f'.
-;;
-;; lambda* can also take keyword arguments. For example, a procedure
-;; defined like this:
-;; (lambda* (#:key xyzzy larch) '())
-;; can be called with any of the argument lists (#:xyzzy 11)
-;; (#:larch 13) (#:larch 42 #:xyzzy 19) (). Whichever arguments
-;; are given as keywords are bound to values.
-;;
-;; Optional and keyword arguments can also be given default values
-;; which they take on when they are not present in a call, by giving a
-;; two-item list in place of an optional argument, for example in:
-;; (lambda* (foo #:optional (bar 42) #:key (baz 73)) (list foo bar baz))
-;; foo is a fixed argument, bar is an optional argument with default
-;; value 42, and baz is a keyword argument with default value 73.
-;; Default value expressions are not evaluated unless they are needed
-;; and until the procedure is called.
-;;
-;; lambda* now supports two more special parameter list keywords.
-;;
-;; lambda*-defined procedures now throw an error by default if a
-;; keyword other than one of those specified is found in the actual
-;; passed arguments. However, specifying #:allow-other-keys
-;; immediately after the keyword argument declarations restores the
-;; previous behavior of ignoring unknown keywords. lambda* also now
-;; guarantees that if the same keyword is passed more than once, the
-;; last one passed is the one that takes effect. For example,
-;; ((lambda* (#:key (heads 0) (tails 0)) (display (list heads tails)))
-;; #:heads 37 #:tails 42 #:heads 99)
-;; would result in (99 47) being displayed.
-;;
-;; #:rest is also now provided as a synonym for the dotted syntax rest
-;; argument. The argument lists (a . b) and (a #:rest b) are equivalent in
-;; all respects to lambda*. This is provided for more similarity to DSSSL,
-;; MIT-Scheme and Kawa among others, as well as for refugees from other
-;; Lisp dialects.
-
-
-(defmacro lambda* (ARGLIST . BODY)
- (parse-arglist
- ARGLIST
- (lambda (non-optional-args optionals keys aok? rest-arg)
- ;; Check for syntax errors.
- (if (not (every? symbol? non-optional-args))
- (error "Syntax error in fixed argument declaration."))
- (if (not (every? ext-decl? optionals))
- (error "Syntax error in optional argument declaration."))
- (if (not (every? ext-decl? keys))
- (error "Syntax error in keyword argument declaration."))
- (if (not (or (symbol? rest-arg) (eq? #f rest-arg)))
- (error "Syntax error in rest argument declaration."))
- ;; generate the code.
- (let ((rest-gensym (or rest-arg (gensym "lambda*:G")))
- (lambda-gensym (gensym "lambda*:L")))
- (if (not (and (null? optionals) (null? keys)))
- `(let ((,lambda-gensym
- (lambda (,@non-optional-args . ,rest-gensym)
- ;; Make sure that if the proc had a docstring, we put it
- ;; here where it will be visible.
- ,@(if (and (not (null? BODY))
- (string? (car BODY)))
- (list (car BODY))
- '())
- (let-optional*
- ,rest-gensym
- ,optionals
- (let-keywords* ,rest-gensym
- ,aok?
- ,keys
- ,@(if (and (not rest-arg) (null? keys))
- `((if (not (null? ,rest-gensym))
- (error "Too many arguments.")))
- '())
- (let ()
- ,@BODY))))))
- (set-procedure-property! ,lambda-gensym 'arglist
- '(,non-optional-args
- ,optionals
- ,keys
- ,aok?
- ,rest-arg))
- ,lambda-gensym)
- `(lambda (,@non-optional-args . ,(if rest-arg rest-arg '()))
- ,@BODY))))))
-
-
-(define (every? pred lst)
- (or (null? lst)
- (and (pred (car lst))
- (every? pred (cdr lst)))))
-
-(define (ext-decl? obj)
- (or (symbol? obj)
- (and (list? obj) (= 2 (length obj)) (symbol? (car obj)))))
-
-(define (parse-arglist arglist cont)
- (define (split-list-at val lst cont)
- (cond
- ((memq val lst)
- => (lambda (pos)
- (if (memq val (cdr pos))
- (error (with-output-to-string
- (lambda ()
- (map display `(,val
- " specified more than once in argument list.")))))
- (cont (reverse (cdr (memq val (reverse lst)))) (cdr pos) #t))))
- (else (cont lst '() #f))))
- (define (parse-opt-and-fixed arglist keys aok? rest cont)
- (split-list-at
- #:optional arglist
- (lambda (before after split?)
- (if (and split? (null? after))
- (error "#:optional specified but no optional arguments declared.")
- (cont before after keys aok? rest)))))
- (define (parse-keys arglist rest cont)
- (split-list-at
- #:allow-other-keys arglist
- (lambda (aok-before aok-after aok-split?)
- (if (and aok-split? (not (null? aok-after)))
- (error "#:allow-other-keys not at end of keyword argument declarations.")
- (split-list-at
- #:key aok-before
- (lambda (key-before key-after key-split?)
- (cond
- ((and aok-split? (not key-split?))
- (error "#:allow-other-keys specified but no keyword arguments declared."))
- (key-split?
- (cond
- ((null? key-after) (error "#:key specified but no keyword arguments declared."))
- ((memq #:optional key-after) (error "#:optional arguments declared after #:key arguments."))
- (else (parse-opt-and-fixed key-before key-after aok-split? rest cont))))
- (else (parse-opt-and-fixed arglist '() #f rest cont)))))))))
- (define (parse-rest arglist cont)
- (cond
- ((null? arglist) (cont '() '() '() #f #f))
- ((not (pair? arglist)) (cont '() '() '() #f arglist))
- ((not (list? arglist))
- (let* ((copy (list-copy arglist))
- (lp (last-pair copy))
- (ra (cdr lp)))
- (set-cdr! lp '())
- (if (memq #:rest copy)
- (error "Cannot specify both #:rest and dotted rest argument.")
- (parse-keys copy ra cont))))
- (else (split-list-at
- #:rest arglist
- (lambda (before after split?)
- (if split?
- (case (length after)
- ((0) (error "#:rest not followed by argument."))
- ((1) (parse-keys before (car after) cont))
- (else (error "#:rest argument must be declared last.")))
- (parse-keys before #f cont)))))))
-
- (parse-rest arglist cont))
-
-
-
-;; define* args . body
-;; define*-public args . body
-;; define and define-public extended for optional and keyword arguments
-;;
-;; define* and define*-public support optional arguments with
-;; a similar syntax to lambda*. They also support arbitrary-depth
-;; currying, just like Guile's define. Some examples:
-;; (define* (x y #:optional a (z 3) #:key w . u) (display (list y z u)))
-;; defines a procedure x with a fixed argument y, an optional agument
-;; a, another optional argument z with default value 3, a keyword argument w,
-;; and a rest argument u.
-;; (define-public* ((foo #:optional bar) #:optional baz) '())
-;; This illustrates currying. A procedure foo is defined, which,
-;; when called with an optional argument bar, returns a procedure that
-;; takes an optional argument baz.
-;;
-;; Of course, define*[-public] also supports #:rest and #:allow-other-keys
-;; in the same way as lambda*.
-
-(defmacro define* (ARGLIST . BODY)
- (define*-guts 'define ARGLIST BODY))
-
-(defmacro define*-public (ARGLIST . BODY)
- (define*-guts 'define-public ARGLIST BODY))
-
-;; The guts of define* and define*-public.
-(define (define*-guts DT ARGLIST BODY)
- (define (nest-lambda*s arglists)
- (if (null? arglists)
- BODY
- `((lambda* ,(car arglists) ,@(nest-lambda*s (cdr arglists))))))
- (define (define*-guts-helper ARGLIST arglists)
- (let ((first (car ARGLIST))
- (al (cons (cdr ARGLIST) arglists)))
- (if (symbol? first)
- `(,DT ,first ,@(nest-lambda*s al))
- (define*-guts-helper first al))))
- (if (symbol? ARGLIST)
- `(,DT ,ARGLIST ,@BODY)
- (define*-guts-helper ARGLIST '())))
-
-
-
-;; defmacro* name args . body
-;; defmacro*-public args . body
-;; defmacro and defmacro-public extended for optional and keyword arguments
-;;
-;; These are just like defmacro and defmacro-public except that they
-;; take lambda*-style extended paramter lists, where #:optional,
-;; #:key, #:allow-other-keys and #:rest are allowed with the usual
-;; semantics. Here is an example of a macro with an optional argument:
-;; (defmacro* transmorgify (a #:optional b)
-
-(defmacro defmacro* (NAME ARGLIST . BODY)
- (defmacro*-guts 'define NAME ARGLIST BODY))
-
-(defmacro defmacro*-public (NAME ARGLIST . BODY)
- (defmacro*-guts 'define-public NAME ARGLIST BODY))
-
-;; The guts of defmacro* and defmacro*-public
-(define (defmacro*-guts DT NAME ARGLIST BODY)
- `(,DT ,NAME
- (,(lambda (transformer) (defmacro:transformer transformer))
- (lambda* ,ARGLIST ,@BODY))))
-
-;;; optargs.scm ends here
diff --git a/ice-9/poe.scm b/ice-9/poe.scm
deleted file mode 100644
index 96133c764..000000000
--- a/ice-9/poe.scm
+++ /dev/null
@@ -1,143 +0,0 @@
-;;; installed-scm-file
-
-;;;; Copyright (C) 1996, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-
-(define-module (ice-9 poe)
- :use-module (ice-9 hcons)
- :export (pure-funcq perfect-funcq))
-
-
-
-
-;;; {Pure Functions}
-;;;
-;;; A pure function (of some sort) is characterized by two equality
-;;; relations: one on argument lists and one on return values.
-;;; A pure function is one that when applied to equal arguments lists
-;;; yields equal results.
-;;;
-;;; If the equality relationship on return values can be eq?, it may make
-;;; sense to cache values returned by the function. Choosing the right
-;;; equality relation on arguments is tricky.
-;;;
-
-
-;;; {pure-funcq}
-;;;
-;;; The simplest case of pure functions are those in which results
-;;; are only certainly eq? if all of the arguments are. These functions
-;;; are called "pure-funcq", for obvious reasons.
-;;;
-
-
-(define funcq-memo (make-weak-key-hash-table 523)) ; !!! randomly selected values
-(define funcq-buffer (make-gc-buffer 256))
-
-(define (funcq-hash arg-list n)
- (let ((it (let loop ((x 0)
- (arg-list arg-list))
- (if (null? arg-list)
- (modulo x n)
- (loop (logior x (hashq (car arg-list) 4194303))
- (cdr arg-list))))))
- it))
-
-(define (funcq-assoc arg-list alist)
- (let ((it (and alist
- (let and-map ((key arg-list)
- (entry (caar alist)))
- (or (and (and (not key) (not entry))
- (car alist))
- (and key entry
- (eq? (car key) (car entry))
- (and-map (cdr key) (cdr entry))))))))
- it))
-
-
-
-(define (pure-funcq base-func)
- (lambda args
- (let ((cached (hashx-get-handle funcq-hash funcq-assoc funcq-memo (cons base-func args))))
- (if cached
- (begin
- (funcq-buffer (car cached))
- (cdr cached))
-
- (let ((val (apply base-func args))
- (key (cons base-func args)))
- (funcq-buffer key)
- (hashx-set! funcq-hash funcq-assoc funcq-memo key val)
- val)))))
-
-
-
-;;; {Perfect funq}
-;;;
-;;; A pure funq may sometimes forget its past but a perfect
-;;; funcq never does.
-;;;
-
-(define (perfect-funcq size base-func)
- (define funcq-memo (make-hash-table size))
-
- (lambda args
- (let ((cached (hashx-get-handle funcq-hash funcq-assoc funcq-memo (cons base-func args))))
- (if cached
- (begin
- (funcq-buffer (car cached))
- (cdr cached))
-
- (let ((val (apply base-func args))
- (key (cons base-func args)))
- (funcq-buffer key)
- (hashx-set! funcq-hash funcq-assoc funcq-memo key val)
- val)))))
-
-
-
-
-
-
-
-
diff --git a/ice-9/popen.scm b/ice-9/popen.scm
deleted file mode 100644
index 2a3bdd605..000000000
--- a/ice-9/popen.scm
+++ /dev/null
@@ -1,205 +0,0 @@
-;; popen emulation, for non-stdio based ports.
-
-;;;; Copyright (C) 1998, 1999, 2000, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-(define-module (ice-9 popen)
- :export (port/pid-table open-pipe close-pipe open-input-pipe
- open-output-pipe))
-
-;; (define-module (guile popen)
-;; :use-module (guile posix))
-
-;; a guardian to ensure the cleanup is done correctly when
-;; an open pipe is gc'd or a close-port is used.
-(define pipe-guardian (make-guardian))
-
-;; a weak hash-table to store the process ids.
-(define port/pid-table (make-weak-key-hash-table 31))
-
-(define (ensure-fdes port mode)
- (or (false-if-exception (fileno port))
- (open-fdes *null-device* mode)))
-
-;; run a process connected to an input or output port.
-;; mode: OPEN_READ or OPEN_WRITE.
-;; returns port/pid pair.
-(define (open-process mode prog . args)
- (let ((p (pipe))
- (reading (string=? mode OPEN_READ)))
- (setvbuf (cdr p) _IONBF)
- (let ((pid (primitive-fork)))
- (cond ((= pid 0)
- ;; child
- (set-batch-mode?! #t)
-
- ;; select the three file descriptors to be used as
- ;; standard descriptors 0, 1, 2 for the new process. one
- ;; is the pipe to the parent, the other two are taken
- ;; from the current Scheme input/output/error ports if
- ;; possible.
-
- (let ((input-fdes (if reading
- (ensure-fdes (current-input-port)
- O_RDONLY)
- (fileno (car p))))
- (output-fdes (if reading
- (fileno (cdr p))
- (ensure-fdes (current-output-port)
- O_WRONLY)))
- (error-fdes (ensure-fdes (current-error-port)
- O_WRONLY)))
-
- ;; close all file descriptors in ports inherited from
- ;; the parent except for the three selected above.
- ;; this is to avoid causing problems for other pipes in
- ;; the parent.
-
- ;; use low-level system calls, not close-port or the
- ;; scsh routines, to avoid side-effects such as
- ;; flushing port buffers or evicting ports.
-
- (port-for-each (lambda (pt-entry)
- (false-if-exception
- (let ((pt-fileno (fileno pt-entry)))
- (if (not (or (= pt-fileno input-fdes)
- (= pt-fileno output-fdes)
- (= pt-fileno error-fdes)))
- (close-fdes pt-fileno))))))
-
- ;; copy the three selected descriptors to the standard
- ;; descriptors 0, 1, 2. note that it's possible that
- ;; output-fdes or input-fdes is equal to error-fdes.
-
- (cond ((not (= input-fdes 0))
- (if (= output-fdes 0)
- (set! output-fdes (dup->fdes 0)))
- (if (= error-fdes 0)
- (set! error-fdes (dup->fdes 0)))
- (dup2 input-fdes 0)))
-
- (cond ((not (= output-fdes 1))
- (if (= error-fdes 1)
- (set! error-fdes (dup->fdes 1)))
- (dup2 output-fdes 1)))
-
- (dup2 error-fdes 2)
-
- (apply execlp prog prog args)))
-
- (else
- ;; parent
- (if reading
- (close-port (cdr p))
- (close-port (car p)))
- (cons (if reading
- (car p)
- (cdr p))
- pid))))))
-
-(define (open-pipe command mode)
- "Executes the shell command @var{command} (a string) in a subprocess.
-A pipe to the process is created and returned. @var{modes} specifies
-whether an input or output pipe to the process is created: it should
-be the value of @code{OPEN_READ} or @code{OPEN_WRITE}."
- (let* ((port/pid (open-process mode "/bin/sh" "-c" command))
- (port (car port/pid)))
- (pipe-guardian port)
- (hashq-set! port/pid-table port (cdr port/pid))
- port))
-
-(define (fetch-pid port)
- (let ((pid (hashq-ref port/pid-table port)))
- (hashq-remove! port/pid-table port)
- pid))
-
-(define (close-process port/pid)
- (close-port (car port/pid))
- (cdr (waitpid (cdr port/pid))))
-
-;; for the background cleanup handler: just clean up without reporting
-;; errors. also avoids blocking the process: if the child isn't ready
-;; to be collected, puts it back into the guardian's live list so it
-;; can be tried again the next time the cleanup runs.
-(define (close-process-quietly port/pid)
- (catch 'system-error
- (lambda ()
- (close-port (car port/pid)))
- (lambda args #f))
- (catch 'system-error
- (lambda ()
- (let ((pid/status (waitpid (cdr port/pid) WNOHANG)))
- (cond ((= (car pid/status) 0)
- ;; not ready for collection
- (pipe-guardian (car port/pid))
- (hashq-set! port/pid-table
- (car port/pid) (cdr port/pid))))))
- (lambda args #f)))
-
-(define (close-pipe p)
- "Closes the pipe created by @code{open-pipe}, then waits for the process
-to terminate and returns its status value, @xref{Processes, waitpid}, for
-information on how to interpret this value."
- (let ((pid (fetch-pid p)))
- (if (not pid)
- (error "close-pipe: pipe not in table"))
- (close-process (cons p pid))))
-
-(define reap-pipes
- (lambda ()
- (let loop ((p (pipe-guardian)))
- (cond (p
- ;; maybe removed already by close-pipe.
- (let ((pid (fetch-pid p)))
- (if pid
- (close-process-quietly (cons p pid))))
- (loop (pipe-guardian)))))))
-
-(add-hook! after-gc-hook reap-pipes)
-
-(define (open-input-pipe command)
- "Equivalent to @code{open-pipe} with mode @code{OPEN_READ}"
- (open-pipe command OPEN_READ))
-
-(define (open-output-pipe command)
- "Equivalent to @code{open-pipe} with mode @code{OPEN_WRITE}"
- (open-pipe command OPEN_WRITE))
diff --git a/ice-9/posix.scm b/ice-9/posix.scm
deleted file mode 100644
index 701e942cc..000000000
--- a/ice-9/posix.scm
+++ /dev/null
@@ -1,94 +0,0 @@
-;;; installed-scm-file
-
-;;;; Copyright (C) 1999 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-(define (stat:dev f) (vector-ref f 0))
-(define (stat:ino f) (vector-ref f 1))
-(define (stat:mode f) (vector-ref f 2))
-(define (stat:nlink f) (vector-ref f 3))
-(define (stat:uid f) (vector-ref f 4))
-(define (stat:gid f) (vector-ref f 5))
-(define (stat:rdev f) (vector-ref f 6))
-(define (stat:size f) (vector-ref f 7))
-(define (stat:atime f) (vector-ref f 8))
-(define (stat:mtime f) (vector-ref f 9))
-(define (stat:ctime f) (vector-ref f 10))
-(define (stat:blksize f) (vector-ref f 11))
-(define (stat:blocks f) (vector-ref f 12))
-
-;; derived from stat mode.
-(define (stat:type f) (vector-ref f 13))
-(define (stat:perms f) (vector-ref f 14))
-
-(define (passwd:name obj) (vector-ref obj 0))
-(define (passwd:passwd obj) (vector-ref obj 1))
-(define (passwd:uid obj) (vector-ref obj 2))
-(define (passwd:gid obj) (vector-ref obj 3))
-(define (passwd:gecos obj) (vector-ref obj 4))
-(define (passwd:dir obj) (vector-ref obj 5))
-(define (passwd:shell obj) (vector-ref obj 6))
-
-(define (group:name obj) (vector-ref obj 0))
-(define (group:passwd obj) (vector-ref obj 1))
-(define (group:gid obj) (vector-ref obj 2))
-(define (group:mem obj) (vector-ref obj 3))
-
-(define (utsname:sysname obj) (vector-ref obj 0))
-(define (utsname:nodename obj) (vector-ref obj 1))
-(define (utsname:release obj) (vector-ref obj 2))
-(define (utsname:version obj) (vector-ref obj 3))
-(define (utsname:machine obj) (vector-ref obj 4))
-
-(define (getpwent) (getpw))
-(define (setpwent) (setpw #t))
-(define (endpwent) (setpw))
-
-(define (getpwnam name) (getpw name))
-(define (getpwuid uid) (getpw uid))
-
-(define (getgrent) (getgr))
-(define (setgrent) (setgr #t))
-(define (endgrent) (setgr))
-
-(define (getgrnam name) (getgr name))
-(define (getgrgid id) (getgr id))
diff --git a/ice-9/pretty-print.scm b/ice-9/pretty-print.scm
deleted file mode 100644
index c323488bd..000000000
--- a/ice-9/pretty-print.scm
+++ /dev/null
@@ -1,344 +0,0 @@
-;;;; -*-scheme-*-
-;;;;
-;;;; Copyright (C) 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-(define-module (ice-9 pretty-print)
- :use-module (ice-9 optargs)
- :export (pretty-print))
-
-;; From SLIB.
-
-;;"genwrite.scm" generic write used by pretty-print and truncated-print.
-;; Copyright (c) 1991, Marc Feeley
-;; Author: Marc Feeley (feeley@iro.umontreal.ca)
-;; Distribution restrictions: none
-
-(define genwrite:newline-str (make-string 1 #\newline))
-
-(define (generic-write obj display? width per-line-prefix output)
-
- (define (read-macro? l)
- (define (length1? l) (and (pair? l) (null? (cdr l))))
- (let ((head (car l)) (tail (cdr l)))
- (case head
- ((quote quasiquote unquote unquote-splicing) (length1? tail))
- (else #f))))
-
- (define (read-macro-body l)
- (cadr l))
-
- (define (read-macro-prefix l)
- (let ((head (car l)) (tail (cdr l)))
- (case head
- ((quote) "'")
- ((quasiquote) "`")
- ((unquote) ",")
- ((unquote-splicing) ",@"))))
-
- (define (out str col)
- (and col (output str) (+ col (string-length str))))
-
- (define (wr obj col)
-
- (define (wr-expr expr col)
- (if (read-macro? expr)
- (wr (read-macro-body expr) (out (read-macro-prefix expr) col))
- (wr-lst expr col)))
-
- (define (wr-lst l col)
- (if (pair? l)
- (let loop ((l (cdr l))
- (col (and col (wr (car l) (out "(" col)))))
- (cond ((not col) col)
- ((pair? l)
- (loop (cdr l) (wr (car l) (out " " col))))
- ((null? l) (out ")" col))
- (else (out ")" (wr l (out " . " col))))))
- (out "()" col)))
-
- (cond ((pair? obj) (wr-expr obj col))
- ((null? obj) (wr-lst obj col))
- ((vector? obj) (wr-lst (vector->list obj) (out "#" col)))
- ((boolean? obj) (out (if obj "#t" "#f") col))
- ((number? obj) (out (number->string obj) col))
- ((symbol? obj) (out (symbol->string obj) col))
- ((procedure? obj) (out "#[procedure]" col))
- ((string? obj) (if display?
- (out obj col)
- (let loop ((i 0) (j 0) (col (out "\"" col)))
- (if (and col (< j (string-length obj)))
- (let ((c (string-ref obj j)))
- (if (or (char=? c #\\)
- (char=? c #\"))
- (loop j
- (+ j 1)
- (out "\\"
- (out (substring obj i j)
- col)))
- (loop i (+ j 1) col)))
- (out "\""
- (out (substring obj i j) col))))))
- ((char? obj) (if display?
- (out (make-string 1 obj) col)
- (out (case obj
- ((#\space) "space")
- ((#\newline) "newline")
- (else (make-string 1 obj)))
- (out "#\\" col))))
- (else (out (object->string obj) col))))
-
- (define (pp obj col)
-
- (define (spaces n col)
- (if (> n 0)
- (if (> n 7)
- (spaces (- n 8) (out " " col))
- (out (substring " " 0 n) col))
- col))
-
- (define (indent to col)
- (and col
- (if (< to col)
- (and (out genwrite:newline-str col)
- (out per-line-prefix 0)
- (spaces to 0))
- (spaces (- to col) col))))
-
- (define (pr obj col extra pp-pair)
- (if (or (pair? obj) (vector? obj)) ; may have to split on multiple lines
- (let ((result '())
- (left (min (+ (- (- width col) extra) 1) max-expr-width)))
- (generic-write obj display? #f ""
- (lambda (str)
- (set! result (cons str result))
- (set! left (- left (string-length str)))
- (> left 0)))
- (if (> left 0) ; all can be printed on one line
- (out (reverse-string-append result) col)
- (if (pair? obj)
- (pp-pair obj col extra)
- (pp-list (vector->list obj) (out "#" col) extra pp-expr))))
- (wr obj col)))
-
- (define (pp-expr expr col extra)
- (if (read-macro? expr)
- (pr (read-macro-body expr)
- (out (read-macro-prefix expr) col)
- extra
- pp-expr)
- (let ((head (car expr)))
- (if (symbol? head)
- (let ((proc (style head)))
- (if proc
- (proc expr col extra)
- (if (> (string-length (symbol->string head))
- max-call-head-width)
- (pp-general expr col extra #f #f #f pp-expr)
- (pp-call expr col extra pp-expr))))
- (pp-list expr col extra pp-expr)))))
-
- ; (head item1
- ; item2
- ; item3)
- (define (pp-call expr col extra pp-item)
- (let ((col* (wr (car expr) (out "(" col))))
- (and col
- (pp-down (cdr expr) col* (+ col* 1) extra pp-item))))
-
- ; (item1
- ; item2
- ; item3)
- (define (pp-list l col extra pp-item)
- (let ((col (out "(" col)))
- (pp-down l col col extra pp-item)))
-
- (define (pp-down l col1 col2 extra pp-item)
- (let loop ((l l) (col col1))
- (and col
- (cond ((pair? l)
- (let ((rest (cdr l)))
- (let ((extra (if (null? rest) (+ extra 1) 0)))
- (loop rest
- (pr (car l) (indent col2 col) extra pp-item)))))
- ((null? l)
- (out ")" col))
- (else
- (out ")"
- (pr l
- (indent col2 (out "." (indent col2 col)))
- (+ extra 1)
- pp-item)))))))
-
- (define (pp-general expr col extra named? pp-1 pp-2 pp-3)
-
- (define (tail1 rest col1 col2 col3)
- (if (and pp-1 (pair? rest))
- (let* ((val1 (car rest))
- (rest (cdr rest))
- (extra (if (null? rest) (+ extra 1) 0)))
- (tail2 rest col1 (pr val1 (indent col3 col2) extra pp-1) col3))
- (tail2 rest col1 col2 col3)))
-
- (define (tail2 rest col1 col2 col3)
- (if (and pp-2 (pair? rest))
- (let* ((val1 (car rest))
- (rest (cdr rest))
- (extra (if (null? rest) (+ extra 1) 0)))
- (tail3 rest col1 (pr val1 (indent col3 col2) extra pp-2)))
- (tail3 rest col1 col2)))
-
- (define (tail3 rest col1 col2)
- (pp-down rest col2 col1 extra pp-3))
-
- (let* ((head (car expr))
- (rest (cdr expr))
- (col* (wr head (out "(" col))))
- (if (and named? (pair? rest))
- (let* ((name (car rest))
- (rest (cdr rest))
- (col** (wr name (out " " col*))))
- (tail1 rest (+ col indent-general) col** (+ col** 1)))
- (tail1 rest (+ col indent-general) col* (+ col* 1)))))
-
- (define (pp-expr-list l col extra)
- (pp-list l col extra pp-expr))
-
- (define (pp-LAMBDA expr col extra)
- (pp-general expr col extra #f pp-expr-list #f pp-expr))
-
- (define (pp-IF expr col extra)
- (pp-general expr col extra #f pp-expr #f pp-expr))
-
- (define (pp-COND expr col extra)
- (pp-call expr col extra pp-expr-list))
-
- (define (pp-CASE expr col extra)
- (pp-general expr col extra #f pp-expr #f pp-expr-list))
-
- (define (pp-AND expr col extra)
- (pp-call expr col extra pp-expr))
-
- (define (pp-LET expr col extra)
- (let* ((rest (cdr expr))
- (named? (and (pair? rest) (symbol? (car rest)))))
- (pp-general expr col extra named? pp-expr-list #f pp-expr)))
-
- (define (pp-BEGIN expr col extra)
- (pp-general expr col extra #f #f #f pp-expr))
-
- (define (pp-DO expr col extra)
- (pp-general expr col extra #f pp-expr-list pp-expr-list pp-expr))
-
- ; define formatting style (change these to suit your style)
-
- (define indent-general 2)
-
- (define max-call-head-width 5)
-
- (define max-expr-width 50)
-
- (define (style head)
- (case head
- ((lambda let* letrec define) pp-LAMBDA)
- ((if set!) pp-IF)
- ((cond) pp-COND)
- ((case) pp-CASE)
- ((and or) pp-AND)
- ((let) pp-LET)
- ((begin) pp-BEGIN)
- ((do) pp-DO)
- (else #f)))
-
- (pr obj col 0 pp-expr))
-
- (out per-line-prefix 0)
- (if width
- (out genwrite:newline-str (pp obj 0))
- (wr obj 0))
- ;; Return `unspecified'
- (if #f #f))
-
-; (reverse-string-append l) = (apply string-append (reverse l))
-
-(define (reverse-string-append l)
-
- (define (rev-string-append l i)
- (if (pair? l)
- (let* ((str (car l))
- (len (string-length str))
- (result (rev-string-append (cdr l) (+ i len))))
- (let loop ((j 0) (k (- (- (string-length result) i) len)))
- (if (< j len)
- (begin
- (string-set! result k (string-ref str j))
- (loop (+ j 1) (+ k 1)))
- result)))
- (make-string i)))
-
- (rev-string-append l 0))
-
-(define (pretty-print obj . opts)
- "Pretty-print OBJ on PORT, which is a keyword argument defaulting to
-the current output port. Formatting can be controlled by a number of
-keyword arguments: Each line in the output is preceded by the string
-PER-LINE-PREFIX, which is empty by default. The output lines will be
-at most WIDTH characters wide; the default is 79. If DISPLAY? is
-true, display rather than write representation will be used.
-
-Instead of with a keyword argument, you can also specify the output
-port directly after OBJ, like (pretty-print OBJ PORT)."
- (if (pair? opts)
- (if (keyword? (car opts))
- (apply pretty-print-with-keys obj opts)
- (apply pretty-print-with-keys obj #:port (car opts) (cdr opts)))
- (pretty-print-with-keys obj)))
-
-(define* (pretty-print-with-keys obj
- #:key
- (port (current-output-port))
- (width 79)
- (display? #f)
- (per-line-prefix ""))
- (generic-write obj display?
- (- width (string-length per-line-prefix))
- per-line-prefix
- (lambda (s) (display s port) #t)))
diff --git a/ice-9/psyntax.pp b/ice-9/psyntax.pp
deleted file mode 100644
index e3701c740..000000000
--- a/ice-9/psyntax.pp
+++ /dev/null
@@ -1,11 +0,0 @@
-(letrec ((syntmp-lambda-var-list-116 (lambda (syntmp-vars-323) (let syntmp-lvl-324 ((syntmp-vars-325 syntmp-vars-323) (syntmp-ls-326 (quote ())) (syntmp-w-327 (quote (())))) (cond ((pair? syntmp-vars-325) (syntmp-lvl-324 (cdr syntmp-vars-325) (cons (syntmp-wrap-95 (car syntmp-vars-325) syntmp-w-327) syntmp-ls-326) syntmp-w-327)) ((syntmp-id?-67 syntmp-vars-325) (cons (syntmp-wrap-95 syntmp-vars-325 syntmp-w-327) syntmp-ls-326)) ((null? syntmp-vars-325) syntmp-ls-326) ((syntmp-syntax-object?-53 syntmp-vars-325) (syntmp-lvl-324 (syntmp-syntax-object-expression-54 syntmp-vars-325) syntmp-ls-326 (syntmp-join-wraps-86 syntmp-w-327 (syntmp-syntax-object-wrap-55 syntmp-vars-325)))) ((syntmp-annotation?-42 syntmp-vars-325) (syntmp-lvl-324 (annotation-expression syntmp-vars-325) syntmp-ls-326 syntmp-w-327)) (else (cons syntmp-vars-325 syntmp-ls-326)))))) (syntmp-gen-var-115 (lambda (syntmp-id-328) (let ((syntmp-id-329 (if (syntmp-syntax-object?-53 syntmp-id-328) (syntmp-syntax-object-expression-54 syntmp-id-328) syntmp-id-328))) (if (syntmp-annotation?-42 syntmp-id-329) (gensym (symbol->string (annotation-expression syntmp-id-329))) (gensym (symbol->string syntmp-id-329)))))) (syntmp-strip-114 (lambda (syntmp-x-330 syntmp-w-331) (if (memq (quote top) (syntmp-wrap-marks-70 syntmp-w-331)) (if (or (syntmp-annotation?-42 syntmp-x-330) (and (pair? syntmp-x-330) (syntmp-annotation?-42 (car syntmp-x-330)))) (syntmp-strip-annotation-113 syntmp-x-330 (quote #f)) syntmp-x-330) (let syntmp-f-332 ((syntmp-x-333 syntmp-x-330)) (cond ((syntmp-syntax-object?-53 syntmp-x-333) (syntmp-strip-114 (syntmp-syntax-object-expression-54 syntmp-x-333) (syntmp-syntax-object-wrap-55 syntmp-x-333))) ((pair? syntmp-x-333) (let ((syntmp-a-334 (syntmp-f-332 (car syntmp-x-333))) (syntmp-d-335 (syntmp-f-332 (cdr syntmp-x-333)))) (if (and (eq? syntmp-a-334 (car syntmp-x-333)) (eq? syntmp-d-335 (cdr syntmp-x-333))) syntmp-x-333 (cons syntmp-a-334 syntmp-d-335)))) ((vector? syntmp-x-333) (let ((syntmp-old-336 (vector->list syntmp-x-333))) (let ((syntmp-new-337 (map syntmp-f-332 syntmp-old-336))) (if (andmap eq? syntmp-old-336 syntmp-new-337) syntmp-x-333 (list->vector syntmp-new-337))))) (else syntmp-x-333)))))) (syntmp-strip-annotation-113 (lambda (syntmp-x-338 syntmp-parent-339) (cond ((pair? syntmp-x-338) (let ((syntmp-new-340 (cons (quote #f) (quote #f)))) (begin (when syntmp-parent-339 (set-annotation-stripped! syntmp-parent-339 syntmp-new-340)) (set-car! syntmp-new-340 (syntmp-strip-annotation-113 (car syntmp-x-338) (quote #f))) (set-cdr! syntmp-new-340 (syntmp-strip-annotation-113 (cdr syntmp-x-338) (quote #f))) syntmp-new-340))) ((syntmp-annotation?-42 syntmp-x-338) (or (annotation-stripped syntmp-x-338) (syntmp-strip-annotation-113 (annotation-expression syntmp-x-338) syntmp-x-338))) ((vector? syntmp-x-338) (let ((syntmp-new-341 (make-vector (vector-length syntmp-x-338)))) (begin (when syntmp-parent-339 (set-annotation-stripped! syntmp-parent-339 syntmp-new-341)) (let syntmp-loop-342 ((syntmp-i-343 (- (vector-length syntmp-x-338) (quote 1)))) (unless (syntmp-fx<-41 syntmp-i-343 (quote 0)) (vector-set! syntmp-new-341 syntmp-i-343 (syntmp-strip-annotation-113 (vector-ref syntmp-x-338 syntmp-i-343) (quote #f))) (syntmp-loop-342 (syntmp-fx--39 syntmp-i-343 (quote 1))))) syntmp-new-341))) (else syntmp-x-338)))) (syntmp-ellipsis?-112 (lambda (syntmp-x-344) (and (syntmp-nonsymbol-id?-66 syntmp-x-344) (syntmp-free-id=?-90 syntmp-x-344 (quote #(syntax-object ... ((top) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i")) #(ribcage (lambda-var-list gen-var strip strip-annotation ellipsis? chi-void eval-local-transformer chi-local-syntax chi-lambda-clause chi-body chi-macro chi-application chi-expr chi chi-top syntax-type chi-when-list chi-install-global chi-top-sequence chi-sequence source-wrap wrap bound-id-member? distinct-bound-ids? valid-bound-ids? bound-id=? free-id=? id-var-name same-marks? join-marks join-wraps smart-append make-binding-wrap extend-ribcage! make-empty-ribcage new-mark anti-mark the-anti-mark top-marked? top-wrap empty-wrap set-ribcage-labels! set-ribcage-marks! set-ribcage-symnames! ribcage-labels ribcage-marks ribcage-symnames ribcage? make-ribcage gen-labels gen-label make-rename rename-marks rename-new rename-old subst-rename? wrap-subst wrap-marks make-wrap id-sym-name&marks id-sym-name id? nonsymbol-id? global-extend lookup macros-only-env extend-var-env extend-env null-env binding-value binding-type make-binding arg-check source-annotation no-source unannotate set-syntax-object-wrap! set-syntax-object-expression! syntax-object-wrap syntax-object-expression syntax-object? make-syntax-object self-evaluating? build-lexical-var build-letrec build-named-let build-let build-sequence build-data build-primref build-lambda build-global-definition build-global-assignment build-global-reference build-lexical-assignment build-lexical-reference build-conditional build-application get-global-definition-hook put-global-definition-hook gensym-hook error-hook local-eval-hook top-level-eval-hook annotation? fx< fx= fx- fx+ noexpand) ((top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top)) ("i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i")) #(ribcage (define-structure) ((top)) ("i"))))))))) (syntmp-chi-void-111 (lambda () (list (quote void)))) (syntmp-eval-local-transformer-110 (lambda (syntmp-expanded-345) (let ((syntmp-p-346 (syntmp-local-eval-hook-44 syntmp-expanded-345))) (if (procedure? syntmp-p-346) syntmp-p-346 (syntax-error syntmp-p-346 (quote "nonprocedure transfomer")))))) (syntmp-chi-local-syntax-109 (lambda (syntmp-rec?-347 syntmp-e-348 syntmp-r-349 syntmp-w-350 syntmp-s-351 syntmp-k-352) ((lambda (syntmp-tmp-353) ((lambda (syntmp-tmp-354) (if syntmp-tmp-354 (apply (lambda (syntmp-_-355 syntmp-id-356 syntmp-val-357 syntmp-e1-358 syntmp-e2-359) (let ((syntmp-ids-360 syntmp-id-356)) (if (not (syntmp-valid-bound-ids?-92 syntmp-ids-360)) (syntax-error syntmp-e-348 (quote "duplicate bound keyword in")) (let ((syntmp-labels-362 (syntmp-gen-labels-73 syntmp-ids-360))) (let ((syntmp-new-w-363 (syntmp-make-binding-wrap-84 syntmp-ids-360 syntmp-labels-362 syntmp-w-350))) (syntmp-k-352 (cons syntmp-e1-358 syntmp-e2-359) (syntmp-extend-env-61 syntmp-labels-362 (let ((syntmp-w-365 (if syntmp-rec?-347 syntmp-new-w-363 syntmp-w-350)) (syntmp-trans-r-366 (syntmp-macros-only-env-63 syntmp-r-349))) (map (lambda (syntmp-x-367) (cons (quote macro) (syntmp-eval-local-transformer-110 (syntmp-chi-103 syntmp-x-367 syntmp-trans-r-366 syntmp-w-365)))) syntmp-val-357)) syntmp-r-349) syntmp-new-w-363 syntmp-s-351)))))) syntmp-tmp-354) ((lambda (syntmp-_-369) (syntax-error (syntmp-source-wrap-96 syntmp-e-348 syntmp-w-350 syntmp-s-351))) syntmp-tmp-353))) (syntax-dispatch syntmp-tmp-353 (quote (any #(each (any any)) any . each-any))))) syntmp-e-348))) (syntmp-chi-lambda-clause-108 (lambda (syntmp-e-370 syntmp-c-371 syntmp-r-372 syntmp-w-373 syntmp-k-374) ((lambda (syntmp-tmp-375) ((lambda (syntmp-tmp-376) (if syntmp-tmp-376 (apply (lambda (syntmp-id-377 syntmp-e1-378 syntmp-e2-379) (let ((syntmp-ids-380 syntmp-id-377)) (if (not (syntmp-valid-bound-ids?-92 syntmp-ids-380)) (syntax-error syntmp-e-370 (quote "invalid parameter list in")) (let ((syntmp-labels-382 (syntmp-gen-labels-73 syntmp-ids-380)) (syntmp-new-vars-383 (map syntmp-gen-var-115 syntmp-ids-380))) (syntmp-k-374 syntmp-new-vars-383 (syntmp-chi-body-107 (cons syntmp-e1-378 syntmp-e2-379) syntmp-e-370 (syntmp-extend-var-env-62 syntmp-labels-382 syntmp-new-vars-383 syntmp-r-372) (syntmp-make-binding-wrap-84 syntmp-ids-380 syntmp-labels-382 syntmp-w-373))))))) syntmp-tmp-376) ((lambda (syntmp-tmp-385) (if syntmp-tmp-385 (apply (lambda (syntmp-ids-386 syntmp-e1-387 syntmp-e2-388) (let ((syntmp-old-ids-389 (syntmp-lambda-var-list-116 syntmp-ids-386))) (if (not (syntmp-valid-bound-ids?-92 syntmp-old-ids-389)) (syntax-error syntmp-e-370 (quote "invalid parameter list in")) (let ((syntmp-labels-390 (syntmp-gen-labels-73 syntmp-old-ids-389)) (syntmp-new-vars-391 (map syntmp-gen-var-115 syntmp-old-ids-389))) (syntmp-k-374 (let syntmp-f-392 ((syntmp-ls1-393 (cdr syntmp-new-vars-391)) (syntmp-ls2-394 (car syntmp-new-vars-391))) (if (null? syntmp-ls1-393) syntmp-ls2-394 (syntmp-f-392 (cdr syntmp-ls1-393) (cons (car syntmp-ls1-393) syntmp-ls2-394)))) (syntmp-chi-body-107 (cons syntmp-e1-387 syntmp-e2-388) syntmp-e-370 (syntmp-extend-var-env-62 syntmp-labels-390 syntmp-new-vars-391 syntmp-r-372) (syntmp-make-binding-wrap-84 syntmp-old-ids-389 syntmp-labels-390 syntmp-w-373))))))) syntmp-tmp-385) ((lambda (syntmp-_-396) (syntax-error syntmp-e-370)) syntmp-tmp-375))) (syntax-dispatch syntmp-tmp-375 (quote (any any . each-any)))))) (syntax-dispatch syntmp-tmp-375 (quote (each-any any . each-any))))) syntmp-c-371))) (syntmp-chi-body-107 (lambda (syntmp-body-397 syntmp-outer-form-398 syntmp-r-399 syntmp-w-400) (let ((syntmp-r-401 (cons (quote ("placeholder" placeholder)) syntmp-r-399))) (let ((syntmp-ribcage-402 (syntmp-make-ribcage-74 (quote ()) (quote ()) (quote ())))) (let ((syntmp-w-403 (syntmp-make-wrap-69 (syntmp-wrap-marks-70 syntmp-w-400) (cons syntmp-ribcage-402 (syntmp-wrap-subst-71 syntmp-w-400))))) (let syntmp-parse-404 ((syntmp-body-405 (map (lambda (syntmp-x-411) (cons syntmp-r-401 (syntmp-wrap-95 syntmp-x-411 syntmp-w-403))) syntmp-body-397)) (syntmp-ids-406 (quote ())) (syntmp-labels-407 (quote ())) (syntmp-vars-408 (quote ())) (syntmp-vals-409 (quote ())) (syntmp-bindings-410 (quote ()))) (if (null? syntmp-body-405) (syntax-error syntmp-outer-form-398 (quote "no expressions in body")) (let ((syntmp-e-412 (cdar syntmp-body-405)) (syntmp-er-413 (caar syntmp-body-405))) (call-with-values (lambda () (syntmp-syntax-type-101 syntmp-e-412 syntmp-er-413 (quote (())) (quote #f) syntmp-ribcage-402)) (lambda (syntmp-type-414 syntmp-value-415 syntmp-e-416 syntmp-w-417 syntmp-s-418) (let ((syntmp-t-419 syntmp-type-414)) (if (memv syntmp-t-419 (quote (define-form))) (let ((syntmp-id-420 (syntmp-wrap-95 syntmp-value-415 syntmp-w-417)) (syntmp-label-421 (syntmp-gen-label-72))) (let ((syntmp-var-422 (syntmp-gen-var-115 syntmp-id-420))) (begin (syntmp-extend-ribcage!-83 syntmp-ribcage-402 syntmp-id-420 syntmp-label-421) (syntmp-parse-404 (cdr syntmp-body-405) (cons syntmp-id-420 syntmp-ids-406) (cons syntmp-label-421 syntmp-labels-407) (cons syntmp-var-422 syntmp-vars-408) (cons (cons syntmp-er-413 (syntmp-wrap-95 syntmp-e-416 syntmp-w-417)) syntmp-vals-409) (cons (cons (quote lexical) syntmp-var-422) syntmp-bindings-410))))) (if (memv syntmp-t-419 (quote (define-syntax-form))) (let ((syntmp-id-423 (syntmp-wrap-95 syntmp-value-415 syntmp-w-417)) (syntmp-label-424 (syntmp-gen-label-72))) (begin (syntmp-extend-ribcage!-83 syntmp-ribcage-402 syntmp-id-423 syntmp-label-424) (syntmp-parse-404 (cdr syntmp-body-405) (cons syntmp-id-423 syntmp-ids-406) (cons syntmp-label-424 syntmp-labels-407) syntmp-vars-408 syntmp-vals-409 (cons (cons (quote macro) (cons syntmp-er-413 (syntmp-wrap-95 syntmp-e-416 syntmp-w-417))) syntmp-bindings-410)))) (if (memv syntmp-t-419 (quote (begin-form))) ((lambda (syntmp-tmp-425) ((lambda (syntmp-tmp-426) (if syntmp-tmp-426 (apply (lambda (syntmp-_-427 syntmp-e1-428) (syntmp-parse-404 (let syntmp-f-429 ((syntmp-forms-430 syntmp-e1-428)) (if (null? syntmp-forms-430) (cdr syntmp-body-405) (cons (cons syntmp-er-413 (syntmp-wrap-95 (car syntmp-forms-430) syntmp-w-417)) (syntmp-f-429 (cdr syntmp-forms-430))))) syntmp-ids-406 syntmp-labels-407 syntmp-vars-408 syntmp-vals-409 syntmp-bindings-410)) syntmp-tmp-426) (syntax-error syntmp-tmp-425))) (syntax-dispatch syntmp-tmp-425 (quote (any . each-any))))) syntmp-e-416) (if (memv syntmp-t-419 (quote (local-syntax-form))) (syntmp-chi-local-syntax-109 syntmp-value-415 syntmp-e-416 syntmp-er-413 syntmp-w-417 syntmp-s-418 (lambda (syntmp-forms-432 syntmp-er-433 syntmp-w-434 syntmp-s-435) (syntmp-parse-404 (let syntmp-f-436 ((syntmp-forms-437 syntmp-forms-432)) (if (null? syntmp-forms-437) (cdr syntmp-body-405) (cons (cons syntmp-er-433 (syntmp-wrap-95 (car syntmp-forms-437) syntmp-w-434)) (syntmp-f-436 (cdr syntmp-forms-437))))) syntmp-ids-406 syntmp-labels-407 syntmp-vars-408 syntmp-vals-409 syntmp-bindings-410))) (if (null? syntmp-ids-406) (syntmp-build-sequence-48 (quote #f) (map (lambda (syntmp-x-438) (syntmp-chi-103 (cdr syntmp-x-438) (car syntmp-x-438) (quote (())))) (cons (cons syntmp-er-413 (syntmp-source-wrap-96 syntmp-e-416 syntmp-w-417 syntmp-s-418)) (cdr syntmp-body-405)))) (begin (if (not (syntmp-valid-bound-ids?-92 syntmp-ids-406)) (syntax-error syntmp-outer-form-398 (quote "invalid or duplicate identifier in definition"))) (let syntmp-loop-439 ((syntmp-bs-440 syntmp-bindings-410) (syntmp-er-cache-441 (quote #f)) (syntmp-r-cache-442 (quote #f))) (if (not (null? syntmp-bs-440)) (let ((syntmp-b-443 (car syntmp-bs-440))) (if (eq? (car syntmp-b-443) (quote macro)) (let ((syntmp-er-444 (cadr syntmp-b-443))) (let ((syntmp-r-cache-445 (if (eq? syntmp-er-444 syntmp-er-cache-441) syntmp-r-cache-442 (syntmp-macros-only-env-63 syntmp-er-444)))) (begin (set-cdr! syntmp-b-443 (syntmp-eval-local-transformer-110 (syntmp-chi-103 (cddr syntmp-b-443) syntmp-r-cache-445 (quote (()))))) (syntmp-loop-439 (cdr syntmp-bs-440) syntmp-er-444 syntmp-r-cache-445)))) (syntmp-loop-439 (cdr syntmp-bs-440) syntmp-er-cache-441 syntmp-r-cache-442))))) (set-cdr! syntmp-r-401 (syntmp-extend-env-61 syntmp-labels-407 syntmp-bindings-410 (cdr syntmp-r-401))) (syntmp-build-letrec-51 (quote #f) syntmp-vars-408 (map (lambda (syntmp-x-446) (syntmp-chi-103 (cdr syntmp-x-446) (car syntmp-x-446) (quote (())))) syntmp-vals-409) (syntmp-build-sequence-48 (quote #f) (map (lambda (syntmp-x-447) (syntmp-chi-103 (cdr syntmp-x-447) (car syntmp-x-447) (quote (())))) (cons (cons syntmp-er-413 (syntmp-source-wrap-96 syntmp-e-416 syntmp-w-417 syntmp-s-418)) (cdr syntmp-body-405)))))))))))))))))))))) (syntmp-chi-macro-106 (lambda (syntmp-p-448 syntmp-e-449 syntmp-r-450 syntmp-w-451 syntmp-rib-452) (letrec ((syntmp-rebuild-macro-output-453 (lambda (syntmp-x-454 syntmp-m-455) (cond ((pair? syntmp-x-454) (cons (syntmp-rebuild-macro-output-453 (car syntmp-x-454) syntmp-m-455) (syntmp-rebuild-macro-output-453 (cdr syntmp-x-454) syntmp-m-455))) ((syntmp-syntax-object?-53 syntmp-x-454) (let ((syntmp-w-456 (syntmp-syntax-object-wrap-55 syntmp-x-454))) (let ((syntmp-ms-457 (syntmp-wrap-marks-70 syntmp-w-456)) (syntmp-s-458 (syntmp-wrap-subst-71 syntmp-w-456))) (syntmp-make-syntax-object-52 (syntmp-syntax-object-expression-54 syntmp-x-454) (if (and (pair? syntmp-ms-457) (eq? (car syntmp-ms-457) (quote #f))) (syntmp-make-wrap-69 (cdr syntmp-ms-457) (if syntmp-rib-452 (cons syntmp-rib-452 (cdr syntmp-s-458)) (cdr syntmp-s-458))) (syntmp-make-wrap-69 (cons syntmp-m-455 syntmp-ms-457) (if syntmp-rib-452 (cons syntmp-rib-452 (cons (quote shift) syntmp-s-458)) (cons (quote shift) syntmp-s-458)))))))) ((vector? syntmp-x-454) (let ((syntmp-n-459 (vector-length syntmp-x-454))) (let ((syntmp-v-460 (make-vector syntmp-n-459))) (let syntmp-doloop-461 ((syntmp-i-462 (quote 0))) (if (syntmp-fx=-40 syntmp-i-462 syntmp-n-459) syntmp-v-460 (begin (vector-set! syntmp-v-460 syntmp-i-462 (syntmp-rebuild-macro-output-453 (vector-ref syntmp-x-454 syntmp-i-462) syntmp-m-455)) (syntmp-doloop-461 (syntmp-fx+-38 syntmp-i-462 (quote 1))))))))) ((symbol? syntmp-x-454) (syntax-error syntmp-x-454 (quote "encountered raw symbol in macro output"))) (else syntmp-x-454))))) (syntmp-rebuild-macro-output-453 (syntmp-p-448 (syntmp-wrap-95 syntmp-e-449 (syntmp-anti-mark-82 syntmp-w-451))) (string (quote #\m)))))) (syntmp-chi-application-105 (lambda (syntmp-x-463 syntmp-e-464 syntmp-r-465 syntmp-w-466 syntmp-s-467) ((lambda (syntmp-tmp-468) ((lambda (syntmp-tmp-469) (if syntmp-tmp-469 (apply (lambda (syntmp-e0-470 syntmp-e1-471) (cons syntmp-x-463 (map (lambda (syntmp-e-472) (syntmp-chi-103 syntmp-e-472 syntmp-r-465 syntmp-w-466)) syntmp-e1-471))) syntmp-tmp-469) (syntax-error syntmp-tmp-468))) (syntax-dispatch syntmp-tmp-468 (quote (any . each-any))))) syntmp-e-464))) (syntmp-chi-expr-104 (lambda (syntmp-type-474 syntmp-value-475 syntmp-e-476 syntmp-r-477 syntmp-w-478 syntmp-s-479) (let ((syntmp-t-480 syntmp-type-474)) (if (memv syntmp-t-480 (quote (lexical))) syntmp-value-475 (if (memv syntmp-t-480 (quote (core))) (syntmp-value-475 syntmp-e-476 syntmp-r-477 syntmp-w-478 syntmp-s-479) (if (memv syntmp-t-480 (quote (lexical-call))) (syntmp-chi-application-105 syntmp-value-475 syntmp-e-476 syntmp-r-477 syntmp-w-478 syntmp-s-479) (if (memv syntmp-t-480 (quote (global-call))) (syntmp-chi-application-105 syntmp-value-475 syntmp-e-476 syntmp-r-477 syntmp-w-478 syntmp-s-479) (if (memv syntmp-t-480 (quote (constant))) (list (quote quote) (syntmp-strip-114 (syntmp-source-wrap-96 syntmp-e-476 syntmp-w-478 syntmp-s-479) (quote (())))) (if (memv syntmp-t-480 (quote (global))) syntmp-value-475 (if (memv syntmp-t-480 (quote (call))) (syntmp-chi-application-105 (syntmp-chi-103 (car syntmp-e-476) syntmp-r-477 syntmp-w-478) syntmp-e-476 syntmp-r-477 syntmp-w-478 syntmp-s-479) (if (memv syntmp-t-480 (quote (begin-form))) ((lambda (syntmp-tmp-481) ((lambda (syntmp-tmp-482) (if syntmp-tmp-482 (apply (lambda (syntmp-_-483 syntmp-e1-484 syntmp-e2-485) (syntmp-chi-sequence-97 (cons syntmp-e1-484 syntmp-e2-485) syntmp-r-477 syntmp-w-478 syntmp-s-479)) syntmp-tmp-482) (syntax-error syntmp-tmp-481))) (syntax-dispatch syntmp-tmp-481 (quote (any any . each-any))))) syntmp-e-476) (if (memv syntmp-t-480 (quote (local-syntax-form))) (syntmp-chi-local-syntax-109 syntmp-value-475 syntmp-e-476 syntmp-r-477 syntmp-w-478 syntmp-s-479 syntmp-chi-sequence-97) (if (memv syntmp-t-480 (quote (eval-when-form))) ((lambda (syntmp-tmp-487) ((lambda (syntmp-tmp-488) (if syntmp-tmp-488 (apply (lambda (syntmp-_-489 syntmp-x-490 syntmp-e1-491 syntmp-e2-492) (let ((syntmp-when-list-493 (syntmp-chi-when-list-100 syntmp-e-476 syntmp-x-490 syntmp-w-478))) (if (memq (quote eval) syntmp-when-list-493) (syntmp-chi-sequence-97 (cons syntmp-e1-491 syntmp-e2-492) syntmp-r-477 syntmp-w-478 syntmp-s-479) (syntmp-chi-void-111)))) syntmp-tmp-488) (syntax-error syntmp-tmp-487))) (syntax-dispatch syntmp-tmp-487 (quote (any each-any any . each-any))))) syntmp-e-476) (if (memv syntmp-t-480 (quote (define-form define-syntax-form))) (syntax-error (syntmp-wrap-95 syntmp-value-475 syntmp-w-478) (quote "invalid context for definition of")) (if (memv syntmp-t-480 (quote (syntax))) (syntax-error (syntmp-source-wrap-96 syntmp-e-476 syntmp-w-478 syntmp-s-479) (quote "reference to pattern variable outside syntax form")) (if (memv syntmp-t-480 (quote (displaced-lexical))) (syntax-error (syntmp-source-wrap-96 syntmp-e-476 syntmp-w-478 syntmp-s-479) (quote "reference to identifier outside its scope")) (syntax-error (syntmp-source-wrap-96 syntmp-e-476 syntmp-w-478 syntmp-s-479)))))))))))))))))) (syntmp-chi-103 (lambda (syntmp-e-496 syntmp-r-497 syntmp-w-498) (call-with-values (lambda () (syntmp-syntax-type-101 syntmp-e-496 syntmp-r-497 syntmp-w-498 (quote #f) (quote #f))) (lambda (syntmp-type-499 syntmp-value-500 syntmp-e-501 syntmp-w-502 syntmp-s-503) (syntmp-chi-expr-104 syntmp-type-499 syntmp-value-500 syntmp-e-501 syntmp-r-497 syntmp-w-502 syntmp-s-503))))) (syntmp-chi-top-102 (lambda (syntmp-e-504 syntmp-r-505 syntmp-w-506 syntmp-m-507 syntmp-esew-508) (call-with-values (lambda () (syntmp-syntax-type-101 syntmp-e-504 syntmp-r-505 syntmp-w-506 (quote #f) (quote #f))) (lambda (syntmp-type-515 syntmp-value-516 syntmp-e-517 syntmp-w-518 syntmp-s-519) (let ((syntmp-t-520 syntmp-type-515)) (if (memv syntmp-t-520 (quote (begin-form))) ((lambda (syntmp-tmp-521) ((lambda (syntmp-tmp-522) (if syntmp-tmp-522 (apply (lambda (syntmp-_-523) (syntmp-chi-void-111)) syntmp-tmp-522) ((lambda (syntmp-tmp-524) (if syntmp-tmp-524 (apply (lambda (syntmp-_-525 syntmp-e1-526 syntmp-e2-527) (syntmp-chi-top-sequence-98 (cons syntmp-e1-526 syntmp-e2-527) syntmp-r-505 syntmp-w-518 syntmp-s-519 syntmp-m-507 syntmp-esew-508)) syntmp-tmp-524) (syntax-error syntmp-tmp-521))) (syntax-dispatch syntmp-tmp-521 (quote (any any . each-any)))))) (syntax-dispatch syntmp-tmp-521 (quote (any))))) syntmp-e-517) (if (memv syntmp-t-520 (quote (local-syntax-form))) (syntmp-chi-local-syntax-109 syntmp-value-516 syntmp-e-517 syntmp-r-505 syntmp-w-518 syntmp-s-519 (lambda (syntmp-body-529 syntmp-r-530 syntmp-w-531 syntmp-s-532) (syntmp-chi-top-sequence-98 syntmp-body-529 syntmp-r-530 syntmp-w-531 syntmp-s-532 syntmp-m-507 syntmp-esew-508))) (if (memv syntmp-t-520 (quote (eval-when-form))) ((lambda (syntmp-tmp-533) ((lambda (syntmp-tmp-534) (if syntmp-tmp-534 (apply (lambda (syntmp-_-535 syntmp-x-536 syntmp-e1-537 syntmp-e2-538) (let ((syntmp-when-list-539 (syntmp-chi-when-list-100 syntmp-e-517 syntmp-x-536 syntmp-w-518)) (syntmp-body-540 (cons syntmp-e1-537 syntmp-e2-538))) (cond ((eq? syntmp-m-507 (quote e)) (if (memq (quote eval) syntmp-when-list-539) (syntmp-chi-top-sequence-98 syntmp-body-540 syntmp-r-505 syntmp-w-518 syntmp-s-519 (quote e) (quote (eval))) (syntmp-chi-void-111))) ((memq (quote load) syntmp-when-list-539) (if (or (memq (quote compile) syntmp-when-list-539) (and (eq? syntmp-m-507 (quote c&e)) (memq (quote eval) syntmp-when-list-539))) (syntmp-chi-top-sequence-98 syntmp-body-540 syntmp-r-505 syntmp-w-518 syntmp-s-519 (quote c&e) (quote (compile load))) (if (memq syntmp-m-507 (quote (c c&e))) (syntmp-chi-top-sequence-98 syntmp-body-540 syntmp-r-505 syntmp-w-518 syntmp-s-519 (quote c) (quote (load))) (syntmp-chi-void-111)))) ((or (memq (quote compile) syntmp-when-list-539) (and (eq? syntmp-m-507 (quote c&e)) (memq (quote eval) syntmp-when-list-539))) (syntmp-top-level-eval-hook-43 (syntmp-chi-top-sequence-98 syntmp-body-540 syntmp-r-505 syntmp-w-518 syntmp-s-519 (quote e) (quote (eval)))) (syntmp-chi-void-111)) (else (syntmp-chi-void-111))))) syntmp-tmp-534) (syntax-error syntmp-tmp-533))) (syntax-dispatch syntmp-tmp-533 (quote (any each-any any . each-any))))) syntmp-e-517) (if (memv syntmp-t-520 (quote (define-syntax-form))) (let ((syntmp-n-543 (syntmp-id-var-name-89 syntmp-value-516 syntmp-w-518)) (syntmp-r-544 (syntmp-macros-only-env-63 syntmp-r-505))) (let ((syntmp-t-545 syntmp-m-507)) (if (memv syntmp-t-545 (quote (c))) (if (memq (quote compile) syntmp-esew-508) (let ((syntmp-e-546 (syntmp-chi-install-global-99 syntmp-n-543 (syntmp-chi-103 syntmp-e-517 syntmp-r-544 syntmp-w-518)))) (begin (syntmp-top-level-eval-hook-43 syntmp-e-546) (if (memq (quote load) syntmp-esew-508) syntmp-e-546 (syntmp-chi-void-111)))) (if (memq (quote load) syntmp-esew-508) (syntmp-chi-install-global-99 syntmp-n-543 (syntmp-chi-103 syntmp-e-517 syntmp-r-544 syntmp-w-518)) (syntmp-chi-void-111))) (if (memv syntmp-t-545 (quote (c&e))) (let ((syntmp-e-547 (syntmp-chi-install-global-99 syntmp-n-543 (syntmp-chi-103 syntmp-e-517 syntmp-r-544 syntmp-w-518)))) (begin (syntmp-top-level-eval-hook-43 syntmp-e-547) syntmp-e-547)) (begin (if (memq (quote eval) syntmp-esew-508) (syntmp-top-level-eval-hook-43 (syntmp-chi-install-global-99 syntmp-n-543 (syntmp-chi-103 syntmp-e-517 syntmp-r-544 syntmp-w-518)))) (syntmp-chi-void-111)))))) (if (memv syntmp-t-520 (quote (define-form))) (let ((syntmp-n-548 (syntmp-id-var-name-89 syntmp-value-516 syntmp-w-518))) (let ((syntmp-t-549 (syntmp-binding-type-59 (syntmp-lookup-64 syntmp-n-548 syntmp-r-505)))) (if (memv syntmp-t-549 (quote (global))) (let ((syntmp-x-550 (list (quote define) syntmp-n-548 (syntmp-chi-103 syntmp-e-517 syntmp-r-505 syntmp-w-518)))) (begin (if (eq? syntmp-m-507 (quote c&e)) (syntmp-top-level-eval-hook-43 syntmp-x-550)) syntmp-x-550)) (if (memv syntmp-t-549 (quote (displaced-lexical))) (syntax-error (syntmp-wrap-95 syntmp-value-516 syntmp-w-518) (quote "identifier out of context")) (syntax-error (syntmp-wrap-95 syntmp-value-516 syntmp-w-518) (quote "cannot define keyword at top level")))))) (let ((syntmp-x-551 (syntmp-chi-expr-104 syntmp-type-515 syntmp-value-516 syntmp-e-517 syntmp-r-505 syntmp-w-518 syntmp-s-519))) (begin (if (eq? syntmp-m-507 (quote c&e)) (syntmp-top-level-eval-hook-43 syntmp-x-551)) syntmp-x-551)))))))))))) (syntmp-syntax-type-101 (lambda (syntmp-e-552 syntmp-r-553 syntmp-w-554 syntmp-s-555 syntmp-rib-556) (cond ((symbol? syntmp-e-552) (let ((syntmp-n-557 (syntmp-id-var-name-89 syntmp-e-552 syntmp-w-554))) (let ((syntmp-b-558 (syntmp-lookup-64 syntmp-n-557 syntmp-r-553))) (let ((syntmp-type-559 (syntmp-binding-type-59 syntmp-b-558))) (let ((syntmp-t-560 syntmp-type-559)) (if (memv syntmp-t-560 (quote (lexical))) (values syntmp-type-559 (syntmp-binding-value-60 syntmp-b-558) syntmp-e-552 syntmp-w-554 syntmp-s-555) (if (memv syntmp-t-560 (quote (global))) (values syntmp-type-559 syntmp-n-557 syntmp-e-552 syntmp-w-554 syntmp-s-555) (if (memv syntmp-t-560 (quote (macro))) (syntmp-syntax-type-101 (syntmp-chi-macro-106 (syntmp-binding-value-60 syntmp-b-558) syntmp-e-552 syntmp-r-553 syntmp-w-554 syntmp-rib-556) syntmp-r-553 (quote (())) syntmp-s-555 syntmp-rib-556) (values syntmp-type-559 (syntmp-binding-value-60 syntmp-b-558) syntmp-e-552 syntmp-w-554 syntmp-s-555))))))))) ((pair? syntmp-e-552) (let ((syntmp-first-561 (car syntmp-e-552))) (if (syntmp-id?-67 syntmp-first-561) (let ((syntmp-n-562 (syntmp-id-var-name-89 syntmp-first-561 syntmp-w-554))) (let ((syntmp-b-563 (syntmp-lookup-64 syntmp-n-562 syntmp-r-553))) (let ((syntmp-type-564 (syntmp-binding-type-59 syntmp-b-563))) (let ((syntmp-t-565 syntmp-type-564)) (if (memv syntmp-t-565 (quote (lexical))) (values (quote lexical-call) (syntmp-binding-value-60 syntmp-b-563) syntmp-e-552 syntmp-w-554 syntmp-s-555) (if (memv syntmp-t-565 (quote (global))) (values (quote global-call) syntmp-n-562 syntmp-e-552 syntmp-w-554 syntmp-s-555) (if (memv syntmp-t-565 (quote (macro))) (syntmp-syntax-type-101 (syntmp-chi-macro-106 (syntmp-binding-value-60 syntmp-b-563) syntmp-e-552 syntmp-r-553 syntmp-w-554 syntmp-rib-556) syntmp-r-553 (quote (())) syntmp-s-555 syntmp-rib-556) (if (memv syntmp-t-565 (quote (core))) (values syntmp-type-564 (syntmp-binding-value-60 syntmp-b-563) syntmp-e-552 syntmp-w-554 syntmp-s-555) (if (memv syntmp-t-565 (quote (local-syntax))) (values (quote local-syntax-form) (syntmp-binding-value-60 syntmp-b-563) syntmp-e-552 syntmp-w-554 syntmp-s-555) (if (memv syntmp-t-565 (quote (begin))) (values (quote begin-form) (quote #f) syntmp-e-552 syntmp-w-554 syntmp-s-555) (if (memv syntmp-t-565 (quote (eval-when))) (values (quote eval-when-form) (quote #f) syntmp-e-552 syntmp-w-554 syntmp-s-555) (if (memv syntmp-t-565 (quote (define))) ((lambda (syntmp-tmp-566) ((lambda (syntmp-tmp-567) (if (if syntmp-tmp-567 (apply (lambda (syntmp-_-568 syntmp-name-569 syntmp-val-570) (syntmp-id?-67 syntmp-name-569)) syntmp-tmp-567) (quote #f)) (apply (lambda (syntmp-_-571 syntmp-name-572 syntmp-val-573) (values (quote define-form) syntmp-name-572 syntmp-val-573 syntmp-w-554 syntmp-s-555)) syntmp-tmp-567) ((lambda (syntmp-tmp-574) (if (if syntmp-tmp-574 (apply (lambda (syntmp-_-575 syntmp-name-576 syntmp-args-577 syntmp-e1-578 syntmp-e2-579) (and (syntmp-id?-67 syntmp-name-576) (syntmp-valid-bound-ids?-92 (syntmp-lambda-var-list-116 syntmp-args-577)))) syntmp-tmp-574) (quote #f)) (apply (lambda (syntmp-_-580 syntmp-name-581 syntmp-args-582 syntmp-e1-583 syntmp-e2-584) (values (quote define-form) (syntmp-wrap-95 syntmp-name-581 syntmp-w-554) (cons (quote #(syntax-object lambda ((top) #(ribcage #(_ name args e1 e2) #((top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(t) #(("m" top)) #("i")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage () () ()) #(ribcage #(type) #((top)) #("i")) #(ribcage () () ()) #(ribcage #(b) #((top)) #("i")) #(ribcage () () ()) #(ribcage #(n) #((top)) #("i")) #(ribcage () () ()) #(ribcage #(first) #((top)) #("i")) #(ribcage () () ()) #(ribcage #(e r w s rib) #((top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i")) #(ribcage (lambda-var-list gen-var strip strip-annotation ellipsis? chi-void eval-local-transformer chi-local-syntax chi-lambda-clause chi-body chi-macro chi-application chi-expr chi chi-top syntax-type chi-when-list chi-install-global chi-top-sequence chi-sequence source-wrap wrap bound-id-member? distinct-bound-ids? valid-bound-ids? bound-id=? free-id=? id-var-name same-marks? join-marks join-wraps smart-append make-binding-wrap extend-ribcage! make-empty-ribcage new-mark anti-mark the-anti-mark top-marked? top-wrap empty-wrap set-ribcage-labels! set-ribcage-marks! set-ribcage-symnames! ribcage-labels ribcage-marks ribcage-symnames ribcage? make-ribcage gen-labels gen-label make-rename rename-marks rename-new rename-old subst-rename? wrap-subst wrap-marks make-wrap id-sym-name&marks id-sym-name id? nonsymbol-id? global-extend lookup macros-only-env extend-var-env extend-env null-env binding-value binding-type make-binding arg-check source-annotation no-source unannotate set-syntax-object-wrap! set-syntax-object-expression! syntax-object-wrap syntax-object-expression syntax-object? make-syntax-object self-evaluating? build-lexical-var build-letrec build-named-let build-let build-sequence build-data build-primref build-lambda build-global-definition build-global-assignment build-global-reference build-lexical-assignment build-lexical-reference build-conditional build-application get-global-definition-hook put-global-definition-hook gensym-hook error-hook local-eval-hook top-level-eval-hook annotation? fx< fx= fx- fx+ noexpand) ((top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top)) ("i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i")) #(ribcage (define-structure) ((top)) ("i"))))) (syntmp-wrap-95 (cons syntmp-args-582 (cons syntmp-e1-583 syntmp-e2-584)) syntmp-w-554)) (quote (())) syntmp-s-555)) syntmp-tmp-574) ((lambda (syntmp-tmp-586) (if (if syntmp-tmp-586 (apply (lambda (syntmp-_-587 syntmp-name-588) (syntmp-id?-67 syntmp-name-588)) syntmp-tmp-586) (quote #f)) (apply (lambda (syntmp-_-589 syntmp-name-590) (values (quote define-form) (syntmp-wrap-95 syntmp-name-590 syntmp-w-554) (quote (#(syntax-object void ((top) #(ribcage #(_ name) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage #(t) #(("m" top)) #("i")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage () () ()) #(ribcage #(type) #((top)) #("i")) #(ribcage () () ()) #(ribcage #(b) #((top)) #("i")) #(ribcage () () ()) #(ribcage #(n) #((top)) #("i")) #(ribcage () () ()) #(ribcage #(first) #((top)) #("i")) #(ribcage () () ()) #(ribcage #(e r w s rib) #((top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i")) #(ribcage (lambda-var-list gen-var strip strip-annotation ellipsis? chi-void eval-local-transformer chi-local-syntax chi-lambda-clause chi-body chi-macro chi-application chi-expr chi chi-top syntax-type chi-when-list chi-install-global chi-top-sequence chi-sequence source-wrap wrap bound-id-member? distinct-bound-ids? valid-bound-ids? bound-id=? free-id=? id-var-name same-marks? join-marks join-wraps smart-append make-binding-wrap extend-ribcage! make-empty-ribcage new-mark anti-mark the-anti-mark top-marked? top-wrap empty-wrap set-ribcage-labels! set-ribcage-marks! set-ribcage-symnames! ribcage-labels ribcage-marks ribcage-symnames ribcage? make-ribcage gen-labels gen-label make-rename rename-marks rename-new rename-old subst-rename? wrap-subst wrap-marks make-wrap id-sym-name&marks id-sym-name id? nonsymbol-id? global-extend lookup macros-only-env extend-var-env extend-env null-env binding-value binding-type make-binding arg-check source-annotation no-source unannotate set-syntax-object-wrap! set-syntax-object-expression! syntax-object-wrap syntax-object-expression syntax-object? make-syntax-object self-evaluating? build-lexical-var build-letrec build-named-let build-let build-sequence build-data build-primref build-lambda build-global-definition build-global-assignment build-global-reference build-lexical-assignment build-lexical-reference build-conditional build-application get-global-definition-hook put-global-definition-hook gensym-hook error-hook local-eval-hook top-level-eval-hook annotation? fx< fx= fx- fx+ noexpand) ((top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top)) ("i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i")) #(ribcage (define-structure) ((top)) ("i")))))) (quote (())) syntmp-s-555)) syntmp-tmp-586) (syntax-error syntmp-tmp-566))) (syntax-dispatch syntmp-tmp-566 (quote (any any)))))) (syntax-dispatch syntmp-tmp-566 (quote (any (any . any) any . each-any)))))) (syntax-dispatch syntmp-tmp-566 (quote (any any any))))) syntmp-e-552) (if (memv syntmp-t-565 (quote (define-syntax))) ((lambda (syntmp-tmp-591) ((lambda (syntmp-tmp-592) (if (if syntmp-tmp-592 (apply (lambda (syntmp-_-593 syntmp-name-594 syntmp-val-595) (syntmp-id?-67 syntmp-name-594)) syntmp-tmp-592) (quote #f)) (apply (lambda (syntmp-_-596 syntmp-name-597 syntmp-val-598) (values (quote define-syntax-form) syntmp-name-597 syntmp-val-598 syntmp-w-554 syntmp-s-555)) syntmp-tmp-592) (syntax-error syntmp-tmp-591))) (syntax-dispatch syntmp-tmp-591 (quote (any any any))))) syntmp-e-552) (values (quote call) (quote #f) syntmp-e-552 syntmp-w-554 syntmp-s-555)))))))))))))) (values (quote call) (quote #f) syntmp-e-552 syntmp-w-554 syntmp-s-555)))) ((syntmp-syntax-object?-53 syntmp-e-552) (syntmp-syntax-type-101 (syntmp-syntax-object-expression-54 syntmp-e-552) syntmp-r-553 (syntmp-join-wraps-86 syntmp-w-554 (syntmp-syntax-object-wrap-55 syntmp-e-552)) (quote #f) syntmp-rib-556)) ((syntmp-annotation?-42 syntmp-e-552) (syntmp-syntax-type-101 (annotation-expression syntmp-e-552) syntmp-r-553 syntmp-w-554 (annotation-source syntmp-e-552) syntmp-rib-556)) ((let ((syntmp-x-599 syntmp-e-552)) (or (boolean? syntmp-x-599) (number? syntmp-x-599) (string? syntmp-x-599) (char? syntmp-x-599) (null? syntmp-x-599) (keyword? syntmp-x-599))) (values (quote constant) (quote #f) syntmp-e-552 syntmp-w-554 syntmp-s-555)) (else (values (quote other) (quote #f) syntmp-e-552 syntmp-w-554 syntmp-s-555))))) (syntmp-chi-when-list-100 (lambda (syntmp-e-600 syntmp-when-list-601 syntmp-w-602) (let syntmp-f-603 ((syntmp-when-list-604 syntmp-when-list-601) (syntmp-situations-605 (quote ()))) (if (null? syntmp-when-list-604) syntmp-situations-605 (syntmp-f-603 (cdr syntmp-when-list-604) (cons (let ((syntmp-x-606 (car syntmp-when-list-604))) (cond ((syntmp-free-id=?-90 syntmp-x-606 (quote #(syntax-object compile ((top) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i")) #(ribcage () () ()) #(ribcage #(f when-list situations) #((top) (top) (top)) #("i" "i" "i")) #(ribcage () () ()) #(ribcage #(e when-list w) #((top) (top) (top)) #("i" "i" "i")) #(ribcage (lambda-var-list gen-var strip strip-annotation ellipsis? chi-void eval-local-transformer chi-local-syntax chi-lambda-clause chi-body chi-macro chi-application chi-expr chi chi-top syntax-type chi-when-list chi-install-global chi-top-sequence chi-sequence source-wrap wrap bound-id-member? distinct-bound-ids? valid-bound-ids? bound-id=? free-id=? id-var-name same-marks? join-marks join-wraps smart-append make-binding-wrap extend-ribcage! make-empty-ribcage new-mark anti-mark the-anti-mark top-marked? top-wrap empty-wrap set-ribcage-labels! set-ribcage-marks! set-ribcage-symnames! ribcage-labels ribcage-marks ribcage-symnames ribcage? make-ribcage gen-labels gen-label make-rename rename-marks rename-new rename-old subst-rename? wrap-subst wrap-marks make-wrap id-sym-name&marks id-sym-name id? nonsymbol-id? global-extend lookup macros-only-env extend-var-env extend-env null-env binding-value binding-type make-binding arg-check source-annotation no-source unannotate set-syntax-object-wrap! set-syntax-object-expression! syntax-object-wrap syntax-object-expression syntax-object? make-syntax-object self-evaluating? build-lexical-var build-letrec build-named-let build-let build-sequence build-data build-primref build-lambda build-global-definition build-global-assignment build-global-reference build-lexical-assignment build-lexical-reference build-conditional build-application get-global-definition-hook put-global-definition-hook gensym-hook error-hook local-eval-hook top-level-eval-hook annotation? fx< fx= fx- fx+ noexpand) ((top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top)) ("i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i")) #(ribcage (define-structure) ((top)) ("i")))))) (quote compile)) ((syntmp-free-id=?-90 syntmp-x-606 (quote #(syntax-object load ((top) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i")) #(ribcage () () ()) #(ribcage #(f when-list situations) #((top) (top) (top)) #("i" "i" "i")) #(ribcage () () ()) #(ribcage #(e when-list w) #((top) (top) (top)) #("i" "i" "i")) #(ribcage (lambda-var-list gen-var strip strip-annotation ellipsis? chi-void eval-local-transformer chi-local-syntax chi-lambda-clause chi-body chi-macro chi-application chi-expr chi chi-top syntax-type chi-when-list chi-install-global chi-top-sequence chi-sequence source-wrap wrap bound-id-member? distinct-bound-ids? valid-bound-ids? bound-id=? free-id=? id-var-name same-marks? join-marks join-wraps smart-append make-binding-wrap extend-ribcage! make-empty-ribcage new-mark anti-mark the-anti-mark top-marked? top-wrap empty-wrap set-ribcage-labels! set-ribcage-marks! set-ribcage-symnames! ribcage-labels ribcage-marks ribcage-symnames ribcage? make-ribcage gen-labels gen-label make-rename rename-marks rename-new rename-old subst-rename? wrap-subst wrap-marks make-wrap id-sym-name&marks id-sym-name id? nonsymbol-id? global-extend lookup macros-only-env extend-var-env extend-env null-env binding-value binding-type make-binding arg-check source-annotation no-source unannotate set-syntax-object-wrap! set-syntax-object-expression! syntax-object-wrap syntax-object-expression syntax-object? make-syntax-object self-evaluating? build-lexical-var build-letrec build-named-let build-let build-sequence build-data build-primref build-lambda build-global-definition build-global-assignment build-global-reference build-lexical-assignment build-lexical-reference build-conditional build-application get-global-definition-hook put-global-definition-hook gensym-hook error-hook local-eval-hook top-level-eval-hook annotation? fx< fx= fx- fx+ noexpand) ((top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top)) ("i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i")) #(ribcage (define-structure) ((top)) ("i")))))) (quote load)) ((syntmp-free-id=?-90 syntmp-x-606 (quote #(syntax-object eval ((top) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i")) #(ribcage () () ()) #(ribcage #(f when-list situations) #((top) (top) (top)) #("i" "i" "i")) #(ribcage () () ()) #(ribcage #(e when-list w) #((top) (top) (top)) #("i" "i" "i")) #(ribcage (lambda-var-list gen-var strip strip-annotation ellipsis? chi-void eval-local-transformer chi-local-syntax chi-lambda-clause chi-body chi-macro chi-application chi-expr chi chi-top syntax-type chi-when-list chi-install-global chi-top-sequence chi-sequence source-wrap wrap bound-id-member? distinct-bound-ids? valid-bound-ids? bound-id=? free-id=? id-var-name same-marks? join-marks join-wraps smart-append make-binding-wrap extend-ribcage! make-empty-ribcage new-mark anti-mark the-anti-mark top-marked? top-wrap empty-wrap set-ribcage-labels! set-ribcage-marks! set-ribcage-symnames! ribcage-labels ribcage-marks ribcage-symnames ribcage? make-ribcage gen-labels gen-label make-rename rename-marks rename-new rename-old subst-rename? wrap-subst wrap-marks make-wrap id-sym-name&marks id-sym-name id? nonsymbol-id? global-extend lookup macros-only-env extend-var-env extend-env null-env binding-value binding-type make-binding arg-check source-annotation no-source unannotate set-syntax-object-wrap! set-syntax-object-expression! syntax-object-wrap syntax-object-expression syntax-object? make-syntax-object self-evaluating? build-lexical-var build-letrec build-named-let build-let build-sequence build-data build-primref build-lambda build-global-definition build-global-assignment build-global-reference build-lexical-assignment build-lexical-reference build-conditional build-application get-global-definition-hook put-global-definition-hook gensym-hook error-hook local-eval-hook top-level-eval-hook annotation? fx< fx= fx- fx+ noexpand) ((top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top)) ("i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i")) #(ribcage (define-structure) ((top)) ("i")))))) (quote eval)) (else (syntax-error (syntmp-wrap-95 syntmp-x-606 syntmp-w-602) (quote "invalid eval-when situation"))))) syntmp-situations-605)))))) (syntmp-chi-install-global-99 (lambda (syntmp-name-607 syntmp-e-608) (list (quote install-global-transformer) (list (quote quote) syntmp-name-607) syntmp-e-608))) (syntmp-chi-top-sequence-98 (lambda (syntmp-body-609 syntmp-r-610 syntmp-w-611 syntmp-s-612 syntmp-m-613 syntmp-esew-614) (syntmp-build-sequence-48 syntmp-s-612 (let syntmp-dobody-615 ((syntmp-body-616 syntmp-body-609) (syntmp-r-617 syntmp-r-610) (syntmp-w-618 syntmp-w-611) (syntmp-m-619 syntmp-m-613) (syntmp-esew-620 syntmp-esew-614)) (if (null? syntmp-body-616) (quote ()) (let ((syntmp-first-621 (syntmp-chi-top-102 (car syntmp-body-616) syntmp-r-617 syntmp-w-618 syntmp-m-619 syntmp-esew-620))) (cons syntmp-first-621 (syntmp-dobody-615 (cdr syntmp-body-616) syntmp-r-617 syntmp-w-618 syntmp-m-619 syntmp-esew-620)))))))) (syntmp-chi-sequence-97 (lambda (syntmp-body-622 syntmp-r-623 syntmp-w-624 syntmp-s-625) (syntmp-build-sequence-48 syntmp-s-625 (let syntmp-dobody-626 ((syntmp-body-627 syntmp-body-622) (syntmp-r-628 syntmp-r-623) (syntmp-w-629 syntmp-w-624)) (if (null? syntmp-body-627) (quote ()) (let ((syntmp-first-630 (syntmp-chi-103 (car syntmp-body-627) syntmp-r-628 syntmp-w-629))) (cons syntmp-first-630 (syntmp-dobody-626 (cdr syntmp-body-627) syntmp-r-628 syntmp-w-629)))))))) (syntmp-source-wrap-96 (lambda (syntmp-x-631 syntmp-w-632 syntmp-s-633) (syntmp-wrap-95 (if syntmp-s-633 (make-annotation syntmp-x-631 syntmp-s-633 (quote #f)) syntmp-x-631) syntmp-w-632))) (syntmp-wrap-95 (lambda (syntmp-x-634 syntmp-w-635) (cond ((and (null? (syntmp-wrap-marks-70 syntmp-w-635)) (null? (syntmp-wrap-subst-71 syntmp-w-635))) syntmp-x-634) ((syntmp-syntax-object?-53 syntmp-x-634) (syntmp-make-syntax-object-52 (syntmp-syntax-object-expression-54 syntmp-x-634) (syntmp-join-wraps-86 syntmp-w-635 (syntmp-syntax-object-wrap-55 syntmp-x-634)))) ((null? syntmp-x-634) syntmp-x-634) (else (syntmp-make-syntax-object-52 syntmp-x-634 syntmp-w-635))))) (syntmp-bound-id-member?-94 (lambda (syntmp-x-636 syntmp-list-637) (and (not (null? syntmp-list-637)) (or (syntmp-bound-id=?-91 syntmp-x-636 (car syntmp-list-637)) (syntmp-bound-id-member?-94 syntmp-x-636 (cdr syntmp-list-637)))))) (syntmp-distinct-bound-ids?-93 (lambda (syntmp-ids-638) (let syntmp-distinct?-639 ((syntmp-ids-640 syntmp-ids-638)) (or (null? syntmp-ids-640) (and (not (syntmp-bound-id-member?-94 (car syntmp-ids-640) (cdr syntmp-ids-640))) (syntmp-distinct?-639 (cdr syntmp-ids-640))))))) (syntmp-valid-bound-ids?-92 (lambda (syntmp-ids-641) (and (let syntmp-all-ids?-642 ((syntmp-ids-643 syntmp-ids-641)) (or (null? syntmp-ids-643) (and (syntmp-id?-67 (car syntmp-ids-643)) (syntmp-all-ids?-642 (cdr syntmp-ids-643))))) (syntmp-distinct-bound-ids?-93 syntmp-ids-641)))) (syntmp-bound-id=?-91 (lambda (syntmp-i-644 syntmp-j-645) (if (and (syntmp-syntax-object?-53 syntmp-i-644) (syntmp-syntax-object?-53 syntmp-j-645)) (and (eq? (let ((syntmp-e-646 (syntmp-syntax-object-expression-54 syntmp-i-644))) (if (syntmp-annotation?-42 syntmp-e-646) (annotation-expression syntmp-e-646) syntmp-e-646)) (let ((syntmp-e-647 (syntmp-syntax-object-expression-54 syntmp-j-645))) (if (syntmp-annotation?-42 syntmp-e-647) (annotation-expression syntmp-e-647) syntmp-e-647))) (syntmp-same-marks?-88 (syntmp-wrap-marks-70 (syntmp-syntax-object-wrap-55 syntmp-i-644)) (syntmp-wrap-marks-70 (syntmp-syntax-object-wrap-55 syntmp-j-645)))) (eq? (let ((syntmp-e-648 syntmp-i-644)) (if (syntmp-annotation?-42 syntmp-e-648) (annotation-expression syntmp-e-648) syntmp-e-648)) (let ((syntmp-e-649 syntmp-j-645)) (if (syntmp-annotation?-42 syntmp-e-649) (annotation-expression syntmp-e-649) syntmp-e-649)))))) (syntmp-free-id=?-90 (lambda (syntmp-i-650 syntmp-j-651) (and (eq? (let ((syntmp-x-652 syntmp-i-650)) (let ((syntmp-e-653 (if (syntmp-syntax-object?-53 syntmp-x-652) (syntmp-syntax-object-expression-54 syntmp-x-652) syntmp-x-652))) (if (syntmp-annotation?-42 syntmp-e-653) (annotation-expression syntmp-e-653) syntmp-e-653))) (let ((syntmp-x-654 syntmp-j-651)) (let ((syntmp-e-655 (if (syntmp-syntax-object?-53 syntmp-x-654) (syntmp-syntax-object-expression-54 syntmp-x-654) syntmp-x-654))) (if (syntmp-annotation?-42 syntmp-e-655) (annotation-expression syntmp-e-655) syntmp-e-655)))) (eq? (syntmp-id-var-name-89 syntmp-i-650 (quote (()))) (syntmp-id-var-name-89 syntmp-j-651 (quote (()))))))) (syntmp-id-var-name-89 (lambda (syntmp-id-656 syntmp-w-657) (letrec ((syntmp-search-vector-rib-660 (lambda (syntmp-sym-666 syntmp-subst-667 syntmp-marks-668 syntmp-symnames-669 syntmp-ribcage-670) (let ((syntmp-n-671 (vector-length syntmp-symnames-669))) (let syntmp-f-672 ((syntmp-i-673 (quote 0))) (cond ((syntmp-fx=-40 syntmp-i-673 syntmp-n-671) (syntmp-search-658 syntmp-sym-666 (cdr syntmp-subst-667) syntmp-marks-668)) ((and (eq? (vector-ref syntmp-symnames-669 syntmp-i-673) syntmp-sym-666) (syntmp-same-marks?-88 syntmp-marks-668 (vector-ref (syntmp-ribcage-marks-77 syntmp-ribcage-670) syntmp-i-673))) (values (vector-ref (syntmp-ribcage-labels-78 syntmp-ribcage-670) syntmp-i-673) syntmp-marks-668)) (else (syntmp-f-672 (syntmp-fx+-38 syntmp-i-673 (quote 1))))))))) (syntmp-search-list-rib-659 (lambda (syntmp-sym-674 syntmp-subst-675 syntmp-marks-676 syntmp-symnames-677 syntmp-ribcage-678) (let syntmp-f-679 ((syntmp-symnames-680 syntmp-symnames-677) (syntmp-i-681 (quote 0))) (cond ((null? syntmp-symnames-680) (syntmp-search-658 syntmp-sym-674 (cdr syntmp-subst-675) syntmp-marks-676)) ((and (eq? (car syntmp-symnames-680) syntmp-sym-674) (syntmp-same-marks?-88 syntmp-marks-676 (list-ref (syntmp-ribcage-marks-77 syntmp-ribcage-678) syntmp-i-681))) (values (list-ref (syntmp-ribcage-labels-78 syntmp-ribcage-678) syntmp-i-681) syntmp-marks-676)) (else (syntmp-f-679 (cdr syntmp-symnames-680) (syntmp-fx+-38 syntmp-i-681 (quote 1)))))))) (syntmp-search-658 (lambda (syntmp-sym-682 syntmp-subst-683 syntmp-marks-684) (if (null? syntmp-subst-683) (values (quote #f) syntmp-marks-684) (let ((syntmp-fst-685 (car syntmp-subst-683))) (if (eq? syntmp-fst-685 (quote shift)) (syntmp-search-658 syntmp-sym-682 (cdr syntmp-subst-683) (cdr syntmp-marks-684)) (let ((syntmp-symnames-686 (syntmp-ribcage-symnames-76 syntmp-fst-685))) (if (vector? syntmp-symnames-686) (syntmp-search-vector-rib-660 syntmp-sym-682 syntmp-subst-683 syntmp-marks-684 syntmp-symnames-686 syntmp-fst-685) (syntmp-search-list-rib-659 syntmp-sym-682 syntmp-subst-683 syntmp-marks-684 syntmp-symnames-686 syntmp-fst-685))))))))) (cond ((symbol? syntmp-id-656) (or (call-with-values (lambda () (syntmp-search-658 syntmp-id-656 (syntmp-wrap-subst-71 syntmp-w-657) (syntmp-wrap-marks-70 syntmp-w-657))) (lambda (syntmp-x-688 . syntmp-ignore-687) syntmp-x-688)) syntmp-id-656)) ((syntmp-syntax-object?-53 syntmp-id-656) (let ((syntmp-id-689 (let ((syntmp-e-691 (syntmp-syntax-object-expression-54 syntmp-id-656))) (if (syntmp-annotation?-42 syntmp-e-691) (annotation-expression syntmp-e-691) syntmp-e-691))) (syntmp-w1-690 (syntmp-syntax-object-wrap-55 syntmp-id-656))) (let ((syntmp-marks-692 (syntmp-join-marks-87 (syntmp-wrap-marks-70 syntmp-w-657) (syntmp-wrap-marks-70 syntmp-w1-690)))) (call-with-values (lambda () (syntmp-search-658 syntmp-id-689 (syntmp-wrap-subst-71 syntmp-w-657) syntmp-marks-692)) (lambda (syntmp-new-id-693 syntmp-marks-694) (or syntmp-new-id-693 (call-with-values (lambda () (syntmp-search-658 syntmp-id-689 (syntmp-wrap-subst-71 syntmp-w1-690) syntmp-marks-694)) (lambda (syntmp-x-696 . syntmp-ignore-695) syntmp-x-696)) syntmp-id-689)))))) ((syntmp-annotation?-42 syntmp-id-656) (let ((syntmp-id-697 (let ((syntmp-e-698 syntmp-id-656)) (if (syntmp-annotation?-42 syntmp-e-698) (annotation-expression syntmp-e-698) syntmp-e-698)))) (or (call-with-values (lambda () (syntmp-search-658 syntmp-id-697 (syntmp-wrap-subst-71 syntmp-w-657) (syntmp-wrap-marks-70 syntmp-w-657))) (lambda (syntmp-x-700 . syntmp-ignore-699) syntmp-x-700)) syntmp-id-697))) (else (syntmp-error-hook-45 (quote id-var-name) (quote "invalid id") syntmp-id-656)))))) (syntmp-same-marks?-88 (lambda (syntmp-x-701 syntmp-y-702) (or (eq? syntmp-x-701 syntmp-y-702) (and (not (null? syntmp-x-701)) (not (null? syntmp-y-702)) (eq? (car syntmp-x-701) (car syntmp-y-702)) (syntmp-same-marks?-88 (cdr syntmp-x-701) (cdr syntmp-y-702)))))) (syntmp-join-marks-87 (lambda (syntmp-m1-703 syntmp-m2-704) (syntmp-smart-append-85 syntmp-m1-703 syntmp-m2-704))) (syntmp-join-wraps-86 (lambda (syntmp-w1-705 syntmp-w2-706) (let ((syntmp-m1-707 (syntmp-wrap-marks-70 syntmp-w1-705)) (syntmp-s1-708 (syntmp-wrap-subst-71 syntmp-w1-705))) (if (null? syntmp-m1-707) (if (null? syntmp-s1-708) syntmp-w2-706 (syntmp-make-wrap-69 (syntmp-wrap-marks-70 syntmp-w2-706) (syntmp-smart-append-85 syntmp-s1-708 (syntmp-wrap-subst-71 syntmp-w2-706)))) (syntmp-make-wrap-69 (syntmp-smart-append-85 syntmp-m1-707 (syntmp-wrap-marks-70 syntmp-w2-706)) (syntmp-smart-append-85 syntmp-s1-708 (syntmp-wrap-subst-71 syntmp-w2-706))))))) (syntmp-smart-append-85 (lambda (syntmp-m1-709 syntmp-m2-710) (if (null? syntmp-m2-710) syntmp-m1-709 (append syntmp-m1-709 syntmp-m2-710)))) (syntmp-make-binding-wrap-84 (lambda (syntmp-ids-711 syntmp-labels-712 syntmp-w-713) (if (null? syntmp-ids-711) syntmp-w-713 (syntmp-make-wrap-69 (syntmp-wrap-marks-70 syntmp-w-713) (cons (let ((syntmp-labelvec-714 (list->vector syntmp-labels-712))) (let ((syntmp-n-715 (vector-length syntmp-labelvec-714))) (let ((syntmp-symnamevec-716 (make-vector syntmp-n-715)) (syntmp-marksvec-717 (make-vector syntmp-n-715))) (begin (let syntmp-f-718 ((syntmp-ids-719 syntmp-ids-711) (syntmp-i-720 (quote 0))) (if (not (null? syntmp-ids-719)) (call-with-values (lambda () (syntmp-id-sym-name&marks-68 (car syntmp-ids-719) syntmp-w-713)) (lambda (syntmp-symname-721 syntmp-marks-722) (begin (vector-set! syntmp-symnamevec-716 syntmp-i-720 syntmp-symname-721) (vector-set! syntmp-marksvec-717 syntmp-i-720 syntmp-marks-722) (syntmp-f-718 (cdr syntmp-ids-719) (syntmp-fx+-38 syntmp-i-720 (quote 1)))))))) (syntmp-make-ribcage-74 syntmp-symnamevec-716 syntmp-marksvec-717 syntmp-labelvec-714))))) (syntmp-wrap-subst-71 syntmp-w-713)))))) (syntmp-extend-ribcage!-83 (lambda (syntmp-ribcage-723 syntmp-id-724 syntmp-label-725) (begin (syntmp-set-ribcage-symnames!-79 syntmp-ribcage-723 (cons (let ((syntmp-e-726 (syntmp-syntax-object-expression-54 syntmp-id-724))) (if (syntmp-annotation?-42 syntmp-e-726) (annotation-expression syntmp-e-726) syntmp-e-726)) (syntmp-ribcage-symnames-76 syntmp-ribcage-723))) (syntmp-set-ribcage-marks!-80 syntmp-ribcage-723 (cons (syntmp-wrap-marks-70 (syntmp-syntax-object-wrap-55 syntmp-id-724)) (syntmp-ribcage-marks-77 syntmp-ribcage-723))) (syntmp-set-ribcage-labels!-81 syntmp-ribcage-723 (cons syntmp-label-725 (syntmp-ribcage-labels-78 syntmp-ribcage-723)))))) (syntmp-anti-mark-82 (lambda (syntmp-w-727) (syntmp-make-wrap-69 (cons (quote #f) (syntmp-wrap-marks-70 syntmp-w-727)) (cons (quote shift) (syntmp-wrap-subst-71 syntmp-w-727))))) (syntmp-set-ribcage-labels!-81 (lambda (syntmp-x-728 syntmp-update-729) (vector-set! syntmp-x-728 (quote 3) syntmp-update-729))) (syntmp-set-ribcage-marks!-80 (lambda (syntmp-x-730 syntmp-update-731) (vector-set! syntmp-x-730 (quote 2) syntmp-update-731))) (syntmp-set-ribcage-symnames!-79 (lambda (syntmp-x-732 syntmp-update-733) (vector-set! syntmp-x-732 (quote 1) syntmp-update-733))) (syntmp-ribcage-labels-78 (lambda (syntmp-x-734) (vector-ref syntmp-x-734 (quote 3)))) (syntmp-ribcage-marks-77 (lambda (syntmp-x-735) (vector-ref syntmp-x-735 (quote 2)))) (syntmp-ribcage-symnames-76 (lambda (syntmp-x-736) (vector-ref syntmp-x-736 (quote 1)))) (syntmp-ribcage?-75 (lambda (syntmp-x-737) (and (vector? syntmp-x-737) (= (vector-length syntmp-x-737) (quote 4)) (eq? (vector-ref syntmp-x-737 (quote 0)) (quote ribcage))))) (syntmp-make-ribcage-74 (lambda (syntmp-symnames-738 syntmp-marks-739 syntmp-labels-740) (vector (quote ribcage) syntmp-symnames-738 syntmp-marks-739 syntmp-labels-740))) (syntmp-gen-labels-73 (lambda (syntmp-ls-741) (if (null? syntmp-ls-741) (quote ()) (cons (syntmp-gen-label-72) (syntmp-gen-labels-73 (cdr syntmp-ls-741)))))) (syntmp-gen-label-72 (lambda () (string (quote #\i)))) (syntmp-wrap-subst-71 cdr) (syntmp-wrap-marks-70 car) (syntmp-make-wrap-69 cons) (syntmp-id-sym-name&marks-68 (lambda (syntmp-x-742 syntmp-w-743) (if (syntmp-syntax-object?-53 syntmp-x-742) (values (let ((syntmp-e-744 (syntmp-syntax-object-expression-54 syntmp-x-742))) (if (syntmp-annotation?-42 syntmp-e-744) (annotation-expression syntmp-e-744) syntmp-e-744)) (syntmp-join-marks-87 (syntmp-wrap-marks-70 syntmp-w-743) (syntmp-wrap-marks-70 (syntmp-syntax-object-wrap-55 syntmp-x-742)))) (values (let ((syntmp-e-745 syntmp-x-742)) (if (syntmp-annotation?-42 syntmp-e-745) (annotation-expression syntmp-e-745) syntmp-e-745)) (syntmp-wrap-marks-70 syntmp-w-743))))) (syntmp-id?-67 (lambda (syntmp-x-746) (cond ((symbol? syntmp-x-746) (quote #t)) ((syntmp-syntax-object?-53 syntmp-x-746) (symbol? (let ((syntmp-e-747 (syntmp-syntax-object-expression-54 syntmp-x-746))) (if (syntmp-annotation?-42 syntmp-e-747) (annotation-expression syntmp-e-747) syntmp-e-747)))) ((syntmp-annotation?-42 syntmp-x-746) (symbol? (annotation-expression syntmp-x-746))) (else (quote #f))))) (syntmp-nonsymbol-id?-66 (lambda (syntmp-x-748) (and (syntmp-syntax-object?-53 syntmp-x-748) (symbol? (let ((syntmp-e-749 (syntmp-syntax-object-expression-54 syntmp-x-748))) (if (syntmp-annotation?-42 syntmp-e-749) (annotation-expression syntmp-e-749) syntmp-e-749)))))) (syntmp-global-extend-65 (lambda (syntmp-type-750 syntmp-sym-751 syntmp-val-752) (syntmp-put-global-definition-hook-46 syntmp-sym-751 (cons syntmp-type-750 syntmp-val-752)))) (syntmp-lookup-64 (lambda (syntmp-x-753 syntmp-r-754) (cond ((assq syntmp-x-753 syntmp-r-754) => cdr) ((symbol? syntmp-x-753) (or (syntmp-get-global-definition-hook-47 syntmp-x-753) (quote (global)))) (else (quote (displaced-lexical)))))) (syntmp-macros-only-env-63 (lambda (syntmp-r-755) (if (null? syntmp-r-755) (quote ()) (let ((syntmp-a-756 (car syntmp-r-755))) (if (eq? (cadr syntmp-a-756) (quote macro)) (cons syntmp-a-756 (syntmp-macros-only-env-63 (cdr syntmp-r-755))) (syntmp-macros-only-env-63 (cdr syntmp-r-755))))))) (syntmp-extend-var-env-62 (lambda (syntmp-labels-757 syntmp-vars-758 syntmp-r-759) (if (null? syntmp-labels-757) syntmp-r-759 (syntmp-extend-var-env-62 (cdr syntmp-labels-757) (cdr syntmp-vars-758) (cons (cons (car syntmp-labels-757) (cons (quote lexical) (car syntmp-vars-758))) syntmp-r-759))))) (syntmp-extend-env-61 (lambda (syntmp-labels-760 syntmp-bindings-761 syntmp-r-762) (if (null? syntmp-labels-760) syntmp-r-762 (syntmp-extend-env-61 (cdr syntmp-labels-760) (cdr syntmp-bindings-761) (cons (cons (car syntmp-labels-760) (car syntmp-bindings-761)) syntmp-r-762))))) (syntmp-binding-value-60 cdr) (syntmp-binding-type-59 car) (syntmp-source-annotation-58 (lambda (syntmp-x-763) (cond ((syntmp-annotation?-42 syntmp-x-763) (annotation-source syntmp-x-763)) ((syntmp-syntax-object?-53 syntmp-x-763) (syntmp-source-annotation-58 (syntmp-syntax-object-expression-54 syntmp-x-763))) (else (quote #f))))) (syntmp-set-syntax-object-wrap!-57 (lambda (syntmp-x-764 syntmp-update-765) (vector-set! syntmp-x-764 (quote 2) syntmp-update-765))) (syntmp-set-syntax-object-expression!-56 (lambda (syntmp-x-766 syntmp-update-767) (vector-set! syntmp-x-766 (quote 1) syntmp-update-767))) (syntmp-syntax-object-wrap-55 (lambda (syntmp-x-768) (vector-ref syntmp-x-768 (quote 2)))) (syntmp-syntax-object-expression-54 (lambda (syntmp-x-769) (vector-ref syntmp-x-769 (quote 1)))) (syntmp-syntax-object?-53 (lambda (syntmp-x-770) (and (vector? syntmp-x-770) (= (vector-length syntmp-x-770) (quote 3)) (eq? (vector-ref syntmp-x-770 (quote 0)) (quote syntax-object))))) (syntmp-make-syntax-object-52 (lambda (syntmp-expression-771 syntmp-wrap-772) (vector (quote syntax-object) syntmp-expression-771 syntmp-wrap-772))) (syntmp-build-letrec-51 (lambda (syntmp-src-773 syntmp-vars-774 syntmp-val-exps-775 syntmp-body-exp-776) (if (null? syntmp-vars-774) syntmp-body-exp-776 (list (quote letrec) (map list syntmp-vars-774 syntmp-val-exps-775) syntmp-body-exp-776)))) (syntmp-build-named-let-50 (lambda (syntmp-src-777 syntmp-vars-778 syntmp-val-exps-779 syntmp-body-exp-780) (if (null? syntmp-vars-778) syntmp-body-exp-780 (list (quote let) (car syntmp-vars-778) (map list (cdr syntmp-vars-778) syntmp-val-exps-779) syntmp-body-exp-780)))) (syntmp-build-let-49 (lambda (syntmp-src-781 syntmp-vars-782 syntmp-val-exps-783 syntmp-body-exp-784) (if (null? syntmp-vars-782) syntmp-body-exp-784 (list (quote let) (map list syntmp-vars-782 syntmp-val-exps-783) syntmp-body-exp-784)))) (syntmp-build-sequence-48 (lambda (syntmp-src-785 syntmp-exps-786) (if (null? (cdr syntmp-exps-786)) (car syntmp-exps-786) (cons (quote begin) syntmp-exps-786)))) (syntmp-get-global-definition-hook-47 (lambda (syntmp-symbol-787) (getprop syntmp-symbol-787 (quote *sc-expander*)))) (syntmp-put-global-definition-hook-46 (lambda (syntmp-symbol-788 syntmp-binding-789) (putprop syntmp-symbol-788 (quote *sc-expander*) syntmp-binding-789))) (syntmp-error-hook-45 (lambda (syntmp-who-790 syntmp-why-791 syntmp-what-792) (error syntmp-who-790 (quote "~a ~s") syntmp-why-791 syntmp-what-792))) (syntmp-local-eval-hook-44 (lambda (syntmp-x-793) (eval (list syntmp-noexpand-37 syntmp-x-793) (interaction-environment)))) (syntmp-top-level-eval-hook-43 (lambda (syntmp-x-794) (eval (list syntmp-noexpand-37 syntmp-x-794) (interaction-environment)))) (syntmp-annotation?-42 (lambda (syntmp-x-795) (quote #f))) (syntmp-fx<-41 <) (syntmp-fx=-40 =) (syntmp-fx--39 -) (syntmp-fx+-38 +) (syntmp-noexpand-37 (quote "noexpand"))) (begin (syntmp-global-extend-65 (quote local-syntax) (quote letrec-syntax) (quote #t)) (syntmp-global-extend-65 (quote local-syntax) (quote let-syntax) (quote #f)) (syntmp-global-extend-65 (quote core) (quote fluid-let-syntax) (lambda (syntmp-e-796 syntmp-r-797 syntmp-w-798 syntmp-s-799) ((lambda (syntmp-tmp-800) ((lambda (syntmp-tmp-801) (if (if syntmp-tmp-801 (apply (lambda (syntmp-_-802 syntmp-var-803 syntmp-val-804 syntmp-e1-805 syntmp-e2-806) (syntmp-valid-bound-ids?-92 syntmp-var-803)) syntmp-tmp-801) (quote #f)) (apply (lambda (syntmp-_-808 syntmp-var-809 syntmp-val-810 syntmp-e1-811 syntmp-e2-812) (let ((syntmp-names-813 (map (lambda (syntmp-x-814) (syntmp-id-var-name-89 syntmp-x-814 syntmp-w-798)) syntmp-var-809))) (begin (for-each (lambda (syntmp-id-816 syntmp-n-817) (let ((syntmp-t-818 (syntmp-binding-type-59 (syntmp-lookup-64 syntmp-n-817 syntmp-r-797)))) (if (memv syntmp-t-818 (quote (displaced-lexical))) (syntax-error (syntmp-source-wrap-96 syntmp-id-816 syntmp-w-798 syntmp-s-799) (quote "identifier out of context"))))) syntmp-var-809 syntmp-names-813) (syntmp-chi-body-107 (cons syntmp-e1-811 syntmp-e2-812) (syntmp-source-wrap-96 syntmp-e-796 syntmp-w-798 syntmp-s-799) (syntmp-extend-env-61 syntmp-names-813 (let ((syntmp-trans-r-821 (syntmp-macros-only-env-63 syntmp-r-797))) (map (lambda (syntmp-x-822) (cons (quote macro) (syntmp-eval-local-transformer-110 (syntmp-chi-103 syntmp-x-822 syntmp-trans-r-821 syntmp-w-798)))) syntmp-val-810)) syntmp-r-797) syntmp-w-798)))) syntmp-tmp-801) ((lambda (syntmp-_-824) (syntax-error (syntmp-source-wrap-96 syntmp-e-796 syntmp-w-798 syntmp-s-799))) syntmp-tmp-800))) (syntax-dispatch syntmp-tmp-800 (quote (any #(each (any any)) any . each-any))))) syntmp-e-796))) (syntmp-global-extend-65 (quote core) (quote quote) (lambda (syntmp-e-825 syntmp-r-826 syntmp-w-827 syntmp-s-828) ((lambda (syntmp-tmp-829) ((lambda (syntmp-tmp-830) (if syntmp-tmp-830 (apply (lambda (syntmp-_-831 syntmp-e-832) (list (quote quote) (syntmp-strip-114 syntmp-e-832 syntmp-w-827))) syntmp-tmp-830) ((lambda (syntmp-_-833) (syntax-error (syntmp-source-wrap-96 syntmp-e-825 syntmp-w-827 syntmp-s-828))) syntmp-tmp-829))) (syntax-dispatch syntmp-tmp-829 (quote (any any))))) syntmp-e-825))) (syntmp-global-extend-65 (quote core) (quote syntax) (letrec ((syntmp-regen-841 (lambda (syntmp-x-842) (let ((syntmp-t-843 (car syntmp-x-842))) (if (memv syntmp-t-843 (quote (ref))) (cadr syntmp-x-842) (if (memv syntmp-t-843 (quote (primitive))) (cadr syntmp-x-842) (if (memv syntmp-t-843 (quote (quote))) (list (quote quote) (cadr syntmp-x-842)) (if (memv syntmp-t-843 (quote (lambda))) (list (quote lambda) (cadr syntmp-x-842) (syntmp-regen-841 (caddr syntmp-x-842))) (if (memv syntmp-t-843 (quote (map))) (let ((syntmp-ls-844 (map syntmp-regen-841 (cdr syntmp-x-842)))) (cons (if (syntmp-fx=-40 (length syntmp-ls-844) (quote 2)) (quote map) (quote map)) syntmp-ls-844)) (cons (car syntmp-x-842) (map syntmp-regen-841 (cdr syntmp-x-842))))))))))) (syntmp-gen-vector-840 (lambda (syntmp-x-845) (cond ((eq? (car syntmp-x-845) (quote list)) (cons (quote vector) (cdr syntmp-x-845))) ((eq? (car syntmp-x-845) (quote quote)) (list (quote quote) (list->vector (cadr syntmp-x-845)))) (else (list (quote list->vector) syntmp-x-845))))) (syntmp-gen-append-839 (lambda (syntmp-x-846 syntmp-y-847) (if (equal? syntmp-y-847 (quote (quote ()))) syntmp-x-846 (list (quote append) syntmp-x-846 syntmp-y-847)))) (syntmp-gen-cons-838 (lambda (syntmp-x-848 syntmp-y-849) (let ((syntmp-t-850 (car syntmp-y-849))) (if (memv syntmp-t-850 (quote (quote))) (if (eq? (car syntmp-x-848) (quote quote)) (list (quote quote) (cons (cadr syntmp-x-848) (cadr syntmp-y-849))) (if (eq? (cadr syntmp-y-849) (quote ())) (list (quote list) syntmp-x-848) (list (quote cons) syntmp-x-848 syntmp-y-849))) (if (memv syntmp-t-850 (quote (list))) (cons (quote list) (cons syntmp-x-848 (cdr syntmp-y-849))) (list (quote cons) syntmp-x-848 syntmp-y-849)))))) (syntmp-gen-map-837 (lambda (syntmp-e-851 syntmp-map-env-852) (let ((syntmp-formals-853 (map cdr syntmp-map-env-852)) (syntmp-actuals-854 (map (lambda (syntmp-x-855) (list (quote ref) (car syntmp-x-855))) syntmp-map-env-852))) (cond ((eq? (car syntmp-e-851) (quote ref)) (car syntmp-actuals-854)) ((andmap (lambda (syntmp-x-856) (and (eq? (car syntmp-x-856) (quote ref)) (memq (cadr syntmp-x-856) syntmp-formals-853))) (cdr syntmp-e-851)) (cons (quote map) (cons (list (quote primitive) (car syntmp-e-851)) (map (let ((syntmp-r-857 (map cons syntmp-formals-853 syntmp-actuals-854))) (lambda (syntmp-x-858) (cdr (assq (cadr syntmp-x-858) syntmp-r-857)))) (cdr syntmp-e-851))))) (else (cons (quote map) (cons (list (quote lambda) syntmp-formals-853 syntmp-e-851) syntmp-actuals-854))))))) (syntmp-gen-mappend-836 (lambda (syntmp-e-859 syntmp-map-env-860) (list (quote apply) (quote (primitive append)) (syntmp-gen-map-837 syntmp-e-859 syntmp-map-env-860)))) (syntmp-gen-ref-835 (lambda (syntmp-src-861 syntmp-var-862 syntmp-level-863 syntmp-maps-864) (if (syntmp-fx=-40 syntmp-level-863 (quote 0)) (values syntmp-var-862 syntmp-maps-864) (if (null? syntmp-maps-864) (syntax-error syntmp-src-861 (quote "missing ellipsis in syntax form")) (call-with-values (lambda () (syntmp-gen-ref-835 syntmp-src-861 syntmp-var-862 (syntmp-fx--39 syntmp-level-863 (quote 1)) (cdr syntmp-maps-864))) (lambda (syntmp-outer-var-865 syntmp-outer-maps-866) (let ((syntmp-b-867 (assq syntmp-outer-var-865 (car syntmp-maps-864)))) (if syntmp-b-867 (values (cdr syntmp-b-867) syntmp-maps-864) (let ((syntmp-inner-var-868 (syntmp-gen-var-115 (quote tmp)))) (values syntmp-inner-var-868 (cons (cons (cons syntmp-outer-var-865 syntmp-inner-var-868) (car syntmp-maps-864)) syntmp-outer-maps-866))))))))))) (syntmp-gen-syntax-834 (lambda (syntmp-src-869 syntmp-e-870 syntmp-r-871 syntmp-maps-872 syntmp-ellipsis?-873) (if (syntmp-id?-67 syntmp-e-870) (let ((syntmp-label-874 (syntmp-id-var-name-89 syntmp-e-870 (quote (()))))) (let ((syntmp-b-875 (syntmp-lookup-64 syntmp-label-874 syntmp-r-871))) (if (eq? (syntmp-binding-type-59 syntmp-b-875) (quote syntax)) (call-with-values (lambda () (let ((syntmp-var.lev-876 (syntmp-binding-value-60 syntmp-b-875))) (syntmp-gen-ref-835 syntmp-src-869 (car syntmp-var.lev-876) (cdr syntmp-var.lev-876) syntmp-maps-872))) (lambda (syntmp-var-877 syntmp-maps-878) (values (list (quote ref) syntmp-var-877) syntmp-maps-878))) (if (syntmp-ellipsis?-873 syntmp-e-870) (syntax-error syntmp-src-869 (quote "misplaced ellipsis in syntax form")) (values (list (quote quote) syntmp-e-870) syntmp-maps-872))))) ((lambda (syntmp-tmp-879) ((lambda (syntmp-tmp-880) (if (if syntmp-tmp-880 (apply (lambda (syntmp-dots-881 syntmp-e-882) (syntmp-ellipsis?-873 syntmp-dots-881)) syntmp-tmp-880) (quote #f)) (apply (lambda (syntmp-dots-883 syntmp-e-884) (syntmp-gen-syntax-834 syntmp-src-869 syntmp-e-884 syntmp-r-871 syntmp-maps-872 (lambda (syntmp-x-885) (quote #f)))) syntmp-tmp-880) ((lambda (syntmp-tmp-886) (if (if syntmp-tmp-886 (apply (lambda (syntmp-x-887 syntmp-dots-888 syntmp-y-889) (syntmp-ellipsis?-873 syntmp-dots-888)) syntmp-tmp-886) (quote #f)) (apply (lambda (syntmp-x-890 syntmp-dots-891 syntmp-y-892) (let syntmp-f-893 ((syntmp-y-894 syntmp-y-892) (syntmp-k-895 (lambda (syntmp-maps-896) (call-with-values (lambda () (syntmp-gen-syntax-834 syntmp-src-869 syntmp-x-890 syntmp-r-871 (cons (quote ()) syntmp-maps-896) syntmp-ellipsis?-873)) (lambda (syntmp-x-897 syntmp-maps-898) (if (null? (car syntmp-maps-898)) (syntax-error syntmp-src-869 (quote "extra ellipsis in syntax form")) (values (syntmp-gen-map-837 syntmp-x-897 (car syntmp-maps-898)) (cdr syntmp-maps-898)))))))) ((lambda (syntmp-tmp-899) ((lambda (syntmp-tmp-900) (if (if syntmp-tmp-900 (apply (lambda (syntmp-dots-901 syntmp-y-902) (syntmp-ellipsis?-873 syntmp-dots-901)) syntmp-tmp-900) (quote #f)) (apply (lambda (syntmp-dots-903 syntmp-y-904) (syntmp-f-893 syntmp-y-904 (lambda (syntmp-maps-905) (call-with-values (lambda () (syntmp-k-895 (cons (quote ()) syntmp-maps-905))) (lambda (syntmp-x-906 syntmp-maps-907) (if (null? (car syntmp-maps-907)) (syntax-error syntmp-src-869 (quote "extra ellipsis in syntax form")) (values (syntmp-gen-mappend-836 syntmp-x-906 (car syntmp-maps-907)) (cdr syntmp-maps-907)))))))) syntmp-tmp-900) ((lambda (syntmp-_-908) (call-with-values (lambda () (syntmp-gen-syntax-834 syntmp-src-869 syntmp-y-894 syntmp-r-871 syntmp-maps-872 syntmp-ellipsis?-873)) (lambda (syntmp-y-909 syntmp-maps-910) (call-with-values (lambda () (syntmp-k-895 syntmp-maps-910)) (lambda (syntmp-x-911 syntmp-maps-912) (values (syntmp-gen-append-839 syntmp-x-911 syntmp-y-909) syntmp-maps-912)))))) syntmp-tmp-899))) (syntax-dispatch syntmp-tmp-899 (quote (any . any))))) syntmp-y-894))) syntmp-tmp-886) ((lambda (syntmp-tmp-913) (if syntmp-tmp-913 (apply (lambda (syntmp-x-914 syntmp-y-915) (call-with-values (lambda () (syntmp-gen-syntax-834 syntmp-src-869 syntmp-x-914 syntmp-r-871 syntmp-maps-872 syntmp-ellipsis?-873)) (lambda (syntmp-x-916 syntmp-maps-917) (call-with-values (lambda () (syntmp-gen-syntax-834 syntmp-src-869 syntmp-y-915 syntmp-r-871 syntmp-maps-917 syntmp-ellipsis?-873)) (lambda (syntmp-y-918 syntmp-maps-919) (values (syntmp-gen-cons-838 syntmp-x-916 syntmp-y-918) syntmp-maps-919)))))) syntmp-tmp-913) ((lambda (syntmp-tmp-920) (if syntmp-tmp-920 (apply (lambda (syntmp-e1-921 syntmp-e2-922) (call-with-values (lambda () (syntmp-gen-syntax-834 syntmp-src-869 (cons syntmp-e1-921 syntmp-e2-922) syntmp-r-871 syntmp-maps-872 syntmp-ellipsis?-873)) (lambda (syntmp-e-924 syntmp-maps-925) (values (syntmp-gen-vector-840 syntmp-e-924) syntmp-maps-925)))) syntmp-tmp-920) ((lambda (syntmp-_-926) (values (list (quote quote) syntmp-e-870) syntmp-maps-872)) syntmp-tmp-879))) (syntax-dispatch syntmp-tmp-879 (quote #(vector (any . each-any))))))) (syntax-dispatch syntmp-tmp-879 (quote (any . any)))))) (syntax-dispatch syntmp-tmp-879 (quote (any any . any)))))) (syntax-dispatch syntmp-tmp-879 (quote (any any))))) syntmp-e-870))))) (lambda (syntmp-e-927 syntmp-r-928 syntmp-w-929 syntmp-s-930) (let ((syntmp-e-931 (syntmp-source-wrap-96 syntmp-e-927 syntmp-w-929 syntmp-s-930))) ((lambda (syntmp-tmp-932) ((lambda (syntmp-tmp-933) (if syntmp-tmp-933 (apply (lambda (syntmp-_-934 syntmp-x-935) (call-with-values (lambda () (syntmp-gen-syntax-834 syntmp-e-931 syntmp-x-935 syntmp-r-928 (quote ()) syntmp-ellipsis?-112)) (lambda (syntmp-e-936 syntmp-maps-937) (syntmp-regen-841 syntmp-e-936)))) syntmp-tmp-933) ((lambda (syntmp-_-938) (syntax-error syntmp-e-931)) syntmp-tmp-932))) (syntax-dispatch syntmp-tmp-932 (quote (any any))))) syntmp-e-931))))) (syntmp-global-extend-65 (quote core) (quote lambda) (lambda (syntmp-e-939 syntmp-r-940 syntmp-w-941 syntmp-s-942) ((lambda (syntmp-tmp-943) ((lambda (syntmp-tmp-944) (if syntmp-tmp-944 (apply (lambda (syntmp-_-945 syntmp-c-946) (syntmp-chi-lambda-clause-108 (syntmp-source-wrap-96 syntmp-e-939 syntmp-w-941 syntmp-s-942) syntmp-c-946 syntmp-r-940 syntmp-w-941 (lambda (syntmp-vars-947 syntmp-body-948) (list (quote lambda) syntmp-vars-947 syntmp-body-948)))) syntmp-tmp-944) (syntax-error syntmp-tmp-943))) (syntax-dispatch syntmp-tmp-943 (quote (any . any))))) syntmp-e-939))) (syntmp-global-extend-65 (quote core) (quote let) (letrec ((syntmp-chi-let-949 (lambda (syntmp-e-950 syntmp-r-951 syntmp-w-952 syntmp-s-953 syntmp-constructor-954 syntmp-ids-955 syntmp-vals-956 syntmp-exps-957) (if (not (syntmp-valid-bound-ids?-92 syntmp-ids-955)) (syntax-error syntmp-e-950 (quote "duplicate bound variable in")) (let ((syntmp-labels-958 (syntmp-gen-labels-73 syntmp-ids-955)) (syntmp-new-vars-959 (map syntmp-gen-var-115 syntmp-ids-955))) (let ((syntmp-nw-960 (syntmp-make-binding-wrap-84 syntmp-ids-955 syntmp-labels-958 syntmp-w-952)) (syntmp-nr-961 (syntmp-extend-var-env-62 syntmp-labels-958 syntmp-new-vars-959 syntmp-r-951))) (syntmp-constructor-954 syntmp-s-953 syntmp-new-vars-959 (map (lambda (syntmp-x-962) (syntmp-chi-103 syntmp-x-962 syntmp-r-951 syntmp-w-952)) syntmp-vals-956) (syntmp-chi-body-107 syntmp-exps-957 (syntmp-source-wrap-96 syntmp-e-950 syntmp-nw-960 syntmp-s-953) syntmp-nr-961 syntmp-nw-960)))))))) (lambda (syntmp-e-963 syntmp-r-964 syntmp-w-965 syntmp-s-966) ((lambda (syntmp-tmp-967) ((lambda (syntmp-tmp-968) (if syntmp-tmp-968 (apply (lambda (syntmp-_-969 syntmp-id-970 syntmp-val-971 syntmp-e1-972 syntmp-e2-973) (syntmp-chi-let-949 syntmp-e-963 syntmp-r-964 syntmp-w-965 syntmp-s-966 syntmp-build-let-49 syntmp-id-970 syntmp-val-971 (cons syntmp-e1-972 syntmp-e2-973))) syntmp-tmp-968) ((lambda (syntmp-tmp-977) (if (if syntmp-tmp-977 (apply (lambda (syntmp-_-978 syntmp-f-979 syntmp-id-980 syntmp-val-981 syntmp-e1-982 syntmp-e2-983) (syntmp-id?-67 syntmp-f-979)) syntmp-tmp-977) (quote #f)) (apply (lambda (syntmp-_-984 syntmp-f-985 syntmp-id-986 syntmp-val-987 syntmp-e1-988 syntmp-e2-989) (syntmp-chi-let-949 syntmp-e-963 syntmp-r-964 syntmp-w-965 syntmp-s-966 syntmp-build-named-let-50 (cons syntmp-f-985 syntmp-id-986) syntmp-val-987 (cons syntmp-e1-988 syntmp-e2-989))) syntmp-tmp-977) ((lambda (syntmp-_-993) (syntax-error (syntmp-source-wrap-96 syntmp-e-963 syntmp-w-965 syntmp-s-966))) syntmp-tmp-967))) (syntax-dispatch syntmp-tmp-967 (quote (any any #(each (any any)) any . each-any)))))) (syntax-dispatch syntmp-tmp-967 (quote (any #(each (any any)) any . each-any))))) syntmp-e-963)))) (syntmp-global-extend-65 (quote core) (quote letrec) (lambda (syntmp-e-994 syntmp-r-995 syntmp-w-996 syntmp-s-997) ((lambda (syntmp-tmp-998) ((lambda (syntmp-tmp-999) (if syntmp-tmp-999 (apply (lambda (syntmp-_-1000 syntmp-id-1001 syntmp-val-1002 syntmp-e1-1003 syntmp-e2-1004) (let ((syntmp-ids-1005 syntmp-id-1001)) (if (not (syntmp-valid-bound-ids?-92 syntmp-ids-1005)) (syntax-error syntmp-e-994 (quote "duplicate bound variable in")) (let ((syntmp-labels-1007 (syntmp-gen-labels-73 syntmp-ids-1005)) (syntmp-new-vars-1008 (map syntmp-gen-var-115 syntmp-ids-1005))) (let ((syntmp-w-1009 (syntmp-make-binding-wrap-84 syntmp-ids-1005 syntmp-labels-1007 syntmp-w-996)) (syntmp-r-1010 (syntmp-extend-var-env-62 syntmp-labels-1007 syntmp-new-vars-1008 syntmp-r-995))) (syntmp-build-letrec-51 syntmp-s-997 syntmp-new-vars-1008 (map (lambda (syntmp-x-1011) (syntmp-chi-103 syntmp-x-1011 syntmp-r-1010 syntmp-w-1009)) syntmp-val-1002) (syntmp-chi-body-107 (cons syntmp-e1-1003 syntmp-e2-1004) (syntmp-source-wrap-96 syntmp-e-994 syntmp-w-1009 syntmp-s-997) syntmp-r-1010 syntmp-w-1009))))))) syntmp-tmp-999) ((lambda (syntmp-_-1014) (syntax-error (syntmp-source-wrap-96 syntmp-e-994 syntmp-w-996 syntmp-s-997))) syntmp-tmp-998))) (syntax-dispatch syntmp-tmp-998 (quote (any #(each (any any)) any . each-any))))) syntmp-e-994))) (syntmp-global-extend-65 (quote core) (quote set!) (lambda (syntmp-e-1015 syntmp-r-1016 syntmp-w-1017 syntmp-s-1018) ((lambda (syntmp-tmp-1019) ((lambda (syntmp-tmp-1020) (if (if syntmp-tmp-1020 (apply (lambda (syntmp-_-1021 syntmp-id-1022 syntmp-val-1023) (syntmp-id?-67 syntmp-id-1022)) syntmp-tmp-1020) (quote #f)) (apply (lambda (syntmp-_-1024 syntmp-id-1025 syntmp-val-1026) (let ((syntmp-val-1027 (syntmp-chi-103 syntmp-val-1026 syntmp-r-1016 syntmp-w-1017)) (syntmp-n-1028 (syntmp-id-var-name-89 syntmp-id-1025 syntmp-w-1017))) (let ((syntmp-b-1029 (syntmp-lookup-64 syntmp-n-1028 syntmp-r-1016))) (let ((syntmp-t-1030 (syntmp-binding-type-59 syntmp-b-1029))) (if (memv syntmp-t-1030 (quote (lexical))) (list (quote set!) (syntmp-binding-value-60 syntmp-b-1029) syntmp-val-1027) (if (memv syntmp-t-1030 (quote (global))) (list (quote set!) syntmp-n-1028 syntmp-val-1027) (if (memv syntmp-t-1030 (quote (displaced-lexical))) (syntax-error (syntmp-wrap-95 syntmp-id-1025 syntmp-w-1017) (quote "identifier out of context")) (syntax-error (syntmp-source-wrap-96 syntmp-e-1015 syntmp-w-1017 syntmp-s-1018))))))))) syntmp-tmp-1020) ((lambda (syntmp-tmp-1031) (if syntmp-tmp-1031 (apply (lambda (syntmp-_-1032 syntmp-getter-1033 syntmp-arg-1034 syntmp-val-1035) (cons (syntmp-chi-103 (list (quote #(syntax-object setter ((top) #(ribcage #(_ getter arg val) #((top) (top) (top) (top)) #("i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(e r w s) #((top) (top) (top) (top)) #("i" "i" "i" "i")) #(ribcage (lambda-var-list gen-var strip strip-annotation ellipsis? chi-void eval-local-transformer chi-local-syntax chi-lambda-clause chi-body chi-macro chi-application chi-expr chi chi-top syntax-type chi-when-list chi-install-global chi-top-sequence chi-sequence source-wrap wrap bound-id-member? distinct-bound-ids? valid-bound-ids? bound-id=? free-id=? id-var-name same-marks? join-marks join-wraps smart-append make-binding-wrap extend-ribcage! make-empty-ribcage new-mark anti-mark the-anti-mark top-marked? top-wrap empty-wrap set-ribcage-labels! set-ribcage-marks! set-ribcage-symnames! ribcage-labels ribcage-marks ribcage-symnames ribcage? make-ribcage gen-labels gen-label make-rename rename-marks rename-new rename-old subst-rename? wrap-subst wrap-marks make-wrap id-sym-name&marks id-sym-name id? nonsymbol-id? global-extend lookup macros-only-env extend-var-env extend-env null-env binding-value binding-type make-binding arg-check source-annotation no-source unannotate set-syntax-object-wrap! set-syntax-object-expression! syntax-object-wrap syntax-object-expression syntax-object? make-syntax-object self-evaluating? build-lexical-var build-letrec build-named-let build-let build-sequence build-data build-primref build-lambda build-global-definition build-global-assignment build-global-reference build-lexical-assignment build-lexical-reference build-conditional build-application get-global-definition-hook put-global-definition-hook gensym-hook error-hook local-eval-hook top-level-eval-hook annotation? fx< fx= fx- fx+ noexpand) ((top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top)) ("i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i")) #(ribcage (define-structure) ((top)) ("i"))))) syntmp-getter-1033) syntmp-r-1016 syntmp-w-1017) (map (lambda (syntmp-e-1036) (syntmp-chi-103 syntmp-e-1036 syntmp-r-1016 syntmp-w-1017)) (append syntmp-arg-1034 (list syntmp-val-1035))))) syntmp-tmp-1031) ((lambda (syntmp-_-1038) (syntax-error (syntmp-source-wrap-96 syntmp-e-1015 syntmp-w-1017 syntmp-s-1018))) syntmp-tmp-1019))) (syntax-dispatch syntmp-tmp-1019 (quote (any (any . each-any) any)))))) (syntax-dispatch syntmp-tmp-1019 (quote (any any any))))) syntmp-e-1015))) (syntmp-global-extend-65 (quote begin) (quote begin) (quote ())) (syntmp-global-extend-65 (quote define) (quote define) (quote ())) (syntmp-global-extend-65 (quote define-syntax) (quote define-syntax) (quote ())) (syntmp-global-extend-65 (quote eval-when) (quote eval-when) (quote ())) (syntmp-global-extend-65 (quote core) (quote syntax-case) (letrec ((syntmp-gen-syntax-case-1042 (lambda (syntmp-x-1043 syntmp-keys-1044 syntmp-clauses-1045 syntmp-r-1046) (if (null? syntmp-clauses-1045) (list (quote syntax-error) syntmp-x-1043) ((lambda (syntmp-tmp-1047) ((lambda (syntmp-tmp-1048) (if syntmp-tmp-1048 (apply (lambda (syntmp-pat-1049 syntmp-exp-1050) (if (and (syntmp-id?-67 syntmp-pat-1049) (andmap (lambda (syntmp-x-1051) (not (syntmp-free-id=?-90 syntmp-pat-1049 syntmp-x-1051))) (cons (quote #(syntax-object ... ((top) #(ribcage #(pat exp) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage #(x keys clauses r) #((top) (top) (top) (top)) #("i" "i" "i" "i")) #(ribcage (gen-syntax-case gen-clause build-dispatch-call convert-pattern) ((top) (top) (top) (top)) ("i" "i" "i" "i")) #(ribcage (lambda-var-list gen-var strip strip-annotation ellipsis? chi-void eval-local-transformer chi-local-syntax chi-lambda-clause chi-body chi-macro chi-application chi-expr chi chi-top syntax-type chi-when-list chi-install-global chi-top-sequence chi-sequence source-wrap wrap bound-id-member? distinct-bound-ids? valid-bound-ids? bound-id=? free-id=? id-var-name same-marks? join-marks join-wraps smart-append make-binding-wrap extend-ribcage! make-empty-ribcage new-mark anti-mark the-anti-mark top-marked? top-wrap empty-wrap set-ribcage-labels! set-ribcage-marks! set-ribcage-symnames! ribcage-labels ribcage-marks ribcage-symnames ribcage? make-ribcage gen-labels gen-label make-rename rename-marks rename-new rename-old subst-rename? wrap-subst wrap-marks make-wrap id-sym-name&marks id-sym-name id? nonsymbol-id? global-extend lookup macros-only-env extend-var-env extend-env null-env binding-value binding-type make-binding arg-check source-annotation no-source unannotate set-syntax-object-wrap! set-syntax-object-expression! syntax-object-wrap syntax-object-expression syntax-object? make-syntax-object self-evaluating? build-lexical-var build-letrec build-named-let build-let build-sequence build-data build-primref build-lambda build-global-definition build-global-assignment build-global-reference build-lexical-assignment build-lexical-reference build-conditional build-application get-global-definition-hook put-global-definition-hook gensym-hook error-hook local-eval-hook top-level-eval-hook annotation? fx< fx= fx- fx+ noexpand) ((top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top) (top)) ("i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i" "i")) #(ribcage (define-structure) ((top)) ("i"))))) syntmp-keys-1044))) (let ((syntmp-labels-1052 (list (syntmp-gen-label-72))) (syntmp-var-1053 (syntmp-gen-var-115 syntmp-pat-1049))) (list (list (quote lambda) (list syntmp-var-1053) (syntmp-chi-103 syntmp-exp-1050 (syntmp-extend-env-61 syntmp-labels-1052 (list (cons (quote syntax) (cons syntmp-var-1053 (quote 0)))) syntmp-r-1046) (syntmp-make-binding-wrap-84 (list syntmp-pat-1049) syntmp-labels-1052 (quote (()))))) syntmp-x-1043)) (syntmp-gen-clause-1041 syntmp-x-1043 syntmp-keys-1044 (cdr syntmp-clauses-1045) syntmp-r-1046 syntmp-pat-1049 (quote #t) syntmp-exp-1050))) syntmp-tmp-1048) ((lambda (syntmp-tmp-1054) (if syntmp-tmp-1054 (apply (lambda (syntmp-pat-1055 syntmp-fender-1056 syntmp-exp-1057) (syntmp-gen-clause-1041 syntmp-x-1043 syntmp-keys-1044 (cdr syntmp-clauses-1045) syntmp-r-1046 syntmp-pat-1055 syntmp-fender-1056 syntmp-exp-1057)) syntmp-tmp-1054) ((lambda (syntmp-_-1058) (syntax-error (car syntmp-clauses-1045) (quote "invalid syntax-case clause"))) syntmp-tmp-1047))) (syntax-dispatch syntmp-tmp-1047 (quote (any any any)))))) (syntax-dispatch syntmp-tmp-1047 (quote (any any))))) (car syntmp-clauses-1045))))) (syntmp-gen-clause-1041 (lambda (syntmp-x-1059 syntmp-keys-1060 syntmp-clauses-1061 syntmp-r-1062 syntmp-pat-1063 syntmp-fender-1064 syntmp-exp-1065) (call-with-values (lambda () (syntmp-convert-pattern-1039 syntmp-pat-1063 syntmp-keys-1060)) (lambda (syntmp-p-1066 syntmp-pvars-1067) (cond ((not (syntmp-distinct-bound-ids?-93 (map car syntmp-pvars-1067))) (syntax-error syntmp-pat-1063 (quote "duplicate pattern variable in syntax-case pattern"))) ((not (andmap (lambda (syntmp-x-1068) (not (syntmp-ellipsis?-112 (car syntmp-x-1068)))) syntmp-pvars-1067)) (syntax-error syntmp-pat-1063 (quote "misplaced ellipsis in syntax-case pattern"))) (else (let ((syntmp-y-1069 (syntmp-gen-var-115 (quote tmp)))) (list (list (quote lambda) (list syntmp-y-1069) (let ((syntmp-y-1070 syntmp-y-1069)) (list (quote if) ((lambda (syntmp-tmp-1071) ((lambda (syntmp-tmp-1072) (if syntmp-tmp-1072 (apply (lambda () syntmp-y-1070) syntmp-tmp-1072) ((lambda (syntmp-_-1073) (list (quote if) syntmp-y-1070 (syntmp-build-dispatch-call-1040 syntmp-pvars-1067 syntmp-fender-1064 syntmp-y-1070 syntmp-r-1062) (list (quote quote) (quote #f)))) syntmp-tmp-1071))) (syntax-dispatch syntmp-tmp-1071 (quote #(atom #t))))) syntmp-fender-1064) (syntmp-build-dispatch-call-1040 syntmp-pvars-1067 syntmp-exp-1065 syntmp-y-1070 syntmp-r-1062) (syntmp-gen-syntax-case-1042 syntmp-x-1059 syntmp-keys-1060 syntmp-clauses-1061 syntmp-r-1062)))) (if (eq? syntmp-p-1066 (quote any)) (list (quote list) syntmp-x-1059) (list (quote syntax-dispatch) syntmp-x-1059 (list (quote quote) syntmp-p-1066))))))))))) (syntmp-build-dispatch-call-1040 (lambda (syntmp-pvars-1074 syntmp-exp-1075 syntmp-y-1076 syntmp-r-1077) (let ((syntmp-ids-1078 (map car syntmp-pvars-1074)) (syntmp-levels-1079 (map cdr syntmp-pvars-1074))) (let ((syntmp-labels-1080 (syntmp-gen-labels-73 syntmp-ids-1078)) (syntmp-new-vars-1081 (map syntmp-gen-var-115 syntmp-ids-1078))) (list (quote apply) (list (quote lambda) syntmp-new-vars-1081 (syntmp-chi-103 syntmp-exp-1075 (syntmp-extend-env-61 syntmp-labels-1080 (map (lambda (syntmp-var-1082 syntmp-level-1083) (cons (quote syntax) (cons syntmp-var-1082 syntmp-level-1083))) syntmp-new-vars-1081 (map cdr syntmp-pvars-1074)) syntmp-r-1077) (syntmp-make-binding-wrap-84 syntmp-ids-1078 syntmp-labels-1080 (quote (()))))) syntmp-y-1076))))) (syntmp-convert-pattern-1039 (lambda (syntmp-pattern-1084 syntmp-keys-1085) (let syntmp-cvt-1086 ((syntmp-p-1087 syntmp-pattern-1084) (syntmp-n-1088 (quote 0)) (syntmp-ids-1089 (quote ()))) (if (syntmp-id?-67 syntmp-p-1087) (if (syntmp-bound-id-member?-94 syntmp-p-1087 syntmp-keys-1085) (values (vector (quote free-id) syntmp-p-1087) syntmp-ids-1089) (values (quote any) (cons (cons syntmp-p-1087 syntmp-n-1088) syntmp-ids-1089))) ((lambda (syntmp-tmp-1090) ((lambda (syntmp-tmp-1091) (if (if syntmp-tmp-1091 (apply (lambda (syntmp-x-1092 syntmp-dots-1093) (syntmp-ellipsis?-112 syntmp-dots-1093)) syntmp-tmp-1091) (quote #f)) (apply (lambda (syntmp-x-1094 syntmp-dots-1095) (call-with-values (lambda () (syntmp-cvt-1086 syntmp-x-1094 (syntmp-fx+-38 syntmp-n-1088 (quote 1)) syntmp-ids-1089)) (lambda (syntmp-p-1096 syntmp-ids-1097) (values (if (eq? syntmp-p-1096 (quote any)) (quote each-any) (vector (quote each) syntmp-p-1096)) syntmp-ids-1097)))) syntmp-tmp-1091) ((lambda (syntmp-tmp-1098) (if syntmp-tmp-1098 (apply (lambda (syntmp-x-1099 syntmp-y-1100) (call-with-values (lambda () (syntmp-cvt-1086 syntmp-y-1100 syntmp-n-1088 syntmp-ids-1089)) (lambda (syntmp-y-1101 syntmp-ids-1102) (call-with-values (lambda () (syntmp-cvt-1086 syntmp-x-1099 syntmp-n-1088 syntmp-ids-1102)) (lambda (syntmp-x-1103 syntmp-ids-1104) (values (cons syntmp-x-1103 syntmp-y-1101) syntmp-ids-1104)))))) syntmp-tmp-1098) ((lambda (syntmp-tmp-1105) (if syntmp-tmp-1105 (apply (lambda () (values (quote ()) syntmp-ids-1089)) syntmp-tmp-1105) ((lambda (syntmp-tmp-1106) (if syntmp-tmp-1106 (apply (lambda (syntmp-x-1107) (call-with-values (lambda () (syntmp-cvt-1086 syntmp-x-1107 syntmp-n-1088 syntmp-ids-1089)) (lambda (syntmp-p-1109 syntmp-ids-1110) (values (vector (quote vector) syntmp-p-1109) syntmp-ids-1110)))) syntmp-tmp-1106) ((lambda (syntmp-x-1111) (values (vector (quote atom) (syntmp-strip-114 syntmp-p-1087 (quote (())))) syntmp-ids-1089)) syntmp-tmp-1090))) (syntax-dispatch syntmp-tmp-1090 (quote #(vector each-any)))))) (syntax-dispatch syntmp-tmp-1090 (quote ()))))) (syntax-dispatch syntmp-tmp-1090 (quote (any . any)))))) (syntax-dispatch syntmp-tmp-1090 (quote (any any))))) syntmp-p-1087)))))) (lambda (syntmp-e-1112 syntmp-r-1113 syntmp-w-1114 syntmp-s-1115) (let ((syntmp-e-1116 (syntmp-source-wrap-96 syntmp-e-1112 syntmp-w-1114 syntmp-s-1115))) ((lambda (syntmp-tmp-1117) ((lambda (syntmp-tmp-1118) (if syntmp-tmp-1118 (apply (lambda (syntmp-_-1119 syntmp-val-1120 syntmp-key-1121 syntmp-m-1122) (if (andmap (lambda (syntmp-x-1123) (and (syntmp-id?-67 syntmp-x-1123) (not (syntmp-ellipsis?-112 syntmp-x-1123)))) syntmp-key-1121) (let ((syntmp-x-1125 (syntmp-gen-var-115 (quote tmp)))) (list (list (quote lambda) (list syntmp-x-1125) (syntmp-gen-syntax-case-1042 syntmp-x-1125 syntmp-key-1121 syntmp-m-1122 syntmp-r-1113)) (syntmp-chi-103 syntmp-val-1120 syntmp-r-1113 (quote (()))))) (syntax-error syntmp-e-1116 (quote "invalid literals list in")))) syntmp-tmp-1118) (syntax-error syntmp-tmp-1117))) (syntax-dispatch syntmp-tmp-1117 (quote (any any each-any . each-any))))) syntmp-e-1116))))) (set! sc-expand (let ((syntmp-m-1128 (quote e)) (syntmp-esew-1129 (quote (eval)))) (lambda (syntmp-x-1130) (if (and (pair? syntmp-x-1130) (equal? (car syntmp-x-1130) syntmp-noexpand-37)) (cadr syntmp-x-1130) (syntmp-chi-top-102 syntmp-x-1130 (quote ()) (quote ((top))) syntmp-m-1128 syntmp-esew-1129))))) (set! sc-expand3 (let ((syntmp-m-1131 (quote e)) (syntmp-esew-1132 (quote (eval)))) (lambda (syntmp-x-1134 . syntmp-rest-1133) (if (and (pair? syntmp-x-1134) (equal? (car syntmp-x-1134) syntmp-noexpand-37)) (cadr syntmp-x-1134) (syntmp-chi-top-102 syntmp-x-1134 (quote ()) (quote ((top))) (if (null? syntmp-rest-1133) syntmp-m-1131 (car syntmp-rest-1133)) (if (or (null? syntmp-rest-1133) (null? (cdr syntmp-rest-1133))) syntmp-esew-1132 (cadr syntmp-rest-1133))))))) (set! identifier? (lambda (syntmp-x-1135) (syntmp-nonsymbol-id?-66 syntmp-x-1135))) (set! datum->syntax-object (lambda (syntmp-id-1136 syntmp-datum-1137) (syntmp-make-syntax-object-52 syntmp-datum-1137 (syntmp-syntax-object-wrap-55 syntmp-id-1136)))) (set! syntax-object->datum (lambda (syntmp-x-1138) (syntmp-strip-114 syntmp-x-1138 (quote (()))))) (set! generate-temporaries (lambda (syntmp-ls-1139) (begin (let ((syntmp-x-1140 syntmp-ls-1139)) (if (not (list? syntmp-x-1140)) (syntmp-error-hook-45 (quote generate-temporaries) (quote "invalid argument") syntmp-x-1140))) (map (lambda (syntmp-x-1141) (syntmp-wrap-95 (gensym) (quote ((top))))) syntmp-ls-1139)))) (set! free-identifier=? (lambda (syntmp-x-1142 syntmp-y-1143) (begin (let ((syntmp-x-1144 syntmp-x-1142)) (if (not (syntmp-nonsymbol-id?-66 syntmp-x-1144)) (syntmp-error-hook-45 (quote free-identifier=?) (quote "invalid argument") syntmp-x-1144))) (let ((syntmp-x-1145 syntmp-y-1143)) (if (not (syntmp-nonsymbol-id?-66 syntmp-x-1145)) (syntmp-error-hook-45 (quote free-identifier=?) (quote "invalid argument") syntmp-x-1145))) (syntmp-free-id=?-90 syntmp-x-1142 syntmp-y-1143)))) (set! bound-identifier=? (lambda (syntmp-x-1146 syntmp-y-1147) (begin (let ((syntmp-x-1148 syntmp-x-1146)) (if (not (syntmp-nonsymbol-id?-66 syntmp-x-1148)) (syntmp-error-hook-45 (quote bound-identifier=?) (quote "invalid argument") syntmp-x-1148))) (let ((syntmp-x-1149 syntmp-y-1147)) (if (not (syntmp-nonsymbol-id?-66 syntmp-x-1149)) (syntmp-error-hook-45 (quote bound-identifier=?) (quote "invalid argument") syntmp-x-1149))) (syntmp-bound-id=?-91 syntmp-x-1146 syntmp-y-1147)))) (set! syntax-error (lambda (syntmp-object-1151 . syntmp-messages-1150) (begin (for-each (lambda (syntmp-x-1152) (let ((syntmp-x-1153 syntmp-x-1152)) (if (not (string? syntmp-x-1153)) (syntmp-error-hook-45 (quote syntax-error) (quote "invalid argument") syntmp-x-1153)))) syntmp-messages-1150) (let ((syntmp-message-1154 (if (null? syntmp-messages-1150) (quote "invalid syntax") (apply string-append syntmp-messages-1150)))) (syntmp-error-hook-45 (quote #f) syntmp-message-1154 (syntmp-strip-114 syntmp-object-1151 (quote (())))))))) (set! install-global-transformer (lambda (syntmp-sym-1155 syntmp-v-1156) (begin (let ((syntmp-x-1157 syntmp-sym-1155)) (if (not (symbol? syntmp-x-1157)) (syntmp-error-hook-45 (quote define-syntax) (quote "invalid argument") syntmp-x-1157))) (let ((syntmp-x-1158 syntmp-v-1156)) (if (not (procedure? syntmp-x-1158)) (syntmp-error-hook-45 (quote define-syntax) (quote "invalid argument") syntmp-x-1158))) (syntmp-global-extend-65 (quote macro) syntmp-sym-1155 syntmp-v-1156)))) (letrec ((syntmp-match-1163 (lambda (syntmp-e-1164 syntmp-p-1165 syntmp-w-1166 syntmp-r-1167) (cond ((not syntmp-r-1167) (quote #f)) ((eq? syntmp-p-1165 (quote any)) (cons (syntmp-wrap-95 syntmp-e-1164 syntmp-w-1166) syntmp-r-1167)) ((syntmp-syntax-object?-53 syntmp-e-1164) (syntmp-match*-1162 (let ((syntmp-e-1168 (syntmp-syntax-object-expression-54 syntmp-e-1164))) (if (syntmp-annotation?-42 syntmp-e-1168) (annotation-expression syntmp-e-1168) syntmp-e-1168)) syntmp-p-1165 (syntmp-join-wraps-86 syntmp-w-1166 (syntmp-syntax-object-wrap-55 syntmp-e-1164)) syntmp-r-1167)) (else (syntmp-match*-1162 (let ((syntmp-e-1169 syntmp-e-1164)) (if (syntmp-annotation?-42 syntmp-e-1169) (annotation-expression syntmp-e-1169) syntmp-e-1169)) syntmp-p-1165 syntmp-w-1166 syntmp-r-1167))))) (syntmp-match*-1162 (lambda (syntmp-e-1170 syntmp-p-1171 syntmp-w-1172 syntmp-r-1173) (cond ((null? syntmp-p-1171) (and (null? syntmp-e-1170) syntmp-r-1173)) ((pair? syntmp-p-1171) (and (pair? syntmp-e-1170) (syntmp-match-1163 (car syntmp-e-1170) (car syntmp-p-1171) syntmp-w-1172 (syntmp-match-1163 (cdr syntmp-e-1170) (cdr syntmp-p-1171) syntmp-w-1172 syntmp-r-1173)))) ((eq? syntmp-p-1171 (quote each-any)) (let ((syntmp-l-1174 (syntmp-match-each-any-1160 syntmp-e-1170 syntmp-w-1172))) (and syntmp-l-1174 (cons syntmp-l-1174 syntmp-r-1173)))) (else (let ((syntmp-t-1175 (vector-ref syntmp-p-1171 (quote 0)))) (if (memv syntmp-t-1175 (quote (each))) (if (null? syntmp-e-1170) (syntmp-match-empty-1161 (vector-ref syntmp-p-1171 (quote 1)) syntmp-r-1173) (let ((syntmp-l-1176 (syntmp-match-each-1159 syntmp-e-1170 (vector-ref syntmp-p-1171 (quote 1)) syntmp-w-1172))) (and syntmp-l-1176 (let syntmp-collect-1177 ((syntmp-l-1178 syntmp-l-1176)) (if (null? (car syntmp-l-1178)) syntmp-r-1173 (cons (map car syntmp-l-1178) (syntmp-collect-1177 (map cdr syntmp-l-1178)))))))) (if (memv syntmp-t-1175 (quote (free-id))) (and (syntmp-id?-67 syntmp-e-1170) (syntmp-free-id=?-90 (syntmp-wrap-95 syntmp-e-1170 syntmp-w-1172) (vector-ref syntmp-p-1171 (quote 1))) syntmp-r-1173) (if (memv syntmp-t-1175 (quote (atom))) (and (equal? (vector-ref syntmp-p-1171 (quote 1)) (syntmp-strip-114 syntmp-e-1170 syntmp-w-1172)) syntmp-r-1173) (if (memv syntmp-t-1175 (quote (vector))) (and (vector? syntmp-e-1170) (syntmp-match-1163 (vector->list syntmp-e-1170) (vector-ref syntmp-p-1171 (quote 1)) syntmp-w-1172 syntmp-r-1173))))))))))) (syntmp-match-empty-1161 (lambda (syntmp-p-1179 syntmp-r-1180) (cond ((null? syntmp-p-1179) syntmp-r-1180) ((eq? syntmp-p-1179 (quote any)) (cons (quote ()) syntmp-r-1180)) ((pair? syntmp-p-1179) (syntmp-match-empty-1161 (car syntmp-p-1179) (syntmp-match-empty-1161 (cdr syntmp-p-1179) syntmp-r-1180))) ((eq? syntmp-p-1179 (quote each-any)) (cons (quote ()) syntmp-r-1180)) (else (let ((syntmp-t-1181 (vector-ref syntmp-p-1179 (quote 0)))) (if (memv syntmp-t-1181 (quote (each))) (syntmp-match-empty-1161 (vector-ref syntmp-p-1179 (quote 1)) syntmp-r-1180) (if (memv syntmp-t-1181 (quote (free-id atom))) syntmp-r-1180 (if (memv syntmp-t-1181 (quote (vector))) (syntmp-match-empty-1161 (vector-ref syntmp-p-1179 (quote 1)) syntmp-r-1180))))))))) (syntmp-match-each-any-1160 (lambda (syntmp-e-1182 syntmp-w-1183) (cond ((syntmp-annotation?-42 syntmp-e-1182) (syntmp-match-each-any-1160 (annotation-expression syntmp-e-1182) syntmp-w-1183)) ((pair? syntmp-e-1182) (let ((syntmp-l-1184 (syntmp-match-each-any-1160 (cdr syntmp-e-1182) syntmp-w-1183))) (and syntmp-l-1184 (cons (syntmp-wrap-95 (car syntmp-e-1182) syntmp-w-1183) syntmp-l-1184)))) ((null? syntmp-e-1182) (quote ())) ((syntmp-syntax-object?-53 syntmp-e-1182) (syntmp-match-each-any-1160 (syntmp-syntax-object-expression-54 syntmp-e-1182) (syntmp-join-wraps-86 syntmp-w-1183 (syntmp-syntax-object-wrap-55 syntmp-e-1182)))) (else (quote #f))))) (syntmp-match-each-1159 (lambda (syntmp-e-1185 syntmp-p-1186 syntmp-w-1187) (cond ((syntmp-annotation?-42 syntmp-e-1185) (syntmp-match-each-1159 (annotation-expression syntmp-e-1185) syntmp-p-1186 syntmp-w-1187)) ((pair? syntmp-e-1185) (let ((syntmp-first-1188 (syntmp-match-1163 (car syntmp-e-1185) syntmp-p-1186 syntmp-w-1187 (quote ())))) (and syntmp-first-1188 (let ((syntmp-rest-1189 (syntmp-match-each-1159 (cdr syntmp-e-1185) syntmp-p-1186 syntmp-w-1187))) (and syntmp-rest-1189 (cons syntmp-first-1188 syntmp-rest-1189)))))) ((null? syntmp-e-1185) (quote ())) ((syntmp-syntax-object?-53 syntmp-e-1185) (syntmp-match-each-1159 (syntmp-syntax-object-expression-54 syntmp-e-1185) syntmp-p-1186 (syntmp-join-wraps-86 syntmp-w-1187 (syntmp-syntax-object-wrap-55 syntmp-e-1185)))) (else (quote #f)))))) (set! syntax-dispatch (lambda (syntmp-e-1190 syntmp-p-1191) (cond ((eq? syntmp-p-1191 (quote any)) (list syntmp-e-1190)) ((syntmp-syntax-object?-53 syntmp-e-1190) (syntmp-match*-1162 (let ((syntmp-e-1192 (syntmp-syntax-object-expression-54 syntmp-e-1190))) (if (syntmp-annotation?-42 syntmp-e-1192) (annotation-expression syntmp-e-1192) syntmp-e-1192)) syntmp-p-1191 (syntmp-syntax-object-wrap-55 syntmp-e-1190) (quote ()))) (else (syntmp-match*-1162 (let ((syntmp-e-1193 syntmp-e-1190)) (if (syntmp-annotation?-42 syntmp-e-1193) (annotation-expression syntmp-e-1193) syntmp-e-1193)) syntmp-p-1191 (quote (())) (quote ())))))))))
-(install-global-transformer (quote with-syntax) (lambda (syntmp-x-1194) ((lambda (syntmp-tmp-1195) ((lambda (syntmp-tmp-1196) (if syntmp-tmp-1196 (apply (lambda (syntmp-_-1197 syntmp-e1-1198 syntmp-e2-1199) (cons (quote #(syntax-object begin ((top) #(ribcage #(_ e1 e2) #((top) (top) (top)) #("i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) (cons syntmp-e1-1198 syntmp-e2-1199))) syntmp-tmp-1196) ((lambda (syntmp-tmp-1201) (if syntmp-tmp-1201 (apply (lambda (syntmp-_-1202 syntmp-out-1203 syntmp-in-1204 syntmp-e1-1205 syntmp-e2-1206) (list (quote #(syntax-object syntax-case ((top) #(ribcage #(_ out in e1 e2) #((top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) syntmp-in-1204 (quote ()) (list syntmp-out-1203 (cons (quote #(syntax-object begin ((top) #(ribcage #(_ out in e1 e2) #((top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) (cons syntmp-e1-1205 syntmp-e2-1206))))) syntmp-tmp-1201) ((lambda (syntmp-tmp-1208) (if syntmp-tmp-1208 (apply (lambda (syntmp-_-1209 syntmp-out-1210 syntmp-in-1211 syntmp-e1-1212 syntmp-e2-1213) (list (quote #(syntax-object syntax-case ((top) #(ribcage #(_ out in e1 e2) #((top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) (cons (quote #(syntax-object list ((top) #(ribcage #(_ out in e1 e2) #((top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) syntmp-in-1211) (quote ()) (list syntmp-out-1210 (cons (quote #(syntax-object begin ((top) #(ribcage #(_ out in e1 e2) #((top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) (cons syntmp-e1-1212 syntmp-e2-1213))))) syntmp-tmp-1208) (syntax-error syntmp-tmp-1195))) (syntax-dispatch syntmp-tmp-1195 (quote (any #(each (any any)) any . each-any)))))) (syntax-dispatch syntmp-tmp-1195 (quote (any ((any any)) any . each-any)))))) (syntax-dispatch syntmp-tmp-1195 (quote (any () any . each-any))))) syntmp-x-1194)))
-(install-global-transformer (quote syntax-rules) (lambda (syntmp-x-1217) ((lambda (syntmp-tmp-1218) ((lambda (syntmp-tmp-1219) (if syntmp-tmp-1219 (apply (lambda (syntmp-_-1220 syntmp-k-1221 syntmp-keyword-1222 syntmp-pattern-1223 syntmp-template-1224) (list (quote #(syntax-object lambda ((top) #(ribcage #(_ k keyword pattern template) #((top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) (quote (#(syntax-object x ((top) #(ribcage #(_ k keyword pattern template) #((top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i")))))) (cons (quote #(syntax-object syntax-case ((top) #(ribcage #(_ k keyword pattern template) #((top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) (cons (quote #(syntax-object x ((top) #(ribcage #(_ k keyword pattern template) #((top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) (cons syntmp-k-1221 (map (lambda (syntmp-tmp-1227 syntmp-tmp-1226) (list (cons (quote #(syntax-object dummy ((top) #(ribcage #(_ k keyword pattern template) #((top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) syntmp-tmp-1226) (list (quote #(syntax-object syntax ((top) #(ribcage #(_ k keyword pattern template) #((top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) syntmp-tmp-1227))) syntmp-template-1224 syntmp-pattern-1223)))))) syntmp-tmp-1219) (syntax-error syntmp-tmp-1218))) (syntax-dispatch syntmp-tmp-1218 (quote (any each-any . #(each ((any . any) any))))))) syntmp-x-1217)))
-(install-global-transformer (quote let*) (lambda (syntmp-x-1228) ((lambda (syntmp-tmp-1229) ((lambda (syntmp-tmp-1230) (if (if syntmp-tmp-1230 (apply (lambda (syntmp-let*-1231 syntmp-x-1232 syntmp-v-1233 syntmp-e1-1234 syntmp-e2-1235) (andmap identifier? syntmp-x-1232)) syntmp-tmp-1230) (quote #f)) (apply (lambda (syntmp-let*-1237 syntmp-x-1238 syntmp-v-1239 syntmp-e1-1240 syntmp-e2-1241) (let syntmp-f-1242 ((syntmp-bindings-1243 (map list syntmp-x-1238 syntmp-v-1239))) (if (null? syntmp-bindings-1243) (cons (quote #(syntax-object let ((top) #(ribcage () () ()) #(ribcage #(f bindings) #((top) (top)) #("i" "i")) #(ribcage #(let* x v e1 e2) #((top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) (cons (quote ()) (cons syntmp-e1-1240 syntmp-e2-1241))) ((lambda (syntmp-tmp-1247) ((lambda (syntmp-tmp-1248) (if syntmp-tmp-1248 (apply (lambda (syntmp-body-1249 syntmp-binding-1250) (list (quote #(syntax-object let ((top) #(ribcage #(body binding) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage #(f bindings) #((top) (top)) #("i" "i")) #(ribcage #(let* x v e1 e2) #((top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) (list syntmp-binding-1250) syntmp-body-1249)) syntmp-tmp-1248) (syntax-error syntmp-tmp-1247))) (syntax-dispatch syntmp-tmp-1247 (quote (any any))))) (list (syntmp-f-1242 (cdr syntmp-bindings-1243)) (car syntmp-bindings-1243)))))) syntmp-tmp-1230) (syntax-error syntmp-tmp-1229))) (syntax-dispatch syntmp-tmp-1229 (quote (any #(each (any any)) any . each-any))))) syntmp-x-1228)))
-(install-global-transformer (quote do) (lambda (syntmp-orig-x-1251) ((lambda (syntmp-tmp-1252) ((lambda (syntmp-tmp-1253) (if syntmp-tmp-1253 (apply (lambda (syntmp-_-1254 syntmp-var-1255 syntmp-init-1256 syntmp-step-1257 syntmp-e0-1258 syntmp-e1-1259 syntmp-c-1260) ((lambda (syntmp-tmp-1261) ((lambda (syntmp-tmp-1262) (if syntmp-tmp-1262 (apply (lambda (syntmp-step-1263) ((lambda (syntmp-tmp-1264) ((lambda (syntmp-tmp-1265) (if syntmp-tmp-1265 (apply (lambda () (list (quote #(syntax-object let ((top) #(ribcage #(step) #((top)) #("i")) #(ribcage #(_ var init step e0 e1 c) #((top) (top) (top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(orig-x) #((top)) #("i"))))) (quote #(syntax-object doloop ((top) #(ribcage #(step) #((top)) #("i")) #(ribcage #(_ var init step e0 e1 c) #((top) (top) (top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(orig-x) #((top)) #("i"))))) (map list syntmp-var-1255 syntmp-init-1256) (list (quote #(syntax-object if ((top) #(ribcage #(step) #((top)) #("i")) #(ribcage #(_ var init step e0 e1 c) #((top) (top) (top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(orig-x) #((top)) #("i"))))) (list (quote #(syntax-object not ((top) #(ribcage #(step) #((top)) #("i")) #(ribcage #(_ var init step e0 e1 c) #((top) (top) (top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(orig-x) #((top)) #("i"))))) syntmp-e0-1258) (cons (quote #(syntax-object begin ((top) #(ribcage #(step) #((top)) #("i")) #(ribcage #(_ var init step e0 e1 c) #((top) (top) (top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(orig-x) #((top)) #("i"))))) (append syntmp-c-1260 (list (cons (quote #(syntax-object doloop ((top) #(ribcage #(step) #((top)) #("i")) #(ribcage #(_ var init step e0 e1 c) #((top) (top) (top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(orig-x) #((top)) #("i"))))) syntmp-step-1263))))))) syntmp-tmp-1265) ((lambda (syntmp-tmp-1270) (if syntmp-tmp-1270 (apply (lambda (syntmp-e1-1271 syntmp-e2-1272) (list (quote #(syntax-object let ((top) #(ribcage #(e1 e2) #((top) (top)) #("i" "i")) #(ribcage #(step) #((top)) #("i")) #(ribcage #(_ var init step e0 e1 c) #((top) (top) (top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(orig-x) #((top)) #("i"))))) (quote #(syntax-object doloop ((top) #(ribcage #(e1 e2) #((top) (top)) #("i" "i")) #(ribcage #(step) #((top)) #("i")) #(ribcage #(_ var init step e0 e1 c) #((top) (top) (top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(orig-x) #((top)) #("i"))))) (map list syntmp-var-1255 syntmp-init-1256) (list (quote #(syntax-object if ((top) #(ribcage #(e1 e2) #((top) (top)) #("i" "i")) #(ribcage #(step) #((top)) #("i")) #(ribcage #(_ var init step e0 e1 c) #((top) (top) (top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(orig-x) #((top)) #("i"))))) syntmp-e0-1258 (cons (quote #(syntax-object begin ((top) #(ribcage #(e1 e2) #((top) (top)) #("i" "i")) #(ribcage #(step) #((top)) #("i")) #(ribcage #(_ var init step e0 e1 c) #((top) (top) (top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(orig-x) #((top)) #("i"))))) (cons syntmp-e1-1271 syntmp-e2-1272)) (cons (quote #(syntax-object begin ((top) #(ribcage #(e1 e2) #((top) (top)) #("i" "i")) #(ribcage #(step) #((top)) #("i")) #(ribcage #(_ var init step e0 e1 c) #((top) (top) (top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(orig-x) #((top)) #("i"))))) (append syntmp-c-1260 (list (cons (quote #(syntax-object doloop ((top) #(ribcage #(e1 e2) #((top) (top)) #("i" "i")) #(ribcage #(step) #((top)) #("i")) #(ribcage #(_ var init step e0 e1 c) #((top) (top) (top) (top) (top) (top) (top)) #("i" "i" "i" "i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(orig-x) #((top)) #("i"))))) syntmp-step-1263))))))) syntmp-tmp-1270) (syntax-error syntmp-tmp-1264))) (syntax-dispatch syntmp-tmp-1264 (quote (any . each-any)))))) (syntax-dispatch syntmp-tmp-1264 (quote ())))) syntmp-e1-1259)) syntmp-tmp-1262) (syntax-error syntmp-tmp-1261))) (syntax-dispatch syntmp-tmp-1261 (quote each-any)))) (map (lambda (syntmp-v-1279 syntmp-s-1280) ((lambda (syntmp-tmp-1281) ((lambda (syntmp-tmp-1282) (if syntmp-tmp-1282 (apply (lambda () syntmp-v-1279) syntmp-tmp-1282) ((lambda (syntmp-tmp-1283) (if syntmp-tmp-1283 (apply (lambda (syntmp-e-1284) syntmp-e-1284) syntmp-tmp-1283) ((lambda (syntmp-_-1285) (syntax-error syntmp-orig-x-1251)) syntmp-tmp-1281))) (syntax-dispatch syntmp-tmp-1281 (quote (any)))))) (syntax-dispatch syntmp-tmp-1281 (quote ())))) syntmp-s-1280)) syntmp-var-1255 syntmp-step-1257))) syntmp-tmp-1253) (syntax-error syntmp-tmp-1252))) (syntax-dispatch syntmp-tmp-1252 (quote (any #(each (any any . any)) (any . each-any) . each-any))))) syntmp-orig-x-1251)))
-(install-global-transformer (quote quasiquote) (letrec ((syntmp-quasicons-1288 (lambda (syntmp-x-1292 syntmp-y-1293) ((lambda (syntmp-tmp-1294) ((lambda (syntmp-tmp-1295) (if syntmp-tmp-1295 (apply (lambda (syntmp-x-1296 syntmp-y-1297) ((lambda (syntmp-tmp-1298) ((lambda (syntmp-tmp-1299) (if syntmp-tmp-1299 (apply (lambda (syntmp-dy-1300) ((lambda (syntmp-tmp-1301) ((lambda (syntmp-tmp-1302) (if syntmp-tmp-1302 (apply (lambda (syntmp-dx-1303) (list (quote #(syntax-object quote ((top) #(ribcage #(dx) #((top)) #("i")) #(ribcage #(dy) #((top)) #("i")) #(ribcage #(x y) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage #(x y) #((top) (top)) #("i" "i")) #(ribcage #(quasicons quasiappend quasivector quasi) #((top) (top) (top) (top)) #("i" "i" "i" "i"))))) (cons syntmp-dx-1303 syntmp-dy-1300))) syntmp-tmp-1302) ((lambda (syntmp-_-1304) (if (null? syntmp-dy-1300) (list (quote #(syntax-object list ((top) #(ribcage #(_) #((top)) #("i")) #(ribcage #(dy) #((top)) #("i")) #(ribcage #(x y) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage #(x y) #((top) (top)) #("i" "i")) #(ribcage #(quasicons quasiappend quasivector quasi) #((top) (top) (top) (top)) #("i" "i" "i" "i"))))) syntmp-x-1296) (list (quote #(syntax-object cons ((top) #(ribcage #(_) #((top)) #("i")) #(ribcage #(dy) #((top)) #("i")) #(ribcage #(x y) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage #(x y) #((top) (top)) #("i" "i")) #(ribcage #(quasicons quasiappend quasivector quasi) #((top) (top) (top) (top)) #("i" "i" "i" "i"))))) syntmp-x-1296 syntmp-y-1297))) syntmp-tmp-1301))) (syntax-dispatch syntmp-tmp-1301 (quote (#(free-id #(syntax-object quote ((top) #(ribcage #(dy) #((top)) #("i")) #(ribcage #(x y) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage #(x y) #((top) (top)) #("i" "i")) #(ribcage #(quasicons quasiappend quasivector quasi) #((top) (top) (top) (top)) #("i" "i" "i" "i"))))) any))))) syntmp-x-1296)) syntmp-tmp-1299) ((lambda (syntmp-tmp-1305) (if syntmp-tmp-1305 (apply (lambda (syntmp-stuff-1306) (cons (quote #(syntax-object list ((top) #(ribcage #(stuff) #((top)) #("i")) #(ribcage #(x y) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage #(x y) #((top) (top)) #("i" "i")) #(ribcage #(quasicons quasiappend quasivector quasi) #((top) (top) (top) (top)) #("i" "i" "i" "i"))))) (cons syntmp-x-1296 syntmp-stuff-1306))) syntmp-tmp-1305) ((lambda (syntmp-else-1307) (list (quote #(syntax-object cons ((top) #(ribcage #(else) #((top)) #("i")) #(ribcage #(x y) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage #(x y) #((top) (top)) #("i" "i")) #(ribcage #(quasicons quasiappend quasivector quasi) #((top) (top) (top) (top)) #("i" "i" "i" "i"))))) syntmp-x-1296 syntmp-y-1297)) syntmp-tmp-1298))) (syntax-dispatch syntmp-tmp-1298 (quote (#(free-id #(syntax-object list ((top) #(ribcage #(x y) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage #(x y) #((top) (top)) #("i" "i")) #(ribcage #(quasicons quasiappend quasivector quasi) #((top) (top) (top) (top)) #("i" "i" "i" "i"))))) . any)))))) (syntax-dispatch syntmp-tmp-1298 (quote (#(free-id #(syntax-object quote ((top) #(ribcage #(x y) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage #(x y) #((top) (top)) #("i" "i")) #(ribcage #(quasicons quasiappend quasivector quasi) #((top) (top) (top) (top)) #("i" "i" "i" "i"))))) any))))) syntmp-y-1297)) syntmp-tmp-1295) (syntax-error syntmp-tmp-1294))) (syntax-dispatch syntmp-tmp-1294 (quote (any any))))) (list syntmp-x-1292 syntmp-y-1293)))) (syntmp-quasiappend-1289 (lambda (syntmp-x-1308 syntmp-y-1309) ((lambda (syntmp-tmp-1310) ((lambda (syntmp-tmp-1311) (if syntmp-tmp-1311 (apply (lambda (syntmp-x-1312 syntmp-y-1313) ((lambda (syntmp-tmp-1314) ((lambda (syntmp-tmp-1315) (if syntmp-tmp-1315 (apply (lambda () syntmp-x-1312) syntmp-tmp-1315) ((lambda (syntmp-_-1316) (list (quote #(syntax-object append ((top) #(ribcage #(_) #((top)) #("i")) #(ribcage #(x y) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage #(x y) #((top) (top)) #("i" "i")) #(ribcage #(quasicons quasiappend quasivector quasi) #((top) (top) (top) (top)) #("i" "i" "i" "i"))))) syntmp-x-1312 syntmp-y-1313)) syntmp-tmp-1314))) (syntax-dispatch syntmp-tmp-1314 (quote (#(free-id #(syntax-object quote ((top) #(ribcage #(x y) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage #(x y) #((top) (top)) #("i" "i")) #(ribcage #(quasicons quasiappend quasivector quasi) #((top) (top) (top) (top)) #("i" "i" "i" "i"))))) ()))))) syntmp-y-1313)) syntmp-tmp-1311) (syntax-error syntmp-tmp-1310))) (syntax-dispatch syntmp-tmp-1310 (quote (any any))))) (list syntmp-x-1308 syntmp-y-1309)))) (syntmp-quasivector-1290 (lambda (syntmp-x-1317) ((lambda (syntmp-tmp-1318) ((lambda (syntmp-x-1319) ((lambda (syntmp-tmp-1320) ((lambda (syntmp-tmp-1321) (if syntmp-tmp-1321 (apply (lambda (syntmp-x-1322) (list (quote #(syntax-object quote ((top) #(ribcage #(x) #((top)) #("i")) #(ribcage #(x) #((top)) #("i")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i")) #(ribcage #(quasicons quasiappend quasivector quasi) #((top) (top) (top) (top)) #("i" "i" "i" "i"))))) (list->vector syntmp-x-1322))) syntmp-tmp-1321) ((lambda (syntmp-tmp-1324) (if syntmp-tmp-1324 (apply (lambda (syntmp-x-1325) (cons (quote #(syntax-object vector ((top) #(ribcage #(x) #((top)) #("i")) #(ribcage #(x) #((top)) #("i")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i")) #(ribcage #(quasicons quasiappend quasivector quasi) #((top) (top) (top) (top)) #("i" "i" "i" "i"))))) syntmp-x-1325)) syntmp-tmp-1324) ((lambda (syntmp-_-1327) (list (quote #(syntax-object list->vector ((top) #(ribcage #(_) #((top)) #("i")) #(ribcage #(x) #((top)) #("i")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i")) #(ribcage #(quasicons quasiappend quasivector quasi) #((top) (top) (top) (top)) #("i" "i" "i" "i"))))) syntmp-x-1319)) syntmp-tmp-1320))) (syntax-dispatch syntmp-tmp-1320 (quote (#(free-id #(syntax-object list ((top) #(ribcage #(x) #((top)) #("i")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i")) #(ribcage #(quasicons quasiappend quasivector quasi) #((top) (top) (top) (top)) #("i" "i" "i" "i"))))) . each-any)))))) (syntax-dispatch syntmp-tmp-1320 (quote (#(free-id #(syntax-object quote ((top) #(ribcage #(x) #((top)) #("i")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i")) #(ribcage #(quasicons quasiappend quasivector quasi) #((top) (top) (top) (top)) #("i" "i" "i" "i"))))) each-any))))) syntmp-x-1319)) syntmp-tmp-1318)) syntmp-x-1317))) (syntmp-quasi-1291 (lambda (syntmp-p-1328 syntmp-lev-1329) ((lambda (syntmp-tmp-1330) ((lambda (syntmp-tmp-1331) (if syntmp-tmp-1331 (apply (lambda (syntmp-p-1332) (if (= syntmp-lev-1329 (quote 0)) syntmp-p-1332 (syntmp-quasicons-1288 (quote (#(syntax-object quote ((top) #(ribcage #(p) #((top)) #("i")) #(ribcage () () ()) #(ribcage #(p lev) #((top) (top)) #("i" "i")) #(ribcage #(quasicons quasiappend quasivector quasi) #((top) (top) (top) (top)) #("i" "i" "i" "i")))) #(syntax-object unquote ((top) #(ribcage #(p) #((top)) #("i")) #(ribcage () () ()) #(ribcage #(p lev) #((top) (top)) #("i" "i")) #(ribcage #(quasicons quasiappend quasivector quasi) #((top) (top) (top) (top)) #("i" "i" "i" "i")))))) (syntmp-quasi-1291 (list syntmp-p-1332) (- syntmp-lev-1329 (quote 1)))))) syntmp-tmp-1331) ((lambda (syntmp-tmp-1333) (if syntmp-tmp-1333 (apply (lambda (syntmp-p-1334 syntmp-q-1335) (if (= syntmp-lev-1329 (quote 0)) (syntmp-quasiappend-1289 syntmp-p-1334 (syntmp-quasi-1291 syntmp-q-1335 syntmp-lev-1329)) (syntmp-quasicons-1288 (syntmp-quasicons-1288 (quote (#(syntax-object quote ((top) #(ribcage #(p q) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage #(p lev) #((top) (top)) #("i" "i")) #(ribcage #(quasicons quasiappend quasivector quasi) #((top) (top) (top) (top)) #("i" "i" "i" "i")))) #(syntax-object unquote-splicing ((top) #(ribcage #(p q) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage #(p lev) #((top) (top)) #("i" "i")) #(ribcage #(quasicons quasiappend quasivector quasi) #((top) (top) (top) (top)) #("i" "i" "i" "i")))))) (syntmp-quasi-1291 (list syntmp-p-1334) (- syntmp-lev-1329 (quote 1)))) (syntmp-quasi-1291 syntmp-q-1335 syntmp-lev-1329)))) syntmp-tmp-1333) ((lambda (syntmp-tmp-1336) (if syntmp-tmp-1336 (apply (lambda (syntmp-p-1337) (syntmp-quasicons-1288 (quote (#(syntax-object quote ((top) #(ribcage #(p) #((top)) #("i")) #(ribcage () () ()) #(ribcage #(p lev) #((top) (top)) #("i" "i")) #(ribcage #(quasicons quasiappend quasivector quasi) #((top) (top) (top) (top)) #("i" "i" "i" "i")))) #(syntax-object quasiquote ((top) #(ribcage #(p) #((top)) #("i")) #(ribcage () () ()) #(ribcage #(p lev) #((top) (top)) #("i" "i")) #(ribcage #(quasicons quasiappend quasivector quasi) #((top) (top) (top) (top)) #("i" "i" "i" "i")))))) (syntmp-quasi-1291 (list syntmp-p-1337) (+ syntmp-lev-1329 (quote 1))))) syntmp-tmp-1336) ((lambda (syntmp-tmp-1338) (if syntmp-tmp-1338 (apply (lambda (syntmp-p-1339 syntmp-q-1340) (syntmp-quasicons-1288 (syntmp-quasi-1291 syntmp-p-1339 syntmp-lev-1329) (syntmp-quasi-1291 syntmp-q-1340 syntmp-lev-1329))) syntmp-tmp-1338) ((lambda (syntmp-tmp-1341) (if syntmp-tmp-1341 (apply (lambda (syntmp-x-1342) (syntmp-quasivector-1290 (syntmp-quasi-1291 syntmp-x-1342 syntmp-lev-1329))) syntmp-tmp-1341) ((lambda (syntmp-p-1344) (list (quote #(syntax-object quote ((top) #(ribcage #(p) #((top)) #("i")) #(ribcage () () ()) #(ribcage #(p lev) #((top) (top)) #("i" "i")) #(ribcage #(quasicons quasiappend quasivector quasi) #((top) (top) (top) (top)) #("i" "i" "i" "i"))))) syntmp-p-1344)) syntmp-tmp-1330))) (syntax-dispatch syntmp-tmp-1330 (quote #(vector each-any)))))) (syntax-dispatch syntmp-tmp-1330 (quote (any . any)))))) (syntax-dispatch syntmp-tmp-1330 (quote (#(free-id #(syntax-object quasiquote ((top) #(ribcage () () ()) #(ribcage #(p lev) #((top) (top)) #("i" "i")) #(ribcage #(quasicons quasiappend quasivector quasi) #((top) (top) (top) (top)) #("i" "i" "i" "i"))))) any)))))) (syntax-dispatch syntmp-tmp-1330 (quote ((#(free-id #(syntax-object unquote-splicing ((top) #(ribcage () () ()) #(ribcage #(p lev) #((top) (top)) #("i" "i")) #(ribcage #(quasicons quasiappend quasivector quasi) #((top) (top) (top) (top)) #("i" "i" "i" "i"))))) any) . any)))))) (syntax-dispatch syntmp-tmp-1330 (quote (#(free-id #(syntax-object unquote ((top) #(ribcage () () ()) #(ribcage #(p lev) #((top) (top)) #("i" "i")) #(ribcage #(quasicons quasiappend quasivector quasi) #((top) (top) (top) (top)) #("i" "i" "i" "i"))))) any))))) syntmp-p-1328)))) (lambda (syntmp-x-1345) ((lambda (syntmp-tmp-1346) ((lambda (syntmp-tmp-1347) (if syntmp-tmp-1347 (apply (lambda (syntmp-_-1348 syntmp-e-1349) (syntmp-quasi-1291 syntmp-e-1349 (quote 0))) syntmp-tmp-1347) (syntax-error syntmp-tmp-1346))) (syntax-dispatch syntmp-tmp-1346 (quote (any any))))) syntmp-x-1345))))
-(install-global-transformer (quote include) (lambda (syntmp-x-1350) (letrec ((syntmp-read-file-1351 (lambda (syntmp-fn-1352 syntmp-k-1353) (let ((syntmp-p-1354 (open-input-file syntmp-fn-1352))) (let syntmp-f-1355 ((syntmp-x-1356 (read syntmp-p-1354))) (if (eof-object? syntmp-x-1356) (begin (close-input-port syntmp-p-1354) (quote ())) (cons (datum->syntax-object syntmp-k-1353 syntmp-x-1356) (syntmp-f-1355 (read syntmp-p-1354))))))))) ((lambda (syntmp-tmp-1357) ((lambda (syntmp-tmp-1358) (if syntmp-tmp-1358 (apply (lambda (syntmp-k-1359 syntmp-filename-1360) (let ((syntmp-fn-1361 (syntax-object->datum syntmp-filename-1360))) ((lambda (syntmp-tmp-1362) ((lambda (syntmp-tmp-1363) (if syntmp-tmp-1363 (apply (lambda (syntmp-exp-1364) (cons (quote #(syntax-object begin ((top) #(ribcage #(exp) #((top)) #("i")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage #(fn) #((top)) #("i")) #(ribcage #(k filename) #((top) (top)) #("i" "i")) #(ribcage (read-file) ((top)) ("i")) #(ribcage #(x) #((top)) #("i"))))) syntmp-exp-1364)) syntmp-tmp-1363) (syntax-error syntmp-tmp-1362))) (syntax-dispatch syntmp-tmp-1362 (quote each-any)))) (syntmp-read-file-1351 syntmp-fn-1361 syntmp-k-1359)))) syntmp-tmp-1358) (syntax-error syntmp-tmp-1357))) (syntax-dispatch syntmp-tmp-1357 (quote (any any))))) syntmp-x-1350))))
-(install-global-transformer (quote unquote) (lambda (syntmp-x-1366) ((lambda (syntmp-tmp-1367) ((lambda (syntmp-tmp-1368) (if syntmp-tmp-1368 (apply (lambda (syntmp-_-1369 syntmp-e-1370) (error (quote unquote) (quote "expression ,~s not valid outside of quasiquote") (syntax-object->datum syntmp-e-1370))) syntmp-tmp-1368) (syntax-error syntmp-tmp-1367))) (syntax-dispatch syntmp-tmp-1367 (quote (any any))))) syntmp-x-1366)))
-(install-global-transformer (quote unquote-splicing) (lambda (syntmp-x-1371) ((lambda (syntmp-tmp-1372) ((lambda (syntmp-tmp-1373) (if syntmp-tmp-1373 (apply (lambda (syntmp-_-1374 syntmp-e-1375) (error (quote unquote-splicing) (quote "expression ,@~s not valid outside of quasiquote") (syntax-object->datum syntmp-e-1375))) syntmp-tmp-1373) (syntax-error syntmp-tmp-1372))) (syntax-dispatch syntmp-tmp-1372 (quote (any any))))) syntmp-x-1371)))
-(install-global-transformer (quote case) (lambda (syntmp-x-1376) ((lambda (syntmp-tmp-1377) ((lambda (syntmp-tmp-1378) (if syntmp-tmp-1378 (apply (lambda (syntmp-_-1379 syntmp-e-1380 syntmp-m1-1381 syntmp-m2-1382) ((lambda (syntmp-tmp-1383) ((lambda (syntmp-body-1384) (list (quote #(syntax-object let ((top) #(ribcage #(body) #((top)) #("i")) #(ribcage #(_ e m1 m2) #((top) (top) (top) (top)) #("i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) (list (list (quote #(syntax-object t ((top) #(ribcage #(body) #((top)) #("i")) #(ribcage #(_ e m1 m2) #((top) (top) (top) (top)) #("i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) syntmp-e-1380)) syntmp-body-1384)) syntmp-tmp-1383)) (let syntmp-f-1385 ((syntmp-clause-1386 syntmp-m1-1381) (syntmp-clauses-1387 syntmp-m2-1382)) (if (null? syntmp-clauses-1387) ((lambda (syntmp-tmp-1389) ((lambda (syntmp-tmp-1390) (if syntmp-tmp-1390 (apply (lambda (syntmp-e1-1391 syntmp-e2-1392) (cons (quote #(syntax-object begin ((top) #(ribcage #(e1 e2) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage #(f clause clauses) #((top) (top) (top)) #("i" "i" "i")) #(ribcage #(_ e m1 m2) #((top) (top) (top) (top)) #("i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) (cons syntmp-e1-1391 syntmp-e2-1392))) syntmp-tmp-1390) ((lambda (syntmp-tmp-1394) (if syntmp-tmp-1394 (apply (lambda (syntmp-k-1395 syntmp-e1-1396 syntmp-e2-1397) (list (quote #(syntax-object if ((top) #(ribcage #(k e1 e2) #((top) (top) (top)) #("i" "i" "i")) #(ribcage () () ()) #(ribcage #(f clause clauses) #((top) (top) (top)) #("i" "i" "i")) #(ribcage #(_ e m1 m2) #((top) (top) (top) (top)) #("i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) (list (quote #(syntax-object memv ((top) #(ribcage #(k e1 e2) #((top) (top) (top)) #("i" "i" "i")) #(ribcage () () ()) #(ribcage #(f clause clauses) #((top) (top) (top)) #("i" "i" "i")) #(ribcage #(_ e m1 m2) #((top) (top) (top) (top)) #("i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) (quote #(syntax-object t ((top) #(ribcage #(k e1 e2) #((top) (top) (top)) #("i" "i" "i")) #(ribcage () () ()) #(ribcage #(f clause clauses) #((top) (top) (top)) #("i" "i" "i")) #(ribcage #(_ e m1 m2) #((top) (top) (top) (top)) #("i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) (list (quote #(syntax-object quote ((top) #(ribcage #(k e1 e2) #((top) (top) (top)) #("i" "i" "i")) #(ribcage () () ()) #(ribcage #(f clause clauses) #((top) (top) (top)) #("i" "i" "i")) #(ribcage #(_ e m1 m2) #((top) (top) (top) (top)) #("i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) syntmp-k-1395)) (cons (quote #(syntax-object begin ((top) #(ribcage #(k e1 e2) #((top) (top) (top)) #("i" "i" "i")) #(ribcage () () ()) #(ribcage #(f clause clauses) #((top) (top) (top)) #("i" "i" "i")) #(ribcage #(_ e m1 m2) #((top) (top) (top) (top)) #("i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) (cons syntmp-e1-1396 syntmp-e2-1397)))) syntmp-tmp-1394) ((lambda (syntmp-_-1400) (syntax-error syntmp-x-1376)) syntmp-tmp-1389))) (syntax-dispatch syntmp-tmp-1389 (quote (each-any any . each-any)))))) (syntax-dispatch syntmp-tmp-1389 (quote (#(free-id #(syntax-object else ((top) #(ribcage () () ()) #(ribcage #(f clause clauses) #((top) (top) (top)) #("i" "i" "i")) #(ribcage #(_ e m1 m2) #((top) (top) (top) (top)) #("i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) any . each-any))))) syntmp-clause-1386) ((lambda (syntmp-tmp-1401) ((lambda (syntmp-rest-1402) ((lambda (syntmp-tmp-1403) ((lambda (syntmp-tmp-1404) (if syntmp-tmp-1404 (apply (lambda (syntmp-k-1405 syntmp-e1-1406 syntmp-e2-1407) (list (quote #(syntax-object if ((top) #(ribcage #(k e1 e2) #((top) (top) (top)) #("i" "i" "i")) #(ribcage #(rest) #((top)) #("i")) #(ribcage () () ()) #(ribcage #(f clause clauses) #((top) (top) (top)) #("i" "i" "i")) #(ribcage #(_ e m1 m2) #((top) (top) (top) (top)) #("i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) (list (quote #(syntax-object memv ((top) #(ribcage #(k e1 e2) #((top) (top) (top)) #("i" "i" "i")) #(ribcage #(rest) #((top)) #("i")) #(ribcage () () ()) #(ribcage #(f clause clauses) #((top) (top) (top)) #("i" "i" "i")) #(ribcage #(_ e m1 m2) #((top) (top) (top) (top)) #("i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) (quote #(syntax-object t ((top) #(ribcage #(k e1 e2) #((top) (top) (top)) #("i" "i" "i")) #(ribcage #(rest) #((top)) #("i")) #(ribcage () () ()) #(ribcage #(f clause clauses) #((top) (top) (top)) #("i" "i" "i")) #(ribcage #(_ e m1 m2) #((top) (top) (top) (top)) #("i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) (list (quote #(syntax-object quote ((top) #(ribcage #(k e1 e2) #((top) (top) (top)) #("i" "i" "i")) #(ribcage #(rest) #((top)) #("i")) #(ribcage () () ()) #(ribcage #(f clause clauses) #((top) (top) (top)) #("i" "i" "i")) #(ribcage #(_ e m1 m2) #((top) (top) (top) (top)) #("i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) syntmp-k-1405)) (cons (quote #(syntax-object begin ((top) #(ribcage #(k e1 e2) #((top) (top) (top)) #("i" "i" "i")) #(ribcage #(rest) #((top)) #("i")) #(ribcage () () ()) #(ribcage #(f clause clauses) #((top) (top) (top)) #("i" "i" "i")) #(ribcage #(_ e m1 m2) #((top) (top) (top) (top)) #("i" "i" "i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) (cons syntmp-e1-1406 syntmp-e2-1407)) syntmp-rest-1402)) syntmp-tmp-1404) ((lambda (syntmp-_-1410) (syntax-error syntmp-x-1376)) syntmp-tmp-1403))) (syntax-dispatch syntmp-tmp-1403 (quote (each-any any . each-any))))) syntmp-clause-1386)) syntmp-tmp-1401)) (syntmp-f-1385 (car syntmp-clauses-1387) (cdr syntmp-clauses-1387))))))) syntmp-tmp-1378) (syntax-error syntmp-tmp-1377))) (syntax-dispatch syntmp-tmp-1377 (quote (any any any . each-any))))) syntmp-x-1376)))
-(install-global-transformer (quote identifier-syntax) (lambda (syntmp-x-1411) ((lambda (syntmp-tmp-1412) ((lambda (syntmp-tmp-1413) (if syntmp-tmp-1413 (apply (lambda (syntmp-_-1414 syntmp-e-1415) (list (quote #(syntax-object lambda ((top) #(ribcage #(_ e) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) (quote (#(syntax-object x ((top) #(ribcage #(_ e) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i")))))) (list (quote #(syntax-object syntax-case ((top) #(ribcage #(_ e) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) (quote #(syntax-object x ((top) #(ribcage #(_ e) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) (quote ()) (list (quote #(syntax-object id ((top) #(ribcage #(_ e) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) (quote (#(syntax-object identifier? ((top) #(ribcage #(_ e) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i")))) (#(syntax-object syntax ((top) #(ribcage #(_ e) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i")))) #(syntax-object id ((top) #(ribcage #(_ e) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))))) (list (quote #(syntax-object syntax ((top) #(ribcage #(_ e) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) syntmp-e-1415)) (list (cons syntmp-_-1414 (quote (#(syntax-object x ((top) #(ribcage #(_ e) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i")))) #(syntax-object ... ((top) #(ribcage #(_ e) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))))) (list (quote #(syntax-object syntax ((top) #(ribcage #(_ e) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i"))))) (cons syntmp-e-1415 (quote (#(syntax-object x ((top) #(ribcage #(_ e) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i")))) #(syntax-object ... ((top) #(ribcage #(_ e) #((top) (top)) #("i" "i")) #(ribcage () () ()) #(ribcage #(x) #((top)) #("i")))))))))))) syntmp-tmp-1413) (syntax-error syntmp-tmp-1412))) (syntax-dispatch syntmp-tmp-1412 (quote (any any))))) syntmp-x-1411)))
diff --git a/ice-9/psyntax.ss b/ice-9/psyntax.ss
deleted file mode 100644
index 27b23b342..000000000
--- a/ice-9/psyntax.ss
+++ /dev/null
@@ -1,2232 +0,0 @@
-;;;; -*-scheme-*-
-;;;;
-;;;; Copyright (C) 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-
-;;; Portable implementation of syntax-case
-;;; Extracted from Chez Scheme Version 5.9f
-;;; Authors: R. Kent Dybvig, Oscar Waddell, Bob Hieb, Carl Bruggeman
-
-;;; Modified by Mikael Djurfeldt <djurfeldt@nada.kth.se> according
-;;; to the ChangeLog distributed in the same directory as this file:
-;;; 1997-08-19, 1997-09-03, 1997-09-10, 2000-08-13, 2000-08-24,
-;;; 2000-09-12, 2001-03-08
-
-;;; Copyright (c) 1992-1997 Cadence Research Systems
-;;; Permission to copy this software, in whole or in part, to use this
-;;; software for any lawful purpose, and to redistribute this software
-;;; is granted subject to the restriction that all copies made of this
-;;; software must include this copyright notice in full. This software
-;;; is provided AS IS, with NO WARRANTY, EITHER EXPRESS OR IMPLIED,
-;;; INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY
-;;; OR FITNESS FOR ANY PARTICULAR PURPOSE. IN NO EVENT SHALL THE
-;;; AUTHORS BE LIABLE FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES OF ANY
-;;; NATURE WHATSOEVER.
-
-;;; Before attempting to port this code to a new implementation of
-;;; Scheme, please read the notes below carefully.
-
-
-;;; This file defines the syntax-case expander, sc-expand, and a set
-;;; of associated syntactic forms and procedures. Of these, the
-;;; following are documented in The Scheme Programming Language,
-;;; Second Edition (R. Kent Dybvig, Prentice Hall, 1996). Most are
-;;; also documented in the R4RS and draft R5RS.
-;;;
-;;; bound-identifier=?
-;;; datum->syntax-object
-;;; define-syntax
-;;; fluid-let-syntax
-;;; free-identifier=?
-;;; generate-temporaries
-;;; identifier?
-;;; identifier-syntax
-;;; let-syntax
-;;; letrec-syntax
-;;; syntax
-;;; syntax-case
-;;; syntax-object->datum
-;;; syntax-rules
-;;; with-syntax
-;;;
-;;; All standard Scheme syntactic forms are supported by the expander
-;;; or syntactic abstractions defined in this file. Only the R4RS
-;;; delay is omitted, since its expansion is implementation-dependent.
-
-;;; The remaining exports are listed below:
-;;;
-;;; (sc-expand datum)
-;;; if datum represents a valid expression, sc-expand returns an
-;;; expanded version of datum in a core language that includes no
-;;; syntactic abstractions. The core language includes begin,
-;;; define, if, lambda, letrec, quote, and set!.
-;;; (eval-when situations expr ...)
-;;; conditionally evaluates expr ... at compile-time or run-time
-;;; depending upon situations (see the Chez Scheme System Manual,
-;;; Revision 3, for a complete description)
-;;; (syntax-error object message)
-;;; used to report errors found during expansion
-;;; (install-global-transformer symbol value)
-;;; used by expanded code to install top-level syntactic abstractions
-;;; (syntax-dispatch e p)
-;;; used by expanded code to handle syntax-case matching
-
-;;; The following nonstandard procedures must be provided by the
-;;; implementation for this code to run.
-;;;
-;;; (void)
-;;; returns the implementation's cannonical "unspecified value". This
-;;; usually works: (define void (lambda () (if #f #f))).
-;;;
-;;; (andmap proc list1 list2 ...)
-;;; returns true if proc returns true when applied to each element of list1
-;;; along with the corresponding elements of list2 ....
-;;; The following definition works but does no error checking:
-;;;
-;;; (define andmap
-;;; (lambda (f first . rest)
-;;; (or (null? first)
-;;; (if (null? rest)
-;;; (let andmap ((first first))
-;;; (let ((x (car first)) (first (cdr first)))
-;;; (if (null? first)
-;;; (f x)
-;;; (and (f x) (andmap first)))))
-;;; (let andmap ((first first) (rest rest))
-;;; (let ((x (car first))
-;;; (xr (map car rest))
-;;; (first (cdr first))
-;;; (rest (map cdr rest)))
-;;; (if (null? first)
-;;; (apply f (cons x xr))
-;;; (and (apply f (cons x xr)) (andmap first rest)))))))))
-;;;
-;;; The following nonstandard procedures must also be provided by the
-;;; implementation for this code to run using the standard portable
-;;; hooks and output constructors. They are not used by expanded code,
-;;; and so need be present only at expansion time.
-;;;
-;;; (eval x)
-;;; where x is always in the form ("noexpand" expr).
-;;; returns the value of expr. the "noexpand" flag is used to tell the
-;;; evaluator/expander that no expansion is necessary, since expr has
-;;; already been fully expanded to core forms.
-;;;
-;;; eval will not be invoked during the loading of psyntax.pp. After
-;;; psyntax.pp has been loaded, the expansion of any macro definition,
-;;; whether local or global, will result in a call to eval. If, however,
-;;; sc-expand has already been registered as the expander to be used
-;;; by eval, and eval accepts one argument, nothing special must be done
-;;; to support the "noexpand" flag, since it is handled by sc-expand.
-;;;
-;;; (error who format-string why what)
-;;; where who is either a symbol or #f, format-string is always "~a ~s",
-;;; why is always a string, and what may be any object. error should
-;;; signal an error with a message something like
-;;;
-;;; "error in <who>: <why> <what>"
-;;;
-;;; (gensym)
-;;; returns a unique symbol each time it's called
-;;;
-;;; (putprop symbol key value)
-;;; (getprop symbol key)
-;;; key is always the symbol *sc-expander*; value may be any object.
-;;; putprop should associate the given value with the given symbol in
-;;; some way that it can be retrieved later with getprop.
-
-;;; When porting to a new Scheme implementation, you should define the
-;;; procedures listed above, load the expanded version of psyntax.ss
-;;; (psyntax.pp, which should be available whereever you found
-;;; psyntax.ss), and register sc-expand as the current expander (how
-;;; you do this depends upon your implementation of Scheme). You may
-;;; change the hooks and constructors defined toward the beginning of
-;;; the code below, but to avoid bootstrapping problems, do so only
-;;; after you have a working version of the expander.
-
-;;; Chez Scheme allows the syntactic form (syntax <template>) to be
-;;; abbreviated to #'<template>, just as (quote <datum>) may be
-;;; abbreviated to '<datum>. The #' syntax makes programs written
-;;; using syntax-case shorter and more readable and draws out the
-;;; intuitive connection between syntax and quote.
-
-;;; If you find that this code loads or runs slowly, consider
-;;; switching to faster hardware or a faster implementation of
-;;; Scheme. In Chez Scheme on a 200Mhz Pentium Pro, expanding,
-;;; compiling (with full optimization), and loading this file takes
-;;; between one and two seconds.
-
-;;; In the expander implementation, we sometimes use syntactic abstractions
-;;; when procedural abstractions would suffice. For example, we define
-;;; top-wrap and top-marked? as
-;;; (define-syntax top-wrap (identifier-syntax '((top))))
-;;; (define-syntax top-marked?
-;;; (syntax-rules ()
-;;; ((_ w) (memq 'top (wrap-marks w)))))
-;;; rather than
-;;; (define top-wrap '((top)))
-;;; (define top-marked?
-;;; (lambda (w) (memq 'top (wrap-marks w))))
-;;; On ther other hand, we don't do this consistently; we define make-wrap,
-;;; wrap-marks, and wrap-subst simply as
-;;; (define make-wrap cons)
-;;; (define wrap-marks car)
-;;; (define wrap-subst cdr)
-;;; In Chez Scheme, the syntactic and procedural forms of these
-;;; abstractions are equivalent, since the optimizer consistently
-;;; integrates constants and small procedures. Some Scheme
-;;; implementations, however, may benefit from more consistent use
-;;; of one form or the other.
-
-
-;;; implementation information:
-
-;;; "begin" is treated as a splicing construct at top level and at
-;;; the beginning of bodies. Any sequence of expressions that would
-;;; be allowed where the "begin" occurs is allowed.
-
-;;; "let-syntax" and "letrec-syntax" are also treated as splicing
-;;; constructs, in violation of the R4RS appendix and probably the R5RS
-;;; when it comes out. A consequence, let-syntax and letrec-syntax do
-;;; not create local contours, as do let and letrec. Although the
-;;; functionality is greater as it is presently implemented, we will
-;;; probably change it to conform to the R4RS/expected R5RS.
-
-;;; Objects with no standard print syntax, including objects containing
-;;; cycles and syntax object, are allowed in quoted data as long as they
-;;; are contained within a syntax form or produced by datum->syntax-object.
-;;; Such objects are never copied.
-
-;;; All identifiers that don't have macro definitions and are not bound
-;;; lexically are assumed to be global variables
-
-;;; Top-level definitions of macro-introduced identifiers are allowed.
-;;; This may not be appropriate for implementations in which the
-;;; model is that bindings are created by definitions, as opposed to
-;;; one in which initial values are assigned by definitions.
-
-;;; Top-level variable definitions of syntax keywords is not permitted.
-;;; Any solution allowing this would be kludgey and would yield
-;;; surprising results in some cases. We can provide an undefine-syntax
-;;; form. The questions is, should define be an implicit undefine-syntax?
-;;; We've decided no for now.
-
-;;; Identifiers and syntax objects are implemented as vectors for
-;;; portability. As a result, it is possible to "forge" syntax
-;;; objects.
-
-;;; The implementation of generate-temporaries assumes that it is possible
-;;; to generate globally unique symbols (gensyms).
-
-;;; The input to sc-expand may contain "annotations" describing, e.g., the
-;;; source file and character position from where each object was read if
-;;; it was read from a file. These annotations are handled properly by
-;;; sc-expand only if the annotation? hook (see hooks below) is implemented
-;;; properly and the operators make-annotation, annotation-expression,
-;;; annotation-source, annotation-stripped, and set-annotation-stripped!
-;;; are supplied. If annotations are supplied, the proper annotation
-;;; source is passed to the various output constructors, allowing
-;;; implementations to accurately correlate source and expanded code.
-;;; Contact one of the authors for details if you wish to make use of
-;;; this feature.
-
-
-
-;;; Bootstrapping:
-
-;;; When changing syntax-object representations, it is necessary to support
-;;; both old and new syntax-object representations in id-var-name. It
-;;; should be sufficient to recognize old representations and treat
-;;; them as not lexically bound.
-
-
-
-(let ()
-(define-syntax define-structure
- (lambda (x)
- (define construct-name
- (lambda (template-identifier . args)
- (datum->syntax-object
- template-identifier
- (string->symbol
- (apply string-append
- (map (lambda (x)
- (if (string? x)
- x
- (symbol->string (syntax-object->datum x))))
- args))))))
- (syntax-case x ()
- ((_ (name id1 ...))
- (andmap identifier? (syntax (name id1 ...)))
- (with-syntax
- ((constructor (construct-name (syntax name) "make-" (syntax name)))
- (predicate (construct-name (syntax name) (syntax name) "?"))
- ((access ...)
- (map (lambda (x) (construct-name x (syntax name) "-" x))
- (syntax (id1 ...))))
- ((assign ...)
- (map (lambda (x)
- (construct-name x "set-" (syntax name) "-" x "!"))
- (syntax (id1 ...))))
- (structure-length
- (+ (length (syntax (id1 ...))) 1))
- ((index ...)
- (let f ((i 1) (ids (syntax (id1 ...))))
- (if (null? ids)
- '()
- (cons i (f (+ i 1) (cdr ids)))))))
- (syntax (begin
- (define constructor
- (lambda (id1 ...)
- (vector 'name id1 ... )))
- (define predicate
- (lambda (x)
- (and (vector? x)
- (= (vector-length x) structure-length)
- (eq? (vector-ref x 0) 'name))))
- (define access
- (lambda (x)
- (vector-ref x index)))
- ...
- (define assign
- (lambda (x update)
- (vector-set! x index update)))
- ...)))))))
-
-(let ()
-(define noexpand "noexpand")
-
-;;; hooks to nonportable run-time helpers
-(begin
-(define fx+ +)
-(define fx- -)
-(define fx= =)
-(define fx< <)
-
-(define annotation? (lambda (x) #f))
-
-(define top-level-eval-hook
- (lambda (x)
- (eval `(,noexpand ,x) (interaction-environment))))
-
-(define local-eval-hook
- (lambda (x)
- (eval `(,noexpand ,x) (interaction-environment))))
-
-(define error-hook
- (lambda (who why what)
- (error who "~a ~s" why what)))
-
-(define-syntax gensym-hook
- (syntax-rules ()
- ((_) (gensym))))
-
-(define put-global-definition-hook
- (lambda (symbol binding)
- (putprop symbol '*sc-expander* binding)))
-
-(define get-global-definition-hook
- (lambda (symbol)
- (getprop symbol '*sc-expander*)))
-)
-
-
-;;; output constructors
-(begin
-(define-syntax build-application
- (syntax-rules ()
- ((_ source fun-exp arg-exps)
- `(,fun-exp . ,arg-exps))))
-
-(define-syntax build-conditional
- (syntax-rules ()
- ((_ source test-exp then-exp else-exp)
- `(if ,test-exp ,then-exp ,else-exp))))
-
-(define-syntax build-lexical-reference
- (syntax-rules ()
- ((_ type source var)
- var)))
-
-(define-syntax build-lexical-assignment
- (syntax-rules ()
- ((_ source var exp)
- `(set! ,var ,exp))))
-
-(define-syntax build-global-reference
- (syntax-rules ()
- ((_ source var)
- var)))
-
-(define-syntax build-global-assignment
- (syntax-rules ()
- ((_ source var exp)
- `(set! ,var ,exp))))
-
-(define-syntax build-global-definition
- (syntax-rules ()
- ((_ source var exp)
- `(define ,var ,exp))))
-
-(define-syntax build-lambda
- (syntax-rules ()
- ((_ src vars exp)
- `(lambda ,vars ,exp))))
-
-(define-syntax build-primref
- (syntax-rules ()
- ((_ src name) name)
- ((_ src level name) name)))
-
-(define-syntax build-data
- (syntax-rules ()
- ((_ src exp) `',exp)))
-
-(define build-sequence
- (lambda (src exps)
- (if (null? (cdr exps))
- (car exps)
- `(begin ,@exps))))
-
-(define build-let
- (lambda (src vars val-exps body-exp)
- (if (null? vars)
- body-exp
- `(let ,(map list vars val-exps) ,body-exp))))
-
-(define build-named-let
- (lambda (src vars val-exps body-exp)
- (if (null? vars)
- body-exp
- `(let ,(car vars) ,(map list (cdr vars) val-exps) ,body-exp))))
-
-(define build-letrec
- (lambda (src vars val-exps body-exp)
- (if (null? vars)
- body-exp
- `(letrec ,(map list vars val-exps) ,body-exp))))
-
-(define-syntax build-lexical-var
- (syntax-rules ()
- ((_ src id) (gensym (symbol->string id)))))
-
-(define-syntax self-evaluating?
- (syntax-rules ()
- ((_ e)
- (let ((x e))
- (or (boolean? x) (number? x) (string? x) (char? x) (null? x) (keyword? x))))))
-)
-
-(define-structure (syntax-object expression wrap))
-
-(define-syntax unannotate
- (syntax-rules ()
- ((_ x)
- (let ((e x))
- (if (annotation? e)
- (annotation-expression e)
- e)))))
-
-(define-syntax no-source (identifier-syntax #f))
-
-(define source-annotation
- (lambda (x)
- (cond
- ((annotation? x) (annotation-source x))
- ((syntax-object? x) (source-annotation (syntax-object-expression x)))
- (else no-source))))
-
-(define-syntax arg-check
- (syntax-rules ()
- ((_ pred? e who)
- (let ((x e))
- (if (not (pred? x)) (error-hook who "invalid argument" x))))))
-
-;;; compile-time environments
-
-;;; wrap and environment comprise two level mapping.
-;;; wrap : id --> label
-;;; env : label --> <element>
-
-;;; environments are represented in two parts: a lexical part and a global
-;;; part. The lexical part is a simple list of associations from labels
-;;; to bindings. The global part is implemented by
-;;; {put,get}-global-definition-hook and associates symbols with
-;;; bindings.
-
-;;; global (assumed global variable) and displaced-lexical (see below)
-;;; do not show up in any environment; instead, they are fabricated by
-;;; lookup when it finds no other bindings.
-
-;;; <environment> ::= ((<label> . <binding>)*)
-
-;;; identifier bindings include a type and a value
-
-;;; <binding> ::= (macro . <procedure>) macros
-;;; (core . <procedure>) core forms
-;;; (begin) begin
-;;; (define) define
-;;; (define-syntax) define-syntax
-;;; (local-syntax . rec?) let-syntax/letrec-syntax
-;;; (eval-when) eval-when
-;;; (syntax . (<var> . <level>)) pattern variables
-;;; (global) assumed global variable
-;;; (lexical . <var>) lexical variables
-;;; (displaced-lexical) displaced lexicals
-;;; <level> ::= <nonnegative integer>
-;;; <var> ::= variable returned by build-lexical-var
-
-;;; a macro is a user-defined syntactic-form. a core is a system-defined
-;;; syntactic form. begin, define, define-syntax, and eval-when are
-;;; treated specially since they are sensitive to whether the form is
-;;; at top-level and (except for eval-when) can denote valid internal
-;;; definitions.
-
-;;; a pattern variable is a variable introduced by syntax-case and can
-;;; be referenced only within a syntax form.
-
-;;; any identifier for which no top-level syntax definition or local
-;;; binding of any kind has been seen is assumed to be a global
-;;; variable.
-
-;;; a lexical variable is a lambda- or letrec-bound variable.
-
-;;; a displaced-lexical identifier is a lexical identifier removed from
-;;; it's scope by the return of a syntax object containing the identifier.
-;;; a displaced lexical can also appear when a letrec-syntax-bound
-;;; keyword is referenced on the rhs of one of the letrec-syntax clauses.
-;;; a displaced lexical should never occur with properly written macros.
-
-(define-syntax make-binding
- (syntax-rules (quote)
- ((_ type value) (cons type value))
- ((_ 'type) '(type))
- ((_ type) (cons type '()))))
-(define binding-type car)
-(define binding-value cdr)
-
-(define-syntax null-env (identifier-syntax '()))
-
-(define extend-env
- (lambda (labels bindings r)
- (if (null? labels)
- r
- (extend-env (cdr labels) (cdr bindings)
- (cons (cons (car labels) (car bindings)) r)))))
-
-(define extend-var-env
- ; variant of extend-env that forms "lexical" binding
- (lambda (labels vars r)
- (if (null? labels)
- r
- (extend-var-env (cdr labels) (cdr vars)
- (cons (cons (car labels) (make-binding 'lexical (car vars))) r)))))
-
-;;; we use a "macros only" environment in expansion of local macro
-;;; definitions so that their definitions can use local macros without
-;;; attempting to use other lexical identifiers.
-(define macros-only-env
- (lambda (r)
- (if (null? r)
- '()
- (let ((a (car r)))
- (if (eq? (cadr a) 'macro)
- (cons a (macros-only-env (cdr r)))
- (macros-only-env (cdr r)))))))
-
-(define lookup
- ; x may be a label or a symbol
- ; although symbols are usually global, we check the environment first
- ; anyway because a temporary binding may have been established by
- ; fluid-let-syntax
- (lambda (x r)
- (cond
- ((assq x r) => cdr)
- ((symbol? x)
- (or (get-global-definition-hook x) (make-binding 'global)))
- (else (make-binding 'displaced-lexical)))))
-
-(define global-extend
- (lambda (type sym val)
- (put-global-definition-hook sym (make-binding type val))))
-
-
-;;; Conceptually, identifiers are always syntax objects. Internally,
-;;; however, the wrap is sometimes maintained separately (a source of
-;;; efficiency and confusion), so that symbols are also considered
-;;; identifiers by id?. Externally, they are always wrapped.
-
-(define nonsymbol-id?
- (lambda (x)
- (and (syntax-object? x)
- (symbol? (unannotate (syntax-object-expression x))))))
-
-(define id?
- (lambda (x)
- (cond
- ((symbol? x) #t)
- ((syntax-object? x) (symbol? (unannotate (syntax-object-expression x))))
- ((annotation? x) (symbol? (annotation-expression x)))
- (else #f))))
-
-(define-syntax id-sym-name
- (syntax-rules ()
- ((_ e)
- (let ((x e))
- (unannotate (if (syntax-object? x) (syntax-object-expression x) x))))))
-
-(define id-sym-name&marks
- (lambda (x w)
- (if (syntax-object? x)
- (values
- (unannotate (syntax-object-expression x))
- (join-marks (wrap-marks w) (wrap-marks (syntax-object-wrap x))))
- (values (unannotate x) (wrap-marks w)))))
-
-;;; syntax object wraps
-
-;;; <wrap> ::= ((<mark> ...) . (<subst> ...))
-;;; <subst> ::= <shift> | <subs>
-;;; <subs> ::= #(<old name> <label> (<mark> ...))
-;;; <shift> ::= positive fixnum
-
-(define make-wrap cons)
-(define wrap-marks car)
-(define wrap-subst cdr)
-
-(define-syntax subst-rename? (identifier-syntax vector?))
-(define-syntax rename-old (syntax-rules () ((_ x) (vector-ref x 0))))
-(define-syntax rename-new (syntax-rules () ((_ x) (vector-ref x 1))))
-(define-syntax rename-marks (syntax-rules () ((_ x) (vector-ref x 2))))
-(define-syntax make-rename
- (syntax-rules ()
- ((_ old new marks) (vector old new marks))))
-
-;;; labels must be comparable with "eq?" and distinct from symbols.
-(define gen-label
- (lambda () (string #\i)))
-
-(define gen-labels
- (lambda (ls)
- (if (null? ls)
- '()
- (cons (gen-label) (gen-labels (cdr ls))))))
-
-(define-structure (ribcage symnames marks labels))
-
-(define-syntax empty-wrap (identifier-syntax '(())))
-
-(define-syntax top-wrap (identifier-syntax '((top))))
-
-(define-syntax top-marked?
- (syntax-rules ()
- ((_ w) (memq 'top (wrap-marks w)))))
-
-;;; Marks must be comparable with "eq?" and distinct from pairs and
-;;; the symbol top. We do not use integers so that marks will remain
-;;; unique even across file compiles.
-
-(define-syntax the-anti-mark (identifier-syntax #f))
-
-(define anti-mark
- (lambda (w)
- (make-wrap (cons the-anti-mark (wrap-marks w))
- (cons 'shift (wrap-subst w)))))
-
-(define-syntax new-mark
- (syntax-rules ()
- ((_) (string #\m))))
-
-;;; make-empty-ribcage and extend-ribcage maintain list-based ribcages for
-;;; internal definitions, in which the ribcages are built incrementally
-(define-syntax make-empty-ribcage
- (syntax-rules ()
- ((_) (make-ribcage '() '() '()))))
-
-(define extend-ribcage!
- ; must receive ids with complete wraps
- (lambda (ribcage id label)
- (set-ribcage-symnames! ribcage
- (cons (unannotate (syntax-object-expression id))
- (ribcage-symnames ribcage)))
- (set-ribcage-marks! ribcage
- (cons (wrap-marks (syntax-object-wrap id))
- (ribcage-marks ribcage)))
- (set-ribcage-labels! ribcage
- (cons label (ribcage-labels ribcage)))))
-
-;;; make-binding-wrap creates vector-based ribcages
-(define make-binding-wrap
- (lambda (ids labels w)
- (if (null? ids)
- w
- (make-wrap
- (wrap-marks w)
- (cons
- (let ((labelvec (list->vector labels)))
- (let ((n (vector-length labelvec)))
- (let ((symnamevec (make-vector n)) (marksvec (make-vector n)))
- (let f ((ids ids) (i 0))
- (if (not (null? ids))
- (call-with-values
- (lambda () (id-sym-name&marks (car ids) w))
- (lambda (symname marks)
- (vector-set! symnamevec i symname)
- (vector-set! marksvec i marks)
- (f (cdr ids) (fx+ i 1))))))
- (make-ribcage symnamevec marksvec labelvec))))
- (wrap-subst w))))))
-
-(define smart-append
- (lambda (m1 m2)
- (if (null? m2)
- m1
- (append m1 m2))))
-
-(define join-wraps
- (lambda (w1 w2)
- (let ((m1 (wrap-marks w1)) (s1 (wrap-subst w1)))
- (if (null? m1)
- (if (null? s1)
- w2
- (make-wrap
- (wrap-marks w2)
- (smart-append s1 (wrap-subst w2))))
- (make-wrap
- (smart-append m1 (wrap-marks w2))
- (smart-append s1 (wrap-subst w2)))))))
-
-(define join-marks
- (lambda (m1 m2)
- (smart-append m1 m2)))
-
-(define same-marks?
- (lambda (x y)
- (or (eq? x y)
- (and (not (null? x))
- (not (null? y))
- (eq? (car x) (car y))
- (same-marks? (cdr x) (cdr y))))))
-
-(define id-var-name
- (lambda (id w)
- (define-syntax first
- (syntax-rules ()
- ((_ e) (call-with-values (lambda () e) (lambda (x . ignore) x)))))
- (define search
- (lambda (sym subst marks)
- (if (null? subst)
- (values #f marks)
- (let ((fst (car subst)))
- (if (eq? fst 'shift)
- (search sym (cdr subst) (cdr marks))
- (let ((symnames (ribcage-symnames fst)))
- (if (vector? symnames)
- (search-vector-rib sym subst marks symnames fst)
- (search-list-rib sym subst marks symnames fst))))))))
- (define search-list-rib
- (lambda (sym subst marks symnames ribcage)
- (let f ((symnames symnames) (i 0))
- (cond
- ((null? symnames) (search sym (cdr subst) marks))
- ((and (eq? (car symnames) sym)
- (same-marks? marks (list-ref (ribcage-marks ribcage) i)))
- (values (list-ref (ribcage-labels ribcage) i) marks))
- (else (f (cdr symnames) (fx+ i 1)))))))
- (define search-vector-rib
- (lambda (sym subst marks symnames ribcage)
- (let ((n (vector-length symnames)))
- (let f ((i 0))
- (cond
- ((fx= i n) (search sym (cdr subst) marks))
- ((and (eq? (vector-ref symnames i) sym)
- (same-marks? marks (vector-ref (ribcage-marks ribcage) i)))
- (values (vector-ref (ribcage-labels ribcage) i) marks))
- (else (f (fx+ i 1))))))))
- (cond
- ((symbol? id)
- (or (first (search id (wrap-subst w) (wrap-marks w))) id))
- ((syntax-object? id)
- (let ((id (unannotate (syntax-object-expression id)))
- (w1 (syntax-object-wrap id)))
- (let ((marks (join-marks (wrap-marks w) (wrap-marks w1))))
- (call-with-values (lambda () (search id (wrap-subst w) marks))
- (lambda (new-id marks)
- (or new-id
- (first (search id (wrap-subst w1) marks))
- id))))))
- ((annotation? id)
- (let ((id (unannotate id)))
- (or (first (search id (wrap-subst w) (wrap-marks w))) id)))
- (else (error-hook 'id-var-name "invalid id" id)))))
-
-;;; free-id=? must be passed fully wrapped ids since (free-id=? x y)
-;;; may be true even if (free-id=? (wrap x w) (wrap y w)) is not.
-
-(define free-id=?
- (lambda (i j)
- (and (eq? (id-sym-name i) (id-sym-name j)) ; accelerator
- (eq? (id-var-name i empty-wrap) (id-var-name j empty-wrap)))))
-
-;;; bound-id=? may be passed unwrapped (or partially wrapped) ids as
-;;; long as the missing portion of the wrap is common to both of the ids
-;;; since (bound-id=? x y) iff (bound-id=? (wrap x w) (wrap y w))
-
-(define bound-id=?
- (lambda (i j)
- (if (and (syntax-object? i) (syntax-object? j))
- (and (eq? (unannotate (syntax-object-expression i))
- (unannotate (syntax-object-expression j)))
- (same-marks? (wrap-marks (syntax-object-wrap i))
- (wrap-marks (syntax-object-wrap j))))
- (eq? (unannotate i) (unannotate j)))))
-
-;;; "valid-bound-ids?" returns #t if it receives a list of distinct ids.
-;;; valid-bound-ids? may be passed unwrapped (or partially wrapped) ids
-;;; as long as the missing portion of the wrap is common to all of the
-;;; ids.
-
-(define valid-bound-ids?
- (lambda (ids)
- (and (let all-ids? ((ids ids))
- (or (null? ids)
- (and (id? (car ids))
- (all-ids? (cdr ids)))))
- (distinct-bound-ids? ids))))
-
-;;; distinct-bound-ids? expects a list of ids and returns #t if there are
-;;; no duplicates. It is quadratic on the length of the id list; long
-;;; lists could be sorted to make it more efficient. distinct-bound-ids?
-;;; may be passed unwrapped (or partially wrapped) ids as long as the
-;;; missing portion of the wrap is common to all of the ids.
-
-(define distinct-bound-ids?
- (lambda (ids)
- (let distinct? ((ids ids))
- (or (null? ids)
- (and (not (bound-id-member? (car ids) (cdr ids)))
- (distinct? (cdr ids)))))))
-
-(define bound-id-member?
- (lambda (x list)
- (and (not (null? list))
- (or (bound-id=? x (car list))
- (bound-id-member? x (cdr list))))))
-
-;;; wrapping expressions and identifiers
-
-(define wrap
- (lambda (x w)
- (cond
- ((and (null? (wrap-marks w)) (null? (wrap-subst w))) x)
- ((syntax-object? x)
- (make-syntax-object
- (syntax-object-expression x)
- (join-wraps w (syntax-object-wrap x))))
- ((null? x) x)
- (else (make-syntax-object x w)))))
-
-(define source-wrap
- (lambda (x w s)
- (wrap (if s (make-annotation x s #f) x) w)))
-
-;;; expanding
-
-(define chi-sequence
- (lambda (body r w s)
- (build-sequence s
- (let dobody ((body body) (r r) (w w))
- (if (null? body)
- '()
- (let ((first (chi (car body) r w)))
- (cons first (dobody (cdr body) r w))))))))
-
-(define chi-top-sequence
- (lambda (body r w s m esew)
- (build-sequence s
- (let dobody ((body body) (r r) (w w) (m m) (esew esew))
- (if (null? body)
- '()
- (let ((first (chi-top (car body) r w m esew)))
- (cons first (dobody (cdr body) r w m esew))))))))
-
-(define chi-install-global
- (lambda (name e)
- (build-application no-source
- (build-primref no-source 'install-global-transformer)
- (list (build-data no-source name) e))))
-
-(define chi-when-list
- (lambda (e when-list w)
- ; when-list is syntax'd version of list of situations
- (let f ((when-list when-list) (situations '()))
- (if (null? when-list)
- situations
- (f (cdr when-list)
- (cons (let ((x (car when-list)))
- (cond
- ((free-id=? x (syntax compile)) 'compile)
- ((free-id=? x (syntax load)) 'load)
- ((free-id=? x (syntax eval)) 'eval)
- (else (syntax-error (wrap x w)
- "invalid eval-when situation"))))
- situations))))))
-
-;;; syntax-type returns five values: type, value, e, w, and s. The first
-;;; two are described in the table below.
-;;;
-;;; type value explanation
-;;; -------------------------------------------------------------------
-;;; core procedure core form (including singleton)
-;;; lexical name lexical variable reference
-;;; global name global variable reference
-;;; begin none begin keyword
-;;; define none define keyword
-;;; define-syntax none define-syntax keyword
-;;; local-syntax rec? letrec-syntax/let-syntax keyword
-;;; eval-when none eval-when keyword
-;;; syntax level pattern variable
-;;; displaced-lexical none displaced lexical identifier
-;;; lexical-call name call to lexical variable
-;;; global-call name call to global variable
-;;; call none any other call
-;;; begin-form none begin expression
-;;; define-form id variable definition
-;;; define-syntax-form id syntax definition
-;;; local-syntax-form rec? syntax definition
-;;; eval-when-form none eval-when form
-;;; constant none self-evaluating datum
-;;; other none anything else
-;;;
-;;; For define-form and define-syntax-form, e is the rhs expression.
-;;; For all others, e is the entire form. w is the wrap for e.
-;;; s is the source for the entire form.
-;;;
-;;; syntax-type expands macros and unwraps as necessary to get to
-;;; one of the forms above. It also parses define and define-syntax
-;;; forms, although perhaps this should be done by the consumer.
-
-(define syntax-type
- (lambda (e r w s rib)
- (cond
- ((symbol? e)
- (let* ((n (id-var-name e w))
- (b (lookup n r))
- (type (binding-type b)))
- (case type
- ((lexical) (values type (binding-value b) e w s))
- ((global) (values type n e w s))
- ((macro)
- (syntax-type (chi-macro (binding-value b) e r w rib) r empty-wrap s rib))
- (else (values type (binding-value b) e w s)))))
- ((pair? e)
- (let ((first (car e)))
- (if (id? first)
- (let* ((n (id-var-name first w))
- (b (lookup n r))
- (type (binding-type b)))
- (case type
- ((lexical) (values 'lexical-call (binding-value b) e w s))
- ((global) (values 'global-call n e w s))
- ((macro)
- (syntax-type (chi-macro (binding-value b) e r w rib)
- r empty-wrap s rib))
- ((core) (values type (binding-value b) e w s))
- ((local-syntax)
- (values 'local-syntax-form (binding-value b) e w s))
- ((begin) (values 'begin-form #f e w s))
- ((eval-when) (values 'eval-when-form #f e w s))
- ((define)
- (syntax-case e ()
- ((_ name val)
- (id? (syntax name))
- (values 'define-form (syntax name) (syntax val) w s))
- ((_ (name . args) e1 e2 ...)
- (and (id? (syntax name))
- (valid-bound-ids? (lambda-var-list (syntax args))))
- ; need lambda here...
- (values 'define-form (wrap (syntax name) w)
- (cons (syntax lambda) (wrap (syntax (args e1 e2 ...)) w))
- empty-wrap s))
- ((_ name)
- (id? (syntax name))
- (values 'define-form (wrap (syntax name) w)
- (syntax (void))
- empty-wrap s))))
- ((define-syntax)
- (syntax-case e ()
- ((_ name val)
- (id? (syntax name))
- (values 'define-syntax-form (syntax name)
- (syntax val) w s))))
- (else (values 'call #f e w s))))
- (values 'call #f e w s))))
- ((syntax-object? e)
- ;; s can't be valid source if we've unwrapped
- (syntax-type (syntax-object-expression e)
- r
- (join-wraps w (syntax-object-wrap e))
- no-source rib))
- ((annotation? e)
- (syntax-type (annotation-expression e) r w (annotation-source e) rib))
- ((self-evaluating? e) (values 'constant #f e w s))
- (else (values 'other #f e w s)))))
-
-(define chi-top
- (lambda (e r w m esew)
- (define-syntax eval-if-c&e
- (syntax-rules ()
- ((_ m e)
- (let ((x e))
- (if (eq? m 'c&e) (top-level-eval-hook x))
- x))))
- (call-with-values
- (lambda () (syntax-type e r w no-source #f))
- (lambda (type value e w s)
- (case type
- ((begin-form)
- (syntax-case e ()
- ((_) (chi-void))
- ((_ e1 e2 ...)
- (chi-top-sequence (syntax (e1 e2 ...)) r w s m esew))))
- ((local-syntax-form)
- (chi-local-syntax value e r w s
- (lambda (body r w s)
- (chi-top-sequence body r w s m esew))))
- ((eval-when-form)
- (syntax-case e ()
- ((_ (x ...) e1 e2 ...)
- (let ((when-list (chi-when-list e (syntax (x ...)) w))
- (body (syntax (e1 e2 ...))))
- (cond
- ((eq? m 'e)
- (if (memq 'eval when-list)
- (chi-top-sequence body r w s 'e '(eval))
- (chi-void)))
- ((memq 'load when-list)
- (if (or (memq 'compile when-list)
- (and (eq? m 'c&e) (memq 'eval when-list)))
- (chi-top-sequence body r w s 'c&e '(compile load))
- (if (memq m '(c c&e))
- (chi-top-sequence body r w s 'c '(load))
- (chi-void))))
- ((or (memq 'compile when-list)
- (and (eq? m 'c&e) (memq 'eval when-list)))
- (top-level-eval-hook
- (chi-top-sequence body r w s 'e '(eval)))
- (chi-void))
- (else (chi-void)))))))
- ((define-syntax-form)
- (let ((n (id-var-name value w)) (r (macros-only-env r)))
- (case m
- ((c)
- (if (memq 'compile esew)
- (let ((e (chi-install-global n (chi e r w))))
- (top-level-eval-hook e)
- (if (memq 'load esew) e (chi-void)))
- (if (memq 'load esew)
- (chi-install-global n (chi e r w))
- (chi-void))))
- ((c&e)
- (let ((e (chi-install-global n (chi e r w))))
- (top-level-eval-hook e)
- e))
- (else
- (if (memq 'eval esew)
- (top-level-eval-hook
- (chi-install-global n (chi e r w))))
- (chi-void)))))
- ((define-form)
- (let ((n (id-var-name value w)))
- (case (binding-type (lookup n r))
- ((global)
- (eval-if-c&e m
- (build-global-definition s n (chi e r w))))
- ((displaced-lexical)
- (syntax-error (wrap value w) "identifier out of context"))
- (else (syntax-error (wrap value w)
- "cannot define keyword at top level")))))
- (else (eval-if-c&e m (chi-expr type value e r w s))))))))
-
-(define chi
- (lambda (e r w)
- (call-with-values
- (lambda () (syntax-type e r w no-source #f))
- (lambda (type value e w s)
- (chi-expr type value e r w s)))))
-
-(define chi-expr
- (lambda (type value e r w s)
- (case type
- ((lexical)
- (build-lexical-reference 'value s value))
- ((core) (value e r w s))
- ((lexical-call)
- (chi-application
- (build-lexical-reference 'fun (source-annotation (car e)) value)
- e r w s))
- ((global-call)
- (chi-application
- (build-global-reference (source-annotation (car e)) value)
- e r w s))
- ((constant) (build-data s (strip (source-wrap e w s) empty-wrap)))
- ((global) (build-global-reference s value))
- ((call) (chi-application (chi (car e) r w) e r w s))
- ((begin-form)
- (syntax-case e ()
- ((_ e1 e2 ...) (chi-sequence (syntax (e1 e2 ...)) r w s))))
- ((local-syntax-form)
- (chi-local-syntax value e r w s chi-sequence))
- ((eval-when-form)
- (syntax-case e ()
- ((_ (x ...) e1 e2 ...)
- (let ((when-list (chi-when-list e (syntax (x ...)) w)))
- (if (memq 'eval when-list)
- (chi-sequence (syntax (e1 e2 ...)) r w s)
- (chi-void))))))
- ((define-form define-syntax-form)
- (syntax-error (wrap value w) "invalid context for definition of"))
- ((syntax)
- (syntax-error (source-wrap e w s)
- "reference to pattern variable outside syntax form"))
- ((displaced-lexical)
- (syntax-error (source-wrap e w s)
- "reference to identifier outside its scope"))
- (else (syntax-error (source-wrap e w s))))))
-
-(define chi-application
- (lambda (x e r w s)
- (syntax-case e ()
- ((e0 e1 ...)
- (build-application s x
- (map (lambda (e) (chi e r w)) (syntax (e1 ...))))))))
-
-(define chi-macro
- (lambda (p e r w rib)
- (define rebuild-macro-output
- (lambda (x m)
- (cond ((pair? x)
- (cons (rebuild-macro-output (car x) m)
- (rebuild-macro-output (cdr x) m)))
- ((syntax-object? x)
- (let ((w (syntax-object-wrap x)))
- (let ((ms (wrap-marks w)) (s (wrap-subst w)))
- (make-syntax-object (syntax-object-expression x)
- (if (and (pair? ms) (eq? (car ms) the-anti-mark))
- (make-wrap (cdr ms)
- (if rib (cons rib (cdr s)) (cdr s)))
- (make-wrap (cons m ms)
- (if rib
- (cons rib (cons 'shift s))
- (cons 'shift s))))))))
- ((vector? x)
- (let* ((n (vector-length x)) (v (make-vector n)))
- (do ((i 0 (fx+ i 1)))
- ((fx= i n) v)
- (vector-set! v i
- (rebuild-macro-output (vector-ref x i) m)))))
- ((symbol? x)
- (syntax-error x "encountered raw symbol in macro output"))
- (else x))))
- (rebuild-macro-output (p (wrap e (anti-mark w))) (new-mark))))
-
-(define chi-body
- ;; In processing the forms of the body, we create a new, empty wrap.
- ;; This wrap is augmented (destructively) each time we discover that
- ;; the next form is a definition. This is done:
- ;;
- ;; (1) to allow the first nondefinition form to be a call to
- ;; one of the defined ids even if the id previously denoted a
- ;; definition keyword or keyword for a macro expanding into a
- ;; definition;
- ;; (2) to prevent subsequent definition forms (but unfortunately
- ;; not earlier ones) and the first nondefinition form from
- ;; confusing one of the bound identifiers for an auxiliary
- ;; keyword; and
- ;; (3) so that we do not need to restart the expansion of the
- ;; first nondefinition form, which is problematic anyway
- ;; since it might be the first element of a begin that we
- ;; have just spliced into the body (meaning if we restarted,
- ;; we'd really need to restart with the begin or the macro
- ;; call that expanded into the begin, and we'd have to give
- ;; up allowing (begin <defn>+ <expr>+), which is itself
- ;; problematic since we don't know if a begin contains only
- ;; definitions until we've expanded it).
- ;;
- ;; Before processing the body, we also create a new environment
- ;; containing a placeholder for the bindings we will add later and
- ;; associate this environment with each form. In processing a
- ;; let-syntax or letrec-syntax, the associated environment may be
- ;; augmented with local keyword bindings, so the environment may
- ;; be different for different forms in the body. Once we have
- ;; gathered up all of the definitions, we evaluate the transformer
- ;; expressions and splice into r at the placeholder the new variable
- ;; and keyword bindings. This allows let-syntax or letrec-syntax
- ;; forms local to a portion or all of the body to shadow the
- ;; definition bindings.
- ;;
- ;; Subforms of a begin, let-syntax, or letrec-syntax are spliced
- ;; into the body.
- ;;
- ;; outer-form is fully wrapped w/source
- (lambda (body outer-form r w)
- (let* ((r (cons '("placeholder" . (placeholder)) r))
- (ribcage (make-empty-ribcage))
- (w (make-wrap (wrap-marks w) (cons ribcage (wrap-subst w)))))
- (let parse ((body (map (lambda (x) (cons r (wrap x w))) body))
- (ids '()) (labels '()) (vars '()) (vals '()) (bindings '()))
- (if (null? body)
- (syntax-error outer-form "no expressions in body")
- (let ((e (cdar body)) (er (caar body)))
- (call-with-values
- (lambda () (syntax-type e er empty-wrap no-source ribcage))
- (lambda (type value e w s)
- (case type
- ((define-form)
- (let ((id (wrap value w)) (label (gen-label)))
- (let ((var (gen-var id)))
- (extend-ribcage! ribcage id label)
- (parse (cdr body)
- (cons id ids) (cons label labels)
- (cons var vars) (cons (cons er (wrap e w)) vals)
- (cons (make-binding 'lexical var) bindings)))))
- ((define-syntax-form)
- (let ((id (wrap value w)) (label (gen-label)))
- (extend-ribcage! ribcage id label)
- (parse (cdr body)
- (cons id ids) (cons label labels)
- vars vals
- (cons (make-binding 'macro (cons er (wrap e w)))
- bindings))))
- ((begin-form)
- (syntax-case e ()
- ((_ e1 ...)
- (parse (let f ((forms (syntax (e1 ...))))
- (if (null? forms)
- (cdr body)
- (cons (cons er (wrap (car forms) w))
- (f (cdr forms)))))
- ids labels vars vals bindings))))
- ((local-syntax-form)
- (chi-local-syntax value e er w s
- (lambda (forms er w s)
- (parse (let f ((forms forms))
- (if (null? forms)
- (cdr body)
- (cons (cons er (wrap (car forms) w))
- (f (cdr forms)))))
- ids labels vars vals bindings))))
- (else ; found a non-definition
- (if (null? ids)
- (build-sequence no-source
- (map (lambda (x)
- (chi (cdr x) (car x) empty-wrap))
- (cons (cons er (source-wrap e w s))
- (cdr body))))
- (begin
- (if (not (valid-bound-ids? ids))
- (syntax-error outer-form
- "invalid or duplicate identifier in definition"))
- (let loop ((bs bindings) (er-cache #f) (r-cache #f))
- (if (not (null? bs))
- (let* ((b (car bs)))
- (if (eq? (car b) 'macro)
- (let* ((er (cadr b))
- (r-cache
- (if (eq? er er-cache)
- r-cache
- (macros-only-env er))))
- (set-cdr! b
- (eval-local-transformer
- (chi (cddr b) r-cache empty-wrap)))
- (loop (cdr bs) er r-cache))
- (loop (cdr bs) er-cache r-cache)))))
- (set-cdr! r (extend-env labels bindings (cdr r)))
- (build-letrec no-source
- vars
- (map (lambda (x)
- (chi (cdr x) (car x) empty-wrap))
- vals)
- (build-sequence no-source
- (map (lambda (x)
- (chi (cdr x) (car x) empty-wrap))
- (cons (cons er (source-wrap e w s))
- (cdr body)))))))))))))))))
-
-(define chi-lambda-clause
- (lambda (e c r w k)
- (syntax-case c ()
- (((id ...) e1 e2 ...)
- (let ((ids (syntax (id ...))))
- (if (not (valid-bound-ids? ids))
- (syntax-error e "invalid parameter list in")
- (let ((labels (gen-labels ids))
- (new-vars (map gen-var ids)))
- (k new-vars
- (chi-body (syntax (e1 e2 ...))
- e
- (extend-var-env labels new-vars r)
- (make-binding-wrap ids labels w)))))))
- ((ids e1 e2 ...)
- (let ((old-ids (lambda-var-list (syntax ids))))
- (if (not (valid-bound-ids? old-ids))
- (syntax-error e "invalid parameter list in")
- (let ((labels (gen-labels old-ids))
- (new-vars (map gen-var old-ids)))
- (k (let f ((ls1 (cdr new-vars)) (ls2 (car new-vars)))
- (if (null? ls1)
- ls2
- (f (cdr ls1) (cons (car ls1) ls2))))
- (chi-body (syntax (e1 e2 ...))
- e
- (extend-var-env labels new-vars r)
- (make-binding-wrap old-ids labels w)))))))
- (_ (syntax-error e)))))
-
-(define chi-local-syntax
- (lambda (rec? e r w s k)
- (syntax-case e ()
- ((_ ((id val) ...) e1 e2 ...)
- (let ((ids (syntax (id ...))))
- (if (not (valid-bound-ids? ids))
- (syntax-error e "duplicate bound keyword in")
- (let ((labels (gen-labels ids)))
- (let ((new-w (make-binding-wrap ids labels w)))
- (k (syntax (e1 e2 ...))
- (extend-env
- labels
- (let ((w (if rec? new-w w))
- (trans-r (macros-only-env r)))
- (map (lambda (x)
- (make-binding 'macro
- (eval-local-transformer (chi x trans-r w))))
- (syntax (val ...))))
- r)
- new-w
- s))))))
- (_ (syntax-error (source-wrap e w s))))))
-
-(define eval-local-transformer
- (lambda (expanded)
- (let ((p (local-eval-hook expanded)))
- (if (procedure? p)
- p
- (syntax-error p "nonprocedure transfomer")))))
-
-(define chi-void
- (lambda ()
- (build-application no-source (build-primref no-source 'void) '())))
-
-(define ellipsis?
- (lambda (x)
- (and (nonsymbol-id? x)
- (free-id=? x (syntax (... ...))))))
-
-;;; data
-
-;;; strips all annotations from potentially circular reader output
-
-(define strip-annotation
- (lambda (x parent)
- (cond
- ((pair? x)
- (let ((new (cons #f #f)))
- (when parent (set-annotation-stripped! parent new))
- (set-car! new (strip-annotation (car x) #f))
- (set-cdr! new (strip-annotation (cdr x) #f))
- new))
- ((annotation? x)
- (or (annotation-stripped x)
- (strip-annotation (annotation-expression x) x)))
- ((vector? x)
- (let ((new (make-vector (vector-length x))))
- (when parent (set-annotation-stripped! parent new))
- (let loop ((i (- (vector-length x) 1)))
- (unless (fx< i 0)
- (vector-set! new i (strip-annotation (vector-ref x i) #f))
- (loop (fx- i 1))))
- new))
- (else x))))
-
-;;; strips syntax-objects down to top-wrap; if top-wrap is layered directly
-;;; on an annotation, strips the annotation as well.
-;;; since only the head of a list is annotated by the reader, not each pair
-;;; in the spine, we also check for pairs whose cars are annotated in case
-;;; we've been passed the cdr of an annotated list
-
-(define strip
- (lambda (x w)
- (if (top-marked? w)
- (if (or (annotation? x) (and (pair? x) (annotation? (car x))))
- (strip-annotation x #f)
- x)
- (let f ((x x))
- (cond
- ((syntax-object? x)
- (strip (syntax-object-expression x) (syntax-object-wrap x)))
- ((pair? x)
- (let ((a (f (car x))) (d (f (cdr x))))
- (if (and (eq? a (car x)) (eq? d (cdr x)))
- x
- (cons a d))))
- ((vector? x)
- (let ((old (vector->list x)))
- (let ((new (map f old)))
- (if (andmap eq? old new) x (list->vector new)))))
- (else x))))))
-
-;;; lexical variables
-
-(define gen-var
- (lambda (id)
- (let ((id (if (syntax-object? id) (syntax-object-expression id) id)))
- (if (annotation? id)
- (build-lexical-var (annotation-source id) (annotation-expression id))
- (build-lexical-var no-source id)))))
-
-(define lambda-var-list
- (lambda (vars)
- (let lvl ((vars vars) (ls '()) (w empty-wrap))
- (cond
- ((pair? vars) (lvl (cdr vars) (cons (wrap (car vars) w) ls) w))
- ((id? vars) (cons (wrap vars w) ls))
- ((null? vars) ls)
- ((syntax-object? vars)
- (lvl (syntax-object-expression vars)
- ls
- (join-wraps w (syntax-object-wrap vars))))
- ((annotation? vars)
- (lvl (annotation-expression vars) ls w))
- ; include anything else to be caught by subsequent error
- ; checking
- (else (cons vars ls))))))
-
-;;; core transformers
-
-(global-extend 'local-syntax 'letrec-syntax #t)
-(global-extend 'local-syntax 'let-syntax #f)
-
-(global-extend 'core 'fluid-let-syntax
- (lambda (e r w s)
- (syntax-case e ()
- ((_ ((var val) ...) e1 e2 ...)
- (valid-bound-ids? (syntax (var ...)))
- (let ((names (map (lambda (x) (id-var-name x w)) (syntax (var ...)))))
- (for-each
- (lambda (id n)
- (case (binding-type (lookup n r))
- ((displaced-lexical)
- (syntax-error (source-wrap id w s)
- "identifier out of context"))))
- (syntax (var ...))
- names)
- (chi-body
- (syntax (e1 e2 ...))
- (source-wrap e w s)
- (extend-env
- names
- (let ((trans-r (macros-only-env r)))
- (map (lambda (x)
- (make-binding 'macro
- (eval-local-transformer (chi x trans-r w))))
- (syntax (val ...))))
- r)
- w)))
- (_ (syntax-error (source-wrap e w s))))))
-
-(global-extend 'core 'quote
- (lambda (e r w s)
- (syntax-case e ()
- ((_ e) (build-data s (strip (syntax e) w)))
- (_ (syntax-error (source-wrap e w s))))))
-
-(global-extend 'core 'syntax
- (let ()
- (define gen-syntax
- (lambda (src e r maps ellipsis?)
- (if (id? e)
- (let ((label (id-var-name e empty-wrap)))
- (let ((b (lookup label r)))
- (if (eq? (binding-type b) 'syntax)
- (call-with-values
- (lambda ()
- (let ((var.lev (binding-value b)))
- (gen-ref src (car var.lev) (cdr var.lev) maps)))
- (lambda (var maps) (values `(ref ,var) maps)))
- (if (ellipsis? e)
- (syntax-error src "misplaced ellipsis in syntax form")
- (values `(quote ,e) maps)))))
- (syntax-case e ()
- ((dots e)
- (ellipsis? (syntax dots))
- (gen-syntax src (syntax e) r maps (lambda (x) #f)))
- ((x dots . y)
- ; this could be about a dozen lines of code, except that we
- ; choose to handle (syntax (x ... ...)) forms
- (ellipsis? (syntax dots))
- (let f ((y (syntax y))
- (k (lambda (maps)
- (call-with-values
- (lambda ()
- (gen-syntax src (syntax x) r
- (cons '() maps) ellipsis?))
- (lambda (x maps)
- (if (null? (car maps))
- (syntax-error src
- "extra ellipsis in syntax form")
- (values (gen-map x (car maps))
- (cdr maps))))))))
- (syntax-case y ()
- ((dots . y)
- (ellipsis? (syntax dots))
- (f (syntax y)
- (lambda (maps)
- (call-with-values
- (lambda () (k (cons '() maps)))
- (lambda (x maps)
- (if (null? (car maps))
- (syntax-error src
- "extra ellipsis in syntax form")
- (values (gen-mappend x (car maps))
- (cdr maps))))))))
- (_ (call-with-values
- (lambda () (gen-syntax src y r maps ellipsis?))
- (lambda (y maps)
- (call-with-values
- (lambda () (k maps))
- (lambda (x maps)
- (values (gen-append x y) maps)))))))))
- ((x . y)
- (call-with-values
- (lambda () (gen-syntax src (syntax x) r maps ellipsis?))
- (lambda (x maps)
- (call-with-values
- (lambda () (gen-syntax src (syntax y) r maps ellipsis?))
- (lambda (y maps) (values (gen-cons x y) maps))))))
- (#(e1 e2 ...)
- (call-with-values
- (lambda ()
- (gen-syntax src (syntax (e1 e2 ...)) r maps ellipsis?))
- (lambda (e maps) (values (gen-vector e) maps))))
- (_ (values `(quote ,e) maps))))))
-
- (define gen-ref
- (lambda (src var level maps)
- (if (fx= level 0)
- (values var maps)
- (if (null? maps)
- (syntax-error src "missing ellipsis in syntax form")
- (call-with-values
- (lambda () (gen-ref src var (fx- level 1) (cdr maps)))
- (lambda (outer-var outer-maps)
- (let ((b (assq outer-var (car maps))))
- (if b
- (values (cdr b) maps)
- (let ((inner-var (gen-var 'tmp)))
- (values inner-var
- (cons (cons (cons outer-var inner-var)
- (car maps))
- outer-maps)))))))))))
-
- (define gen-mappend
- (lambda (e map-env)
- `(apply (primitive append) ,(gen-map e map-env))))
-
- (define gen-map
- (lambda (e map-env)
- (let ((formals (map cdr map-env))
- (actuals (map (lambda (x) `(ref ,(car x))) map-env)))
- (cond
- ((eq? (car e) 'ref)
- ; identity map equivalence:
- ; (map (lambda (x) x) y) == y
- (car actuals))
- ((andmap
- (lambda (x) (and (eq? (car x) 'ref) (memq (cadr x) formals)))
- (cdr e))
- ; eta map equivalence:
- ; (map (lambda (x ...) (f x ...)) y ...) == (map f y ...)
- `(map (primitive ,(car e))
- ,@(map (let ((r (map cons formals actuals)))
- (lambda (x) (cdr (assq (cadr x) r))))
- (cdr e))))
- (else `(map (lambda ,formals ,e) ,@actuals))))))
-
- (define gen-cons
- (lambda (x y)
- (case (car y)
- ((quote)
- (if (eq? (car x) 'quote)
- `(quote (,(cadr x) . ,(cadr y)))
- (if (eq? (cadr y) '())
- `(list ,x)
- `(cons ,x ,y))))
- ((list) `(list ,x ,@(cdr y)))
- (else `(cons ,x ,y)))))
-
- (define gen-append
- (lambda (x y)
- (if (equal? y '(quote ()))
- x
- `(append ,x ,y))))
-
- (define gen-vector
- (lambda (x)
- (cond
- ((eq? (car x) 'list) `(vector ,@(cdr x)))
- ((eq? (car x) 'quote) `(quote #(,@(cadr x))))
- (else `(list->vector ,x)))))
-
-
- (define regen
- (lambda (x)
- (case (car x)
- ((ref) (build-lexical-reference 'value no-source (cadr x)))
- ((primitive) (build-primref no-source (cadr x)))
- ((quote) (build-data no-source (cadr x)))
- ((lambda) (build-lambda no-source (cadr x) (regen (caddr x))))
- ((map) (let ((ls (map regen (cdr x))))
- (build-application no-source
- (if (fx= (length ls) 2)
- (build-primref no-source 'map)
- ; really need to do our own checking here
- (build-primref no-source 2 'map)) ; require error check
- ls)))
- (else (build-application no-source
- (build-primref no-source (car x))
- (map regen (cdr x)))))))
-
- (lambda (e r w s)
- (let ((e (source-wrap e w s)))
- (syntax-case e ()
- ((_ x)
- (call-with-values
- (lambda () (gen-syntax e (syntax x) r '() ellipsis?))
- (lambda (e maps) (regen e))))
- (_ (syntax-error e)))))))
-
-
-(global-extend 'core 'lambda
- (lambda (e r w s)
- (syntax-case e ()
- ((_ . c)
- (chi-lambda-clause (source-wrap e w s) (syntax c) r w
- (lambda (vars body) (build-lambda s vars body)))))))
-
-
-(global-extend 'core 'let
- (let ()
- (define (chi-let e r w s constructor ids vals exps)
- (if (not (valid-bound-ids? ids))
- (syntax-error e "duplicate bound variable in")
- (let ((labels (gen-labels ids))
- (new-vars (map gen-var ids)))
- (let ((nw (make-binding-wrap ids labels w))
- (nr (extend-var-env labels new-vars r)))
- (constructor s
- new-vars
- (map (lambda (x) (chi x r w)) vals)
- (chi-body exps (source-wrap e nw s) nr nw))))))
- (lambda (e r w s)
- (syntax-case e ()
- ((_ ((id val) ...) e1 e2 ...)
- (chi-let e r w s
- build-let
- (syntax (id ...))
- (syntax (val ...))
- (syntax (e1 e2 ...))))
- ((_ f ((id val) ...) e1 e2 ...)
- (id? (syntax f))
- (chi-let e r w s
- build-named-let
- (syntax (f id ...))
- (syntax (val ...))
- (syntax (e1 e2 ...))))
- (_ (syntax-error (source-wrap e w s)))))))
-
-
-(global-extend 'core 'letrec
- (lambda (e r w s)
- (syntax-case e ()
- ((_ ((id val) ...) e1 e2 ...)
- (let ((ids (syntax (id ...))))
- (if (not (valid-bound-ids? ids))
- (syntax-error e "duplicate bound variable in")
- (let ((labels (gen-labels ids))
- (new-vars (map gen-var ids)))
- (let ((w (make-binding-wrap ids labels w))
- (r (extend-var-env labels new-vars r)))
- (build-letrec s
- new-vars
- (map (lambda (x) (chi x r w)) (syntax (val ...)))
- (chi-body (syntax (e1 e2 ...)) (source-wrap e w s) r w)))))))
- (_ (syntax-error (source-wrap e w s))))))
-
-
-(global-extend 'core 'set!
- (lambda (e r w s)
- (syntax-case e ()
- ((_ id val)
- (id? (syntax id))
- (let ((val (chi (syntax val) r w))
- (n (id-var-name (syntax id) w)))
- (let ((b (lookup n r)))
- (case (binding-type b)
- ((lexical)
- (build-lexical-assignment s (binding-value b) val))
- ((global) (build-global-assignment s n val))
- ((displaced-lexical)
- (syntax-error (wrap (syntax id) w)
- "identifier out of context"))
- (else (syntax-error (source-wrap e w s)))))))
- ((_ (getter arg ...) val)
- (build-application s
- (chi (syntax (setter getter)) r w)
- (map (lambda (e) (chi e r w))
- (syntax (arg ... val)))))
- (_ (syntax-error (source-wrap e w s))))))
-
-(global-extend 'begin 'begin '())
-
-(global-extend 'define 'define '())
-
-(global-extend 'define-syntax 'define-syntax '())
-
-(global-extend 'eval-when 'eval-when '())
-
-(global-extend 'core 'syntax-case
- (let ()
- (define convert-pattern
- ; accepts pattern & keys
- ; returns syntax-dispatch pattern & ids
- (lambda (pattern keys)
- (let cvt ((p pattern) (n 0) (ids '()))
- (if (id? p)
- (if (bound-id-member? p keys)
- (values (vector 'free-id p) ids)
- (values 'any (cons (cons p n) ids)))
- (syntax-case p ()
- ((x dots)
- (ellipsis? (syntax dots))
- (call-with-values
- (lambda () (cvt (syntax x) (fx+ n 1) ids))
- (lambda (p ids)
- (values (if (eq? p 'any) 'each-any (vector 'each p))
- ids))))
- ((x . y)
- (call-with-values
- (lambda () (cvt (syntax y) n ids))
- (lambda (y ids)
- (call-with-values
- (lambda () (cvt (syntax x) n ids))
- (lambda (x ids)
- (values (cons x y) ids))))))
- (() (values '() ids))
- (#(x ...)
- (call-with-values
- (lambda () (cvt (syntax (x ...)) n ids))
- (lambda (p ids) (values (vector 'vector p) ids))))
- (x (values (vector 'atom (strip p empty-wrap)) ids)))))))
-
- (define build-dispatch-call
- (lambda (pvars exp y r)
- (let ((ids (map car pvars)) (levels (map cdr pvars)))
- (let ((labels (gen-labels ids)) (new-vars (map gen-var ids)))
- (build-application no-source
- (build-primref no-source 'apply)
- (list (build-lambda no-source new-vars
- (chi exp
- (extend-env
- labels
- (map (lambda (var level)
- (make-binding 'syntax `(,var . ,level)))
- new-vars
- (map cdr pvars))
- r)
- (make-binding-wrap ids labels empty-wrap)))
- y))))))
-
- (define gen-clause
- (lambda (x keys clauses r pat fender exp)
- (call-with-values
- (lambda () (convert-pattern pat keys))
- (lambda (p pvars)
- (cond
- ((not (distinct-bound-ids? (map car pvars)))
- (syntax-error pat
- "duplicate pattern variable in syntax-case pattern"))
- ((not (andmap (lambda (x) (not (ellipsis? (car x)))) pvars))
- (syntax-error pat
- "misplaced ellipsis in syntax-case pattern"))
- (else
- (let ((y (gen-var 'tmp)))
- ; fat finger binding and references to temp variable y
- (build-application no-source
- (build-lambda no-source (list y)
- (let ((y (build-lexical-reference 'value no-source y)))
- (build-conditional no-source
- (syntax-case fender ()
- (#t y)
- (_ (build-conditional no-source
- y
- (build-dispatch-call pvars fender y r)
- (build-data no-source #f))))
- (build-dispatch-call pvars exp y r)
- (gen-syntax-case x keys clauses r))))
- (list (if (eq? p 'any)
- (build-application no-source
- (build-primref no-source 'list)
- (list x))
- (build-application no-source
- (build-primref no-source 'syntax-dispatch)
- (list x (build-data no-source p)))))))))))))
-
- (define gen-syntax-case
- (lambda (x keys clauses r)
- (if (null? clauses)
- (build-application no-source
- (build-primref no-source 'syntax-error)
- (list x))
- (syntax-case (car clauses) ()
- ((pat exp)
- (if (and (id? (syntax pat))
- (andmap (lambda (x) (not (free-id=? (syntax pat) x)))
- (cons (syntax (... ...)) keys)))
- (let ((labels (list (gen-label)))
- (var (gen-var (syntax pat))))
- (build-application no-source
- (build-lambda no-source (list var)
- (chi (syntax exp)
- (extend-env labels
- (list (make-binding 'syntax `(,var . 0)))
- r)
- (make-binding-wrap (syntax (pat))
- labels empty-wrap)))
- (list x)))
- (gen-clause x keys (cdr clauses) r
- (syntax pat) #t (syntax exp))))
- ((pat fender exp)
- (gen-clause x keys (cdr clauses) r
- (syntax pat) (syntax fender) (syntax exp)))
- (_ (syntax-error (car clauses) "invalid syntax-case clause"))))))
-
- (lambda (e r w s)
- (let ((e (source-wrap e w s)))
- (syntax-case e ()
- ((_ val (key ...) m ...)
- (if (andmap (lambda (x) (and (id? x) (not (ellipsis? x))))
- (syntax (key ...)))
- (let ((x (gen-var 'tmp)))
- ; fat finger binding and references to temp variable x
- (build-application s
- (build-lambda no-source (list x)
- (gen-syntax-case (build-lexical-reference 'value no-source x)
- (syntax (key ...)) (syntax (m ...))
- r))
- (list (chi (syntax val) r empty-wrap))))
- (syntax-error e "invalid literals list in"))))))))
-
-;;; The portable sc-expand seeds chi-top's mode m with 'e (for
-;;; evaluating) and esew (which stands for "eval syntax expanders
-;;; when") with '(eval). In Chez Scheme, m is set to 'c instead of e
-;;; if we are compiling a file, and esew is set to
-;;; (eval-syntactic-expanders-when), which defaults to the list
-;;; '(compile load eval). This means that, by default, top-level
-;;; syntactic definitions are evaluated immediately after they are
-;;; expanded, and the expanded definitions are also residualized into
-;;; the object file if we are compiling a file.
-(set! sc-expand
- (let ((m 'e) (esew '(eval)))
- (lambda (x)
- (if (and (pair? x) (equal? (car x) noexpand))
- (cadr x)
- (chi-top x null-env top-wrap m esew)))))
-
-(set! sc-expand3
- (let ((m 'e) (esew '(eval)))
- (lambda (x . rest)
- (if (and (pair? x) (equal? (car x) noexpand))
- (cadr x)
- (chi-top x
- null-env
- top-wrap
- (if (null? rest) m (car rest))
- (if (or (null? rest) (null? (cdr rest)))
- esew
- (cadr rest)))))))
-
-(set! identifier?
- (lambda (x)
- (nonsymbol-id? x)))
-
-(set! datum->syntax-object
- (lambda (id datum)
- (make-syntax-object datum (syntax-object-wrap id))))
-
-(set! syntax-object->datum
- ; accepts any object, since syntax objects may consist partially
- ; or entirely of unwrapped, nonsymbolic data
- (lambda (x)
- (strip x empty-wrap)))
-
-(set! generate-temporaries
- (lambda (ls)
- (arg-check list? ls 'generate-temporaries)
- (map (lambda (x) (wrap (gensym-hook) top-wrap)) ls)))
-
-(set! free-identifier=?
- (lambda (x y)
- (arg-check nonsymbol-id? x 'free-identifier=?)
- (arg-check nonsymbol-id? y 'free-identifier=?)
- (free-id=? x y)))
-
-(set! bound-identifier=?
- (lambda (x y)
- (arg-check nonsymbol-id? x 'bound-identifier=?)
- (arg-check nonsymbol-id? y 'bound-identifier=?)
- (bound-id=? x y)))
-
-(set! syntax-error
- (lambda (object . messages)
- (for-each (lambda (x) (arg-check string? x 'syntax-error)) messages)
- (let ((message (if (null? messages)
- "invalid syntax"
- (apply string-append messages))))
- (error-hook #f message (strip object empty-wrap)))))
-
-(set! install-global-transformer
- (lambda (sym v)
- (arg-check symbol? sym 'define-syntax)
- (arg-check procedure? v 'define-syntax)
- (global-extend 'macro sym v)))
-
-;;; syntax-dispatch expects an expression and a pattern. If the expression
-;;; matches the pattern a list of the matching expressions for each
-;;; "any" is returned. Otherwise, #f is returned. (This use of #f will
-;;; not work on r4rs implementations that violate the ieee requirement
-;;; that #f and () be distinct.)
-
-;;; The expression is matched with the pattern as follows:
-
-;;; pattern: matches:
-;;; () empty list
-;;; any anything
-;;; (<pattern>1 . <pattern>2) (<pattern>1 . <pattern>2)
-;;; each-any (any*)
-;;; #(free-id <key>) <key> with free-identifier=?
-;;; #(each <pattern>) (<pattern>*)
-;;; #(vector <pattern>) (list->vector <pattern>)
-;;; #(atom <object>) <object> with "equal?"
-
-;;; Vector cops out to pair under assumption that vectors are rare. If
-;;; not, should convert to:
-;;; #(vector <pattern>*) #(<pattern>*)
-
-(let ()
-
-(define match-each
- (lambda (e p w)
- (cond
- ((annotation? e)
- (match-each (annotation-expression e) p w))
- ((pair? e)
- (let ((first (match (car e) p w '())))
- (and first
- (let ((rest (match-each (cdr e) p w)))
- (and rest (cons first rest))))))
- ((null? e) '())
- ((syntax-object? e)
- (match-each (syntax-object-expression e)
- p
- (join-wraps w (syntax-object-wrap e))))
- (else #f))))
-
-(define match-each-any
- (lambda (e w)
- (cond
- ((annotation? e)
- (match-each-any (annotation-expression e) w))
- ((pair? e)
- (let ((l (match-each-any (cdr e) w)))
- (and l (cons (wrap (car e) w) l))))
- ((null? e) '())
- ((syntax-object? e)
- (match-each-any (syntax-object-expression e)
- (join-wraps w (syntax-object-wrap e))))
- (else #f))))
-
-(define match-empty
- (lambda (p r)
- (cond
- ((null? p) r)
- ((eq? p 'any) (cons '() r))
- ((pair? p) (match-empty (car p) (match-empty (cdr p) r)))
- ((eq? p 'each-any) (cons '() r))
- (else
- (case (vector-ref p 0)
- ((each) (match-empty (vector-ref p 1) r))
- ((free-id atom) r)
- ((vector) (match-empty (vector-ref p 1) r)))))))
-
-(define match*
- (lambda (e p w r)
- (cond
- ((null? p) (and (null? e) r))
- ((pair? p)
- (and (pair? e) (match (car e) (car p) w
- (match (cdr e) (cdr p) w r))))
- ((eq? p 'each-any)
- (let ((l (match-each-any e w))) (and l (cons l r))))
- (else
- (case (vector-ref p 0)
- ((each)
- (if (null? e)
- (match-empty (vector-ref p 1) r)
- (let ((l (match-each e (vector-ref p 1) w)))
- (and l
- (let collect ((l l))
- (if (null? (car l))
- r
- (cons (map car l) (collect (map cdr l)))))))))
- ((free-id) (and (id? e) (free-id=? (wrap e w) (vector-ref p 1)) r))
- ((atom) (and (equal? (vector-ref p 1) (strip e w)) r))
- ((vector)
- (and (vector? e)
- (match (vector->list e) (vector-ref p 1) w r))))))))
-
-(define match
- (lambda (e p w r)
- (cond
- ((not r) #f)
- ((eq? p 'any) (cons (wrap e w) r))
- ((syntax-object? e)
- (match*
- (unannotate (syntax-object-expression e))
- p
- (join-wraps w (syntax-object-wrap e))
- r))
- (else (match* (unannotate e) p w r)))))
-
-(set! syntax-dispatch
- (lambda (e p)
- (cond
- ((eq? p 'any) (list e))
- ((syntax-object? e)
- (match* (unannotate (syntax-object-expression e))
- p (syntax-object-wrap e) '()))
- (else (match* (unannotate e) p empty-wrap '())))))
-))
-)
-
-(define-syntax with-syntax
- (lambda (x)
- (syntax-case x ()
- ((_ () e1 e2 ...)
- (syntax (begin e1 e2 ...)))
- ((_ ((out in)) e1 e2 ...)
- (syntax (syntax-case in () (out (begin e1 e2 ...)))))
- ((_ ((out in) ...) e1 e2 ...)
- (syntax (syntax-case (list in ...) ()
- ((out ...) (begin e1 e2 ...))))))))
-
-(define-syntax syntax-rules
- (lambda (x)
- (syntax-case x ()
- ((_ (k ...) ((keyword . pattern) template) ...)
- (syntax (lambda (x)
- (syntax-case x (k ...)
- ((dummy . pattern) (syntax template))
- ...)))))))
-
-(define-syntax let*
- (lambda (x)
- (syntax-case x ()
- ((let* ((x v) ...) e1 e2 ...)
- (andmap identifier? (syntax (x ...)))
- (let f ((bindings (syntax ((x v) ...))))
- (if (null? bindings)
- (syntax (let () e1 e2 ...))
- (with-syntax ((body (f (cdr bindings)))
- (binding (car bindings)))
- (syntax (let (binding) body)))))))))
-
-(define-syntax do
- (lambda (orig-x)
- (syntax-case orig-x ()
- ((_ ((var init . step) ...) (e0 e1 ...) c ...)
- (with-syntax (((step ...)
- (map (lambda (v s)
- (syntax-case s ()
- (() v)
- ((e) (syntax e))
- (_ (syntax-error orig-x))))
- (syntax (var ...))
- (syntax (step ...)))))
- (syntax-case (syntax (e1 ...)) ()
- (() (syntax (let doloop ((var init) ...)
- (if (not e0)
- (begin c ... (doloop step ...))))))
- ((e1 e2 ...)
- (syntax (let doloop ((var init) ...)
- (if e0
- (begin e1 e2 ...)
- (begin c ... (doloop step ...))))))))))))
-
-(define-syntax quasiquote
- (letrec
- ((quasicons
- (lambda (x y)
- (with-syntax ((x x) (y y))
- (syntax-case (syntax y) (quote list)
- ((quote dy)
- (syntax-case (syntax x) (quote)
- ((quote dx) (syntax (quote (dx . dy))))
- (_ (if (null? (syntax dy))
- (syntax (list x))
- (syntax (cons x y))))))
- ((list . stuff) (syntax (list x . stuff)))
- (else (syntax (cons x y)))))))
- (quasiappend
- (lambda (x y)
- (with-syntax ((x x) (y y))
- (syntax-case (syntax y) (quote)
- ((quote ()) (syntax x))
- (_ (syntax (append x y)))))))
- (quasivector
- (lambda (x)
- (with-syntax ((x x))
- (syntax-case (syntax x) (quote list)
- ((quote (x ...)) (syntax (quote #(x ...))))
- ((list x ...) (syntax (vector x ...)))
- (_ (syntax (list->vector x)))))))
- (quasi
- (lambda (p lev)
- (syntax-case p (unquote unquote-splicing quasiquote)
- ((unquote p)
- (if (= lev 0)
- (syntax p)
- (quasicons (syntax (quote unquote))
- (quasi (syntax (p)) (- lev 1)))))
- (((unquote-splicing p) . q)
- (if (= lev 0)
- (quasiappend (syntax p) (quasi (syntax q) lev))
- (quasicons (quasicons (syntax (quote unquote-splicing))
- (quasi (syntax (p)) (- lev 1)))
- (quasi (syntax q) lev))))
- ((quasiquote p)
- (quasicons (syntax (quote quasiquote))
- (quasi (syntax (p)) (+ lev 1))))
- ((p . q)
- (quasicons (quasi (syntax p) lev) (quasi (syntax q) lev)))
- (#(x ...) (quasivector (quasi (syntax (x ...)) lev)))
- (p (syntax (quote p)))))))
- (lambda (x)
- (syntax-case x ()
- ((_ e) (quasi (syntax e) 0))))))
-
-(define-syntax include
- (lambda (x)
- (define read-file
- (lambda (fn k)
- (let ((p (open-input-file fn)))
- (let f ((x (read p)))
- (if (eof-object? x)
- (begin (close-input-port p) '())
- (cons (datum->syntax-object k x)
- (f (read p))))))))
- (syntax-case x ()
- ((k filename)
- (let ((fn (syntax-object->datum (syntax filename))))
- (with-syntax (((exp ...) (read-file fn (syntax k))))
- (syntax (begin exp ...))))))))
-
-(define-syntax unquote
- (lambda (x)
- (syntax-case x ()
- ((_ e)
- (error 'unquote
- "expression ,~s not valid outside of quasiquote"
- (syntax-object->datum (syntax e)))))))
-
-(define-syntax unquote-splicing
- (lambda (x)
- (syntax-case x ()
- ((_ e)
- (error 'unquote-splicing
- "expression ,@~s not valid outside of quasiquote"
- (syntax-object->datum (syntax e)))))))
-
-(define-syntax case
- (lambda (x)
- (syntax-case x ()
- ((_ e m1 m2 ...)
- (with-syntax
- ((body (let f ((clause (syntax m1)) (clauses (syntax (m2 ...))))
- (if (null? clauses)
- (syntax-case clause (else)
- ((else e1 e2 ...) (syntax (begin e1 e2 ...)))
- (((k ...) e1 e2 ...)
- (syntax (if (memv t '(k ...)) (begin e1 e2 ...))))
- (_ (syntax-error x)))
- (with-syntax ((rest (f (car clauses) (cdr clauses))))
- (syntax-case clause (else)
- (((k ...) e1 e2 ...)
- (syntax (if (memv t '(k ...))
- (begin e1 e2 ...)
- rest)))
- (_ (syntax-error x))))))))
- (syntax (let ((t e)) body)))))))
-
-(define-syntax identifier-syntax
- (lambda (x)
- (syntax-case x ()
- ((_ e)
- (syntax
- (lambda (x)
- (syntax-case x ()
- (id
- (identifier? (syntax id))
- (syntax e))
- ((_ x (... ...))
- (syntax (e x (... ...)))))))))))
-
diff --git a/ice-9/q.scm b/ice-9/q.scm
deleted file mode 100644
index b09f69537..000000000
--- a/ice-9/q.scm
+++ /dev/null
@@ -1,178 +0,0 @@
-;;;; q.scm --- Queues
-;;;;
-;;;; Copyright (C) 1995, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-;;; Commentary:
-
-;;; Q: Based on the interface to
-;;;
-;;; "queue.scm" Queues/Stacks for Scheme
-;;; Written by Andrew Wilcox (awilcox@astro.psu.edu) on April 1, 1992.
-
-;;; {Q}
-;;;
-;;; A list is just a bunch of cons pairs that follows some constrains,
-;;; right? Association lists are the same. Hash tables are just
-;;; vectors and association lists. You can print them, read them,
-;;; write them as constants, pun them off as other data structures
-;;; etc. This is good. This is lisp. These structures are fast and
-;;; compact and easy to manipulate arbitrarily because of their
-;;; simple, regular structure and non-disjointedness (associations
-;;; being lists and so forth).
-;;;
-;;; So I figured, queues should be the same -- just a "subtype" of cons-pair
-;;; structures in general.
-;;;
-;;; A queue is a cons pair:
-;;; ( <the-q> . <last-pair> )
-;;;
-;;; <the-q> is a list of things in the q. New elements go at the end
-;;; of that list.
-;;;
-;;; <last-pair> is #f if the q is empty, and otherwise is the last
-;;; pair of <the-q>.
-;;;
-;;; q's print nicely, but alas, they do not read well because the
-;;; eq?-ness of <last-pair> and (last-pair <the-q>) is lost by read.
-;;;
-;;; All the functions that aren't explicitly defined to return
-;;; something else (a queue element; a boolean value) return the queue
-;;; object itself.
-
-;;; Code:
-
-(define-module (ice-9 q)
- :export (sync-q! make-q q? q-empty? q-empty-check q-front q-rear
- q-remove! q-push! enq! q-pop! deq! q-length))
-
-;;; sync-q!
-;;; The procedure
-;;;
-;;; (sync-q! q)
-;;;
-;;; recomputes and resets the <last-pair> component of a queue.
-;;;
-(define (sync-q! q)
- (set-cdr! q (if (pair? (car q)) (last-pair (car q))
- #f))
- q)
-
-;;; make-q
-;;; return a new q.
-;;;
-(define (make-q) (cons '() #f))
-
-;;; q? obj
-;;; Return true if obj is a Q.
-;;; An object is a queue if it is equal? to '(() . #f)
-;;; or it is a pair P with (list? (car P))
-;;; and (eq? (cdr P) (last-pair (car P))).
-;;;
-(define (q? obj)
- (and (pair? obj)
- (if (pair? (car obj))
- (eq? (cdr obj) (last-pair (car obj)))
- (and (null? (car obj))
- (not (cdr obj))))))
-
-;;; q-empty? obj
-;;;
-(define (q-empty? obj) (null? (car obj)))
-
-;;; q-empty-check q
-;;; Throw a q-empty exception if Q is empty.
-(define (q-empty-check q) (if (q-empty? q) (throw 'q-empty q)))
-
-;;; q-front q
-;;; Return the first element of Q.
-(define (q-front q) (q-empty-check q) (caar q))
-
-;;; q-rear q
-;;; Return the last element of Q.
-(define (q-rear q) (q-empty-check q) (cadr q))
-
-;;; q-remove! q obj
-;;; Remove all occurences of obj from Q.
-(define (q-remove! q obj)
- (set-car! q (delq! obj (car q)))
- (sync-q! q))
-
-;;; q-push! q obj
-;;; Add obj to the front of Q
-(define (q-push! q obj)
- (let ((h (cons obj (car q))))
- (set-car! q h)
- (or (cdr q) (set-cdr! q h)))
- q)
-
-;;; enq! q obj
-;;; Add obj to the rear of Q
-(define (enq! q obj)
- (let ((h (cons obj '())))
- (if (null? (car q))
- (set-car! q h)
- (set-cdr! (cdr q) h))
- (set-cdr! q h))
- q)
-
-;;; q-pop! q
-;;; Take the front of Q and return it.
-(define (q-pop! q)
- (q-empty-check q)
- (let ((it (caar q))
- (next (cdar q)))
- (if (not next)
- (set-cdr! q #f))
- (set-car! q next)
- it))
-
-;;; deq! q
-;;; Take the front of Q and return it.
-(define deq! q-pop!)
-
-;;; q-length q
-;;; Return the number of enqueued elements.
-;;;
-(define (q-length q) (length (car q)))
-
-;;; q.scm ends here
diff --git a/ice-9/r4rs.scm b/ice-9/r4rs.scm
deleted file mode 100644
index 66a3952b8..000000000
--- a/ice-9/r4rs.scm
+++ /dev/null
@@ -1,236 +0,0 @@
-;;;; r4rs.scm --- definitions needed for libguile to be R4RS compliant
-;;;; Jim Blandy <jimb@cyclic.com> --- October 1996
-
-;;;; Copyright (C) 1996, 1997, 1998, 2000, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-
-
-;;;; apply and call-with-current-continuation
-
-;;; We want these to be tail-recursive, so instead of using primitive
-;;; procedures, we define them as closures in terms of the primitive
-;;; macros @apply and @call-with-current-continuation.
-(set! apply (lambda (fun . args) (@apply fun (apply:nconc2last args))))
-(set-procedure-property! apply 'name 'apply)
-(define (call-with-current-continuation proc)
- (@call-with-current-continuation proc))
-(define (call-with-values producer consumer)
- (@call-with-values producer consumer))
-
-
-;;;; Basic Port Code
-
-;;; Specifically, the parts of the low-level port code that are written in
-;;; Scheme rather than C.
-;;;
-;;; WARNING: the parts of this interface that refer to file ports
-;;; are going away. It would be gone already except that it is used
-;;; "internally" in a few places.
-
-
-;;; OPEN_READ, OPEN_WRITE, and OPEN_BOTH are used to request the
-;;; proper mode to open files in.
-;;;
-;;; If we want to support systems that do CRLF->LF translation, like
-;;; Windows, then we should have a symbol in scmconfig.h made visible
-;;; to the Scheme level that we can test here, and autoconf magic to
-;;; #define it when appropriate. Windows will probably just have a
-;;; hand-generated scmconfig.h file.
-(define OPEN_READ "r")
-(define OPEN_WRITE "w")
-(define OPEN_BOTH "r+")
-
-(define *null-device* "/dev/null")
-
-(define (open-input-file str)
- "Takes a string naming an existing file and returns an input port
-capable of delivering characters from the file. If the file
-cannot be opened, an error is signalled."
- (open-file str OPEN_READ))
-
-(define (open-output-file str)
- "Takes a string naming an output file to be created and returns an
-output port capable of writing characters to a new file by that
-name. If the file cannot be opened, an error is signalled. If a
-file with the given name already exists, the effect is unspecified."
- (open-file str OPEN_WRITE))
-
-(define (open-io-file str)
- "Open file with name STR for both input and output."
- (open-file str OPEN_BOTH))
-
-(define close-io-port close-port)
-
-(define (call-with-input-file str proc)
- "PROC should be a procedure of one argument, and STR should be a
-string naming a file. The file must
-already exist. These procedures call PROC
-with one argument: the port obtained by opening the named file for
-input or output. If the file cannot be opened, an error is
-signalled. If the procedure returns, then the port is closed
-automatically and the value yielded by the procedure is returned.
-If the procedure does not return, then the port will not be closed
-automatically unless it is possible to prove that the port will
-never again be used for a read or write operation."
- (let* ((file (open-input-file str))
- (ans (proc file)))
- (close-input-port file)
- ans))
-
-(define (call-with-output-file str proc)
- "PROC should be a procedure of one argument, and STR should be a
-string naming a file. The behaviour is unspecified if the file
-already exists. These procedures call PROC
-with one argument: the port obtained by opening the named file for
-input or output. If the file cannot be opened, an error is
-signalled. If the procedure returns, then the port is closed
-automatically and the value yielded by the procedure is returned.
-If the procedure does not return, then the port will not be closed
-automatically unless it is possible to prove that the port will
-never again be used for a read or write operation."
- (let* ((file (open-output-file str))
- (ans (proc file)))
- (close-output-port file)
- ans))
-
-(define (with-input-from-port port thunk)
- (let* ((swaports (lambda () (set! port (set-current-input-port port)))))
- (dynamic-wind swaports thunk swaports)))
-
-(define (with-output-to-port port thunk)
- (let* ((swaports (lambda () (set! port (set-current-output-port port)))))
- (dynamic-wind swaports thunk swaports)))
-
-(define (with-error-to-port port thunk)
- (let* ((swaports (lambda () (set! port (set-current-error-port port)))))
- (dynamic-wind swaports thunk swaports)))
-
-(define (with-input-from-file file thunk)
- "THUNK must be a procedure of no arguments, and FILE must be a
-string naming a file. The file must already exist. The file is opened for
-input, an input port connected to it is made
-the default value returned by `current-input-port',
-and the THUNK is called with no arguments.
-When the THUNK returns, the port is closed and the previous
-default is restored. Returns the value yielded by THUNK. If an
-escape procedure is used to escape from the continuation of these
-procedures, their behavior is implementation dependent."
- (let* ((nport (open-input-file file))
- (ans (with-input-from-port nport thunk)))
- (close-port nport)
- ans))
-
-(define (with-output-to-file file thunk)
- "THUNK must be a procedure of no arguments, and FILE must be a
-string naming a file. The effect is unspecified if the file already exists.
-The file is opened for output, an output port connected to it is made
-the default value returned by `current-output-port',
-and the THUNK is called with no arguments.
-When the THUNK returns, the port is closed and the previous
-default is restored. Returns the value yielded by THUNK. If an
-escape procedure is used to escape from the continuation of these
-procedures, their behavior is implementation dependent."
- (let* ((nport (open-output-file file))
- (ans (with-output-to-port nport thunk)))
- (close-port nport)
- ans))
-
-(define (with-error-to-file file thunk)
- "THUNK must be a procedure of no arguments, and FILE must be a
-string naming a file. The effect is unspecified if the file already exists.
-The file is opened for output, an output port connected to it is made
-the default value returned by `current-error-port',
-and the THUNK is called with no arguments.
-When the THUNK returns, the port is closed and the previous
-default is restored. Returns the value yielded by THUNK. If an
-escape procedure is used to escape from the continuation of these
-procedures, their behavior is implementation dependent."
- (let* ((nport (open-output-file file))
- (ans (with-error-to-port nport thunk)))
- (close-port nport)
- ans))
-
-(define (with-input-from-string string thunk)
- "THUNK must be a procedure of no arguments.
-The test of STRING is opened for
-input, an input port connected to it is made,
-and the THUNK is called with no arguments.
-When the THUNK returns, the port is closed.
-Returns the value yielded by THUNK. If an
-escape procedure is used to escape from the continuation of these
-procedures, their behavior is implementation dependent."
- (call-with-input-string string
- (lambda (p) (with-input-from-port p thunk))))
-
-(define (with-output-to-string thunk)
- "Calls THUNK and returns its output as a string."
- (call-with-output-string
- (lambda (p) (with-output-to-port p thunk))))
-
-(define (with-error-to-string thunk)
- "Calls THUNK and returns its error output as a string."
- (call-with-output-string
- (lambda (p) (with-error-to-port p thunk))))
-
-(define the-eof-object (call-with-input-string "" (lambda (p) (read-char p))))
-
-
-;;;; Loading
-
-(if (not (defined? '%load-verbosely))
- (define %load-verbosely #f))
-(define (assert-load-verbosity v) (set! %load-verbosely v))
-
-(define (%load-announce file)
- (if %load-verbosely
- (with-output-to-port (current-error-port)
- (lambda ()
- (display ";;; ")
- (display "loading ")
- (display file)
- (newline)
- (force-output)))))
-
-(set! %load-hook %load-announce)
-
-(define (load name)
- (start-stack 'load-stack
- (primitive-load name)))
diff --git a/ice-9/r5rs.scm b/ice-9/r5rs.scm
deleted file mode 100644
index 0704ce5a2..000000000
--- a/ice-9/r5rs.scm
+++ /dev/null
@@ -1,69 +0,0 @@
-;;;; Copyright (C) 2000, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-;;;; R5RS bindings
-
-(define-module (ice-9 r5rs)
- :export (scheme-report-environment
- ;;transcript-on
- ;;transcript-off
- )
- :re-export (interaction-environment
-
- call-with-input-file call-with-output-file
- with-input-from-file with-output-to-file
- open-input-file open-output-file
- close-input-port close-output-port
-
- load))
-
-(module-use! %module-public-interface (resolve-interface '(ice-9 safe-r5rs)))
-
-(define scheme-report-interface %module-public-interface)
-
-(define (scheme-report-environment n)
- (if (not (= n 5))
- (scm-error 'misc-error 'scheme-report-environment
- "~A is not a valid version"
- (list n)
- '()))
- scheme-report-interface)
diff --git a/ice-9/rdelim.scm b/ice-9/rdelim.scm
deleted file mode 100644
index 97c27039f..000000000
--- a/ice-9/rdelim.scm
+++ /dev/null
@@ -1,197 +0,0 @@
-;;; installed-scm-file
-
-;;;; Copyright (C) 1997, 1999, 2000, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-
-;;; This is the Scheme part of the module for delimited I/O. It's
-;;; similar to (scsh rdelim) but somewhat incompatible.
-
-(define-module (ice-9 rdelim)
- :export (read-line read-line! read-delimited read-delimited!
- %read-delimited! %read-line write-line) ; C
- )
-
-(%init-rdelim-builtins)
-
-(define (read-line! string . maybe-port)
- ;; corresponds to SCM_LINE_INCREMENTORS in libguile.
- (define scm-line-incrementors "\n")
-
- (let* ((port (if (pair? maybe-port)
- (car maybe-port)
- (current-input-port))))
- (let* ((rv (%read-delimited! scm-line-incrementors
- string
- #t
- port))
- (terminator (car rv))
- (nchars (cdr rv)))
- (cond ((and (= nchars 0)
- (eof-object? terminator))
- terminator)
- ((not terminator) #f)
- (else nchars)))))
-
-(define (read-delimited! delims buf . args)
- (let* ((num-args (length args))
- (port (if (> num-args 0)
- (car args)
- (current-input-port)))
- (handle-delim (if (> num-args 1)
- (cadr args)
- 'trim))
- (start (if (> num-args 2)
- (caddr args)
- 0))
- (end (if (> num-args 3)
- (cadddr args)
- (string-length buf))))
- (let* ((rv (%read-delimited! delims
- buf
- (not (eq? handle-delim 'peek))
- port
- start
- end))
- (terminator (car rv))
- (nchars (cdr rv)))
- (cond ((or (not terminator) ; buffer filled
- (eof-object? terminator))
- (if (zero? nchars)
- (if (eq? handle-delim 'split)
- (cons terminator terminator)
- terminator)
- (if (eq? handle-delim 'split)
- (cons nchars terminator)
- nchars)))
- (else
- (case handle-delim
- ((trim peek) nchars)
- ((concat) (string-set! buf (+ nchars start) terminator)
- (+ nchars 1))
- ((split) (cons nchars terminator))
- (else (error "unexpected handle-delim value: "
- handle-delim))))))))
-
-(define (read-delimited delims . args)
- (let* ((port (if (pair? args)
- (let ((pt (car args)))
- (set! args (cdr args))
- pt)
- (current-input-port)))
- (handle-delim (if (pair? args)
- (car args)
- 'trim)))
- (let loop ((substrings '())
- (total-chars 0)
- (buf-size 100)) ; doubled each time through.
- (let* ((buf (make-string buf-size))
- (rv (%read-delimited! delims
- buf
- (not (eq? handle-delim 'peek))
- port))
- (terminator (car rv))
- (nchars (cdr rv))
- (join-substrings
- (lambda ()
- (apply string-append
- (reverse
- (cons (if (and (eq? handle-delim 'concat)
- (not (eof-object? terminator)))
- (string terminator)
- "")
- (cons (substring buf 0 nchars)
- substrings))))))
- (new-total (+ total-chars nchars)))
- (cond ((not terminator)
- ;; buffer filled.
- (loop (cons (substring buf 0 nchars) substrings)
- new-total
- (* buf-size 2)))
- ((eof-object? terminator)
- (if (zero? new-total)
- (if (eq? handle-delim 'split)
- (cons terminator terminator)
- terminator)
- (if (eq? handle-delim 'split)
- (cons (join-substrings) terminator)
- (join-substrings))))
- (else
- (case handle-delim
- ((trim peek concat) (join-substrings))
- ((split) (cons (join-substrings) terminator))
-
-
- (else (error "unexpected handle-delim value: "
- handle-delim)))))))))
-
-;;; read-line [PORT [HANDLE-DELIM]] reads a newline-terminated string
-;;; from PORT. The return value depends on the value of HANDLE-DELIM,
-;;; which may be one of the symbols `trim', `concat', `peek' and
-;;; `split'. If it is `trim' (the default), the trailing newline is
-;;; removed and the string is returned. If `concat', the string is
-;;; returned with the trailing newline intact. If `peek', the newline
-;;; is left in the input port buffer and the string is returned. If
-;;; `split', the newline is split from the string and read-line
-;;; returns a pair consisting of the truncated string and the newline.
-
-(define (read-line . args)
- (let* ((port (if (null? args)
- (current-input-port)
- (car args)))
- (handle-delim (if (> (length args) 1)
- (cadr args)
- 'trim))
- (line/delim (%read-line port))
- (line (car line/delim))
- (delim (cdr line/delim)))
- (case handle-delim
- ((trim) line)
- ((split) line/delim)
- ((concat) (if (and (string? line) (char? delim))
- (string-append line (string delim))
- line))
- ((peek) (if (char? delim)
- (unread-char delim port))
- line)
- (else
- (error "unexpected handle-delim value: " handle-delim)))))
diff --git a/ice-9/receive.scm b/ice-9/receive.scm
deleted file mode 100644
index 56e5ecc45..000000000
--- a/ice-9/receive.scm
+++ /dev/null
@@ -1,51 +0,0 @@
-;;;; SRFI-8
-
-;;; Copyright (C) 2000, 2001 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, 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 GUILE.
-;;;
-;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;; code from other Free Software Foundation releases into a copy of
-;;; GUILE, 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 GUILE, it is your choice
-;;; whether to permit this exception to apply to your modifications.
-;;; If you do not wish that, delete this exception notice.
-
-(define-module (ice-9 receive)
- :export (receive)
- :no-backtrace
- )
-
-(define-macro (receive vars vals . body)
- `(call-with-values (lambda () ,vals)
- (lambda ,vars ,@body)))
diff --git a/ice-9/regex.scm b/ice-9/regex.scm
deleted file mode 100644
index 97eb0110b..000000000
--- a/ice-9/regex.scm
+++ /dev/null
@@ -1,239 +0,0 @@
-;;;; Copyright (C) 1997, 1999, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-;;; Commentary:
-
-;; These procedures are exported:
-;; (match:count match)
-;; (match:string match)
-;; (match:prefix match)
-;; (match:suffix match)
-;; (regexp-match? match)
-;; (regexp-quote string)
-;; (match:start match . submatch-num)
-;; (match:end match . submatch-num)
-;; (match:substring match . submatch-num)
-;; (string-match pattern str . start)
-;; (regexp-substitute port match . items)
-;; (fold-matches regexp string init proc . flags)
-;; (list-matches regexp string . flags)
-;; (regexp-substitute/global port regexp string . items)
-
-;;; Code:
-
-;;;; POSIX regex support functions.
-
-(define-module (ice-9 regex)
- :export (match:count match:string match:prefix match:suffix
- regexp-match? regexp-quote match:start match:end match:substring
- string-match regexp-substitute fold-matches list-matches
- regexp-substitute/global))
-
-;;; FIXME:
-;;; It is not clear what should happen if a `match' function
-;;; is passed a `match number' which is out of bounds for the
-;;; regexp match: return #f, or throw an error? These routines
-;;; throw an out-of-range error.
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;; These procedures are not defined in SCSH, but I found them useful.
-
-(define (match:count match)
- (- (vector-length match) 1))
-
-(define (match:string match)
- (vector-ref match 0))
-
-(define (match:prefix match)
- (substring (match:string match) 0 (match:start match 0)))
-
-(define (match:suffix match)
- (substring (match:string match) (match:end match 0)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;; SCSH compatibility routines.
-
-(define (regexp-match? match)
- (and (vector? match)
- (string? (vector-ref match 0))
- (let loop ((i 1))
- (cond ((>= i (vector-length match)) #t)
- ((and (pair? (vector-ref match i))
- (integer? (car (vector-ref match i)))
- (integer? (cdr (vector-ref match i))))
- (loop (+ 1 i)))
- (else #f)))))
-
-(define (regexp-quote string)
- (call-with-output-string
- (lambda (p)
- (let loop ((i 0))
- (and (< i (string-length string))
- (begin
- (case (string-ref string i)
- ((#\* #\. #\( #\) #\+ #\? #\\ #\^ #\$ #\{ #\})
- (write-char #\\ p)))
- (write-char (string-ref string i) p)
- (loop (1+ i))))))))
-
-(define (match:start match . args)
- (let* ((matchnum (if (pair? args)
- (+ 1 (car args))
- 1))
- (start (car (vector-ref match matchnum))))
- (if (= start -1) #f start)))
-
-(define (match:end match . args)
- (let* ((matchnum (if (pair? args)
- (+ 1 (car args))
- 1))
- (end (cdr (vector-ref match matchnum))))
- (if (= end -1) #f end)))
-
-(define (match:substring match . args)
- (let* ((matchnum (if (pair? args)
- (car args)
- 0))
- (start (match:start match matchnum))
- (end (match:end match matchnum)))
- (and start end (substring (match:string match) start end))))
-
-(define (string-match pattern str . args)
- (let ((rx (make-regexp pattern))
- (start (if (pair? args) (car args) 0)))
- (regexp-exec rx str start)))
-
-(define (regexp-substitute port match . items)
- ;; If `port' is #f, send output to a string.
- (if (not port)
- (call-with-output-string
- (lambda (p)
- (apply regexp-substitute p match items)))
-
- ;; Otherwise, process each substitution argument in `items'.
- (for-each (lambda (obj)
- (cond ((string? obj) (display obj port))
- ((integer? obj) (display (match:substring match obj) port))
- ((eq? 'pre obj) (display (match:prefix match) port))
- ((eq? 'post obj) (display (match:suffix match) port))
- (else (error 'wrong-type-arg obj))))
- items)))
-
-;;; If we call fold-matches, below, with a regexp that can match the
-;;; empty string, it's not obvious what "all the matches" means. How
-;;; many empty strings are there in the string "a"? Our answer:
-;;;
-;;; This function applies PROC to every non-overlapping, maximal
-;;; match of REGEXP in STRING.
-;;;
-;;; "non-overlapping": There are two non-overlapping matches of "" in
-;;; "a" --- one before the `a', and one after. There are three
-;;; non-overlapping matches of "q|x*" in "aqb": the empty strings
-;;; before `a' and after `b', and `q'. The two empty strings before
-;;; and after `q' don't count, because they overlap with the match of
-;;; "q".
-;;;
-;;; "maximal": There are three distinct maximal matches of "x*" in
-;;; "axxxb": one before the `a', one covering `xxx', and one after the
-;;; `b'. Around or within `xxx', only the match covering all three
-;;; x's counts, because the rest are not maximal.
-
-(define (fold-matches regexp string init proc . flags)
- (let ((regexp (if (regexp? regexp) regexp (make-regexp regexp)))
- (flags (if (null? flags) 0 flags)))
- (let loop ((start 0)
- (value init)
- (abuts #f)) ; True if start abuts a previous match.
- (let ((m (if (> start (string-length string)) #f
- (regexp-exec regexp string start flags))))
- (cond
- ((not m) value)
- ((and (= (match:start m) (match:end m)) abuts)
- ;; We matched an empty string, but that would overlap the
- ;; match immediately before. Try again at a position
- ;; further to the right.
- (loop (+ start 1) value #f))
- (else
- (loop (match:end m) (proc m value) #t)))))))
-
-(define (list-matches regexp string . flags)
- (reverse! (apply fold-matches regexp string '() cons flags)))
-
-(define (regexp-substitute/global port regexp string . items)
-
- ;; If `port' is #f, send output to a string.
- (if (not port)
- (call-with-output-string
- (lambda (p)
- (apply regexp-substitute/global p regexp string items)))
-
- ;; Walk the set of non-overlapping, maximal matches.
- (let next-match ((matches (list-matches regexp string))
- (start 0))
- (if (null? matches)
- (display (substring string start) port)
- (let ((m (car matches)))
-
- ;; Process all of the items for this match. Don't use
- ;; for-each, because we need to make sure 'post at the
- ;; end of the item list is a tail call.
- (let next-item ((items items))
-
- (define (do-item item)
- (cond
- ((string? item) (display item port))
- ((integer? item) (display (match:substring m item) port))
- ((procedure? item) (display (item m) port))
- ((eq? item 'pre)
- (display
- (substring string start (match:start m))
- port))
- ((eq? item 'post)
- (next-match (cdr matches) (match:end m)))
- (else (error 'wrong-type-arg item))))
-
- (if (pair? items)
- (if (null? (cdr items))
- (do-item (car items)) ; This is a tail call.
- (begin
- (do-item (car items)) ; This is not.
- (next-item (cdr items)))))))))))
diff --git a/ice-9/runq.scm b/ice-9/runq.scm
deleted file mode 100644
index 4f8f8026c..000000000
--- a/ice-9/runq.scm
+++ /dev/null
@@ -1,266 +0,0 @@
-;;;; runq.scm --- the runq data structure
-;;;;
-;;;; Copyright (C) 1996, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-;;; Commentary:
-
-;;; One way to schedule parallel computations in a serial environment is
-;;; to explicitly divide each task up into small, finite execution time,
-;;; strips. Then you interleave the execution of strips from various
-;;; tasks to achieve a kind of parallelism. Runqs are a handy data
-;;; structure for this style of programming.
-;;;
-;;; We use thunks (nullary procedures) and lists of thunks to represent
-;;; strips. By convention, the return value of a strip-thunk must either
-;;; be another strip or the value #f.
-;;;
-;;; A runq is a procedure that manages a queue of strips. Called with no
-;;; arguments, it processes one strip from the queue. Called with
-;;; arguments, the arguments form a control message for the queue. The
-;;; first argument is a symbol which is the message selector.
-;;;
-;;; A strip is processed this way: If the strip is a thunk, the thunk is
-;;; called -- if it returns a strip, that strip is added back to the
-;;; queue. To process a strip which is a list of thunks, the CAR of that
-;;; list is called. After a call to that CAR, there are 0, 1, or 2 strips
-;;; -- perhaps one returned by the thunk, and perhaps the CDR of the
-;;; original strip if that CDR is not nil. The runq puts whichever of
-;;; these strips exist back on the queue. (The exact order in which
-;;; strips are put back on the queue determines the scheduling behavior of
-;;; a particular queue -- it's a parameter.)
-
-;;; Code:
-
-(define-module (ice-9 runq)
- :use-module (ice-9 q)
- :export (runq-control make-void-runq make-fair-runq
- make-exclusive-runq make-subordinate-runq-to strip-sequence
- fair-strip-subtask))
-
-;;;;
-;;; (runq-control q msg . args)
-;;;
-;;; processes in the default way the control messages that
-;;; can be sent to a runq. Q should be an ordinary
-;;; Q (see utils/q.scm).
-;;;
-;;; The standard runq messages are:
-;;;
-;;; 'add! strip0 strip1... ;; to enqueue one or more strips
-;;; 'enqueue! strip0 strip1... ;; to enqueue one or more strips
-;;; 'push! strip0 ... ;; add strips to the front of the queue
-;;; 'empty? ;; true if it is
-;;; 'length ;; how many strips in the queue?
-;;; 'kill! ;; empty the queue
-;;; else ;; throw 'not-understood
-;;;
-(define (runq-control q msg . args)
- (case msg
- ((add!) (for-each (lambda (t) (enq! q t)) args) '*unspecified*)
- ((enqueue!) (for-each (lambda (t) (enq! q t)) args) '*unspecified*)
- ((push!) (for-each (lambda (t) (q-push! q t)) args) '*unspecified*)
- ((empty?) (q-empty? q))
- ((length) (q-length q))
- ((kill!) (set! q (make-q)))
- (else (throw 'not-understood msg args))))
-
-(define (run-strip thunk) (catch #t thunk (lambda ign (warn 'runq-strip thunk ign) #f)))
-
-;;;;
-;;; make-void-runq
-;;;
-;;; Make a runq that discards all messages except "length", for which
-;;; it returns 0.
-;;;
-(define (make-void-runq)
- (lambda opts
- (and opts
- (apply-to-args opts
- (lambda (msg . args)
- (case msg
- ((length) 0)
- (else #f)))))))
-
-;;;;
-;;; (make-fair-runq)
-;;;
-;;; Returns a runq procedure.
-;;; Called with no arguments, the procedure processes one strip from the queue.
-;;; Called with arguments, it uses runq-control.
-;;;
-;;; In a fair runq, if a strip returns a new strip X, X is added
-;;; to the end of the queue, meaning it will be the last to execute
-;;; of all the remaining procedures.
-;;;
-(define (make-fair-runq)
- (letrec ((q (make-q))
- (self
- (lambda ctl
- (if ctl
- (apply runq-control q ctl)
- (and (not (q-empty? q))
- (let ((next-strip (deq! q)))
- (cond
- ((procedure? next-strip) (let ((k (run-strip next-strip)))
- (and k (enq! q k))))
- ((pair? next-strip) (let ((k (run-strip (car next-strip))))
- (and k (enq! q k)))
- (if (not (null? (cdr next-strip)))
- (enq! q (cdr next-strip)))))
- self))))))
- self))
-
-
-;;;;
-;;; (make-exclusive-runq)
-;;;
-;;; Returns a runq procedure.
-;;; Called with no arguments, the procedure processes one strip from the queue.
-;;; Called with arguments, it uses runq-control.
-;;;
-;;; In an exclusive runq, if a strip W returns a new strip X, X is added
-;;; to the front of the queue, meaning it will be the next to execute
-;;; of all the remaining procedures.
-;;;
-;;; An exception to this occurs if W was the CAR of a list of strips.
-;;; In that case, after the return value of W is pushed onto the front
-;;; of the queue, the CDR of the list of strips is pushed in front
-;;; of that (if the CDR is not nil). This way, the rest of the thunks
-;;; in the list that contained W have priority over the return value of W.
-;;;
-(define (make-exclusive-runq)
- (letrec ((q (make-q))
- (self
- (lambda ctl
- (if ctl
- (apply runq-control q ctl)
- (and (not (q-empty? q))
- (let ((next-strip (deq! q)))
- (cond
- ((procedure? next-strip) (let ((k (run-strip next-strip)))
- (and k (q-push! q k))))
- ((pair? next-strip) (let ((k (run-strip (car next-strip))))
- (and k (q-push! q k)))
- (if (not (null? (cdr next-strip)))
- (q-push! q (cdr next-strip)))))
- self))))))
- self))
-
-
-;;;;
-;;; (make-subordinate-runq-to superior basic-inferior)
-;;;
-;;; Returns a runq proxy for the runq basic-inferior.
-;;;
-;;; The proxy watches for operations on the basic-inferior that cause
-;;; a transition from a queue length of 0 to a non-zero length and
-;;; vice versa. While the basic-inferior queue is not empty,
-;;; the proxy installs a task on the superior runq. Each strip
-;;; of that task processes N strips from the basic-inferior where
-;;; N is the length of the basic-inferior queue when the proxy
-;;; strip is entered. [Countless scheduling variations are possible.]
-;;;
-(define (make-subordinate-runq-to superior-runq basic-runq)
- (let ((runq-task (cons #f #f)))
- (set-car! runq-task
- (lambda ()
- (if (basic-runq 'empty?)
- (set-cdr! runq-task #f)
- (do ((n (basic-runq 'length) (1- n)))
- ((<= n 0) #f)
- (basic-runq)))))
- (letrec ((self
- (lambda ctl
- (if (not ctl)
- (let ((answer (basic-runq)))
- (self 'empty?)
- answer)
- (begin
- (case (car ctl)
- ((suspend) (set-cdr! runq-task #f))
- (else (let ((answer (apply basic-runq ctl)))
- (if (and (not (cdr runq-task)) (not (basic-runq 'empty?)))
- (begin
- (set-cdr! runq-task runq-task)
- (superior-runq 'add! runq-task)))
- answer))))))))
- self)))
-
-;;;;
-;;; (define fork-strips (lambda args args))
-;;; Return a strip that starts several strips in
-;;; parallel. If this strip is enqueued on a fair
-;;; runq, strips of the parallel subtasks will run
-;;; round-robin style.
-;;;
-(define fork-strips (lambda args args))
-
-
-;;;;
-;;; (strip-sequence . strips)
-;;;
-;;; Returns a new strip which is the concatenation of the argument strips.
-;;;
-(define ((strip-sequence . strips))
- (let loop ((st (let ((a strips)) (set! strips #f) a)))
- (and (not (null? st))
- (let ((then ((car st))))
- (if then
- (lambda () (loop (cons then (cdr st))))
- (lambda () (loop (cdr st))))))))
-
-
-;;;;
-;;; (fair-strip-subtask . initial-strips)
-;;;
-;;; Returns a new strip which is the synchronos, fair,
-;;; parallel execution of the argument strips.
-;;;
-;;;
-;;;
-(define (fair-strip-subtask . initial-strips)
- (let ((st (make-fair-runq)))
- (apply st 'add! initial-strips)
- st))
-
-;;; runq.scm ends here
diff --git a/ice-9/rw.scm b/ice-9/rw.scm
deleted file mode 100644
index 418eb08e3..000000000
--- a/ice-9/rw.scm
+++ /dev/null
@@ -1,52 +0,0 @@
-;;; installed-scm-file
-
-;;;; Copyright (C) 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-
-;;; This is the Scheme part of (ice-9 rw), which is a subset of
-;;; (scsh rw).
-
-(define-module (ice-9 rw)
- :export (read-string!/partial write-string/partial))
-
-(%init-rw-builtins)
diff --git a/ice-9/safe-r5rs.scm b/ice-9/safe-r5rs.scm
deleted file mode 100644
index c60fb820f..000000000
--- a/ice-9/safe-r5rs.scm
+++ /dev/null
@@ -1,169 +0,0 @@
-;;;; Copyright (C) 2000, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-;;;; Safe subset of R5RS bindings
-
-(define-module (ice-9 safe-r5rs)
- :re-export (eqv? eq? equal?
- number? complex? real? rational? integer?
- exact? inexact?
- = < > <= >=
- zero? positive? negative? odd? even?
- max min
- + * - /
- abs
- quotient remainder modulo
- gcd lcm
- ;;numerator denominator XXX
- ;;rationalize XXX
- floor ceiling truncate round
- exp log sin cos tan asin acos atan
- sqrt
- expt
- make-rectangular make-polar real-part imag-part magnitude angle
- exact->inexact inexact->exact
-
- number->string string->number
-
- boolean?
- not
-
- pair?
- cons car cdr
- set-car! set-cdr!
- caar cadr cdar cddr
- caaar caadr cadar caddr cdaar cdadr cddar cdddr
- caaaar caaadr caadar caaddr cadaar cadadr caddar cadddr
- cdaaar cdaadr cdadar cdaddr cddaar cddadr cdddar cddddr
- null?
- list?
- list
- length
- append
- reverse
- list-tail list-ref
- memq memv member
- assq assv assoc
-
- symbol?
- symbol->string string->symbol
-
- char?
- char=? char<? char>? char<=? char>=?
- char-ci=? char-ci<? char-ci>? char-ci<=? char-ci>=?
- char-alphabetic? char-numeric? char-whitespace?
- char-upper-case? char-lower-case?
- char->integer integer->char
- char-upcase
- char-downcase
-
- string?
- make-string
- string
- string-length
- string-ref string-set!
- string=? string-ci=?
- string<? string>? string<=? string>=?
- string-ci<? string-ci>? string-ci<=? string-ci>=?
- substring
- string-length
- string-append
- string->list list->string
- string-copy string-fill!
-
- vector?
- make-vector
- vector
- vector-length
- vector-ref vector-set!
- vector->list list->vector
- vector-fill!
-
- procedure?
- apply
- map
- for-each
- force
-
- call-with-current-continuation
-
- values
- call-with-values
- dynamic-wind
-
- eval
-
- input-port? output-port?
- current-input-port current-output-port
-
- read
- read-char
- peek-char
- eof-object?
- char-ready?
-
- write
- display
- newline
- write-char
-
- ;;transcript-on
- ;;transcript-off
- )
-
- :export (null-environment))
-
-(define null-interface (resolve-interface '(ice-9 null)))
-
-(module-use! %module-public-interface null-interface)
-
-(define (null-environment n)
- (if (not (= n 5))
- (scm-error 'misc-error 'null-environment
- "~A is not a valid version"
- (list n)
- '()))
- ;; Note that we need to create a *fresh* interface
- (let ((interface (make-module 31)))
- (set-module-kind! interface 'interface)
- (module-use! interface null-interface)
- interface))
diff --git a/ice-9/safe.scm b/ice-9/safe.scm
deleted file mode 100644
index aca656d1d..000000000
--- a/ice-9/safe.scm
+++ /dev/null
@@ -1,59 +0,0 @@
-;;;; Copyright (C) 2000, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-;;;; Safe subset of R5RS bindings
-
-(define-module (ice-9 safe)
- :export (safe-environment make-safe-module))
-
-(define safe-r5rs-interface (resolve-interface '(ice-9 safe-r5rs)))
-
-(define (safe-environment n)
- (if (not (= n 5))
- (scm-error 'misc-error 'safe-environment
- "~A is not a valid version"
- (list n)
- '()))
- safe-r5rs-interface)
-
-(define (make-safe-module)
- (make-module 1021 (list safe-r5rs-interface)))
diff --git a/ice-9/session.scm b/ice-9/session.scm
deleted file mode 100644
index 00a023084..000000000
--- a/ice-9/session.scm
+++ /dev/null
@@ -1,499 +0,0 @@
-;;;; Copyright (C) 1997, 2000, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-
-(define-module (ice-9 session)
- :use-module (ice-9 documentation)
- :use-module (ice-9 regex)
- :use-module (ice-9 rdelim)
- :export (help apropos apropos-internal apropos-fold
- apropos-fold-accessible apropos-fold-exported apropos-fold-all
- source arity system-module))
-
-
-
-;;; Documentation
-;;;
-(define help
- (procedure->syntax
- (lambda (exp env)
- "(help [NAME])
-Prints useful information. Try `(help)'."
- (cond ((not (= (length exp) 2))
- (help-usage))
- ((not (provided? 'regex))
- (display "`help' depends on the `regex' feature.
-You don't seem to have regular expressions installed.\n"))
- (else
- (let ((name (cadr exp))
- (not-found (lambda (type x)
- (simple-format #t "No ~A found for ~A\n"
- type x))))
- (cond
-
- ;; SYMBOL
- ((symbol? name)
- (help-doc name
- (simple-format
- #f "^~A$"
- (regexp-quote (symbol->string name)))))
-
- ;; "STRING"
- ((string? name)
- (help-doc name name))
-
- ;; (unquote SYMBOL)
- ((and (list? name)
- (= (length name) 2)
- (eq? (car name) 'unquote))
- (cond ((object-documentation
- (local-eval (cadr name) env))
- => write-line)
- (else (not-found 'documentation (cadr name)))))
-
- ;; (quote SYMBOL)
- ((and (list? name)
- (= (length name) 2)
- (eq? (car name) 'quote)
- (symbol? (cadr name)))
- (cond ((search-documentation-files (cadr name))
- => write-line)
- (else (not-found 'documentation (cadr name)))))
-
- ;; (SYM1 SYM2 ...)
- ((and (list? name)
- (and-map symbol? name)
- (not (null? name))
- (not (eq? (car name) 'quote)))
- (cond ((module-commentary name)
- => (lambda (doc)
- (display name) (write-line " commentary:")
- (write-line doc)))
- (else (not-found 'commentary name))))
-
- ;; unrecognized
- (else
- (help-usage)))
- *unspecified*))))))
-
-(define (module-filename name) ; fixme: better way? / done elsewhere?
- (let* ((name (map symbol->string name))
- (reverse-name (reverse name))
- (leaf (car reverse-name))
- (dir-hint-module-name (reverse (cdr reverse-name)))
- (dir-hint (apply string-append
- (map (lambda (elt)
- (string-append elt "/"))
- dir-hint-module-name))))
- (%search-load-path (in-vicinity dir-hint leaf))))
-
-(define (module-commentary name)
- (cond ((module-filename name) => file-commentary)
- (else #f)))
-
-(define (help-doc term regexp)
- (let ((entries (apropos-fold (lambda (module name object data)
- (cons (list module
- name
- (object-documentation object)
- (cond ((closure? object)
- "a procedure")
- ((procedure? object)
- "a primitive procedure")
- (else
- "an object")))
- data))
- '()
- regexp
- apropos-fold-exported))
- (module car)
- (name cadr)
- (doc caddr)
- (type cadddr))
- (cond ((not (null? entries))
- (let ((first? #t)
- (undocumented-entries '())
- (documented-entries '())
- (documentations '()))
-
- (for-each (lambda (entry)
- (let ((entry-summary (simple-format
- #f "~S: ~S\n"
- (module-name (module entry))
- (name entry))))
- (if (doc entry)
- (begin
- (set! documented-entries
- (cons entry-summary documented-entries))
- ;; *fixme*: Use `describe' when we have GOOPS?
- (set! documentations
- (cons (simple-format
- #f "`~S' is ~A in the ~S module.\n\n~A\n"
- (name entry)
- (type entry)
- (module-name (module entry))
- (doc entry))
- documentations)))
- (set! undocumented-entries
- (cons entry-summary
- undocumented-entries)))))
- entries)
-
- (if (and (not (null? documented-entries))
- (or (> (length documented-entries) 1)
- (not (null? undocumented-entries))))
- (begin
- (display "Documentation found for:\n")
- (for-each (lambda (entry) (display entry))
- documented-entries)
- (set! first? #f)))
-
- (for-each (lambda (entry)
- (if first?
- (set! first? #f)
- (newline))
- (display entry))
- documentations)
-
- (if (not (null? undocumented-entries))
- (begin
- (if first?
- (set! first? #f)
- (newline))
- (display "No documentation found for:\n")
- (for-each (lambda (entry) (display entry))
- undocumented-entries)))))
- ((search-documentation-files term)
- => (lambda (doc)
- (write-line "Documentation from file:")
- (write-line doc)))
- (else
- ;; no matches
- (display "Did not find any object ")
- (simple-format #t
- (if (symbol? term)
- "named `~A'\n"
- "matching regexp \"~A\"\n")
- term)))))
-
-(define (help-usage)
- (display "Usage: (help NAME) gives documentation about objects named NAME (a symbol)
- (help REGEXP) ditto for objects with names matching REGEXP (a string)
- (help 'NAME) gives documentation for NAME, even if it is not an object
- (help ,EXPR) gives documentation for object returned by EXPR
- (help (my module)) gives module commentary for `(my module)'
- (help) gives this text
-
-`help' searches among bindings exported from loaded modules, while
-`apropos' searches among bindings visible from the \"current\" module.
-
-Examples: (help help)
- (help cons)
- (help \"output-string\")
-
-Other useful sources of helpful information:
-
-(apropos STRING)
-(arity PROCEDURE)
-(name PROCEDURE-OR-MACRO)
-(source PROCEDURE-OR-MACRO)
-
-Tools:
-
-(backtrace) ;show backtrace from last error
-(debug) ;enter the debugger
-(trace [PROCEDURE]) ;trace procedure (no arg => show)
-(untrace [PROCEDURE]) ;untrace (no arg => untrace all)
-
-(OPTIONSET-options 'full) ;display option information
-(OPTIONSET-enable 'OPTION)
-(OPTIONSET-disable 'OPTION)
-(OPTIONSET-set! OPTION VALUE)
-
-where OPTIONSET is one of debug, read, eval, print
-
-"))
-
-;;; {Apropos}
-;;;
-;;; Author: Roland Orre <orre@nada.kth.se>
-;;;
-
-(define (apropos rgx . options)
- "Search for bindings: apropos regexp {options= 'full 'shadow 'value}"
- (if (zero? (string-length rgx))
- "Empty string not allowed"
- (let* ((match (make-regexp rgx))
- (modules (cons (current-module)
- (module-uses (current-module))))
- (separator #\tab)
- (shadow (member 'shadow options))
- (value (member 'value options)))
- (cond ((member 'full options)
- (set! shadow #t)
- (set! value #t)))
- (for-each
- (lambda (module)
- (let* ((name (module-name module))
- (obarray (module-obarray module)))
- ;; XXX - should use hash-fold here
- (array-for-each
- (lambda (oblist)
- (for-each
- (lambda (x)
- (cond ((regexp-exec match (symbol->string (car x)))
- (display name)
- (display ": ")
- (display (car x))
- (cond ((variable-bound? (cdr x))
- (let ((val (variable-ref (cdr x))))
- (cond ((or (procedure? val) value)
- (display separator)
- (display val)))))
- (else
- (display separator)
- (display "(unbound)")))
- (if (and shadow
- (not (eq? (module-ref module
- (car x))
- (module-ref (current-module)
- (car x)))))
- (display " shadowed"))
- (newline))))
- oblist))
- obarray)))
- modules))))
-
-(define (apropos-internal rgx)
- "Return a list of accessible variable names."
- (apropos-fold (lambda (module name var data)
- (cons name data))
- '()
- rgx
- (apropos-fold-accessible (current-module))))
-
-(define (apropos-fold proc init rgx folder)
- "Folds PROCEDURE over bindings matching third arg REGEXP.
-
-Result is
-
- (PROCEDURE MODULE1 NAME1 VALUE1
- (PROCEDURE MODULE2 NAME2 VALUE2
- ...
- (PROCEDURE MODULEn NAMEn VALUEn INIT)))
-
-where INIT is the second arg to `apropos-fold'.
-
-Fourth arg FOLDER is one of
-
- (apropos-fold-accessible MODULE) ;fold over bindings accessible in MODULE
- apropos-fold-exported ;fold over all exported bindings
- apropos-fold-all ;fold over all bindings"
- (let ((match (make-regexp rgx))
- (recorded (make-vector 61 '())))
- (let ((fold-module
- (lambda (module data)
- (let* ((obarray-filter
- (lambda (name val data)
- (if (and (regexp-exec match (symbol->string name))
- (not (hashq-get-handle recorded name)))
- (begin
- (hashq-set! recorded name #t)
- (proc module name val data))
- data)))
- (module-filter
- (lambda (name var data)
- (if (variable-bound? var)
- (obarray-filter name (variable-ref var) data)
- data))))
- (cond (module (hash-fold module-filter
- data
- (module-obarray module)))
- (else data))))))
- (folder fold-module init))))
-
-(define (make-fold-modules init-thunk traverse extract)
- "Return procedure capable of traversing a forest of modules.
-The forest traversed is the image of the forest generated by root
-modules returned by INIT-THUNK and the generator TRAVERSE.
-It is an image under the mapping EXTRACT."
- (lambda (fold-module init)
- (let* ((table (make-hash-table 31))
- (first? (lambda (obj)
- (let* ((handle (hash-create-handle! table obj #t))
- (first? (cdr handle)))
- (set-cdr! handle #f)
- first?))))
- (let rec ((data init)
- (modules (init-thunk)))
- (do ((modules modules (cdr modules))
- (data data (if (first? (car modules))
- (rec (fold-module (extract (car modules)) data)
- (traverse (car modules)))
- data)))
- ((null? modules) data))))))
-
-(define (apropos-fold-accessible module)
- (make-fold-modules (lambda () (list module))
- module-uses
- identity))
-
-(define (root-modules)
- (cons the-root-module
- (submodules (nested-ref the-root-module '(app modules)))))
-
-(define (submodules m)
- (hash-fold (lambda (name var data)
- (let ((obj (and (variable-bound? var) (variable-ref var))))
- (if (and (module? obj)
- (eq? (module-kind obj) 'directory))
- (cons obj data)
- data)))
- '()
- (module-obarray m)))
-
-(define apropos-fold-exported
- (make-fold-modules root-modules submodules module-public-interface))
-
-(define apropos-fold-all
- (make-fold-modules root-modules submodules identity))
-
-(define (source obj)
- (cond ((procedure? obj) (procedure-source obj))
- ((macro? obj) (procedure-source (macro-transformer obj)))
- (else #f)))
-
-(define (arity obj)
- (define (display-arg-list arg-list)
- (display #\`)
- (display (car arg-list))
- (let loop ((ls (cdr arg-list)))
- (cond ((null? ls)
- (display #\'))
- ((not (pair? ls))
- (display "', the rest in `")
- (display ls)
- (display #\'))
- (else
- (if (pair? (cdr ls))
- (display "', `")
- (display "' and `"))
- (display (car ls))
- (loop (cdr ls))))))
- (define (display-arg-list/summary arg-list type)
- (let ((len (length arg-list)))
- (display len)
- (display " ")
- (display type)
- (if (> len 1)
- (display " arguments: ")
- (display " argument: "))
- (display-arg-list arg-list)))
- (cond
- ((procedure-property obj 'arglist)
- => (lambda (arglist)
- (let ((required-args (car arglist))
- (optional-args (cadr arglist))
- (keyword-args (caddr arglist))
- (allow-other-keys? (cadddr arglist))
- (rest-arg (car (cddddr arglist)))
- (need-punctuation #f))
- (cond ((not (null? required-args))
- (display-arg-list/summary required-args "required")
- (set! need-punctuation #t)))
- (cond ((not (null? optional-args))
- (if need-punctuation (display ", "))
- (display-arg-list/summary optional-args "optional")
- (set! need-punctuation #t)))
- (cond ((not (null? keyword-args))
- (if need-punctuation (display ", "))
- (display-arg-list/summary keyword-args "keyword")
- (set! need-punctuation #t)))
- (cond (allow-other-keys?
- (if need-punctuation (display ", "))
- (display "other keywords allowed")
- (set! need-punctuation #t)))
- (cond (rest-arg
- (if need-punctuation (display ", "))
- (display "the rest in `")
- (display rest-arg)
- (display "'"))))))
- (else
- (let ((arity (procedure-property obj 'arity)))
- (display (car arity))
- (cond ((caddr arity)
- (display " or more"))
- ((not (zero? (cadr arity)))
- (display " required and ")
- (display (cadr arity))
- (display " optional")))
- (if (and (not (caddr arity))
- (= (car arity) 1)
- (<= (cadr arity) 1))
- (display " argument")
- (display " arguments"))
- (if (closure? obj)
- (let ((formals (cadr (procedure-source obj))))
- (cond
- ((pair? formals)
- (display ": ")
- (display-arg-list formals))
- (else
- (display " in `")
- (display formals)
- (display #\'))))))))
- (display ".\n"))
-
-(define system-module
- (procedure->syntax
- (lambda (exp env)
- (let* ((m (nested-ref the-root-module
- (append '(app modules) (cadr exp)))))
- (if (not m)
- (error "Couldn't find any module named" (cadr exp)))
- (let ((s (not (procedure-property (module-eval-closure m)
- 'system-module))))
- (set-system-module! m s)
- (string-append "Module " (symbol->string (module-name m))
- " is now a " (if s "system" "user") " module."))))))
-
-;;; session.scm ends here
diff --git a/ice-9/slib.scm b/ice-9/slib.scm
deleted file mode 100644
index cde54c339..000000000
--- a/ice-9/slib.scm
+++ /dev/null
@@ -1,331 +0,0 @@
-;;;; slib.scm --- definitions needed to get SLIB to work with Guile
-;;;;
-;;;; Copyright (C) 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
-;;;;
-;;;; This file is part of GUILE.
-;;;;
-;;;; GUILE 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.
-;;;;
-;;;; GUILE 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 GUILE; 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-(define-module (ice-9 slib)
- :export (slib:load slib:load-source defmacro:load
- implementation-vicinity library-vicinity home-vicinity
- scheme-implementation-type scheme-implementation-version
- output-port-width output-port-height identity array-indexes
- make-random-state require slib:error slib:exit slib:warn slib:eval
- defmacro:eval logical:logand logical:logior logical:logxor
- logical:lognot logical:ash logical:logcount logical:integer-length
- logical:bit-extract logical:integer-expt logical:ipow-by-squaring
- slib:eval-load slib:tab slib:form-feed difftime offset-time
- software-type)
- :no-backtrace)
-
-
-
-(define (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 (read port) (read port)))
- ((eof-object? o))
- (evl o))
- (set! *load-pathname* old-load-pathname)))))
-
-
-
-(define slib:exit quit)
-(define slib:error error)
-(define slib:warn warn)
-(define slib:eval (lambda (x) (eval x slib-module)))
-(define defmacro:eval (lambda (x) (eval x (interaction-environment))))
-(define logical:logand logand)
-(define logical:logior logior)
-(define logical:logxor logxor)
-(define logical:lognot lognot)
-(define logical:ash ash)
-(define logical:logcount logcount)
-(define logical:integer-length integer-length)
-(define logical:bit-extract bit-extract)
-(define logical:integer-expt integer-expt)
-(define logical:ipow-by-squaring ipow-by-squaring)
-(define slib:eval-load eval-load)
-(define slib:tab #\tab)
-(define slib:form-feed #\page)
-
-(define slib-module (current-module))
-
-(define (defined? symbol)
- (module-defined? slib-module symbol))
-
-;;; *FEATURES* should be set to a list of symbols describing features
-;;; of this implementation. Suggestions for features are:
-(define *features*
- (append
- '(
- source ;can load scheme source files
- ;(slib:load-source "filename")
-; compiled ;can load compiled files
- ;(slib:load-compiled "filename")
-
- ;; Scheme report features
-
-; rev5-report ;conforms to
- eval ;R5RS two-argument eval
-; values ;R5RS multiple values
- dynamic-wind ;R5RS dynamic-wind
-; macro ;R5RS high level macros
- delay ;has DELAY and FORCE
- multiarg-apply ;APPLY can take more than 2 args.
-; rationalize
- rev4-optional-procedures ;LIST-TAIL, STRING->LIST,
- ;LIST->STRING, STRING-COPY,
- ;STRING-FILL!, LIST->VECTOR,
- ;VECTOR->LIST, and VECTOR-FILL!
-
-; rev4-report ;conforms to
-
-; ieee-p1178 ;conforms to
-
-; rev3-report ;conforms to
-
- rev2-procedures ;SUBSTRING-MOVE-LEFT!,
- ;SUBSTRING-MOVE-RIGHT!,
- ;SUBSTRING-FILL!,
- ;STRING-NULL?, APPEND!, 1+,
- ;-1+, <?, <=?, =?, >?, >=?
-; object-hash ;has OBJECT-HASH
-
- multiarg/and- ;/ and - can take more than 2 args.
- with-file ;has WITH-INPUT-FROM-FILE and
- ;WITH-OUTPUT-FROM-FILE
-; transcript ;TRANSCRIPT-ON and TRANSCRIPT-OFF
-; ieee-floating-point ;conforms to IEEE Standard 754-1985
- ;IEEE Standard for Binary
- ;Floating-Point Arithmetic.
- full-continuation ;can return multiple times
-
- ;; Other common features
-
-; srfi ;srfi-0, COND-EXPAND finds all srfi-*
-; sicp ;runs code from Structure and
- ;Interpretation of Computer
- ;Programs by Abelson and Sussman.
- defmacro ;has Common Lisp DEFMACRO
-; record ;has user defined data structures
- string-port ;has CALL-WITH-INPUT-STRING and
- ;CALL-WITH-OUTPUT-STRING
-; sort
-; pretty-print
-; object->string
-; format ;Common-lisp output formatting
-; trace ;has macros: TRACE and UNTRACE
-; compiler ;has (COMPILER)
-; ed ;(ED) is editor
- random
- )
-
- (if (defined? 'getenv)
- '(getenv)
- '())
-
- (if (defined? 'current-time)
- '(current-time)
- '())
-
- (if (defined? 'system)
- '(system)
- '())
-
- (if (defined? 'array?)
- '(array)
- '())
-
- (if (defined? 'char-ready?)
- '(char-ready?)
- '())
-
- (if (defined? 'array-for-each)
- '(array-for-each)
- '())
-
- *features*))
-
-
-;;; FIXME: Because uers want require to search the path, this uses
-;;; load-from-path, which probably isn't a hot idea. slib
-;;; doesn't expect this function to search a path, so I expect to get
-;;; bug reports at some point complaining that the wrong file gets
-;;; loaded when something accidentally appears in the path before
-;;; slib, etc. ad nauseum. However, the right fix seems to involve
-;;; changing catalog:get in slib/require.scm, and I don't expect
-;;; Aubrey will integrate such a change. So I'm just going to punt
-;;; for the time being.
-(define (slib:load name)
- (save-module-excursion
- (lambda ()
- (set-current-module slib-module)
- (let ((errinfo (catch 'system-error
- (lambda ()
- (load-from-path name)
- #f)
- (lambda args args))))
- (if (and errinfo
- (catch 'system-error
- (lambda ()
- (load-from-path
- (string-append name ".scm"))
- #f)
- (lambda args args)))
- (apply throw errinfo))))))
-
-(define slib:load-source slib:load)
-(define defmacro:load slib:load)
-
-(define slib-parent-dir
- (let* ((path (%search-load-path "slib/require.scm")))
- (if path
- (substring path 0 (- (string-length path) 17))
- (error "Could not find slib/require.scm in " %load-path))))
-
-(define (implementation-vicinity)
- (string-append slib-parent-dir "/"))
-(define (library-vicinity)
- (string-append (implementation-vicinity) "slib/"))
-(define home-vicinity
- (let ((home-path (getenv "HOME")))
- (lambda () home-path)))
-(define (scheme-implementation-type) 'guile)
-(define scheme-implementation-version version)
-;;; (scheme-implementation-home-page) should return a (string) URI
-;;; (Uniform Resource Identifier) for this scheme implementation's home
-;;; page; or false if there isn't one.
-(define (scheme-implementation-home-page)
- "http://www.gnu.org/software/guile/guile.html")
-
-(define (output-port-width . arg) 80)
-(define (output-port-height . arg) 24)
-(define (identity x) x)
-
-;;; {array-for-each}
-(define (array-indexes ra)
- (let ((ra0 (apply make-array '() (array-shape ra))))
- (array-index-map! ra0 list)
- ra0))
-
-;;; {Random numbers}
-;;;
-(define (make-random-state . args)
- (let ((seed (if (null? args) *random-state* (car args))))
- (cond ((string? seed))
- ((number? seed) (set! seed (number->string seed)))
- (else (let ()
- (require 'object->string)
- (set! seed (object->limited-string seed 50)))))
- (seed->random-state seed)))
-
-;;; {Time}
-;;;
-
-(define difftime -)
-(define offset-time +)
-
-
-(define %system-define define)
-
-(define define
- (procedure->memoizing-macro
- (lambda (exp env)
- (if (= (length env) 1)
- `(define-public ,@(cdr exp))
- `(%system-define ,@(cdr exp))))))
-
-;;; Hack to make syncase macros work in the slib module
-(if (nested-ref the-root-module '(app modules ice-9 syncase))
- (set-object-property! (module-local-variable (current-module) 'define)
- '*sc-expander*
- '(define)))
-
-(define (software-type)
- "Return a symbol describing the current platform's operating system.
-This may be one of AIX, VMS, UNIX, COHERENT, WINDOWS, MS-DOS, OS/2,
-THINKC, AMIGA, ATARIST, MACH, or ACORN.
-
-Note that most varieties of Unix are considered to be simply \"UNIX\".
-That is because when a program depends on features that are not present
-on every operating system, it is usually better to test for the presence
-or absence of that specific feature. The return value of
-@code{software-type} should only be used for this purpose when there is
-no other easy or unambiguous way of detecting such features."
- 'UNIX)
-
-(slib:load (in-vicinity (library-vicinity) "require.scm"))
-
-(define require require:require)
-
-;; {Extensions to the require system so that the user can add new
-;; require modules easily.}
-
-(define *vicinity-table*
- (list
- (cons 'implementation (implementation-vicinity))
- (cons 'library (library-vicinity))))
-
-(define (install-require-vicinity name vicinity)
- (let ((entry (assq name *vicinity-table*)))
- (if entry
- (set-cdr! entry vicinity)
- (set! *vicinity-table*
- (acons name vicinity *vicinity-table*)))))
-
-(define (install-require-module name vicinity-name file-name)
- (if (not *catalog*) ;Fix which loads catalog in slib
- (catalog:get 'random)) ;(doesn't load the feature 'random)
- (let ((entry (assq name *catalog*))
- (vicinity (cdr (assq vicinity-name *vicinity-table*))))
- (let ((path-name (in-vicinity vicinity file-name)))
- (if entry
- (set-cdr! entry path-name)
- (set! *catalog*
- (acons name path-name *catalog*))))))
-
-(define (make-exchanger obj)
- (lambda (rep) (let ((old obj)) (set! obj rep) old)))
diff --git a/ice-9/stack-catch.scm b/ice-9/stack-catch.scm
deleted file mode 100644
index c5f37c199..000000000
--- a/ice-9/stack-catch.scm
+++ /dev/null
@@ -1,70 +0,0 @@
-;;; installed-scm-file
-
-;;;; Copyright (C) 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-(define-module (ice-9 stack-catch)
- :export (stack-catch))
-
-(define (stack-catch key thunk handler)
- "Like @code{catch}, invoke @var{thunk} in the dynamic context of
-@var{handler} for exceptions matching @var{key}, but also save the
-current stack state in the @var{the-last-stack} fluid, for the purpose
-of debugging or re-throwing of an error. If thunk throws to the
-symbol @var{key}, then @var{handler} is invoked this way:\n
-@example
-(handler key args ...)
-@end example\n
-@var{key} is a symbol or #t.\n
-@var{thunk} takes no arguments. If @var{thunk} returns normally, that
-is the return value of @code{catch}.\n
-Handler is invoked outside the scope of its own @code{catch}. If
-@var{handler} again throws to the same key, a new handler from further
-up the call chain is invoked.\n
-If the key is @code{#t}, then a throw to @emph{any} symbol will match
-this call to @code{catch}."
- (catch key
- (lambda ()
- (lazy-catch key
- thunk
- lazy-handler-dispatch))
- handler))
diff --git a/ice-9/streams.scm b/ice-9/streams.scm
deleted file mode 100644
index 518adbf22..000000000
--- a/ice-9/streams.scm
+++ /dev/null
@@ -1,242 +0,0 @@
-;;;; streams.scm --- general lazy streams
-;;;; -*- Scheme -*-
-
-;;;; Copyright (C) 1999, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-
-;; the basic stream operations are inspired by
-;; (i.e. ripped off) Scheme48's `stream' package,
-;; modulo stream-empty? -> stream-null? renaming.
-
-(define-module (ice-9 streams)
- :export (make-stream
- stream-car stream-cdr stream-null?
- list->stream vector->stream port->stream
- stream->list stream->reversed-list
- stream->list&length stream->reversed-list&length
- stream->vector
- stream-fold stream-for-each stream-map))
-
-;; Use:
-;;
-;; (make-stream producer initial-state)
-;; - PRODUCER is a function of one argument, the current state.
-;; it should return either a pair or an atom (i.e. anything that
-;; is not a pair). if PRODUCER returns a pair, then the car of the pair
-;; is the stream's head value, and the cdr is the state to be fed
-;; to PRODUCER later. if PRODUCER returns an atom, then the stream is
-;; considered depleted.
-;;
-;; (stream-car stream)
-;; (stream-cdr stream)
-;; (stream-null? stream)
-;; - yes.
-;;
-;; (list->stream list)
-;; (vector->stream vector)
-;; - make a stream with the same contents as LIST/VECTOR.
-;;
-;; (port->stream port read)
-;; - makes a stream of values which are obtained by READing from PORT.
-;;
-;; (stream->list stream)
-;; - returns a list with the same contents as STREAM.
-;;
-;; (stream->reversed-list stream)
-;; - as above, except the contents are in reversed order.
-;;
-;; (stream->list&length stream)
-;; (stream->reversed-list&length stream)
-;; - multiple-valued versions of the above two, the second value is the
-;; length of the resulting list (so you get it for free).
-;;
-;; (stream->vector stream)
-;; - yes.
-;;
-;; (stream-fold proc init stream0 ...)
-;; - PROC must take (+ 1 <number-of-stream-arguments>) arguments, like this:
-;; (PROC car0 ... init). *NOTE*: the INIT argument is last, not first.
-;; I don't have any preference either way, but it's consistent with
-;; `fold[lr]' procedures from SRFI-1. PROC is applied to successive
-;; elements of the given STREAM(s) and to the value of the previous
-;; invocation (INIT on the first invocation). the last result from PROC
-;; is returned.
-;;
-;; (stream-for-each proc stream0 ...)
-;; - like `for-each' we all know and love.
-;;
-;; (stream-map proc stream0 ...)
-;; - like `map', except returns a stream of results, and not a list.
-
-;; Code:
-
-(define (make-stream m state)
- (delay
- (let ((o (m state)))
- (if (pair? o)
- (cons (car o)
- (make-stream m (cdr o)))
- '()))))
-
-(define (stream-car stream)
- "Returns the first element in STREAM. This is equivalent to `car'."
- (car (force stream)))
-
-(define (stream-cdr stream)
- "Returns the first tail of STREAM. Equivalent to `(force (cdr STREAM))'."
- (cdr (force stream)))
-
-(define (stream-null? stream)
- "Returns `#t' if STREAM is the end-of-stream marker; otherwise
-returns `#f'. This is equivalent to `null?', but should be used
-whenever testing for the end of a stream."
- (null? (force stream)))
-
-(define (list->stream l)
- "Returns a newly allocated stream whose elements are the elements of
-LIST. Equivalent to `(apply stream LIST)'."
- (make-stream
- (lambda (l) l)
- l))
-
-(define (vector->stream v)
- (make-stream
- (let ((len (vector-length v)))
- (lambda (i)
- (or (= i len)
- (cons (vector-ref v i) (+ 1 i)))))
- 0))
-
-(define (stream->reversed-list&length stream)
- (let loop ((s stream) (acc '()) (len 0))
- (if (stream-null? s)
- (values acc len)
- (loop (stream-cdr s) (cons (stream-car s) acc) (+ 1 len)))))
-
-(define (stream->reversed-list stream)
- (call-with-values
- (lambda () (stream->reversed-list&length stream))
- (lambda (l len) l)))
-
-(define (stream->list&length stream)
- (call-with-values
- (lambda () (stream->reversed-list&length stream))
- (lambda (l len) (values (reverse! l) len))))
-
-(define (stream->list stream)
- "Returns a newly allocated list whose elements are the elements of STREAM.
-If STREAM has infinite length this procedure will not terminate."
- (reverse! (stream->reversed-list stream)))
-
-(define (stream->vector stream)
- (call-with-values
- (lambda () (stream->reversed-list&length stream))
- (lambda (l len)
- (let ((v (make-vector len)))
- (let loop ((i 0) (l l))
- (if (not (null? l))
- (begin
- (vector-set! v (- len i 1) (car l))
- (loop (+ 1 i) (cdr l)))))
- v))))
-
-(define (stream-fold f init stream . rest)
- (if (null? rest) ;fast path
- (stream-fold-one f init stream)
- (stream-fold-many f init (cons stream rest))))
-
-(define (stream-fold-one f r stream)
- (if (stream-null? stream)
- r
- (stream-fold-one f (f (stream-car stream) r) (stream-cdr stream))))
-
-(define (stream-fold-many f r streams)
- (if (or-map stream-null? streams)
- r
- (stream-fold-many f
- (apply f (let recur ((cars
- (map stream-car streams)))
- (if (null? cars)
- (list r)
- (cons (car cars)
- (recur (cdr cars))))))
- (map stream-cdr streams))))
-
-(define (stream-for-each f stream . rest)
- (if (null? rest) ;fast path
- (stream-for-each-one f stream)
- (stream-for-each-many f (cons stream rest))))
-
-(define (stream-for-each-one f stream)
- (if (not (stream-null? stream))
- (begin
- (f (stream-car stream))
- (stream-for-each-one f (stream-cdr stream)))))
-
-(define (stream-for-each-many f streams)
- (if (not (or-map stream-null? streams))
- (begin
- (apply f (map stream-car streams))
- (stream-for-each-one f (map stream-cdr streams)))))
-
-(define (stream-map f stream . rest)
- "Returns a newly allocated stream, each element being the result of
-invoking F with the corresponding elements of the STREAMs
-as its arguments."
- (if (null? rest) ;fast path
- (make-stream (lambda (s)
- (or (stream-null? s)
- (cons (f (stream-car s)) (stream-cdr s))))
- stream)
- (make-stream (lambda (streams)
- (or (or-map stream-null? streams)
- (cons (apply f (map stream-car streams))
- (map stream-cdr streams))))
- (cons stream rest))))
-
-(define (port->stream port read)
- (make-stream (lambda (p)
- (let ((o (read p)))
- (or (eof-object? o)
- (cons o p))))
- port))
-
-;;; streams.scm ends here
diff --git a/ice-9/string-fun.scm b/ice-9/string-fun.scm
deleted file mode 100644
index 8470e39d6..000000000
--- a/ice-9/string-fun.scm
+++ /dev/null
@@ -1,304 +0,0 @@
-;;;; string-fun.scm --- string manipulation functions
-;;;;
-;;;; Copyright (C) 1995, 1996, 1997, 1999, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-(define-module (ice-9 string-fun)
- :export (split-after-char split-before-char split-discarding-char
- split-after-char-last split-before-char-last
- split-discarding-char-last split-before-predicate
- split-after-predicate split-discarding-predicate
- separate-fields-discarding-char separate-fields-after-char
- separate-fields-before-char string-prefix-predicate string-prefix=?
- sans-surrounding-whitespace sans-trailing-whitespace
- sans-leading-whitespace sans-final-newline has-trailing-newline?))
-
-;;;;
-;;;
-;;; Various string funcitons, particularly those that take
-;;; advantage of the "shared substring" capability.
-;;;
-
-;;; {String Fun: Dividing Strings Into Fields}
-;;;
-;;; The names of these functions are very regular.
-;;; Here is a grammar of a call to one of these:
-;;;
-;;; <string-function-invocation>
-;;; := (<action>-<seperator-disposition>-<seperator-determination> <seperator-param> <str> <ret>)
-;;;
-;;; <str> = the string
-;;;
-;;; <ret> = The continuation. String functions generally return
-;;; multiple values by passing them to this procedure.
-;;;
-;;; <action> = split
-;;; | separate-fields
-;;;
-;;; "split" means to divide a string into two parts.
-;;; <ret> will be called with two arguments.
-;;;
-;;; "separate-fields" means to divide a string into as many
-;;; parts as possible. <ret> will be called with
-;;; however many fields are found.
-;;;
-;;; <seperator-disposition> = before
-;;; | after
-;;; | discarding
-;;;
-;;; "before" means to leave the seperator attached to
-;;; the beginning of the field to its right.
-;;; "after" means to leave the seperator attached to
-;;; the end of the field to its left.
-;;; "discarding" means to discard seperators.
-;;;
-;;; Other dispositions might be handy. For example, "isolate"
-;;; could mean to treat the separator as a field unto itself.
-;;;
-;;; <seperator-determination> = char
-;;; | predicate
-;;;
-;;; "char" means to use a particular character as field seperator.
-;;; "predicate" means to check each character using a particular predicate.
-;;;
-;;; Other determinations might be handy. For example, "character-set-member".
-;;;
-;;; <seperator-param> = A parameter that completes the meaning of the determinations.
-;;; For example, if the determination is "char", then this parameter
-;;; says which character. If it is "predicate", the parameter is the
-;;; predicate.
-;;;
-;;;
-;;; For example:
-;;;
-;;; (separate-fields-discarding-char #\, "foo, bar, baz, , bat" list)
-;;; => ("foo" " bar" " baz" " " " bat")
-;;;
-;;; (split-after-char #\- 'an-example-of-split list)
-;;; => ("an-" "example-of-split")
-;;;
-;;; As an alternative to using a determination "predicate", or to trying to do anything
-;;; complicated with these functions, consider using regular expressions.
-;;;
-
-(define (split-after-char char str ret)
- (let ((end (cond
- ((string-index str char) => 1+)
- (else (string-length str)))))
- (ret (substring str 0 end)
- (substring str end))))
-
-(define (split-before-char char str ret)
- (let ((end (or (string-index str char)
- (string-length str))))
- (ret (substring str 0 end)
- (substring str end))))
-
-(define (split-discarding-char char str ret)
- (let ((end (string-index str char)))
- (if (not end)
- (ret str "")
- (ret (substring str 0 end)
- (substring str (1+ end))))))
-
-(define (split-after-char-last char str ret)
- (let ((end (cond
- ((string-rindex str char) => 1+)
- (else 0))))
- (ret (substring str 0 end)
- (substring str end))))
-
-(define (split-before-char-last char str ret)
- (let ((end (or (string-rindex str char) 0)))
- (ret (substring str 0 end)
- (substring str end))))
-
-(define (split-discarding-char-last char str ret)
- (let ((end (string-rindex str char)))
- (if (not end)
- (ret str "")
- (ret (substring str 0 end)
- (substring str (1+ end))))))
-
-(define (split-before-predicate pred str ret)
- (let loop ((n 0))
- (cond
- ((= n (string-length str)) (ret str ""))
- ((not (pred (string-ref str n))) (loop (1+ n)))
- (else (ret (substring str 0 n)
- (substring str n))))))
-(define (split-after-predicate pred str ret)
- (let loop ((n 0))
- (cond
- ((= n (string-length str)) (ret str ""))
- ((not (pred (string-ref str n))) (loop (1+ n)))
- (else (ret (substring str 0 (1+ n))
- (substring str (1+ n)))))))
-
-(define (split-discarding-predicate pred str ret)
- (let loop ((n 0))
- (cond
- ((= n (string-length str)) (ret str ""))
- ((not (pred (string-ref str n))) (loop (1+ n)))
- (else (ret (substring str 0 n)
- (substring str (1+ n)))))))
-
-(define (separate-fields-discarding-char ch str ret)
- (let loop ((fields '())
- (str str))
- (cond
- ((string-rindex str ch)
- => (lambda (w) (loop (cons (substring str (+ 1 w)) fields)
- (substring str 0 w))))
- (else (apply ret str fields)))))
-
-(define (separate-fields-after-char ch str ret)
- (reverse
- (let loop ((fields '())
- (str str))
- (cond
- ((string-index str ch)
- => (lambda (w) (loop (cons (substring str 0 (+ 1 w)) fields)
- (substring str (+ 1 w)))))
- (else (apply ret str fields))))))
-
-(define (separate-fields-before-char ch str ret)
- (let loop ((fields '())
- (str str))
- (cond
- ((string-rindex str ch)
- => (lambda (w) (loop (cons (substring str w) fields)
- (substring str 0 w))))
- (else (apply ret str fields)))))
-
-
-;;; {String Fun: String Prefix Predicates}
-;;;
-;;; Very simple:
-;;;
-;;; (define-public ((string-prefix-predicate pred?) prefix str)
-;;; (and (<= (string-length prefix) (string-length str))
-;;; (pred? prefix (substring str 0 (string-length prefix)))))
-;;;
-;;; (define-public string-prefix=? (string-prefix-predicate string=?))
-;;;
-
-(define ((string-prefix-predicate pred?) prefix str)
- (and (<= (string-length prefix) (string-length str))
- (pred? prefix (substring str 0 (string-length prefix)))))
-
-(define string-prefix=? (string-prefix-predicate string=?))
-
-
-;;; {String Fun: Strippers}
-;;;
-;;; <stripper> = sans-<removable-part>
-;;;
-;;; <removable-part> = surrounding-whitespace
-;;; | trailing-whitespace
-;;; | leading-whitespace
-;;; | final-newline
-;;;
-
-(define (sans-surrounding-whitespace s)
- (let ((st 0)
- (end (string-length s)))
- (while (and (< st (string-length s))
- (char-whitespace? (string-ref s st)))
- (set! st (1+ st)))
- (while (and (< 0 end)
- (char-whitespace? (string-ref s (1- end))))
- (set! end (1- end)))
- (if (< end st)
- ""
- (substring s st end))))
-
-(define (sans-trailing-whitespace s)
- (let ((st 0)
- (end (string-length s)))
- (while (and (< 0 end)
- (char-whitespace? (string-ref s (1- end))))
- (set! end (1- end)))
- (if (< end st)
- ""
- (substring s st end))))
-
-(define (sans-leading-whitespace s)
- (let ((st 0)
- (end (string-length s)))
- (while (and (< st (string-length s))
- (char-whitespace? (string-ref s st)))
- (set! st (1+ st)))
- (if (< end st)
- ""
- (substring s st end))))
-
-(define (sans-final-newline str)
- (cond
- ((= 0 (string-length str))
- str)
-
- ((char=? #\nl (string-ref str (1- (string-length str))))
- (substring str 0 (1- (string-length str))))
-
- (else str)))
-
-;;; {String Fun: has-trailing-newline?}
-;;;
-
-(define (has-trailing-newline? str)
- (and (< 0 (string-length str))
- (char=? #\nl (string-ref str (1- (string-length str))))))
-
-
-
-;;; {String Fun: with-regexp-parts}
-
-;;; This relies on the older, hairier regexp interface, which we don't
-;;; particularly want to implement, and it's not used anywhere, so
-;;; we're just going to drop it for now.
-;;; (define-public (with-regexp-parts regexp fields str return fail)
-;;; (let ((parts (regexec regexp str fields)))
-;;; (if (number? parts)
-;;; (fail parts)
-;;; (apply return parts))))
-
diff --git a/ice-9/syncase.scm b/ice-9/syncase.scm
deleted file mode 100644
index 8d61bd120..000000000
--- a/ice-9/syncase.scm
+++ /dev/null
@@ -1,231 +0,0 @@
-;;;; Copyright (C) 1997, 2000, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-
-(define-module (ice-9 syncase)
- :use-module (ice-9 debug)
- :use-module (ice-9 threads)
- :export-syntax (sc-macro define-syntax eval-when fluid-let-syntax
- identifier-syntax let-syntax
- letrec-syntax syntax syntax-case syntax-rules
- with-syntax
- include)
- :export (sc-expand sc-expand3 install-global-transformer
- syntax-dispatch syntax-error bound-identifier=?
- datum->syntax-object free-identifier=?
- generate-temporaries identifier? syntax-object->datum
- void eval syncase))
-
-
-
-(define sc-macro
- (procedure->memoizing-macro
- (lambda (exp env)
- (sc-expand exp))))
-
-;;; Exported variables
-
-(define sc-expand #f)
-(define sc-expand3 #f)
-(define install-global-transformer #f)
-(define syntax-dispatch #f)
-(define syntax-error #f)
-
-(define bound-identifier=? #f)
-(define datum->syntax-object #f)
-(define define-syntax sc-macro)
-(define eval-when sc-macro)
-(define fluid-let-syntax sc-macro)
-(define free-identifier=? #f)
-(define generate-temporaries #f)
-(define identifier? #f)
-(define identifier-syntax sc-macro)
-(define let-syntax sc-macro)
-(define letrec-syntax sc-macro)
-(define syntax sc-macro)
-(define syntax-case sc-macro)
-(define syntax-object->datum #f)
-(define syntax-rules sc-macro)
-(define with-syntax sc-macro)
-(define include sc-macro)
-
-(define primitive-syntax '(quote lambda letrec if set! begin define or
- and let let* cond do quasiquote unquote
- unquote-splicing case))
-
-(for-each (lambda (symbol)
- (set-symbol-property! symbol 'primitive-syntax #t))
- primitive-syntax)
-
-;;; Hooks needed by the syntax-case macro package
-
-(define (void) *unspecified*)
-
-(define andmap
- (lambda (f first . rest)
- (or (null? first)
- (if (null? rest)
- (let andmap ((first first))
- (let ((x (car first)) (first (cdr first)))
- (if (null? first)
- (f x)
- (and (f x) (andmap first)))))
- (let andmap ((first first) (rest rest))
- (let ((x (car first))
- (xr (map car rest))
- (first (cdr first))
- (rest (map cdr rest)))
- (if (null? first)
- (apply f (cons x xr))
- (and (apply f (cons x xr)) (andmap first rest)))))))))
-
-(define (error who format-string why what)
- (start-stack 'syncase-stack
- (scm-error 'misc-error
- who
- "~A ~S"
- (list why what)
- '())))
-
-(define the-syncase-module (current-module))
-
-(define (putprop symbol key binding)
- (let* ((m (current-module))
- (v (or (module-variable m symbol)
- (module-make-local-var! m symbol))))
- (if (symbol-property symbol 'primitive-syntax)
- (if (eq? (current-module) the-syncase-module)
- (set-object-property! (module-variable the-root-module symbol)
- key
- binding))
- (variable-set! v sc-macro))
- (set-object-property! v key binding)))
-
-(define (getprop symbol key)
- (let* ((m (current-module))
- (v (module-variable m symbol)))
- (and v (or (object-property v key)
- (let ((root-v (module-local-variable the-root-module symbol)))
- (and (equal? root-v v)
- (object-property root-v key)))))))
-
-(define generated-symbols (make-weak-key-hash-table 1019))
-
-;; We define our own gensym here because the Guile built-in one will
-;; eventually produce uninterned and unreadable symbols (as needed for
-;; safe macro expansions) and will the be inappropriate for dumping to
-;; pssyntax.pp.
-;;
-;; syncase is supposed to only require that gensym produce unique
-;; readable symbols, and they only need be unique with respect to
-;; multiple calls to gensym, not globally unique.
-;;
-(define gensym
- (let ((counter 0))
-
- (define next-id
- (if (provided? 'threads)
- (let ((symlock (make-mutex)))
- (lambda ()
- (let ((result #f))
- (with-mutex symlock
- (set! result counter)
- (set! counter (+ counter 1)))
- result)))
- ;; faster, non-threaded case.
- (lambda ()
- (let ((result counter))
- (set! counter (+ counter 1))
- result))))
-
- ;; actual gensym body code.
- (lambda (. rest)
- (let* ((next-val (next-id))
- (valstr (number->string next-val)))
- (cond
- ((null? rest)
- (string->symbol (string-append "syntmp-" valstr)))
- ((null? (cdr rest))
- (string->symbol (string-append "syntmp-" (car rest) "-" valstr)))
- (else
- (error
- (string-append
- "syncase's gensym expected 0 or 1 arguments, got "
- (length rest)))))))))
-
-;;; Load the preprocessed code
-
-(let ((old-debug #f)
- (old-read #f))
- (dynamic-wind (lambda ()
- (set! old-debug (debug-options))
- (set! old-read (read-options)))
- (lambda ()
- (debug-disable 'debug 'procnames)
- (read-disable 'positions)
- (load-from-path "ice-9/psyntax.pp"))
- (lambda ()
- (debug-options old-debug)
- (read-options old-read))))
-
-
-;;; The following lines are necessary only if we start making changes
-;; (use-syntax sc-expand)
-;; (load-from-path "ice-9/psyntax.ss")
-
-(define internal-eval (nested-ref the-scm-module '(app modules guile eval)))
-
-(define (eval x environment)
- (internal-eval (if (and (pair? x)
- (equal? (car x) "noexpand"))
- (cadr x)
- (sc-expand x))
- environment))
-
-;;; Hack to make syncase macros work in the slib module
-(let ((m (nested-ref the-root-module '(app modules ice-9 slib))))
- (if m
- (set-object-property! (module-local-variable m 'define)
- '*sc-expander*
- '(define))))
-
-(define syncase sc-expand)
diff --git a/ice-9/test.scm b/ice-9/test.scm
deleted file mode 100644
index 912b7de37..000000000
--- a/ice-9/test.scm
+++ /dev/null
@@ -1,1031 +0,0 @@
-;; Copyright (C) 1991, 1992, 1993, 1994, 1995 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, 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 GUILE.
-;;
-;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;; code from other Free Software Foundation releases into a copy of
-;; GUILE, 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 GUILE, it is your choice
-;; whether to permit this exception to apply to your modifications.
-;; If you do not wish that, delete this exception notice.
-
-;;;; "test.scm" Test correctness of scheme implementations.
-;;; Author: Aubrey Jaffer
-;;; Modified: Mikael Djurfeldt (Removed tests which Guile deliberately
-;;; won't pass. Made the the tests (test-cont), (test-sc4), and
-;;; (test-delay) start to run automatically.
-
-;;; This includes examples from
-;;; William Clinger and Jonathan Rees, editors.
-;;; Revised^4 Report on the Algorithmic Language Scheme
-;;; and the IEEE specification.
-
-;;; The input tests read this file expecting it to be named
-;;; "test.scm", so you'll have to run it from the ice-9 source
-;;; directory, or copy this file elsewhere
-;;; Files `tmp1', `tmp2' and `tmp3' will be created in the course of running
-;;; these tests. You may need to delete them in order to run
-;;; "test.scm" more than once.
-
-;;; There are three optional tests:
-;;; (TEST-CONT) tests multiple returns from call-with-current-continuation
-;;;
-;;; (TEST-SC4) tests procedures required by R4RS but not by IEEE
-;;;
-;;; (TEST-DELAY) tests DELAY and FORCE, which are not required by
-;;; either standard.
-
-;;; If you are testing a R3RS version which does not have `list?' do:
-;;; (define list? #f)
-
-;;; send corrections or additions to jaffer@ai.mit.edu or
-;;; Aubrey Jaffer, 84 Pleasant St., Wakefield MA 01880, USA
-
-(define cur-section '())(define errs '())
-(define SECTION (lambda args
- (display "SECTION") (write args) (newline)
- (set! cur-section args) #t))
-(define record-error (lambda (e) (set! errs (cons (list cur-section e) errs))))
-
-(define test
- (lambda (expect fun . args)
- (write (cons fun args))
- (display " ==> ")
- ((lambda (res)
- (write res)
- (newline)
- (cond ((not (equal? expect res))
- (record-error (list res expect (cons fun args)))
- (display " BUT EXPECTED ")
- (write expect)
- (newline)
- #f)
- (else #t)))
- (if (procedure? fun) (apply fun args) (car args)))))
-(define (report-errs)
- (newline)
- (if (null? errs) (display "Passed all tests")
- (begin
- (display "errors were:")
- (newline)
- (display "(SECTION (got expected (call)))")
- (newline)
- (for-each (lambda (l) (write l) (newline))
- errs)))
- (newline))
-
-(SECTION 2 1);; test that all symbol characters are supported.
-'(+ - ... !.. $.+ %.- &.! *.: /:. :+. <-. =. >. ?. ~. _. ^.)
-
-(SECTION 3 4)
-(define disjoint-type-functions
- (list boolean? char? null? number? pair? procedure? string? symbol? vector?))
-(define type-examples
- (list
- #t #f #\a '() 9739 '(test) record-error "test" "" 'test '#() '#(a b c) ))
-(define i 1)
-(for-each (lambda (x) (display (make-string i #\ ))
- (set! i (+ 3 i))
- (write x)
- (newline))
- disjoint-type-functions)
-(define type-matrix
- (map (lambda (x)
- (let ((t (map (lambda (f) (f x)) disjoint-type-functions)))
- (write t)
- (write x)
- (newline)
- t))
- type-examples))
-(SECTION 4 1 2)
-(test '(quote a) 'quote (quote 'a))
-(test '(quote a) 'quote ''a)
-(SECTION 4 1 3)
-(test 12 (if #f + *) 3 4)
-(SECTION 4 1 4)
-(test 8 (lambda (x) (+ x x)) 4)
-(define reverse-subtract
- (lambda (x y) (- y x)))
-(test 3 reverse-subtract 7 10)
-(define add4
- (let ((x 4))
- (lambda (y) (+ x y))))
-(test 10 add4 6)
-(test '(3 4 5 6) (lambda x x) 3 4 5 6)
-(test '(5 6) (lambda (x y . z) z) 3 4 5 6)
-(SECTION 4 1 5)
-(test 'yes 'if (if (> 3 2) 'yes 'no))
-(test 'no 'if (if (> 2 3) 'yes 'no))
-(test '1 'if (if (> 3 2) (- 3 2) (+ 3 2)))
-(SECTION 4 1 6)
-(define x 2)
-(test 3 'define (+ x 1))
-(set! x 4)
-(test 5 'set! (+ x 1))
-(SECTION 4 2 1)
-(test 'greater 'cond (cond ((> 3 2) 'greater)
- ((< 3 2) 'less)))
-(test 'equal 'cond (cond ((> 3 3) 'greater)
- ((< 3 3) 'less)
- (else 'equal)))
-(test 2 'cond (cond ((assv 'b '((a 1) (b 2))) => cadr)
- (else #f)))
-(test 'composite 'case (case (* 2 3)
- ((2 3 5 7) 'prime)
- ((1 4 6 8 9) 'composite)))
-(test 'consonant 'case (case (car '(c d))
- ((a e i o u) 'vowel)
- ((w y) 'semivowel)
- (else 'consonant)))
-(test #t 'and (and (= 2 2) (> 2 1)))
-(test #f 'and (and (= 2 2) (< 2 1)))
-(test '(f g) 'and (and 1 2 'c '(f g)))
-(test #t 'and (and))
-(test #t 'or (or (= 2 2) (> 2 1)))
-(test #t 'or (or (= 2 2) (< 2 1)))
-(test #f 'or (or #f #f #f))
-(test #f 'or (or))
-(test '(b c) 'or (or (memq 'b '(a b c)) (+ 3 0)))
-(SECTION 4 2 2)
-(test 6 'let (let ((x 2) (y 3)) (* x y)))
-(test 35 'let (let ((x 2) (y 3)) (let ((x 7) (z (+ x y))) (* z x))))
-(test 70 'let* (let ((x 2) (y 3)) (let* ((x 7) (z (+ x y))) (* z x))))
-(test #t 'letrec (letrec ((even?
- (lambda (n) (if (zero? n) #t (odd? (- n 1)))))
- (odd?
- (lambda (n) (if (zero? n) #f (even? (- n 1))))))
- (even? 88)))
-(define x 34)
-(test 5 'let (let ((x 3)) (define x 5) x))
-(test 34 'let x)
-(test 6 'let (let () (define x 6) x))
-(test 34 'let x)
-(test 7 'let* (let* ((x 3)) (define x 7) x))
-(test 34 'let* x)
-(test 8 'let* (let* () (define x 8) x))
-(test 34 'let* x)
-(test 9 'letrec (letrec () (define x 9) x))
-(test 34 'letrec x)
-(test 10 'letrec (letrec ((x 3)) (define x 10) x))
-(test 34 'letrec x)
-(SECTION 4 2 3)
-(define x 0)
-(test 6 'begin (begin (set! x 5) (+ x 1)))
-(SECTION 4 2 4)
-(test '#(0 1 2 3 4) 'do (do ((vec (make-vector 5))
- (i 0 (+ i 1)))
- ((= i 5) vec)
- (vector-set! vec i i)))
-(test 25 'do (let ((x '(1 3 5 7 9)))
- (do ((x x (cdr x))
- (sum 0 (+ sum (car x))))
- ((null? x) sum))))
-(test 1 'let (let foo () 1))
-(test '((6 1 3) (-5 -2)) 'let
- (let loop ((numbers '(3 -2 1 6 -5))
- (nonneg '())
- (neg '()))
- (cond ((null? numbers) (list nonneg neg))
- ((negative? (car numbers))
- (loop (cdr numbers)
- nonneg
- (cons (car numbers) neg)))
- (else
- (loop (cdr numbers)
- (cons (car numbers) nonneg)
- neg)))))
-(SECTION 4 2 6)
-(test '(list 3 4) 'quasiquote `(list ,(+ 1 2) 4))
-(test '(list a (quote a)) 'quasiquote (let ((name 'a)) `(list ,name ',name)))
-(test '(a 3 4 5 6 b) 'quasiquote `(a ,(+ 1 2) ,@(map abs '(4 -5 6)) b))
-(test '((foo 7) . cons)
- 'quasiquote
- `((foo ,(- 10 3)) ,@(cdr '(c)) . ,(car '(cons))))
-
-;;; sqt is defined here because not all implementations are required to
-;;; support it.
-(define (sqt x)
- (do ((i 0 (+ i 1)))
- ((> (* i i) x) (- i 1))))
-
-(test '#(10 5 2 4 3 8) 'quasiquote `#(10 5 ,(sqt 4) ,@(map sqt '(16 9)) 8))
-(test 5 'quasiquote `,(+ 2 3))
-(test '(a `(b ,(+ 1 2) ,(foo 4 d) e) f)
- 'quasiquote `(a `(b ,(+ 1 2) ,(foo ,(+ 1 3) d) e) f))
-(test '(a `(b ,x ,'y d) e) 'quasiquote
- (let ((name1 'x) (name2 'y)) `(a `(b ,,name1 ,',name2 d) e)))
-(test '(list 3 4) 'quasiquote (quasiquote (list (unquote (+ 1 2)) 4)))
-(test '`(list ,(+ 1 2) 4) 'quasiquote '(quasiquote (list (unquote (+ 1 2)) 4)))
-(SECTION 5 2 1)
-(define add3 (lambda (x) (+ x 3)))
-(test 6 'define (add3 3))
-(define first car)
-(test 1 'define (first '(1 2)))
-(SECTION 5 2 2)
-(test 45 'define
- (let ((x 5))
- (define foo (lambda (y) (bar x y)))
- (define bar (lambda (a b) (+ (* a b) a)))
- (foo (+ x 3))))
-(define x 34)
-(define (foo) (define x 5) x)
-(test 5 foo)
-(test 34 'define x)
-(define foo (lambda () (define x 5) x))
-(test 5 foo)
-(test 34 'define x)
-(define (foo x) ((lambda () (define x 5) x)) x)
-(test 88 foo 88)
-(test 4 foo 4)
-(test 34 'define x)
-(SECTION 6 1)
-(test #f not #t)
-(test #f not 3)
-(test #f not (list 3))
-(test #t not #f)
-(test #f not '())
-(test #f not (list))
-(test #f not 'nil)
-
-(test #t boolean? #f)
-(test #f boolean? 0)
-(test #f boolean? '())
-(SECTION 6 2)
-(test #t eqv? 'a 'a)
-(test #f eqv? 'a 'b)
-(test #t eqv? 2 2)
-(test #t eqv? '() '())
-(test #t eqv? '10000 '10000)
-(test #f eqv? (cons 1 2)(cons 1 2))
-(test #f eqv? (lambda () 1) (lambda () 2))
-(test #f eqv? #f 'nil)
-(let ((p (lambda (x) x)))
- (test #t eqv? p p))
-(define gen-counter
- (lambda ()
- (let ((n 0))
- (lambda () (set! n (+ n 1)) n))))
-(let ((g (gen-counter))) (test #t eqv? g g))
-(test #f eqv? (gen-counter) (gen-counter))
-(letrec ((f (lambda () (if (eqv? f g) 'f 'both)))
- (g (lambda () (if (eqv? f g) 'g 'both))))
- (test #f eqv? f g))
-
-(test #t eq? 'a 'a)
-(test #f eq? (list 'a) (list 'a))
-(test #t eq? '() '())
-(test #t eq? car car)
-(let ((x '(a))) (test #t eq? x x))
-(let ((x '#())) (test #t eq? x x))
-(let ((x (lambda (x) x))) (test #t eq? x x))
-
-(test #t equal? 'a 'a)
-(test #t equal? '(a) '(a))
-(test #t equal? '(a (b) c) '(a (b) c))
-(test #t equal? "abc" "abc")
-(test #t equal? 2 2)
-(test #t equal? (make-vector 5 'a) (make-vector 5 'a))
-(SECTION 6 3)
-(test '(a b c d e) 'dot '(a . (b . (c . (d . (e . ()))))))
-(define x (list 'a 'b 'c))
-(define y x)
-(and list? (test #t list? y))
-(set-cdr! x 4)
-(test '(a . 4) 'set-cdr! x)
-(test #t eqv? x y)
-(test '(a b c . d) 'dot '(a . (b . (c . d))))
-(and list? (test #f list? y))
-(and list? (let ((x (list 'a))) (set-cdr! x x) (test #f 'list? (list? x))))
-
-(test #t pair? '(a . b))
-(test #t pair? '(a . 1))
-(test #t pair? '(a b c))
-(test #f pair? '())
-(test #f pair? '#(a b))
-
-(test '(a) cons 'a '())
-(test '((a) b c d) cons '(a) '(b c d))
-(test '("a" b c) cons "a" '(b c))
-(test '(a . 3) cons 'a 3)
-(test '((a b) . c) cons '(a b) 'c)
-
-(test 'a car '(a b c))
-(test '(a) car '((a) b c d))
-(test 1 car '(1 . 2))
-
-(test '(b c d) cdr '((a) b c d))
-(test 2 cdr '(1 . 2))
-
-(test '(a 7 c) list 'a (+ 3 4) 'c)
-(test '() list)
-
-(test 3 length '(a b c))
-(test 3 length '(a (b) (c d e)))
-(test 0 length '())
-
-(test '(x y) append '(x) '(y))
-(test '(a b c d) append '(a) '(b c d))
-(test '(a (b) (c)) append '(a (b)) '((c)))
-(test '() append)
-(test '(a b c . d) append '(a b) '(c . d))
-(test 'a append '() 'a)
-
-(test '(c b a) reverse '(a b c))
-(test '((e (f)) d (b c) a) reverse '(a (b c) d (e (f))))
-
-(test 'c list-ref '(a b c d) 2)
-
-(test '(a b c) memq 'a '(a b c))
-(test '(b c) memq 'b '(a b c))
-(test '#f memq 'a '(b c d))
-(test '#f memq (list 'a) '(b (a) c))
-(test '((a) c) member (list 'a) '(b (a) c))
-(test '(101 102) memv 101 '(100 101 102))
-
-(define e '((a 1) (b 2) (c 3)))
-(test '(a 1) assq 'a e)
-(test '(b 2) assq 'b e)
-(test #f assq 'd e)
-(test #f assq (list 'a) '(((a)) ((b)) ((c))))
-(test '((a)) assoc (list 'a) '(((a)) ((b)) ((c))))
-(test '(5 7) assv 5 '((2 3) (5 7) (11 13)))
-(SECTION 6 4)
-(test #t symbol? 'foo)
-(test #t symbol? (car '(a b)))
-(test #f symbol? "bar")
-(test #t symbol? 'nil)
-(test #f symbol? '())
-(test #f symbol? #f)
-;;; But first, what case are symbols in? Determine the standard case:
-(define char-standard-case char-upcase)
-(if (string=? (symbol->string 'A) "a")
- (set! char-standard-case char-downcase))
-;;; Not for Guile
-;(test #t 'standard-case
-; (string=? (symbol->string 'a) (symbol->string 'A)))
-;(test #t 'standard-case
-; (or (string=? (symbol->string 'a) "A")
-; (string=? (symbol->string 'A) "a")))
-(define (str-copy s)
- (let ((v (make-string (string-length s))))
- (do ((i (- (string-length v) 1) (- i 1)))
- ((< i 0) v)
- (string-set! v i (string-ref s i)))))
-(define (string-standard-case s)
- (set! s (str-copy s))
- (do ((i 0 (+ 1 i))
- (sl (string-length s)))
- ((>= i sl) s)
- (string-set! s i (char-standard-case (string-ref s i)))))
-;;; Not for Guile
-;(test (string-standard-case "flying-fish") symbol->string 'flying-fish)
-;(test (string-standard-case "martin") symbol->string 'Martin)
-(test "Malvina" symbol->string (string->symbol "Malvina"))
-;;; Not for Guile
-;(test #t 'standard-case (eq? 'a 'A))
-
-(define x (string #\a #\b))
-(define y (string->symbol x))
-(string-set! x 0 #\c)
-(test "cb" 'string-set! x)
-(test "ab" symbol->string y)
-(test y string->symbol "ab")
-
-;;; Not for Guile
-;(test #t eq? 'mISSISSIppi 'mississippi)
-;(test #f 'string->symbol (eq? 'bitBlt (string->symbol "bitBlt")))
-(test 'JollyWog string->symbol (symbol->string 'JollyWog))
-
-(SECTION 6 5 5)
-(test #t number? 3)
-(test #t complex? 3)
-(test #t real? 3)
-(test #t rational? 3)
-(test #t integer? 3)
-
-(test #t exact? 3)
-(test #f inexact? 3)
-
-(test #t = 22 22 22)
-(test #t = 22 22)
-(test #f = 34 34 35)
-(test #f = 34 35)
-(test #t > 3 -6246)
-(test #f > 9 9 -2424)
-(test #t >= 3 -4 -6246)
-(test #t >= 9 9)
-(test #f >= 8 9)
-(test #t < -1 2 3 4 5 6 7 8)
-(test #f < -1 2 3 4 4 5 6 7)
-(test #t <= -1 2 3 4 5 6 7 8)
-(test #t <= -1 2 3 4 4 5 6 7)
-(test #f < 1 3 2)
-(test #f >= 1 3 2)
-
-(test #t zero? 0)
-(test #f zero? 1)
-(test #f zero? -1)
-(test #f zero? -100)
-(test #t positive? 4)
-(test #f positive? -4)
-(test #f positive? 0)
-(test #f negative? 4)
-(test #t negative? -4)
-(test #f negative? 0)
-(test #t odd? 3)
-(test #f odd? 2)
-(test #f odd? -4)
-(test #t odd? -1)
-(test #f even? 3)
-(test #t even? 2)
-(test #t even? -4)
-(test #f even? -1)
-
-(test 38 max 34 5 7 38 6)
-(test -24 min 3 5 5 330 4 -24)
-
-(test 7 + 3 4)
-(test '3 + 3)
-(test 0 +)
-(test 4 * 4)
-(test 1 *)
-
-(test -1 - 3 4)
-(test -3 - 3)
-(test 7 abs -7)
-(test 7 abs 7)
-(test 0 abs 0)
-
-(test 5 quotient 35 7)
-(test -5 quotient -35 7)
-(test -5 quotient 35 -7)
-(test 5 quotient -35 -7)
-(test 1 modulo 13 4)
-(test 1 remainder 13 4)
-(test 3 modulo -13 4)
-(test -1 remainder -13 4)
-(test -3 modulo 13 -4)
-(test 1 remainder 13 -4)
-(test -1 modulo -13 -4)
-(test -1 remainder -13 -4)
-(define (divtest n1 n2)
- (= n1 (+ (* n2 (quotient n1 n2))
- (remainder n1 n2))))
-(test #t divtest 238 9)
-(test #t divtest -238 9)
-(test #t divtest 238 -9)
-(test #t divtest -238 -9)
-
-(test 4 gcd 0 4)
-(test 4 gcd -4 0)
-(test 4 gcd 32 -36)
-(test 0 gcd)
-(test 288 lcm 32 -36)
-(test 1 lcm)
-
-;;;;From: fred@sce.carleton.ca (Fred J Kaudel)
-;;; Modified by jaffer.
-(define (test-inexact)
- (define f3.9 (string->number "3.9"))
- (define f4.0 (string->number "4.0"))
- (define f-3.25 (string->number "-3.25"))
- (define f.25 (string->number ".25"))
- (define f4.5 (string->number "4.5"))
- (define f3.5 (string->number "3.5"))
- (define f0.0 (string->number "0.0"))
- (define f0.8 (string->number "0.8"))
- (define f1.0 (string->number "1.0"))
- (define wto write-test-obj)
- (define dto display-test-obj)
- (define lto load-test-obj)
- (newline)
- (display ";testing inexact numbers; ")
- (newline)
- (SECTION 6 5 5)
- (test #t inexact? f3.9)
- (test #t 'inexact? (inexact? (max f3.9 4)))
- (test f4.0 'max (max f3.9 4))
- (test f4.0 'exact->inexact (exact->inexact 4))
- (test (- f4.0) round (- f4.5))
- (test (- f4.0) round (- f3.5))
- (test (- f4.0) round (- f3.9))
- (test f0.0 round f0.0)
- (test f0.0 round f.25)
- (test f1.0 round f0.8)
- (test f4.0 round f3.5)
- (test f4.0 round f4.5)
- (set! write-test-obj (list f.25 f-3.25));.25 inexact errors less likely.
- (set! display-test-obj (list f.25 f-3.25));.3 often has such errors (~10^-13)
- (set! load-test-obj (list 'define 'foo (list 'quote write-test-obj)))
- (test #t call-with-output-file
- "tmp3"
- (lambda (test-file)
- (write-char #\; test-file)
- (display write-test-obj test-file)
- (newline test-file)
- (write load-test-obj test-file)
- (output-port? test-file)))
- (check-test-file "tmp3")
- (set! write-test-obj wto)
- (set! display-test-obj dto)
- (set! load-test-obj lto)
- (let ((x (string->number "4195835.0"))
- (y (string->number "3145727.0")))
- (test #t 'pentium-fdiv-bug (> f1.0 (- x (* (/ x y) y)))))
- (report-errs))
-
-(define (test-bignum)
- (define tb
- (lambda (n1 n2)
- (= n1 (+ (* n2 (quotient n1 n2))
- (remainder n1 n2)))))
- (newline)
- (display ";testing bignums; ")
- (newline)
- (SECTION 6 5 5)
- (test 0 modulo -2177452800 86400)
- (test 0 modulo 2177452800 -86400)
- (test 0 modulo 2177452800 86400)
- (test 0 modulo -2177452800 -86400)
- (test #t 'remainder (tb 281474976710655 65535))
- (test #t 'remainder (tb 281474976710654 65535))
- (SECTION 6 5 6)
- (test 281474976710655 string->number "281474976710655")
- (test "281474976710655" number->string 281474976710655)
- (report-errs))
-
-(SECTION 6 5 6)
-(test "0" number->string 0)
-(test "100" number->string 100)
-(test "100" number->string 256 16)
-(test 100 string->number "100")
-(test 256 string->number "100" 16)
-(test #f string->number "")
-(test #f string->number ".")
-(test #f string->number "d")
-(test #f string->number "D")
-(test #f string->number "i")
-(test #f string->number "I")
-(test #f string->number "3i")
-(test #f string->number "3I")
-(test #f string->number "33i")
-(test #f string->number "33I")
-(test #f string->number "3.3i")
-(test #f string->number "3.3I")
-(test #f string->number "-")
-(test #f string->number "+")
-
-(SECTION 6 6)
-(test #t eqv? '#\ #\Space)
-(test #t eqv? #\space '#\Space)
-(test #t char? #\a)
-(test #t char? #\()
-(test #t char? #\ )
-(test #t char? '#\newline)
-
-(test #f char=? #\A #\B)
-(test #f char=? #\a #\b)
-(test #f char=? #\9 #\0)
-(test #t char=? #\A #\A)
-
-(test #t char<? #\A #\B)
-(test #t char<? #\a #\b)
-(test #f char<? #\9 #\0)
-(test #f char<? #\A #\A)
-
-(test #f char>? #\A #\B)
-(test #f char>? #\a #\b)
-(test #t char>? #\9 #\0)
-(test #f char>? #\A #\A)
-
-(test #t char<=? #\A #\B)
-(test #t char<=? #\a #\b)
-(test #f char<=? #\9 #\0)
-(test #t char<=? #\A #\A)
-
-(test #f char>=? #\A #\B)
-(test #f char>=? #\a #\b)
-(test #t char>=? #\9 #\0)
-(test #t char>=? #\A #\A)
-
-(test #f char-ci=? #\A #\B)
-(test #f char-ci=? #\a #\B)
-(test #f char-ci=? #\A #\b)
-(test #f char-ci=? #\a #\b)
-(test #f char-ci=? #\9 #\0)
-(test #t char-ci=? #\A #\A)
-(test #t char-ci=? #\A #\a)
-
-(test #t char-ci<? #\A #\B)
-(test #t char-ci<? #\a #\B)
-(test #t char-ci<? #\A #\b)
-(test #t char-ci<? #\a #\b)
-(test #f char-ci<? #\9 #\0)
-(test #f char-ci<? #\A #\A)
-(test #f char-ci<? #\A #\a)
-
-(test #f char-ci>? #\A #\B)
-(test #f char-ci>? #\a #\B)
-(test #f char-ci>? #\A #\b)
-(test #f char-ci>? #\a #\b)
-(test #t char-ci>? #\9 #\0)
-(test #f char-ci>? #\A #\A)
-(test #f char-ci>? #\A #\a)
-
-(test #t char-ci<=? #\A #\B)
-(test #t char-ci<=? #\a #\B)
-(test #t char-ci<=? #\A #\b)
-(test #t char-ci<=? #\a #\b)
-(test #f char-ci<=? #\9 #\0)
-(test #t char-ci<=? #\A #\A)
-(test #t char-ci<=? #\A #\a)
-
-(test #f char-ci>=? #\A #\B)
-(test #f char-ci>=? #\a #\B)
-(test #f char-ci>=? #\A #\b)
-(test #f char-ci>=? #\a #\b)
-(test #t char-ci>=? #\9 #\0)
-(test #t char-ci>=? #\A #\A)
-(test #t char-ci>=? #\A #\a)
-
-(test #t char-alphabetic? #\a)
-(test #t char-alphabetic? #\A)
-(test #t char-alphabetic? #\z)
-(test #t char-alphabetic? #\Z)
-(test #f char-alphabetic? #\0)
-(test #f char-alphabetic? #\9)
-(test #f char-alphabetic? #\space)
-(test #f char-alphabetic? #\;)
-
-(test #f char-numeric? #\a)
-(test #f char-numeric? #\A)
-(test #f char-numeric? #\z)
-(test #f char-numeric? #\Z)
-(test #t char-numeric? #\0)
-(test #t char-numeric? #\9)
-(test #f char-numeric? #\space)
-(test #f char-numeric? #\;)
-
-(test #f char-whitespace? #\a)
-(test #f char-whitespace? #\A)
-(test #f char-whitespace? #\z)
-(test #f char-whitespace? #\Z)
-(test #f char-whitespace? #\0)
-(test #f char-whitespace? #\9)
-(test #t char-whitespace? #\space)
-(test #f char-whitespace? #\;)
-
-(test #f char-upper-case? #\0)
-(test #f char-upper-case? #\9)
-(test #f char-upper-case? #\space)
-(test #f char-upper-case? #\;)
-
-(test #f char-lower-case? #\0)
-(test #f char-lower-case? #\9)
-(test #f char-lower-case? #\space)
-(test #f char-lower-case? #\;)
-
-(test #\. integer->char (char->integer #\.))
-(test #\A integer->char (char->integer #\A))
-(test #\a integer->char (char->integer #\a))
-(test #\A char-upcase #\A)
-(test #\A char-upcase #\a)
-(test #\a char-downcase #\A)
-(test #\a char-downcase #\a)
-(SECTION 6 7)
-(test #t string? "The word \"recursion\\\" has many meanings.")
-(test #t string? "")
-(define f (make-string 3 #\*))
-(test "?**" 'string-set! (begin (string-set! f 0 #\?) f))
-(test "abc" string #\a #\b #\c)
-(test "" string)
-(test 3 string-length "abc")
-(test #\a string-ref "abc" 0)
-(test #\c string-ref "abc" 2)
-(test 0 string-length "")
-(test "" substring "ab" 0 0)
-(test "" substring "ab" 1 1)
-(test "" substring "ab" 2 2)
-(test "a" substring "ab" 0 1)
-(test "b" substring "ab" 1 2)
-(test "ab" substring "ab" 0 2)
-(test "foobar" string-append "foo" "bar")
-(test "foo" string-append "foo")
-(test "foo" string-append "foo" "")
-(test "foo" string-append "" "foo")
-(test "" string-append)
-(test "" make-string 0)
-(test #t string=? "" "")
-(test #f string<? "" "")
-(test #f string>? "" "")
-(test #t string<=? "" "")
-(test #t string>=? "" "")
-(test #t string-ci=? "" "")
-(test #f string-ci<? "" "")
-(test #f string-ci>? "" "")
-(test #t string-ci<=? "" "")
-(test #t string-ci>=? "" "")
-
-(test #f string=? "A" "B")
-(test #f string=? "a" "b")
-(test #f string=? "9" "0")
-(test #t string=? "A" "A")
-
-(test #t string<? "A" "B")
-(test #t string<? "a" "b")
-(test #f string<? "9" "0")
-(test #f string<? "A" "A")
-
-(test #f string>? "A" "B")
-(test #f string>? "a" "b")
-(test #t string>? "9" "0")
-(test #f string>? "A" "A")
-
-(test #t string<=? "A" "B")
-(test #t string<=? "a" "b")
-(test #f string<=? "9" "0")
-(test #t string<=? "A" "A")
-
-(test #f string>=? "A" "B")
-(test #f string>=? "a" "b")
-(test #t string>=? "9" "0")
-(test #t string>=? "A" "A")
-
-(test #f string-ci=? "A" "B")
-(test #f string-ci=? "a" "B")
-(test #f string-ci=? "A" "b")
-(test #f string-ci=? "a" "b")
-(test #f string-ci=? "9" "0")
-(test #t string-ci=? "A" "A")
-(test #t string-ci=? "A" "a")
-
-(test #t string-ci<? "A" "B")
-(test #t string-ci<? "a" "B")
-(test #t string-ci<? "A" "b")
-(test #t string-ci<? "a" "b")
-(test #f string-ci<? "9" "0")
-(test #f string-ci<? "A" "A")
-(test #f string-ci<? "A" "a")
-
-(test #f string-ci>? "A" "B")
-(test #f string-ci>? "a" "B")
-(test #f string-ci>? "A" "b")
-(test #f string-ci>? "a" "b")
-(test #t string-ci>? "9" "0")
-(test #f string-ci>? "A" "A")
-(test #f string-ci>? "A" "a")
-
-(test #t string-ci<=? "A" "B")
-(test #t string-ci<=? "a" "B")
-(test #t string-ci<=? "A" "b")
-(test #t string-ci<=? "a" "b")
-(test #f string-ci<=? "9" "0")
-(test #t string-ci<=? "A" "A")
-(test #t string-ci<=? "A" "a")
-
-(test #f string-ci>=? "A" "B")
-(test #f string-ci>=? "a" "B")
-(test #f string-ci>=? "A" "b")
-(test #f string-ci>=? "a" "b")
-(test #t string-ci>=? "9" "0")
-(test #t string-ci>=? "A" "A")
-(test #t string-ci>=? "A" "a")
-(SECTION 6 8)
-(test #t vector? '#(0 (2 2 2 2) "Anna"))
-(test #t vector? '#())
-(test '#(a b c) vector 'a 'b 'c)
-(test '#() vector)
-(test 3 vector-length '#(0 (2 2 2 2) "Anna"))
-(test 0 vector-length '#())
-(test 8 vector-ref '#(1 1 2 3 5 8 13 21) 5)
-(test '#(0 ("Sue" "Sue") "Anna") 'vector-set
- (let ((vec (vector 0 '(2 2 2 2) "Anna")))
- (vector-set! vec 1 '("Sue" "Sue"))
- vec))
-(test '#(hi hi) make-vector 2 'hi)
-(test '#() make-vector 0)
-(test '#() make-vector 0 'a)
-(SECTION 6 9)
-(test #t procedure? car)
-(test #f procedure? 'car)
-(test #t procedure? (lambda (x) (* x x)))
-(test #f procedure? '(lambda (x) (* x x)))
-(test #t call-with-current-continuation procedure?)
-(test 7 apply + (list 3 4))
-(test 7 apply (lambda (a b) (+ a b)) (list 3 4))
-(test 17 apply + 10 (list 3 4))
-(test '() apply list '())
-(define compose (lambda (f g) (lambda args (f (apply g args)))))
-(test 30 (compose sqt *) 12 75)
-
-(test '(b e h) map cadr '((a b) (d e) (g h)))
-(test '(5 7 9) map + '(1 2 3) '(4 5 6))
-(test '#(0 1 4 9 16) 'for-each
- (let ((v (make-vector 5)))
- (for-each (lambda (i) (vector-set! v i (* i i)))
- '(0 1 2 3 4))
- v))
-(test -3 call-with-current-continuation
- (lambda (exit)
- (for-each (lambda (x) (if (negative? x) (exit x)))
- '(54 0 37 -3 245 19))
- #t))
-(define list-length
- (lambda (obj)
- (call-with-current-continuation
- (lambda (return)
- (letrec ((r (lambda (obj) (cond ((null? obj) 0)
- ((pair? obj) (+ (r (cdr obj)) 1))
- (else (return #f))))))
- (r obj))))))
-(test 4 list-length '(1 2 3 4))
-(test #f list-length '(a b . c))
-(test '() map cadr '())
-
-;;; This tests full conformance of call-with-current-continuation. It
-;;; is a separate test because some schemes do not support call/cc
-;;; other than escape procedures. I am indebted to
-;;; raja@copper.ucs.indiana.edu (Raja Sooriamurthi) for fixing this
-;;; code. The function leaf-eq? compares the leaves of 2 arbitrary
-;;; trees constructed of conses.
-(define (next-leaf-generator obj eot)
- (letrec ((return #f)
- (cont (lambda (x)
- (recur obj)
- (set! cont (lambda (x) (return eot)))
- (cont #f)))
- (recur (lambda (obj)
- (if (pair? obj)
- (for-each recur obj)
- (call-with-current-continuation
- (lambda (c)
- (set! cont c)
- (return obj)))))))
- (lambda () (call-with-current-continuation
- (lambda (ret) (set! return ret) (cont #f))))))
-(define (leaf-eq? x y)
- (let* ((eot (list 'eot))
- (xf (next-leaf-generator x eot))
- (yf (next-leaf-generator y eot)))
- (letrec ((loop (lambda (x y)
- (cond ((not (eq? x y)) #f)
- ((eq? eot x) #t)
- (else (loop (xf) (yf)))))))
- (loop (xf) (yf)))))
-(define (test-cont)
- (newline)
- (display ";testing continuations; ")
- (newline)
- (SECTION 6 9)
- (test #t leaf-eq? '(a (b (c))) '((a) b c))
- (test #f leaf-eq? '(a (b (c))) '((a) b c d))
- (report-errs))
-
-;;; Test Optional R4RS DELAY syntax and FORCE procedure
-(define (test-delay)
- (newline)
- (display ";testing DELAY and FORCE; ")
- (newline)
- (SECTION 6 9)
- (test 3 'delay (force (delay (+ 1 2))))
- (test '(3 3) 'delay (let ((p (delay (+ 1 2))))
- (list (force p) (force p))))
- (test 2 'delay (letrec ((a-stream
- (letrec ((next (lambda (n)
- (cons n (delay (next (+ n 1)))))))
- (next 0)))
- (head car)
- (tail (lambda (stream) (force (cdr stream)))))
- (head (tail (tail a-stream)))))
- (letrec ((count 0)
- (p (delay (begin (set! count (+ count 1))
- (if (> count x)
- count
- (force p)))))
- (x 5))
- (test 6 force p)
- (set! x 10)
- (test 6 force p))
- (test 3 'force
- (letrec ((p (delay (if c 3 (begin (set! c #t) (+ (force p) 1)))))
- (c #f))
- (force p)))
- (report-errs))
-
-(SECTION 6 10 1)
-(test #t input-port? (current-input-port))
-(test #t output-port? (current-output-port))
-(test #t call-with-input-file "test.scm" input-port?)
-(define this-file (open-input-file "test.scm"))
-(test #t input-port? this-file)
-(SECTION 6 10 2)
-(test #\; peek-char this-file)
-(test #\; read-char this-file)
-(test '(define cur-section '()) read this-file)
-(test #\( peek-char this-file)
-(test '(define errs '()) read this-file)
-(close-input-port this-file)
-(close-input-port this-file)
-(define (check-test-file name)
- (define test-file (open-input-file name))
- (test #t 'input-port?
- (call-with-input-file
- name
- (lambda (test-file)
- (test load-test-obj read test-file)
- (test #t eof-object? (peek-char test-file))
- (test #t eof-object? (read-char test-file))
- (input-port? test-file))))
- (test #\; read-char test-file)
- (test display-test-obj read test-file)
- (test load-test-obj read test-file)
- (close-input-port test-file))
-(SECTION 6 10 3)
-(define write-test-obj
- '(#t #f #\a () 9739 -3 . #((test) "te \" \" st" "" test #() b c)))
-(define display-test-obj
- '(#t #f a () 9739 -3 . #((test) te " " st test #() b c)))
-(define load-test-obj
- (list 'define 'foo (list 'quote write-test-obj)))
-(test #t call-with-output-file
- "tmp1"
- (lambda (test-file)
- (write-char #\; test-file)
- (display write-test-obj test-file)
- (newline test-file)
- (write load-test-obj test-file)
- (output-port? test-file)))
-(check-test-file "tmp1")
-
-(define test-file (open-output-file "tmp2"))
-(write-char #\; test-file)
-(display write-test-obj test-file)
-(newline test-file)
-(write load-test-obj test-file)
-(test #t output-port? test-file)
-(close-output-port test-file)
-(check-test-file "tmp2")
-(define (test-sc4)
- (newline)
- (display ";testing scheme 4 functions; ")
- (newline)
- (SECTION 6 7)
- (test '(#\P #\space #\l) string->list "P l")
- (test '() string->list "")
- (test "1\\\"" list->string '(#\1 #\\ #\"))
- (test "" list->string '())
- (SECTION 6 8)
- (test '(dah dah didah) vector->list '#(dah dah didah))
- (test '() vector->list '#())
- (test '#(dididit dah) list->vector '(dididit dah))
- (test '#() list->vector '())
- (SECTION 6 10 4)
- (load "tmp1")
- (test write-test-obj 'load foo)
- (report-errs))
-
-(report-errs)
-(if (and (string->number "0.0") (inexact? (string->number "0.0")))
- (test-inexact))
-
-(let ((n (string->number "281474976710655")))
- (if (and n (exact? n))
- (test-bignum)))
-(newline)
-(test-cont)
-(newline)
-(test-sc4)
-(newline)
-(test-delay)
-(newline)
-"last item in file"
diff --git a/ice-9/threads.scm b/ice-9/threads.scm
deleted file mode 100644
index 586bae368..000000000
--- a/ice-9/threads.scm
+++ /dev/null
@@ -1,117 +0,0 @@
-;;;; Copyright (C) 1996, 1998, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-;;;; ----------------------------------------------------------------
-;;;; threads.scm -- User-level interface to Guile's thread system
-;;;; 4 March 1996, Anthony Green <green@cygnus.com>
-;;;; Modified 5 October 1996, MDJ <djurfeldt@nada.kth.se>
-;;;; Modified 6 April 2001, ttn
-;;;; ----------------------------------------------------------------
-;;;;
-
-;;; Commentary:
-
-;; This module is documented in the Guile Reference Manual.
-;; Briefly, one procedure is exported: `%thread-handler';
-;; as well as four macros: `make-thread', `begin-thread',
-;; `with-mutex' and `monitor'.
-
-;;; Code:
-
-(define-module (ice-9 threads)
- :export-syntax (make-thread
- begin-thread
- with-mutex
- monitor)
- :export (%thread-handler))
-
-
-
-(define (%thread-handler tag . args)
- (fluid-set! the-last-stack #f)
- (unmask-signals)
- (let ((n (length args))
- (p (current-error-port)))
- (display "In thread:" p)
- (newline p)
- (if (>= n 3)
- (display-error #f
- p
- (car args)
- (cadr args)
- (caddr args)
- (if (= n 4)
- (cadddr args)
- '()))
- (begin
- (display "uncaught throw to " p)
- (display tag p)
- (display ": " p)
- (display args p)
- (newline p)))))
-
-; --- MACROS -------------------------------------------------------
-
-(defmacro make-thread (proc . args)
- `(call-with-new-thread
- (lambda ()
- (,proc ,@args))
- %thread-handler))
-
-(defmacro begin-thread (first . rest)
- `(call-with-new-thread
- (lambda ()
- (begin
- ,first ,@rest))
- %thread-handler))
-
-(defmacro with-mutex (m . body)
- `(dynamic-wind
- (lambda () (lock-mutex ,m))
- (lambda () (begin ,@body))
- (lambda () (unlock-mutex ,m))))
-
-(defmacro monitor (first . rest)
- `(with-mutex ,(make-mutex)
- (begin
- ,first ,@rest)))
-
-;;; threads.scm ends here
diff --git a/ice-9/time.scm b/ice-9/time.scm
deleted file mode 100644
index 4b1859928..000000000
--- a/ice-9/time.scm
+++ /dev/null
@@ -1,81 +0,0 @@
-;;;; Copyright (C) 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-;;; Commentary:
-
-;; This module exports a single macro: `time'.
-;; Usage: (time exp)
-;;
-;; Example:
-;; guile> (time (sleep 3))
-;; clock utime stime cutime cstime gctime
-;; 3.01 0.00 0.00 0.00 0.00 0.00
-;; 0
-
-;;; Code:
-
-(define-module (ice-9 time)
- :use-module (ice-9 format)
- :export (time))
-
-(define (time-proc proc)
- (let* ((gc-start (gc-run-time))
- (tms-start (times))
- (result (proc))
- (tms-end (times))
- (gc-end (gc-run-time)))
- (define (get proc start end)
- (/ (- (proc end) (proc start)) internal-time-units-per-second))
- (display "clock utime stime cutime cstime gctime\n")
- (format #t "~5,2F ~5,2F ~5,2F ~6,2F ~6,2F ~6,2F\n"
- (get tms:clock tms-start tms-end)
- (get tms:utime tms-start tms-end)
- (get tms:stime tms-start tms-end)
- (get tms:cutime tms-start tms-end)
- (get tms:cstime tms-start tms-end)
- (get identity gc-start gc-end))
- result))
-
-(define-macro (time exp)
- `(,time-proc (lambda () ,exp)))
-
-;;; time.scm ends here
diff --git a/lang/.cvsignore b/lang/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/lang/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/lang/Makefile.am b/lang/Makefile.am
deleted file mode 100644
index 4538cb1ff..000000000
--- a/lang/Makefile.am
+++ /dev/null
@@ -1,24 +0,0 @@
-## Process this file with automake to produce Makefile.in.
-##
-## Copyright (C) 2000 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-AUTOMAKE_OPTIONS = gnu
-
-SUBDIRS = elisp
diff --git a/lang/elisp/.cvsignore b/lang/elisp/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/lang/elisp/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/lang/elisp/ChangeLog b/lang/elisp/ChangeLog
deleted file mode 100644
index 9f28738b0..000000000
--- a/lang/elisp/ChangeLog
+++ /dev/null
@@ -1,359 +0,0 @@
-2002-02-13 Neil Jerram <neil@ossau.uklinux.net>
-
- * base.scm (load-emacs): Add optional parameters for specifying an
- alternative load path, and for debugging this. (Thanks to
- Thien-Thi Nguyen!)
-
- * primitives/syntax.scm (setq): Use `set'.
-
- * internals/set.scm (set): Fixed to support variables that are
- imported from other modules.
-
-2002-02-12 Neil Jerram <neil@ossau.uklinux.net>
-
- * transform.scm (scheme): Use set-current-module to ensure
- expected behaviour of resolve-module.
-
-2002-02-08 Neil Jerram <neil@ossau.uklinux.net>
-
- * STATUS: New file.
-
- * README: Updated.
-
- * interface.scm (translate-elisp): New exported procedure.
- (elisp-function): Symbol var is `obj', not `symbol'.
-
- * internals/lambda.scm, primitives/fns.scm: Fix confusion between
- interactive-spec and interactive-specification.
-
- * internals/lambda.scm (transform-lambda), primitives/syntax.scm
- (defmacro): Bind unspecified optional and rest arguments to #nil,
- not #f.
-
- * internals/null.scm (->nil, lambda->nil): New, exported.
- (null): Use ->nil.
-
- * primitives/features.scm (featurep), primitives/fns.scm
- (fboundp, subrp): Use ->nil.
-
- * internals/lists.scm (cons, setcdr, memq, member, assq, assoc):
- Simplified.
- (car, cdr): Return #nil rather than #f.
-
- * primitives/load.scm (current-load-list), primitives/pure.scm
- (purify-flag): Set to #nil, not #f.
-
- * primitives/match.scm (string-match): Return #nil rather than #f.
-
- * primitives/numbers.scm (integerp, numberp),
- primitives/strings.scm (string-lessp, stringp): Use lambda->nil.
-
- * primitives/symprop.scm (boundp): Use ->nil.
- (symbolp, local-variable-if-set-p): Return #nil rather than #f.
-
- * primitives/syntax.scm (prog1, prog2): Mangle variable names
- further to lessen possibility of conflicts.
- (if, and, or, cond): Return #nil rather than #f.
- (cond): Return #t rather than t (which is undefined).
- (let, let*): Bind uninitialized variables to #nil, not #f.
-
- * transform.scm: Resolve inconsistency in usage of `map', and add
- an explanatory note. Also cleaned up use of subsidiary
- transformation functions. Also use cons-source wherever possible.
- (transform-datum, transform-quote): New.
- (transform-quasiquote): Renamed from `transform-inside-qq'.
- (transform-application): Apply `transform-quote' to application
- args.
- (cars->nil): Removed.
-
- * internals/null.scm (null), primitives/lists.scm (cons, car, cdr,
- setcdr, memq, member, assq, assoc, nth): Update to take into
- account new libguile support for Elisp nil value.
-
-2002-02-06 Neil Jerram <neil@ossau.uklinux.net>
-
- * example.el (time): New macro, for performance measurement.
- Accompanying comment compares results for Guile and Emacs.
-
- * transform.scm (scheme): New macro.
- (transformer): New implementation of `scheme' escape that doesn't
- rely on (lang elisp base) importing Guile bindings.
-
- * base.scm: No longer import anything from (guile).
- (load-emacs): Add scheme form to ensure that keywords
- read option is set correctly.
-
- * primitives/syntax.scm (defmacro, let, let*): Unquote uses of
- `@bind' in transformed code.
- (if): Unquote uses of `nil-cond' in transformed code.
-
- * internals/lambda.scm (transform-lambda): Unquote use of `@bind'
- in transformed code.
-
- * transform.scm (transformer-macro): Don't quote `list' in
- transformed code.
- (transform-application): Don't quote `@fop' in transformed code.
- (transformer): No need to treat `@bind' and `@fop' as special
- cases in input to the transformer.
-
-2002-02-04 Neil Jerram <neil@ossau.uklinux.net>
-
- * primitives/syntax.scm (parse-formals, transform-lambda,
- interactive-spec, set-not-subr!, transform-lambda/interactive):
- Move into internals/lambda.scm so that these can also be used
- by...
-
- * internals/fset.scm (elisp-apply): Use `eval' and
- `transform-lambda/interactive' to turn a quoted lambda expression
- into a Scheme procedure.
-
- * transform.scm (m-quasiquote): Don't quote `quasiquote' in
- transformed code.
- (transformer): Transform '() to #nil.
-
-2002-02-03 Neil Jerram <neil@ossau.uklinux.net>
-
- * internals/Makefile.am (elisp_sources): Add lambda.scm.
-
- * internals/lambda.scm (lang): New file.
-
-2002-02-01 Neil Jerram <neil@ossau.uklinux.net>
-
- * transform.scm (transformer), primitives/syntax.scm (let*):
- Unquote uses of `begin' in transformed code.
-
-2002-01-29 Neil Jerram <neil@ossau.uklinux.net>
-
- * transform.scm (transform-1, transform-2, transform-3,
- transform-list): Removed (unused).
-
- * transform.scm, primitives/syntax.scm: Add commas everywhere
- before use of (guile) primitives in generated code, so that (lang
- elisp base) doesn't have to import bindings from (guile).
-
- * base.scm: Move use-modules expressions inside the define-module,
- and add #:pure so that we don't import bindings from (guile).
-
-2002-01-25 Neil Jerram <neil@ossau.uklinux.net>
-
- * transform.scm (transform-application): Preserve source
- properties of original elisp expression by using cons-source.
-
- * transform.scm: Don't handle special forms specially in the
- translator. Instead, define them as macros in ...
-
- * primitives/syntax.scm: New file; special form definitions.
-
- * primitives/fns.scm (run-hooks): Rewritten correctly.
-
- * primitives/symprop.scm (symbol-value): Use `value'.
-
- * internals/set.scm (value): New function.
-
- * primitives/fns.scm: Use (lang elisp internals null), as null is
- no longer a primitive. Change generated #f values to %nil.
-
- * internals/null.scm (null): Handle nil symbol.
-
- * primitives/lists.scm (memq, member, assq, assoc): Handle all
- possible nil values.
-
- * transform.scm (transformer): Translate `nil' and `t' to #nil and
- #t.
-
- * base.scm: Remove setting of 'language read-option.
-
-2001-11-03 Neil Jerram <neil@ossau.uklinux.net>
-
- * README (Resources): Fill in missing URLs.
-
-2001-11-02 Neil Jerram <neil@ossau.uklinux.net>
-
- * Makefile.am (elisp_sources): Added base.scm, example.el,
- interface.scm; removed emacs.scm.
-
- * README: Updated accordingly.
-
- * internals/load.scm (load): Avoid using `load-path' if the
- supplied file name begins with a slash.
-
- * internals/fset.scm: Support export of defuns, defmacros and
- defvars to a module specified by the fluid `elisp-export-module'.
- This allows us to automate the importing of Elisp definitions into
- Scheme.
-
- * example.el: New file: example code for `load-elisp-file'.
-
- * interface.scm: New file - mechanisms to exchange definitions
- between Scheme and Elisp.
-
- Following changes try to make the Elisp evaluation module less
- Emacs-dependent; in other words, so that it isn't necessary to try
- to load the whole Emacs environment before evaluating basic
- non-Emacs-specific Elisp code.
-
- * variables.scm, internals/evaluation.scm: Changed (lang elisp
- emacs) to (lang elisp base).
-
- * emacs.scm (lang): Removed.
-
- * base.scm (lang): New file (non-emacs-specific replacement for
- emacs.scm).
-
-2001-10-28 Neil Jerram <neil@ossau.uklinux.net>
-
- * primitives/symprop.scm (symbol-name): New primitive.
-
- * primitives/strings.scm (stringp): New primitive.
-
- * primitives/pure.scm (purify-flag): New variable.
-
- * primitives/numbers.scm (numberp): New primitive.
-
- * internals/fset.scm (fset): Set procedure and macro name
- properties usefully to match Elisp symbol names. Also bind Elisp
- function definition variables to similarly named symbols in the
- (lang elisp variables) module.
-
- * transform.scm (transformer, m-unwind-protect): Added support for
- `unwind-protect'.
- (m-quasiquote): Use 'quasiquote rather than 'quote.
- (transform-lambda, m-defmacro): When no rest arguments, set the
- rest parameter to '() rather than #f. It shouldn't make any
- difference, but it feels more right.
-
- * README: Enlarged description of current status.
-
- * Makefile.am (elisp_sources): Added variables.scm.
-
- * variables.scm: New file.
-
-2001-10-26 Neil Jerram <neil@ossau.uklinux.net>
-
- * buffers.scm, calling.scm: Removed. These should have
- disappeared during the reorganization described below, but I
- missed them by mistake.
-
- * primitives/symprop.scm (set, boundp, symbol-value): Changed to
- use (module-xx the-elisp-module ...) rather than (local-xx ...).
- (symbolp): Accept either symbols or keywords.
- (set-default, default-boundp, default-value,
- local-variable-if-set-p): New.
-
- * primitives/match.scm (string-match, match-data): Store last
- match data in Emacs rather than Guile form, to simplify
- implementation of ...
- (set-match-data, store-match-data): New.
-
- * primitives/load.scm (autoload, current-load-list): New. (But
- autoload is just stubbed, not properly implemented.)
-
- * primitives/lists.scm (nth, listp, consp, nconc): New.
-
- * primitives/fns.scm (byte-code-function-p, run-hooks): New.
-
- * transform.scm (transform-application, transformer-macro): New
- scheme for transforming procedure arguments while leaving macro
- args untransformed. (See also associated change in libguile.)
- (m-defconst): Simplified, now uses m-setq.
-
- * Makefile.am: Changed so that it only deals with files directly
- in this directory; otherwise files don't install cleanly.
-
- * internals/Makefile.am, primitives/Makefile.am,
- internals/.cvsignore, primitives/.cvsignore: New files.
-
-2001-10-26 Neil Jerram <neil@ossau.uklinux.net>
-
- * transform.scm (transformer): New handling for (1) quasiquoting
- syntax like "(` ...)" as well as the more normal "` ..."; (2)
- `function'; (3) interactive specification in lambda body.
- Simplied handling for `setq'.
- (transform-inside-qq): Fixed to handle improper as well as proper
- lists.
- (transform-lambda/interactive): New; wraps transform-lambda to
- handle setting of various procedure properties.
- (transform-lambda, m-defmacro): Changed `args' and `num-args' to
- `%--args' and `%--num-args' in the hope of avoiding lexical
- vs. dynamic name clashes.
- (m-and): Use #f instead of '() where a condition fails.
-
- Plus big hierarchy reorganization, in which most of the previous
- occupants of lang/elisp moved to lang/elisp/primitives, with some
- internal processing being split out into lang/elisp/internals.
- The upshot looks like this:
-
- * internals/trace.scm, internals/set.scm, internals/load.scm,
- internals/fset.scm, internals/signal.scm, internals/time.scm,
- internals/format.scm, internals/null.scm,
- internals/evaluation.scm, primitives/buffers.scm,
- primitives/features.scm, primitives/format.scm,
- primitives/time.scm, primitives/guile.scm, primitives/keymaps.scm,
- primitives/lists.scm, primitives/load.scm, primitives/match.scm,
- primitives/numbers.scm, primitives/pure.scm, primitives/read.scm,
- primitives/signal.scm, primitives/strings.scm,
- primitives/symprop.scm, primitives/system.scm, primitives/fns.scm:
- New files.
-
- * features.scm, format.scm, fset.scm, guile.scm, keymaps.scm,
- lists.scm, load.scm, match.scm, numbers.scm, pure.scm, read.scm,
- signal.scm, strings.scm, symprop.scm, system.scm, time.scm,
- trace.scm: Removed files.
-
-2001-10-23 Neil Jerram <neil@ossau.uklinux.net>
-
- * match.scm (string-match): New implementation using new
- `make-emacs-regexp' primitive; old workaround implementation
- renamed to `string-match-workaround'.
-
-2001-10-21 Neil Jerram <neil@ossau.uklinux.net>
-
- * transform.scm (m-defun, m-defmacro, m-let, m-defvar,
- m-defconst): Use more selective tracing mechanism (provided by new
- file trace.scm).
-
- * symprop.scm (get, boundp), transform.scm (transform-lambda,
- m-defmacro): Remove unnecessary uses of nil-ify and t-ify.
-
- * match.scm (string-match): Workaround Guile/libc regex
- parenthesis bug.
-
- * emacs.scm: Move elisp primitive definitions into more specific
- files, so that emacs.scm contains only overall code.
-
- * Makefile.am: Added new files.
-
- * numbers.scm, trace.scm, time.scm, pure.scm, system.scm,
- read.scm, calling.scm, guile.scm: New files.
-
-2001-10-20 Neil Jerram <neil@ossau.uklinux.net>
-
- * Makefile.am (elisp_sources): Added match.scm and strings.scm.
-
- * match.scm, strings.scm: New files.
-
-2001-10-19 Neil Jerram <neil@ossau.uklinux.net>
-
- * transform.scm: Replace uses of `nil' by `#f' or `'()'.
-
- * Makefile.am (elisp_sources): Added lists.scm.
-
- * load.scm (the-elisp-module): Corrected (lang elisp emacs) module
- name.
-
- * lists.scm (lang): New file containing list-related primitives.
-
- * emacs.scm: Corrected module name.
-
-2001-10-19 Neil Jerram <neil@ossau.uklinux.net>
-
- Initial implementation of an Emacs Lisp translator, based on
- transformer code originally written by Mikael Djurfeldt.
-
- * Makefile.am, .cvsignore: New.
-
- * ChangeLog, README, buffers.scm, emacs.scm, features.scm,
- format.scm, fset.scm, keymaps.scm, load.scm, signal.scm,
- symprop.scm, transform.scm: New files.
-
-
diff --git a/lang/elisp/Makefile.am b/lang/elisp/Makefile.am
deleted file mode 100644
index ffb095f1b..000000000
--- a/lang/elisp/Makefile.am
+++ /dev/null
@@ -1,39 +0,0 @@
-## Process this file with automake to produce Makefile.in.
-##
-## Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-AUTOMAKE_OPTIONS = gnu
-
-SUBDIRS = internals primitives
-
-# These should be installed and distributed.
-
-elisp_sources = \
- base.scm \
- example.el \
- interface.scm \
- transform.scm \
- variables.scm
-
-subpkgdatadir = $(pkgdatadir)/$(VERSION)/lang/elisp
-subpkgdata_DATA = $(elisp_sources)
-ETAGS_ARGS = $(subpkgdata_DATA)
-
-EXTRA_DIST = $(elisp_sources)
diff --git a/lang/elisp/README b/lang/elisp/README
deleted file mode 100644
index 1cecb381f..000000000
--- a/lang/elisp/README
+++ /dev/null
@@ -1,303 +0,0 @@
- -*- outline -*-
-
-This directory holds the Scheme side of a translator for Emacs Lisp.
-
-* Usage
-
-To load up the base Elisp environment:
-
- (use-modules (lang elisp base))
-
-Then you can switch into this module
-
- (define-module (lang elisp base))
-
-and start typing away in Elisp, or evaluate an individual Elisp
-expression from Scheme:
-
- (eval EXP (resolve-module '(lang elisp base)))
-
-A more convenient, higher-level interface is provided by (lang elisp
-interface):
-
- (use-modules (lang elisp interface))
-
-With this interface, you can evaluate an Elisp expression
-
- (eval-elisp EXP)
-
-load an Elisp file with no effect on the Scheme world
-
- (load-elisp-file "/home/neil/Guile/cvs/guile-core/lang/elisp/example.el")
-
-load an Elisp file, automatically importing top level definitions into
-Scheme
-
- (use-elisp-file "/home/neil/Guile/cvs/guile-core/lang/elisp/example.el")
-
-export Scheme objects to Elisp
-
- (export-to-elisp + - * my-func 'my-var)
-
-and try to bootstrap a complete Emacs environment:
-
- (load-emacs)
-
-* Status
-
-Please see the STATUS file for the full position.
-
-** Trying to load a complete Emacs environment.
-
-To try this, type `(use-modules (lang elisp interface))' and then
-`(load-emacs)'. The following output shows how far I get when I try
-this.
-
-guile> (use-modules (lang elisp interface))
-guile> (load-emacs)
-Calling loadup.el to clothe the bare Emacs...
-Loading /usr/share/emacs/20.7/lisp/loadup.el...
-Using load-path ("/usr/share/emacs/20.7/lisp/" "/usr/share/emacs/20.7/lisp/emacs-lisp/")
-Loading /usr/share/emacs/20.7/lisp/byte-run.el...
-Loading /usr/share/emacs/20.7/lisp/byte-run.el...done
-Loading /usr/share/emacs/20.7/lisp/subr.el...
-Loading /usr/share/emacs/20.7/lisp/subr.el...done
-Loading /usr/share/emacs/20.7/lisp/version.el...
-Loading /usr/share/emacs/20.7/lisp/version.el...done
-Loading /usr/share/emacs/20.7/lisp/map-ynp.el...
-Loading /usr/share/emacs/20.7/lisp/map-ynp.el...done
-Loading /usr/share/emacs/20.7/lisp/widget.el...
-Loading /usr/share/emacs/20.7/lisp/emacs-lisp/cl.el...
-Loading /usr/share/emacs/20.7/lisp/emacs-lisp/cl.el...done
-Loading /usr/share/emacs/20.7/lisp/widget.el...done
-Loading /usr/share/emacs/20.7/lisp/custom.el...
-Loading /usr/share/emacs/20.7/lisp/custom.el...done
-Loading /usr/share/emacs/20.7/lisp/cus-start.el...
-Note, built-in variable `abbrev-all-caps' not bound
- ... [many other variable not bound messages] ...
-Loading /usr/share/emacs/20.7/lisp/cus-start.el...done
-Loading /usr/share/emacs/20.7/lisp/international/mule.el...
-<unnamed port>: In procedure make-char-table in expression (@fop make-char-table (# #)):
-<unnamed port>: Symbol's function definition is void
-ABORT: (misc-error)
-
-Type "(backtrace)" to get more information or "(debug)" to enter the debugger.
-guile>
-
-That's 3279 lines ("wc -l") of Elisp code already, which isn't bad!
-
-I think that progress beyond this point basically means implementing
-multilingual and multibyte strings properly for Guile. Which is a
-_lot_ of work and requires IMO a very clear plan for Guile's role with
-respect to Emacs.
-
-* Design
-
-When thinking about how to implement an Elisp translator for Guile, it
-is important to realize that the great power of Emacs does not arise
-from Elisp (seen as a language in syntactic terms) alone, but from the
-combination of this language with the collection of primitives
-provided by the Emacs C source code. Therefore, to be of practical
-use, an Elisp translator needs to be more than just a transformer that
-translates sexps to Scheme expressions.
-
-The finished translator should consist of several parts...
-
-** Syntax transformation
-
-Although syntax transformation isn't all we need, we do still need it!
-
-This part is implemented by the (lang elisp transform) module; it is
-close to complete and seems to work pretty reliably.
-
-Note that transformed expressions use the `@fop' and `@bind' macros
-provided by...
-
-** C support for transformed expressions
-
-For performance and historical reasons (and perhaps necessity - I
-haven't thought about it enough yet), some of the transformation
-support is written in C.
-
-*** @fop
-
-The `@fop' macro is used to dispatch Elisp applications. Its first
-argument is a symbol, and this symbol's function slot is examined to
-find a procedure or macro to apply to the remaining arguments. `@fop'
-also handles aliasing (`defalias'): in this case the function slot
-contains another symbol.
-
-Once `@fop' has found the appropriate procedure or macro to apply, it
-returns an application expression in which that procedure or macro
-replaces the `@fop' and the original symbol. Hence no Elisp-specific
-evaluator support is required to perform the application.
-
-*** @bind
-
-Currently, Elisp variables are the same as Scheme variables, so
-variable references are effectively untransformed.
-
-The `@bind' macro does Elisp-style dynamic variable binding.
-Basically, it locates the named top level variables, `set!'s them to
-new values, evaluates its body, and then uses `set!' again to restore
-the original values.
-
-Because of the body evaluation, `@bind' requires evaluator support.
-In fact, the `@bind' macro code does little more than replace itself
-with the memoized SCM_IM_BIND. Most of the work is done by the
-evaluator when it hits SCM_IM_BIND.
-
-One theoretical problem with `@bind' is that any local Scheme variable
-in the same scope and with the same name as an Elisp variable will
-shadow the Elisp variable. But in practice it's difficult to set up
-such a situation; an exception is the translator code itself, so there
-we mangle the relevant Scheme variable names a bit to avoid the
-problem.
-
-Other possible problems with this approach are that it might not be
-possible to implement buffer local variables properly, and that
-`@bind' might become too inefficient when we implement full support
-for undefining Scheme variables. So we might in future have to
-transform Elisp variable references after all.
-
-*** Truth value stuff
-
-Following extensive discussions on the Guile mailing list between
-September 2001 and January 2002, we decided to go with Jim Blandy's
-proposal. See devel/translation/lisp-and-scheme.text for details.
-
-- The Elisp nil value is a new immediate SCM_MAKIFLAG, eq?-distinct
-from both #f and '() (and of course any other Scheme value). It can
-be accessed via the (guile) binding `%nil', and prints as `#nil'.
-
-- All Elisp primitives treat #nil, #f and '() as identical.
-
-- Scheme truth-testing primitives have been modified so that they
-treat #nil the same as #f.
-
-- Scheme list-manipulating primitives have been modified so that they
-treat #nil the same as '().
-
-- The Elisp t value is the same as #t.
-
-** Emacs editing primitives
-
-Buffers, keymaps, text properties, windows, frames etc. etc.
-
-Basically, everything that is implemented as a primitive in the Emacs
-C code needs to be implemented either in Scheme or in C for Guile.
-
-The Scheme files in the primitives subdirectory implement some of
-these primitives in Scheme. Not because that is the right decision,
-but because this is a proof of concept and it's quicker to write badly
-performing code in Scheme.
-
-Ultimately, most of these primitive definitions should really come
-from the Emacs C code itself, translated or preprocessed in a way that
-makes it compile with Guile. I think this is pretty close to the work
-that Ken Raeburn has been doing on the Emacs codebase.
-
-** Reading and printing support
-
-Elisp is close enough to Scheme that it's convenient to coopt the
-existing Guile reader rather than to write a new one from scratch, but
-there are a few syntactic differences that will require changes in
-reading and printing. None of the following changes has yet been
-implemented.
-
-- Character syntax is `?a' rather than `#\a'. (Not done. More
- precisely, `?a' in Elisp isn't character syntax but an alternative
- integer syntax. Note that we could support most of the `?a' syntax
- simply by doing
-
- (define ?a (char->integer #\a)
- (define ?b (char->integer #\b)
-
- and so on.)
-
-- Vector syntax is `[1 2 3]' rather than `#(1 2 3)'.
-
-- When in an Elisp environment, #nil and #t should print as `nil' and
- `t'.
-
-** The Elisp evaluation module (lang elisp base)
-
-Fundamentally, Guile's module system can't be used to package Elisp
-code in the same way it is used for Scheme code, because Elisp
-function definitions are stored as symbol properties (in the symbol's
-"function slot") and so are global. On the other hand, it is useful
-(necessary?) to associate some particular module with Elisp evaluation
-because
-
-- Elisp variables are currently implemented as Scheme variables and so
- need to live in some module
-
-- a syntax transformer is a property of a module.
-
-Therefore we have the (lang elisp base) module, which acts as the
-repository for all Elisp variables and the site of all Elisp
-evaluation.
-
-The initial environment provided by this module is intended to be a
-non-Emacs-dependent subset of Elisp. To get the idea, imagine someone
-who wants to write an extension function for, say Gnucash, and simply
-prefers to write in Elisp rather than in Scheme. He/she therefore
-doesn't buffers, keymaps and so on, just the basic language syntax and
-core data functions like +, *, concat, length etc., plus specific
-functions made available by Gnucash.
-
-(lang elisp base) achieves this by
-
-- importing Scheme definitions for some Emacs primitives from the
- files in the primitives subdirectory
-
-- then switching into Elisp syntax.
-
-After this point, `(eval XXX (resolve-module '(lang elisp base)))'
-will evaluate XXX as an Elisp expression in the (lang elisp base)
-module. (`eval-elisp' in (lang elisp interface) is a more convenient
-wrapper for this.)
-
-** Full Emacs environment
-
-The difference between the initial (lang elisp base) environment and a
-fully loaded Emacs equivalent is
-
-- more primitives: buffers, char-tables and many others
-
-- the bootstrap Elisp code that an undumped Emacs loads during
- installation by calling `(load "loadup.el")'.
-
-We don't have all the missing primitives, but we can already get
-through some of loadup.el. The Elisp function `load-emacs' (defined
-in (lang elisp base) initiates the loading of loadup.el; (lang elisp
-interface) exports `load-emacs' to Scheme.
-
-`load-emacs' loads so much Elisp code that it's an excellent way to
-test the translator. In current practice, it runs for a while and
-then fails when it gets to an undefined primitive or a bug in the
-translator. Eventually, it should go all the way. (And then we can
-worry about adding unexec support to Guile!) For the output that
-currently results from calling `(load-emacs)', see above in the Status
-section.
-
-* Resources
-
-** Ken Raeburn's Guile Emacs page
-
-http://www.mit.edu/~raeburn/guilemacs/
-
-** Keisuke Nishida's Gemacs project
-
-http://gemacs.sourceforge.net
-
-** Jim Blandy's nil/#f/() notes
-
-http://sanpietro.red-bean.com/guile/guile/old/3114.html
-
-Also now stored as guile-core/devel/translation/lisp-and-scheme.text
-in Guile CVS.
-
-** Mikael Djurfeldt's notes on translation
-
-See file guile-core/devel/translation/langtools.text in Guile CVS.
diff --git a/lang/elisp/STATUS b/lang/elisp/STATUS
deleted file mode 100644
index 066e86f24..000000000
--- a/lang/elisp/STATUS
+++ /dev/null
@@ -1,35 +0,0 @@
- -*-text-*-
-
-I've now finished my currently planned work on the Emacs Lisp
-translator in guile-core CVS.
-
-It works well enough for experimentation and playing around with --
-see the README file for details of what it _can_ do -- but has two
-serious restrictions:
-
-- Most Emacs Lisp primitives are not yet implemented. In particular,
- there are no buffer-related primitives.
-
-- Performance compares badly with Emacs. Using a handful of
- completely unscientific tests, I found that Guile was between 2 and
- 20 times slower than Emacs. (See the comment in
- lang/elisp/example.el for details of tests and results.)
-
-Interestingly, both these restrictions point in the same direction:
-the way forward is to define the primitives by compiling a
-preprocessed version of the Emacs source code, not by trying to
-implement them in Scheme. (Which, of course, is what Ken Raeburn's
-project is already trying to do.)
-
-Given this conclusion, I expect that most of the translator's Scheme
-code will eventually become obsolete, replaced by bits of Emacs C
-code. Until then, though, it should have a role:
-
-- as a guide to the Guile Emacs project on how to interface to the
- Elisp support in libguile (notably, usage of `@fop' and `@bind')
-
-- as a proof of concept and fun thing to experiment with
-
-- as a working translator that could help us develop our picture of
- how we want to integrate translator usage in general with the rest
- of Guile.
diff --git a/lang/elisp/base.scm b/lang/elisp/base.scm
deleted file mode 100644
index 8d145c43d..000000000
--- a/lang/elisp/base.scm
+++ /dev/null
@@ -1,47 +0,0 @@
-(define-module (lang elisp base)
-
- ;; Be pure. Nothing in this module requires symbols that map to the
- ;; standard Guile builtins, and it creates a problem if this module
- ;; has access to them, as @bind can dynamically change their values.
- ;; Transformer output always uses the values of builtin procedures
- ;; and macros directly.
- #:pure
-
- ;; {Elisp Primitives}
- ;;
- ;; In other words, Scheme definitions of elisp primitives. This
- ;; should (ultimately) include everything that Emacs defines in C.
- #:use-module (lang elisp primitives buffers)
- #:use-module (lang elisp primitives features)
- #:use-module (lang elisp primitives format)
- #:use-module (lang elisp primitives fns)
- #:use-module (lang elisp primitives guile)
- #:use-module (lang elisp primitives keymaps)
- #:use-module (lang elisp primitives lists)
- #:use-module (lang elisp primitives load)
- #:use-module (lang elisp primitives match)
- #:use-module (lang elisp primitives numbers)
- #:use-module (lang elisp primitives pure)
- #:use-module (lang elisp primitives read)
- #:use-module (lang elisp primitives signal)
- #:use-module (lang elisp primitives strings)
- #:use-module (lang elisp primitives symprop)
- #:use-module (lang elisp primitives syntax)
- #:use-module (lang elisp primitives system)
- #:use-module (lang elisp primitives time)
-
- ;; Now switch into Emacs Lisp syntax.
- #:use-syntax (lang elisp transform))
-
-;;; Everything below here is written in Elisp.
-
-(defun load-emacs (&optional new-load-path debug)
- (if debug (message "load-path: %s" load-path))
- (cond (new-load-path
- (message "Setting load-path to: %s" new-load-path)
- (setq load-path new-load-path)))
- (if debug (message "load-path: %s" load-path))
- (scheme (read-set! keywords 'prefix))
- (message "Calling loadup.el to clothe the bare Emacs...")
- (load "loadup.el")
- (message "Guile Emacs now fully clothed"))
diff --git a/lang/elisp/example.el b/lang/elisp/example.el
deleted file mode 100644
index eebd2f88e..000000000
--- a/lang/elisp/example.el
+++ /dev/null
@@ -1,39 +0,0 @@
-
-(defun html-page (title &rest contents)
- (concat "<HTML>\n"
- "<HEAD>\n"
- "<TITLE>" title "</TITLE>\n"
- "</HEAD>\n"
- "<BODY>\n"
- (apply 'concat contents)
- "</BODY>\n"
- "</HTML>\n"))
-
-(defmacro time (repeat-count &rest body)
- `(let ((count ,repeat-count)
- (beg (current-time))
- end)
- (while (> count 0)
- (setq count (- count 1))
- ,@body)
- (setq end (current-time))
- (+ (* 1000000.0 (+ (* 65536.0 (- (car end) (car beg)))
- (- (cadr end) (cadr beg))))
- (* 1.0 (- (caddr end) (caddr beg))))))
-
-;Non-scientific performance measurements (Guile measurements are with
-;`guile -q --no-debug'):
-;
-;(time 100000 (+ 3 4))
-; => 225,071 (Emacs) 4,000,000 (Guile)
-;(time 100000 (lambda () 1))
-; => 2,410,456 (Emacs) 4,000,000 (Guile)
-;(time 100000 (apply 'concat (mapcar (lambda (s) (concat s "." s)) '("a" "b" "c" "d"))))
-; => 10,185,792 (Emacs) 136,000,000 (Guile)
-;(defun sc (s) (concat s "." s))
-;(time 100000 (apply 'concat (mapcar 'sc '("a" "b" "c" "d"))))
-; => 7,870,055 (Emacs) 26,700,000 (Guile)
-;
-;Sadly, it looks like the translator's performance sucks quite badly
-;when compared with Emacs. But the translator is still very new, so
-;there's probably plenty of room of improvement.
diff --git a/lang/elisp/interface.scm b/lang/elisp/interface.scm
deleted file mode 100644
index 1e0758569..000000000
--- a/lang/elisp/interface.scm
+++ /dev/null
@@ -1,128 +0,0 @@
-(define-module (lang elisp interface)
- #:use-module (lang elisp internals evaluation)
- #:use-module (lang elisp internals fset)
- #:use-module ((lang elisp internals load) #:select ((load . elisp:load)))
- #:use-module ((lang elisp transform) #:select (transformer))
- #:export (eval-elisp
- translate-elisp
- elisp-function
- elisp-variable
- load-elisp-file
- load-elisp-library
- use-elisp-file
- use-elisp-library
- export-to-elisp
- load-emacs))
-
-;;; This file holds my ideas for the mechanisms that would be useful
-;;; to exchange definitions between Scheme and Elisp.
-
-(define (eval-elisp x)
- "Evaluate the Elisp expression @var{x}."
- (eval x the-elisp-module))
-
-(define (translate-elisp x)
- "Translate the Elisp expression @var{x} to equivalent Scheme code."
- (transformer x))
-
-(define (elisp-function sym)
- "Return the procedure or macro that implements @var{sym} in Elisp.
-If @var{sym} has no Elisp function definition, return @code{#f}."
- (fref sym))
-
-(define (elisp-variable sym)
- "Return the variable that implements @var{sym} in Elisp.
-If @var{sym} has no Elisp variable definition, return @code{#f}."
- (module-variable the-elisp-module sym))
-
-(define (load-elisp-file file-name)
- "Load @var{file-name} into the Elisp environment.
-@var{file-name} is assumed to name a file containing Elisp code."
- ;; This is the same as Elisp's `load-file', so use that if it is
- ;; available, otherwise duplicate the definition of `load-file' from
- ;; files.el.
- (let ((load-file (elisp-function 'load-file)))
- (if load-file
- (load-file file-name)
- (elisp:load file-name #f #f #t))))
-
-(define (load-elisp-library library)
- "Load library @var{library} into the Elisp environment.
-@var{library} should name an Elisp code library that can be found in
-one of the directories of @code{load-path}."
- ;; This is the same as Elisp's `load-file', so use that if it is
- ;; available, otherwise duplicate the definition of `load-file' from
- ;; files.el.
- (let ((load-library (elisp-function 'load-library)))
- (if load-library
- (load-library library)
- (elisp:load library))))
-
-(define export-module-name
- (let ((counter 0))
- (lambda ()
- (set! counter (+ counter 1))
- (list 'lang 'elisp
- (string->symbol (string-append "imports:"
- (number->string counter)))))))
-
-(define-macro (use-elisp-file file-name . imports)
- "Load Elisp code file @var{file-name} and import its definitions
-into the current Scheme module. If any @var{imports} are specified,
-they are interpreted as selection and renaming specifiers as per
-@code{use-modules}."
- (let ((export-module-name (export-module-name)))
- `(begin
- (fluid-set! ,elisp-export-module (resolve-module ',export-module-name))
- (beautify-user-module! (resolve-module ',export-module-name))
- (load-elisp-file ,file-name)
- (use-modules (,export-module-name ,@imports))
- (fluid-set! ,elisp-export-module #f))))
-
-(define-macro (use-elisp-library library . imports)
- "Load Elisp library @var{library} and import its definitions into
-the current Scheme module. If any @var{imports} are specified, they
-are interpreted as selection and renaming specifiers as per
-@code{use-modules}."
- (let ((export-module-name (export-module-name)))
- `(begin
- (fluid-set! ,elisp-export-module (resolve-module ',export-module-name))
- (beautify-user-module! (resolve-module ',export-module-name))
- (load-elisp-library ,library)
- (use-modules (,export-module-name ,@imports))
- (fluid-set! ,elisp-export-module #f))))
-
-(define (export-to-elisp . defs)
- "Export procedures and variables specified by @var{defs} to Elisp.
-Each @var{def} is either an object, in which case that object must be
-a named procedure or macro and is exported to Elisp under its Scheme
-name; or a symbol, in which case the variable named by that symbol is
-exported under its Scheme name; or a pair @var{(obj . name)}, in which
-case @var{obj} must be a procedure, macro or symbol as already
-described and @var{name} specifies the name under which that object is
-exported to Elisp."
- (for-each (lambda (def)
- (let ((obj (if (pair? def) (car def) def))
- (name (if (pair? def) (cdr def) #f)))
- (cond ((procedure? obj)
- (or name
- (set! name (procedure-name obj)))
- (if name
- (fset name obj)
- (error "No procedure name specified or deducible:" obj)))
- ((macro? obj)
- (or name
- (set! name (macro-name obj)))
- (if name
- (fset name obj)
- (error "No macro name specified or deducible:" obj)))
- ((symbol? obj)
- (or name
- (set! name obj))
- (module-add! the-elisp-module name
- (module-ref (current-module) obj)))
- (else
- (error "Can't export this kind of object to Elisp:" obj)))))
- defs))
-
-(define load-emacs (elisp-function 'load-emacs))
diff --git a/lang/elisp/internals/.cvsignore b/lang/elisp/internals/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/lang/elisp/internals/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/lang/elisp/internals/Makefile.am b/lang/elisp/internals/Makefile.am
deleted file mode 100644
index c66edb491..000000000
--- a/lang/elisp/internals/Makefile.am
+++ /dev/null
@@ -1,42 +0,0 @@
-## Process this file with automake to produce Makefile.in.
-##
-## Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-AUTOMAKE_OPTIONS = gnu
-
-# These should be installed and distributed.
-
-elisp_sources = \
- evaluation.scm \
- format.scm \
- fset.scm \
- lambda.scm \
- load.scm \
- null.scm \
- set.scm \
- signal.scm \
- time.scm \
- trace.scm
-
-subpkgdatadir = $(pkgdatadir)/$(VERSION)/lang/elisp/internals
-subpkgdata_DATA = $(elisp_sources)
-ETAGS_ARGS = $(subpkgdata_DATA)
-
-EXTRA_DIST = $(elisp_sources)
diff --git a/lang/elisp/internals/evaluation.scm b/lang/elisp/internals/evaluation.scm
deleted file mode 100644
index 8cbb19462..000000000
--- a/lang/elisp/internals/evaluation.scm
+++ /dev/null
@@ -1,13 +0,0 @@
-(define-module (lang elisp internals evaluation)
- #:export (the-elisp-module))
-
-;;;; {Elisp Evaluation}
-
-;;;; All elisp evaluation happens within the same module - namely
-;;;; (lang elisp base). This is necessary both because elisp itself
-;;;; has no concept of different modules - reflected for example in
-;;;; its single argument `eval' function - and because Guile's current
-;;;; implementation of elisp stores elisp function definitions in
-;;;; slots in global symbol objects.
-
-(define the-elisp-module (resolve-module '(lang elisp base)))
diff --git a/lang/elisp/internals/format.scm b/lang/elisp/internals/format.scm
deleted file mode 100644
index 6862dab27..000000000
--- a/lang/elisp/internals/format.scm
+++ /dev/null
@@ -1,62 +0,0 @@
-(define-module (lang elisp internals format)
- #:pure
- #:use-module (ice-9 r5rs)
- #:use-module ((ice-9 format) #:select ((format . scheme:format)))
- #:use-module (lang elisp internals fset)
- #:use-module (lang elisp internals signal)
- #:export (format
- message))
-
-(define (format control-string . args)
-
- (define (cons-string str ls)
- (let loop ((sl (string->list str))
- (ls ls))
- (if (null? sl)
- ls
- (loop (cdr sl) (cons (car sl) ls)))))
-
- (let loop ((input (string->list control-string))
- (args args)
- (output '())
- (mid-control #f))
- (if (null? input)
- (if mid-control
- (error "Format string ends in middle of format specifier")
- (list->string (reverse output)))
- (if mid-control
- (case (car input)
- ((#\%)
- (loop (cdr input)
- args
- (cons #\% output)
- #f))
- (else
- (loop (cdr input)
- (cdr args)
- (cons-string (case (car input)
- ((#\s) (scheme:format #f "~A" (car args)))
- ((#\d) (number->string (car args)))
- ((#\o) (number->string (car args) 8))
- ((#\x) (number->string (car args) 16))
- ((#\e) (number->string (car args))) ;FIXME
- ((#\f) (number->string (car args))) ;FIXME
- ((#\g) (number->string (car args))) ;FIXME
- ((#\c) (let ((a (car args)))
- (if (char? a)
- (string a)
- (string (integer->char a)))))
- ((#\S) (scheme:format #f "~S" (car args)))
- (else
- (error "Invalid format operation %%%c" (car input))))
- output)
- #f)))
- (case (car input)
- ((#\%)
- (loop (cdr input) args output #t))
- (else
- (loop (cdr input) args (cons (car input) output) #f)))))))
-
-(define (message control-string . args)
- (display (apply format control-string args))
- (newline))
diff --git a/lang/elisp/internals/fset.scm b/lang/elisp/internals/fset.scm
deleted file mode 100644
index 249db7c91..000000000
--- a/lang/elisp/internals/fset.scm
+++ /dev/null
@@ -1,113 +0,0 @@
-(define-module (lang elisp internals fset)
- #:use-module (lang elisp internals evaluation)
- #:use-module (lang elisp internals lambda)
- #:use-module (lang elisp internals signal)
- #:export (fset
- fref
- fref/error-if-void
- elisp-apply
- interactive-specification
- not-subr?
- elisp-export-module))
-
-(define the-variables-module (resolve-module '(lang elisp variables)))
-
-;; By default, Guile GC's unreachable symbols. So we need to make
-;; sure they stay reachable!
-(define syms '())
-
-;; elisp-export-module, if non-#f, holds a module to which definitions
-;; should be exported under their normal symbol names. This is used
-;; when importing Elisp definitions into Scheme.
-(define elisp-export-module (make-fluid))
-
-;; Store the procedure, macro or alias symbol PROC in SYM's function
-;; slot.
-(define (fset sym proc)
- (or (memq sym syms)
- (set! syms (cons sym syms)))
- (let ((vcell (symbol-fref sym))
- (vsym #f)
- (export-module (fluid-ref elisp-export-module)))
- ;; Playing around with variables and name properties... For the
- ;; reasoning behind this, see the commentary in (lang elisp
- ;; variables).
- (cond ((procedure? proc)
- ;; A procedure created from Elisp will already have a name
- ;; property attached, with value of the form
- ;; <elisp-defun:NAME> or <elisp-lambda>. Any other
- ;; procedure coming through here must be an Elisp primitive
- ;; definition, so we give it a name of the form
- ;; <elisp-subr:NAME>.
- (or (procedure-name proc)
- (set-procedure-property! proc
- 'name
- (symbol-append '<elisp-subr: sym '>)))
- (set! vsym (procedure-name proc)))
- ((macro? proc)
- ;; Macros coming through here must be defmacros, as all
- ;; primitive special forms are handled directly by the
- ;; transformer.
- (set-procedure-property! (macro-transformer proc)
- 'name
- (symbol-append '<elisp-defmacro: sym '>))
- (set! vsym (procedure-name (macro-transformer proc))))
- (else
- ;; An alias symbol.
- (set! vsym (symbol-append '<elisp-defalias: sym '>))))
- ;; This is the important bit!
- (if (variable? vcell)
- (variable-set! vcell proc)
- (begin
- (set! vcell (make-variable proc))
- (symbol-fset! sym vcell)
- ;; Playing with names and variables again - see above.
- (module-add! the-variables-module vsym vcell)
- (module-export! the-variables-module (list vsym))))
- ;; Export variable to the export module, if non-#f.
- (if (and export-module
- (or (procedure? proc)
- (macro? proc)))
- (begin
- (module-add! export-module sym vcell)
- (module-export! export-module (list sym))))))
-
-;; Retrieve the procedure or macro stored in SYM's function slot.
-;; Note the asymmetry w.r.t. fset: if fref finds an alias symbol, it
-;; recursively calls fref on that symbol. Returns #f if SYM's
-;; function slot doesn't contain a valid definition.
-(define (fref sym)
- (let ((var (symbol-fref sym)))
- (if (and var (variable? var))
- (let ((proc (variable-ref var)))
- (cond ((symbol? proc)
- (fref proc))
- (else
- proc)))
- #f)))
-
-;; Same as fref, but signals an Elisp error if SYM's function
-;; definition is void.
-(define (fref/error-if-void sym)
- (or (fref sym)
- (signal 'void-function (list sym))))
-
-;; Maps a procedure to its (interactive ...) spec.
-(define interactive-specification (make-object-property))
-
-;; Maps a procedure to #t if it is NOT a built-in.
-(define not-subr? (make-object-property))
-
-(define (elisp-apply function . args)
- (apply apply
- (cond ((symbol? function)
- (fref/error-if-void function))
- ((procedure? function)
- function)
- ((and (pair? function)
- (eq? (car function) 'lambda))
- (eval (transform-lambda/interactive function '<elisp-lambda>)
- the-root-module))
- (else
- (signal 'invalid-function (list function))))
- args))
diff --git a/lang/elisp/internals/lambda.scm b/lang/elisp/internals/lambda.scm
deleted file mode 100644
index 9917c08bd..000000000
--- a/lang/elisp/internals/lambda.scm
+++ /dev/null
@@ -1,108 +0,0 @@
-(define-module (lang elisp internals lambda)
- #:use-module (lang elisp internals fset)
- #:use-module (lang elisp transform)
- #:export (parse-formals
- transform-lambda/interactive
- interactive-spec))
-
-;;; Parses a list of elisp formals, e.g. (x y &optional b &rest r) and
-;;; returns three values: (i) list of symbols for required arguments,
-;;; (ii) list of symbols for optional arguments, (iii) rest symbol, or
-;;; #f if there is no rest argument.
-(define (parse-formals formals)
- (letrec ((do-required
- (lambda (required formals)
- (if (null? formals)
- (values (reverse required) '() #f)
- (let ((next-sym (car formals)))
- (cond ((not (symbol? next-sym))
- (error "Bad formals (non-symbol in required list)"))
- ((eq? next-sym '&optional)
- (do-optional required '() (cdr formals)))
- ((eq? next-sym '&rest)
- (do-rest required '() (cdr formals)))
- (else
- (do-required (cons next-sym required)
- (cdr formals))))))))
- (do-optional
- (lambda (required optional formals)
- (if (null? formals)
- (values (reverse required) (reverse optional) #f)
- (let ((next-sym (car formals)))
- (cond ((not (symbol? next-sym))
- (error "Bad formals (non-symbol in optional list)"))
- ((eq? next-sym '&rest)
- (do-rest required optional (cdr formals)))
- (else
- (do-optional required
- (cons next-sym optional)
- (cdr formals))))))))
- (do-rest
- (lambda (required optional formals)
- (if (= (length formals) 1)
- (let ((next-sym (car formals)))
- (if (symbol? next-sym)
- (values (reverse required) (reverse optional) next-sym)
- (error "Bad formals (non-symbol rest formal)")))
- (error "Bad formals (more than one rest formal)")))))
-
- (do-required '() (cond ((list? formals)
- formals)
- ((symbol? formals)
- (list '&rest formals))
- (else
- (error "Bad formals (not a list or a single symbol)"))))))
-
-(define (transform-lambda exp)
- (call-with-values (lambda () (parse-formals (cadr exp)))
- (lambda (required optional rest)
- (let ((num-required (length required))
- (num-optional (length optional)))
- `(,lambda %--args
- (,let ((%--num-args (,length %--args)))
- (,cond ((,< %--num-args ,num-required)
- (,error "Wrong number of args (not enough required args)"))
- ,@(if rest
- '()
- `(((,> %--num-args ,(+ num-required num-optional))
- (,error "Wrong number of args (too many args)"))))
- (else
- (, @bind ,(append (map (lambda (i)
- (list (list-ref required i)
- `(,list-ref %--args ,i)))
- (iota num-required))
- (map (lambda (i)
- (let ((i+nr (+ i num-required)))
- (list (list-ref optional i)
- `(,if (,> %--num-args ,i+nr)
- (,list-ref %--args ,i+nr)
- ,%nil))))
- (iota num-optional))
- (if rest
- (list (list rest
- `(,if (,> %--num-args
- ,(+ num-required
- num-optional))
- (,list-tail %--args
- ,(+ num-required
- num-optional))
- ,%nil)))
- '()))
- ,@(map transformer (cddr exp)))))))))))
-
-(define (set-not-subr! proc boolean)
- (set! (not-subr? proc) boolean))
-
-(define (transform-lambda/interactive exp name)
- (fluid-set! interactive-spec #f)
- (let* ((x (transform-lambda exp))
- (is (fluid-ref interactive-spec)))
- `(,let ((%--lambda ,x))
- (,set-procedure-property! %--lambda (,quote name) (,quote ,name))
- (,set-not-subr! %--lambda #t)
- ,@(if is
- `((,set! (,interactive-specification %--lambda) (,quote ,is)))
- '())
- %--lambda)))
-
-(define interactive-spec (make-fluid))
diff --git a/lang/elisp/internals/load.scm b/lang/elisp/internals/load.scm
deleted file mode 100644
index 88d14b802..000000000
--- a/lang/elisp/internals/load.scm
+++ /dev/null
@@ -1,45 +0,0 @@
-(define-module (lang elisp internals load)
- #:use-module (ice-9 optargs)
- #:use-module (lang elisp internals signal)
- #:use-module (lang elisp internals format)
- #:use-module (lang elisp internals evaluation)
- #:export (load-path
- load))
-
-(define load-path '("/usr/share/emacs/20.7/lisp/"
- "/usr/share/emacs/20.7/lisp/emacs-lisp/"))
-
-(define* (load file #:optional noerror nomessage nosuffix must-suffix)
- (define (load1 filename)
- (let ((pathname (let loop ((dirs (if (char=? (string-ref filename 0) #\/)
- '("")
- load-path)))
- (cond ((null? dirs) #f)
- ((file-exists? (string-append (car dirs)
- filename))
- (string-append (car dirs) filename))
- (else (loop (cdr dirs)))))))
- (if pathname
- (begin
- (or nomessage
- (message "Loading %s..." pathname))
- (with-input-from-file pathname
- (lambda ()
- (let loop ((form (read)))
- (or (eof-object? form)
- (begin
- ;; Note that `eval' already incorporates use
- ;; of the specified module's transformer.
- (eval form the-elisp-module)
- (loop (read)))))))
- (or nomessage
- (message "Loading %s...done" pathname))
- #t)
- #f)))
- (or (and (not nosuffix)
- (load1 (string-append file ".el")))
- (and (not must-suffix)
- (load1 file))
- noerror
- (signal 'file-error
- (list "Cannot open load file" file))))
diff --git a/lang/elisp/internals/null.scm b/lang/elisp/internals/null.scm
deleted file mode 100644
index 94e2b28dd..000000000
--- a/lang/elisp/internals/null.scm
+++ /dev/null
@@ -1,13 +0,0 @@
-(define-module (lang elisp internals null)
- #:export (->nil lambda->nil null))
-
-(define (->nil x)
- (or x %nil))
-
-(define (lambda->nil proc)
- (lambda args
- (->nil (apply proc args))))
-
-(define (null obj)
- (->nil (or (not obj)
- (null? obj))))
diff --git a/lang/elisp/internals/set.scm b/lang/elisp/internals/set.scm
deleted file mode 100644
index 5e5b0048c..000000000
--- a/lang/elisp/internals/set.scm
+++ /dev/null
@@ -1,20 +0,0 @@
-(define-module (lang elisp internals set)
- #:use-module (lang elisp internals evaluation)
- #:use-module (lang elisp internals signal)
- #:export (set value))
-
-;; Set SYM's variable value to VAL, and return VAL.
-(define (set sym val)
- (if (module-defined? the-elisp-module sym)
- (module-set! the-elisp-module sym val)
- (module-define! the-elisp-module sym val))
- val)
-
-;; Return SYM's variable value. If it has none, signal an error if
-;; MUST-EXIST is true, just return #nil otherwise.
-(define (value sym must-exist)
- (if (module-defined? the-elisp-module sym)
- (module-ref the-elisp-module sym)
- (if must-exist
- (error "Symbol's value as variable is void:" sym)
- %nil)))
diff --git a/lang/elisp/internals/signal.scm b/lang/elisp/internals/signal.scm
deleted file mode 100644
index 09e2c05a6..000000000
--- a/lang/elisp/internals/signal.scm
+++ /dev/null
@@ -1,18 +0,0 @@
-(define-module (lang elisp internals signal)
- #:use-module (lang elisp internals format)
- #:export (signal
- error
- wta))
-
-(define (signal error-symbol data)
- (scm-error 'elisp-signal
- #f
- "Signalling ~A with data ~S"
- (list error-symbol data)
- #f))
-
-(define (error . args)
- (signal 'error (list (apply format args))))
-
-(define (wta expected actual pos)
- (signal 'wrong-type-argument (list expected actual)))
diff --git a/lang/elisp/internals/time.scm b/lang/elisp/internals/time.scm
deleted file mode 100644
index 10ac02ddc..000000000
--- a/lang/elisp/internals/time.scm
+++ /dev/null
@@ -1,14 +0,0 @@
-(define-module (lang elisp internals time)
- #:use-module (ice-9 optargs)
- #:export (format-time-string))
-
-(define* (format-time-string format-string #:optional time universal)
- (strftime format-string
- ((if universal gmtime localtime)
- (if time
- (+ (ash (car time) 16)
- (let ((time-cdr (cdr time)))
- (if (pair? time-cdr)
- (car time-cdr)
- time-cdr)))
- (current-time)))))
diff --git a/lang/elisp/internals/trace.scm b/lang/elisp/internals/trace.scm
deleted file mode 100644
index 0dd92ec73..000000000
--- a/lang/elisp/internals/trace.scm
+++ /dev/null
@@ -1,28 +0,0 @@
-(define-module (lang elisp internals trace)
- #:export (trc trc-syms trc-all trc-none))
-
-(define *syms* #f)
-
-(define (trc-syms . syms)
- (set! *syms* syms))
-
-(define (trc-all)
- (set! *syms* #f))
-
-(define (trc-none)
- (set! *syms* '()))
-
-(define (trc . args)
- (let ((sym (car args))
- (args (cdr args)))
- (if (or (and *syms*
- (memq sym *syms*))
- (not *syms*))
- (begin
- (write sym)
- (display ": ")
- (write args)
- (newline)))))
-
-;; Default to no tracing.
-(trc-none)
diff --git a/lang/elisp/primitives/.cvsignore b/lang/elisp/primitives/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/lang/elisp/primitives/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/lang/elisp/primitives/Makefile.am b/lang/elisp/primitives/Makefile.am
deleted file mode 100644
index 283467a41..000000000
--- a/lang/elisp/primitives/Makefile.am
+++ /dev/null
@@ -1,50 +0,0 @@
-## Process this file with automake to produce Makefile.in.
-##
-## Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-AUTOMAKE_OPTIONS = gnu
-
-# These should be installed and distributed.
-
-elisp_sources = \
- buffers.scm \
- features.scm \
- fns.scm \
- format.scm \
- guile.scm \
- keymaps.scm \
- lists.scm \
- load.scm \
- match.scm \
- numbers.scm \
- pure.scm \
- read.scm \
- signal.scm \
- strings.scm \
- symprop.scm \
- syntax.scm \
- system.scm \
- time.scm
-
-subpkgdatadir = $(pkgdatadir)/$(VERSION)/lang/elisp/primitives
-subpkgdata_DATA = $(elisp_sources)
-ETAGS_ARGS = $(subpkgdata_DATA)
-
-EXTRA_DIST = $(elisp_sources)
diff --git a/lang/elisp/primitives/buffers.scm b/lang/elisp/primitives/buffers.scm
deleted file mode 100644
index 756d4be04..000000000
--- a/lang/elisp/primitives/buffers.scm
+++ /dev/null
@@ -1,16 +0,0 @@
-(define-module (lang elisp primitives buffers)
- #:use-module (ice-9 optargs)
- #:use-module (lang elisp internals fset))
-
-(fset 'buffer-disable-undo
- (lambda* (#:optional buffer)
- 'unimplemented))
-
-(fset 're-search-forward
- (lambda* (regexp #:optional bound noerror count)
- 'unimplemented))
-
-(fset 're-search-backward
- (lambda* (regexp #:optional bound noerror count)
- 'unimplemented))
-
diff --git a/lang/elisp/primitives/features.scm b/lang/elisp/primitives/features.scm
deleted file mode 100644
index 8cd1a9958..000000000
--- a/lang/elisp/primitives/features.scm
+++ /dev/null
@@ -1,26 +0,0 @@
-(define-module (lang elisp primitives features)
- #:use-module (lang elisp internals fset)
- #:use-module (lang elisp internals load)
- #:use-module (lang elisp internals null)
- #:use-module (ice-9 optargs))
-
-(define-public features '())
-
-(fset 'provide
- (lambda (feature)
- (or (memq feature features)
- (set! features (cons feature features)))))
-
-(fset 'featurep
- (lambda (feature)
- (->nil (memq feature features))))
-
-(fset 'require
- (lambda* (feature #:optional file-name noerror)
- (or (memq feature features)
- (load (or file-name
- (symbol->string feature))
- noerror
- #f
- #f
- #t))))
diff --git a/lang/elisp/primitives/fns.scm b/lang/elisp/primitives/fns.scm
deleted file mode 100644
index f7a4aa003..000000000
--- a/lang/elisp/primitives/fns.scm
+++ /dev/null
@@ -1,45 +0,0 @@
-(define-module (lang elisp primitives fns)
- #:use-module (lang elisp internals set)
- #:use-module (lang elisp internals fset)
- #:use-module (lang elisp internals null))
-
-(fset 'fset fset)
-(fset 'defalias fset)
-
-(fset 'apply elisp-apply)
-
-(fset 'funcall
- (lambda (function . args)
- (elisp-apply function args)))
-
-(fset 'interactive-p
- (lambda ()
- %nil))
-
-(fset 'commandp
- (lambda (sym)
- (if (interactive-specification (fref sym)) #t %nil)))
-
-(fset 'fboundp
- (lambda (sym)
- (->nil (variable? (symbol-fref sym)))))
-
-(fset 'symbol-function fref/error-if-void)
-
-(fset 'macroexpand macroexpand)
-
-(fset 'subrp
- (lambda (obj)
- (->nil (not (not-subr? obj)))))
-
-(fset 'byte-code-function-p
- (lambda (object)
- %nil))
-
-(fset 'run-hooks
- (lambda hooks
- (for-each (lambda (hooksym)
- (for-each (lambda (fn)
- (elisp-apply fn '()))
- (value hooksym #f)))
- hooks)))
diff --git a/lang/elisp/primitives/format.scm b/lang/elisp/primitives/format.scm
deleted file mode 100644
index a7c637880..000000000
--- a/lang/elisp/primitives/format.scm
+++ /dev/null
@@ -1,6 +0,0 @@
-(define-module (lang elisp primitives format)
- #:use-module (lang elisp internals format)
- #:use-module (lang elisp internals fset))
-
-(fset 'format format)
-(fset 'message message)
diff --git a/lang/elisp/primitives/guile.scm b/lang/elisp/primitives/guile.scm
deleted file mode 100644
index 059f2bbad..000000000
--- a/lang/elisp/primitives/guile.scm
+++ /dev/null
@@ -1,20 +0,0 @@
-(define-module (lang elisp primitives guile)
- #:use-module (lang elisp internals fset))
-
-;;; {Importing Guile procedures into Elisp}
-
-;; It may be worthwhile to import some Guile procedures into the Elisp
-;; environment. For now, though, we don't do this.
-
-(if #f
- (let ((accessible-procedures
- (apropos-fold (lambda (module name var data)
- (cons (cons name var) data))
- '()
- ""
- (apropos-fold-accessible (current-module)))))
- (for-each (lambda (name var)
- (if (procedure? var)
- (fset name var)))
- (map car accessible-procedures)
- (map cdr accessible-procedures))))
diff --git a/lang/elisp/primitives/keymaps.scm b/lang/elisp/primitives/keymaps.scm
deleted file mode 100644
index 730d89fbd..000000000
--- a/lang/elisp/primitives/keymaps.scm
+++ /dev/null
@@ -1,26 +0,0 @@
-(define-module (lang elisp primitives keymaps)
- #:use-module (lang elisp internals fset))
-
-(define (make-sparse-keymap)
- (list 'keymap))
-
-(define (define-key keymap key def)
- (set-cdr! keymap
- (cons (cons key def) (cdr keymap))))
-
-(define global-map (make-sparse-keymap))
-(define esc-map (make-sparse-keymap))
-(define ctl-x-map (make-sparse-keymap))
-(define ctl-x-4-map (make-sparse-keymap))
-(define ctl-x-5-map (make-sparse-keymap))
-
-;;; {Elisp Exports}
-
-(fset 'make-sparse-keymap make-sparse-keymap)
-(fset 'define-key define-key)
-
-(export global-map
- esc-map
- ctl-x-map
- ctl-x-4-map
- ctl-x-5-map)
diff --git a/lang/elisp/primitives/lists.scm b/lang/elisp/primitives/lists.scm
deleted file mode 100644
index 4907ed59d..000000000
--- a/lang/elisp/primitives/lists.scm
+++ /dev/null
@@ -1,103 +0,0 @@
-(define-module (lang elisp primitives lists)
- #:use-module (lang elisp internals fset)
- #:use-module (lang elisp internals null)
- #:use-module (lang elisp internals signal))
-
-(fset 'cons cons)
-
-(fset 'null null)
-
-(fset 'not null)
-
-(fset 'car
- (lambda (l)
- (if (null l)
- %nil
- (car l))))
-
-(fset 'cdr
- (lambda (l)
- (if (null l)
- %nil
- (cdr l))))
-
-(fset 'eq
- (lambda (x y)
- (or (eq? x y)
- (and (null x) (null y)))))
-
-(fset 'equal
- (lambda (x y)
- (or (equal? x y)
- (and (null x) (null y)))))
-
-(fset 'setcar set-car!)
-
-(fset 'setcdr set-cdr!)
-
-(for-each (lambda (sym proc)
- (fset sym
- (lambda (elt list)
- (if (null list)
- %nil
- (if (null elt)
- (let loop ((l list))
- (cond ((null l) %nil)
- ((null (car l)) l)
- (else (loop (cdr l)))))
- (proc elt list))))))
- '( memq member assq assoc)
- `(,memq ,member ,assq ,assoc))
-
-(fset 'length
- (lambda (x)
- (cond ((null x) 0)
- ((pair? x) (length x))
- ((vector? x) (vector-length x))
- ((string? x) (string-length x))
- (else (wta 'sequencep x 1)))))
-
-(fset 'copy-sequence
- (lambda (x)
- (cond ((list? x) (list-copy x))
- ((vector? x) (error "Vector copy not yet implemented"))
- ((string? x) (string-copy x))
- (else (wta 'sequencep x 1)))))
-
-(fset 'elt
- (lambda (obj i)
- (cond ((pair? obj) (list-ref obj i))
- ((vector? obj) (vector-ref obj i))
- ((string? obj) (char->integer (string-ref obj i))))))
-
-(fset 'list list)
-
-(fset 'mapcar
- (lambda (function sequence)
- (map (lambda (elt)
- (elisp-apply function (list elt)))
- (cond ((null sequence) '())
- ((list? sequence) sequence)
- ((vector? sequence) (vector->list sequence))
- ((string? sequence) (map char->integer (string->list sequence)))
- (else (wta 'sequencep sequence 2))))))
-
-(fset 'nth
- (lambda (n list)
- (if (or (null list)
- (>= n (length list)))
- %nil
- (list-ref list n))))
-
-(fset 'listp
- (lambda (object)
- (or (null object)
- (list? object))))
-
-(fset 'consp pair?)
-
-(fset 'nconc
- (lambda args
- (apply append! (map (lambda (arg)
- (if arg arg '()))
- args))))
diff --git a/lang/elisp/primitives/load.scm b/lang/elisp/primitives/load.scm
deleted file mode 100644
index a627b5d10..000000000
--- a/lang/elisp/primitives/load.scm
+++ /dev/null
@@ -1,17 +0,0 @@
-(define-module (lang elisp primitives load)
- #:use-module (lang elisp internals load)
- #:use-module (lang elisp internals evaluation)
- #:use-module (lang elisp internals fset))
-
-(fset 'load load)
-(re-export load-path)
-
-(fset 'eval
- (lambda (form)
- (eval form the-elisp-module)))
-
-(fset 'autoload
- (lambda args
- #t))
-
-(define-public current-load-list %nil)
diff --git a/lang/elisp/primitives/match.scm b/lang/elisp/primitives/match.scm
deleted file mode 100644
index 0a04ef5c5..000000000
--- a/lang/elisp/primitives/match.scm
+++ /dev/null
@@ -1,68 +0,0 @@
-(define-module (lang elisp primitives match)
- #:use-module (lang elisp internals fset)
- #:use-module (ice-9 regex)
- #:use-module (ice-9 optargs))
-
-(define last-match #f)
-
-(fset 'string-match
- (lambda (regexp string . start)
-
- (define emacs-string-match
-
- (if (defined? 'make-emacs-regexp)
-
- ;; This is what we would do if we had an
- ;; Emacs-compatible regexp primitive, here called
- ;; `make-emacs-regexp'.
- (lambda (pattern str . args)
- (let ((rx (make-emacs-regexp pattern))
- (start (if (pair? args) (car args) 0)))
- (regexp-exec rx str start)))
-
- ;; But we don't have Emacs-compatible regexps, and I
- ;; don't think it's worthwhile at this stage to write
- ;; generic regexp conversion code. So work around the
- ;; discrepancies between Guile/libc and Emacs regexps by
- ;; substituting the regexps that actually occur in the
- ;; elisp code that we want to read.
- (lambda (pattern str . args)
- (let loop ((discrepancies '(("^[0-9]+\\.\\([0-9]+\\)" .
- "^[0-9]+\\.([0-9]+)"))))
- (or (null? discrepancies)
- (if (string=? pattern (caar discrepancies))
- (set! pattern (cdar discrepancies))
- (loop (cdr discrepancies)))))
- (apply string-match pattern str args))))
-
- (let ((match (apply emacs-string-match regexp string start)))
- (set! last-match
- (if match
- (apply append!
- (map (lambda (n)
- (list (match:start match n)
- (match:end match n)))
- (iota (match:count match))))
- #f)))
-
- (if last-match (car last-match) %nil)))
-
-(fset 'match-beginning
- (lambda (subexp)
- (list-ref last-match (* 2 subexp))))
-
-(fset 'match-end
- (lambda (subexp)
- (list-ref last-match (+ (* 2 subexp) 1))))
-
-(fset 'substring substring)
-
-(fset 'match-data
- (lambda* (#:optional integers reuse)
- last-match))
-
-(fset 'set-match-data
- (lambda (list)
- (set! last-match list)))
-
-(fset 'store-match-data 'set-match-data)
diff --git a/lang/elisp/primitives/numbers.scm b/lang/elisp/primitives/numbers.scm
deleted file mode 100644
index 43246d32f..000000000
--- a/lang/elisp/primitives/numbers.scm
+++ /dev/null
@@ -1,43 +0,0 @@
-(define-module (lang elisp primitives numbers)
- #:use-module (lang elisp internals fset)
- #:use-module (lang elisp internals null))
-
-(fset 'logior logior)
-(fset 'logand logand)
-(fset 'integerp (lambda->nil integer?))
-(fset '= =)
-(fset '< <)
-(fset '> >)
-(fset '<= <=)
-(fset '>= >=)
-(fset '* *)
-(fset '+ +)
-(fset '- -)
-(fset '1- 1-)
-(fset 'ash ash)
-
-(fset 'lsh
- (let ()
- (define (lsh num shift)
- (cond ((= shift 0)
- num)
- ((< shift 0)
- ;; Logical shift to the right. Do an arithmetic
- ;; shift and then mask out the sign bit.
- (lsh (logand (ash num -1) most-positive-fixnum)
- (+ shift 1)))
- (else
- ;; Logical shift to the left. Guile's ash will
- ;; always preserve the sign of the result, which is
- ;; not what we want for lsh, so we need to work
- ;; around this.
- (let ((new-sign-bit (ash (logand num
- (logxor most-positive-fixnum
- (ash most-positive-fixnum -1)))
- 1)))
- (lsh (logxor new-sign-bit
- (ash (logand num most-positive-fixnum) 1))
- (- shift 1))))))
- lsh))
-
-(fset 'numberp (lambda->nil number?))
diff --git a/lang/elisp/primitives/pure.scm b/lang/elisp/primitives/pure.scm
deleted file mode 100644
index 7cb6b5317..000000000
--- a/lang/elisp/primitives/pure.scm
+++ /dev/null
@@ -1,8 +0,0 @@
-(define-module (lang elisp primitives pure)
- #:use-module (lang elisp internals fset))
-
-;; Purification, unexec etc. are not yet implemented...
-
-(fset 'purecopy identity)
-
-(define-public purify-flag %nil)
diff --git a/lang/elisp/primitives/read.scm b/lang/elisp/primitives/read.scm
deleted file mode 100644
index aeacd2c15..000000000
--- a/lang/elisp/primitives/read.scm
+++ /dev/null
@@ -1,10 +0,0 @@
-(define-module (lang elisp primitives read)
- #:use-module (lang elisp internals fset))
-
-;;; MEGA HACK!!!!
-
-(fset 'read (lambda (str)
- (cond ((string=? str "?\\M-\\^@")
- -134217728)
- (else
- (with-input-from-string str read)))))
diff --git a/lang/elisp/primitives/signal.scm b/lang/elisp/primitives/signal.scm
deleted file mode 100644
index 33168c352..000000000
--- a/lang/elisp/primitives/signal.scm
+++ /dev/null
@@ -1,6 +0,0 @@
-(define-module (lang elisp primitives signal)
- #:use-module (lang elisp internals signal)
- #:use-module (lang elisp internals fset))
-
-(fset 'signal signal)
-(fset 'error error)
diff --git a/lang/elisp/primitives/strings.scm b/lang/elisp/primitives/strings.scm
deleted file mode 100644
index 85a1c10a9..000000000
--- a/lang/elisp/primitives/strings.scm
+++ /dev/null
@@ -1,34 +0,0 @@
-(define-module (lang elisp primitives strings)
- #:use-module (lang elisp internals fset)
- #:use-module (lang elisp internals null)
- #:use-module (lang elisp internals signal))
-
-(fset 'substring substring)
-
-(fset 'concat
- (lambda args
- (apply string-append
- (map (lambda (arg)
- (cond
- ((string? arg) arg)
- ((list? arg) (list->string arg))
- ((vector? arg) (list->string (vector->list arg)))
- (else (error "Wrong type argument for concat"))))
- args))))
-
-(fset 'string-to-number string->number)
-
-(fset 'number-to-string number->string)
-
-(fset 'string-lessp (lambda->nil string<?))
-(fset 'string< 'string-lessp)
-
-(fset 'aref
- (lambda (array idx)
- (cond ((vector? array) (vector-ref array idx))
- ((string? array) (char->integer (string-ref array idx)))
- (else (wta 'arrayp array 1)))))
-
-(fset 'stringp (lambda->nil string?))
-
-(fset 'vector vector)
diff --git a/lang/elisp/primitives/symprop.scm b/lang/elisp/primitives/symprop.scm
deleted file mode 100644
index a520a4b81..000000000
--- a/lang/elisp/primitives/symprop.scm
+++ /dev/null
@@ -1,40 +0,0 @@
-(define-module (lang elisp primitives symprop)
- #:use-module (lang elisp internals evaluation)
- #:use-module (lang elisp internals fset)
- #:use-module (lang elisp internals null)
- #:use-module (lang elisp internals set)
- #:use-module (ice-9 optargs))
-
-;;; {Elisp Exports}
-
-(fset 'put set-symbol-property!)
-
-(fset 'get symbol-property)
-
-(fset 'set set)
-
-(fset 'set-default 'set)
-
-(fset 'boundp
- (lambda (sym)
- (->nil (module-defined? the-elisp-module sym))))
-
-(fset 'default-boundp 'boundp)
-
-(fset 'symbol-value
- (lambda (sym)
- (value sym #t)))
-
-(fset 'default-value 'symbol-value)
-
-(fset 'symbolp
- (lambda (object)
- (or (symbol? object)
- (keyword? object)
- %nil)))
-
-(fset 'local-variable-if-set-p
- (lambda* (variable #:optional buffer)
- %nil))
-
-(fset 'symbol-name symbol->string)
diff --git a/lang/elisp/primitives/syntax.scm b/lang/elisp/primitives/syntax.scm
deleted file mode 100644
index 6babb3dd3..000000000
--- a/lang/elisp/primitives/syntax.scm
+++ /dev/null
@@ -1,266 +0,0 @@
-(define-module (lang elisp primitives syntax)
- #:use-module (lang elisp internals evaluation)
- #:use-module (lang elisp internals fset)
- #:use-module (lang elisp internals lambda)
- #:use-module (lang elisp internals set)
- #:use-module (lang elisp internals trace)
- #:use-module (lang elisp transform))
-
-;;; Define Emacs Lisp special forms as macros. This is more flexible
-;;; than handling them specially in the translator: allows them to be
-;;; redefined, and hopefully allows better source location tracking.
-
-;;; {Variables}
-
-(define (setq exp env)
- (cons begin
- (let loop ((sets (cdr exp)))
- (if (null? sets)
- '()
- (cons `(,set (,quote ,(car sets)) ,(transformer (cadr sets)))
- (loop (cddr sets)))))))
-
-(fset 'setq
- (procedure->memoizing-macro setq))
-
-(fset 'defvar
- (procedure->memoizing-macro
- (lambda (exp env)
- (trc 'defvar (cadr exp))
- (if (null? (cddr exp))
- `(,quote ,(cadr exp))
- `(,begin (,if (,not (,defined? (,quote ,(cadr exp))))
- ,(setq (list (car exp) (cadr exp) (caddr exp)) env))
- (,quote ,(cadr exp)))))))
-
-(fset 'defconst
- (procedure->memoizing-macro
- (lambda (exp env)
- (trc 'defconst (cadr exp))
- `(,begin ,(setq (list (car exp) (cadr exp) (caddr exp)) env)
- (,quote ,(cadr exp))))))
-
-;;; {lambda, function and macro definitions}
-
-(fset 'lambda
- (procedure->memoizing-macro
- (lambda (exp env)
- (transform-lambda/interactive exp '<elisp-lambda>))))
-
-(fset 'defun
- (procedure->memoizing-macro
- (lambda (exp env)
- (trc 'defun (cadr exp))
- `(,begin (,fset (,quote ,(cadr exp))
- ,(transform-lambda/interactive (cdr exp)
- (symbol-append '<elisp-defun:
- (cadr exp)
- '>)))
- (,quote ,(cadr exp))))))
-
-(fset 'interactive
- (procedure->memoizing-macro
- (lambda (exp env)
- (fluid-set! interactive-spec exp)
- #f)))
-
-(fset 'defmacro
- (procedure->memoizing-macro
- (lambda (exp env)
- (trc 'defmacro (cadr exp))
- (call-with-values (lambda () (parse-formals (caddr exp)))
- (lambda (required optional rest)
- (let ((num-required (length required))
- (num-optional (length optional)))
- `(,begin (,fset (,quote ,(cadr exp))
- (,procedure->memoizing-macro
- (,lambda (exp1 env1)
- (,trc (,quote using) (,quote ,(cadr exp)))
- (,let* ((%--args (,cdr exp1))
- (%--num-args (,length %--args)))
- (,cond ((,< %--num-args ,num-required)
- (,error "Wrong number of args (not enough required args)"))
- ,@(if rest
- '()
- `(((,> %--num-args ,(+ num-required num-optional))
- (,error "Wrong number of args (too many args)"))))
- (else (,transformer
- (, @bind ,(append (map (lambda (i)
- (list (list-ref required i)
- `(,list-ref %--args ,i)))
- (iota num-required))
- (map (lambda (i)
- (let ((i+nr (+ i num-required)))
- (list (list-ref optional i)
- `(,if (,> %--num-args ,i+nr)
- (,list-ref %--args ,i+nr)
- ,%nil))))
- (iota num-optional))
- (if rest
- (list (list rest
- `(,if (,> %--num-args
- ,(+ num-required
- num-optional))
- (,list-tail %--args
- ,(+ num-required
- num-optional))
- ,%nil)))
- '()))
- ,@(map transformer (cdddr exp)))))))))))))))))
-
-;;; {Sequencing}
-
-(fset 'progn
- (procedure->memoizing-macro
- (lambda (exp env)
- `(,begin ,@(map transformer (cdr exp))))))
-
-(fset 'prog1
- (procedure->memoizing-macro
- (lambda (exp env)
- `(,let ((%--res1 ,(transformer (cadr exp))))
- ,@(map transformer (cddr exp))
- %--res1))))
-
-(fset 'prog2
- (procedure->memoizing-macro
- (lambda (exp env)
- `(,begin ,(transformer (cadr exp))
- (,let ((%--res2 ,(transformer (caddr exp))))
- ,@(map transformer (cdddr exp))
- %--res2)))))
-
-;;; {Conditionals}
-
-(fset 'if
- (procedure->memoizing-macro
- (lambda (exp env)
- (let ((else-case (cdddr exp)))
- (cond ((null? else-case)
- `(,nil-cond ,(transformer (cadr exp)) ,(transformer (caddr exp)) ,%nil))
- ((null? (cdr else-case))
- `(,nil-cond ,(transformer (cadr exp))
- ,(transformer (caddr exp))
- ,(transformer (car else-case))))
- (else
- `(,nil-cond ,(transformer (cadr exp))
- ,(transformer (caddr exp))
- (,begin ,@(map transformer else-case)))))))))
-
-(fset 'and
- (procedure->memoizing-macro
- (lambda (exp env)
- (cond ((null? (cdr exp)) #t)
- ((null? (cddr exp)) (transformer (cadr exp)))
- (else
- (cons nil-cond
- (let loop ((args (cdr exp)))
- (if (null? (cdr args))
- (list (transformer (car args)))
- (cons (list not (transformer (car args)))
- (cons %nil
- (loop (cdr args))))))))))))
-
-;;; NIL-COND expressions have the form:
-;;;
-;;; (nil-cond COND VAL COND VAL ... ELSEVAL)
-;;;
-;;; The CONDs are evaluated in order until one of them returns true
-;;; (in the Elisp sense, so not including empty lists). If a COND
-;;; returns true, its corresponding VAL is evaluated and returned,
-;;; except if that VAL is the unspecified value, in which case the
-;;; result of evaluating the COND is returned. If none of the COND's
-;;; returns true, ELSEVAL is evaluated and its value returned.
-
-(define <-- *unspecified*)
-
-(fset 'or
- (procedure->memoizing-macro
- (lambda (exp env)
- (cond ((null? (cdr exp)) %nil)
- ((null? (cddr exp)) (transformer (cadr exp)))
- (else
- (cons nil-cond
- (let loop ((args (cdr exp)))
- (if (null? (cdr args))
- (list (transformer (car args)))
- (cons (transformer (car args))
- (cons <--
- (loop (cdr args))))))))))))
-
-(fset 'cond
- (procedure->memoizing-macro
- (lambda (exp env)
- (if (null? (cdr exp))
- %nil
- (cons
- nil-cond
- (let loop ((clauses (cdr exp)))
- (if (null? clauses)
- (list %nil)
- (let ((clause (car clauses)))
- (if (eq? (car clause) #t)
- (cond ((null? (cdr clause)) (list #t))
- ((null? (cddr clause))
- (list (transformer (cadr clause))))
- (else `((,begin ,@(map transformer (cdr clause))))))
- (cons (transformer (car clause))
- (cons (cond ((null? (cdr clause)) <--)
- ((null? (cddr clause))
- (transformer (cadr clause)))
- (else
- `(,begin ,@(map transformer (cdr clause)))))
- (loop (cdr clauses)))))))))))))
-
-(fset 'while
- (procedure->memoizing-macro
- (lambda (exp env)
- `((,letrec ((%--while (,lambda ()
- (,nil-cond ,(transformer (cadr exp))
- (,begin ,@(map transformer (cddr exp))
- (%--while))
- ,%nil))))
- %--while)))))
-
-;;; {Local binding}
-
-(fset 'let
- (procedure->memoizing-macro
- (lambda (exp env)
- `(, @bind ,(map (lambda (binding)
- (trc 'let binding)
- (if (pair? binding)
- `(,(car binding) ,(transformer (cadr binding)))
- `(,binding ,%nil)))
- (cadr exp))
- ,@(map transformer (cddr exp))))))
-
-(fset 'let*
- (procedure->memoizing-macro
- (lambda (exp env)
- (if (null? (cadr exp))
- `(,begin ,@(map transformer (cddr exp)))
- (car (let loop ((bindings (cadr exp)))
- (if (null? bindings)
- (map transformer (cddr exp))
- `((, @bind (,(let ((binding (car bindings)))
- (if (pair? binding)
- `(,(car binding) ,(transformer (cadr binding)))
- `(,binding ,%nil))))
- ,@(loop (cdr bindings)))))))))))
-
-;;; {Exception handling}
-
-(fset 'unwind-protect
- (procedure->memoizing-macro
- (lambda (exp env)
- (trc 'unwind-protect (cadr exp))
- `(,let ((%--throw-args #f))
- (,catch #t
- (,lambda ()
- ,(transformer (cadr exp)))
- (,lambda args
- (,set! %--throw-args args)))
- ,@(map transformer (cddr exp))
- (,if %--throw-args
- (,apply ,throw %--throw-args))))))
diff --git a/lang/elisp/primitives/system.scm b/lang/elisp/primitives/system.scm
deleted file mode 100644
index 6c659cc13..000000000
--- a/lang/elisp/primitives/system.scm
+++ /dev/null
@@ -1,14 +0,0 @@
-(define-module (lang elisp primitives system)
- #:use-module (lang elisp internals fset))
-
-(fset 'system-name
- (lambda ()
- (vector-ref (uname) 1)))
-
-(define-public system-type
- (let ((uname (vector-ref (uname) 0)))
- (if (string=? uname "Linux")
- "gnu/linux"
- uname)))
-
-(define-public system-configuration "i386-suse-linux") ;FIXME
diff --git a/lang/elisp/primitives/time.scm b/lang/elisp/primitives/time.scm
deleted file mode 100644
index 4b2c70c1a..000000000
--- a/lang/elisp/primitives/time.scm
+++ /dev/null
@@ -1,17 +0,0 @@
-(define-module (lang elisp primitives time)
- #:use-module (lang elisp internals time)
- #:use-module (lang elisp internals fset)
- #:use-module (ice-9 optargs))
-
-(fset 'current-time
- (lambda ()
- (let ((now (current-time)))
- (list (ash now -16)
- (logand now (- (ash 1 16) 1))
- 0))))
-
-(fset 'format-time-string format-time-string)
-
-(fset 'current-time-string
- (lambda* (#:optional specified-time)
- (format-time-string "%a %b %e %T %Y" specified-time)))
diff --git a/lang/elisp/transform.scm b/lang/elisp/transform.scm
deleted file mode 100644
index ee288a722..000000000
--- a/lang/elisp/transform.scm
+++ /dev/null
@@ -1,111 +0,0 @@
-(define-module (lang elisp transform)
- #:use-module (lang elisp internals trace)
- #:use-module (lang elisp internals fset)
- #:use-module (lang elisp internals evaluation)
- #:use-module (ice-9 session)
- #:export (transformer transform))
-
-;;; A note on the difference between `(transform-* (cdr x))' and `(map
-;;; transform-* (cdr x))'.
-;;;
-;;; In most cases, none, as most of the transform-* functions are
-;;; recursive.
-;;;
-;;; However, if (cdr x) is not a proper list, the `map' version will
-;;; signal an error immediately, whereas the non-`map' version will
-;;; produce a similarly improper list as its transformed output. In
-;;; some cases, improper lists are allowed, so at least these cases
-;;; require non-`map'.
-;;;
-;;; Therefore we use the non-`map' approach in most cases below, but
-;;; `map' in transform-application, since in the application case we
-;;; know that `(func arg . args)' is an error. It would probably be
-;;; better for the transform-application case to check for an improper
-;;; list explicitly and signal a more explicit error.
-
-(define (syntax-error x)
- (error "Syntax error in expression" x))
-
-(define-macro (scheme exp . module)
- (let ((m (if (null? module)
- the-root-module
- (save-module-excursion
- (lambda ()
- ;; In order for `resolve-module' to work as
- ;; expected, the current module must contain the
- ;; `app' variable. This is not true for #:pure
- ;; modules, specifically (lang elisp base). So,
- ;; switch to the root module (guile) before calling
- ;; resolve-module.
- (set-current-module the-root-module)
- (resolve-module (car module)))))))
- (let ((x `(,eval (,quote ,exp) ,m)))
- ;;(write x)
- ;;(newline)
- x)))
-
-(define (transformer x)
- (cond ((pair? x)
- (cond ((symbol? (car x))
- (case (car x)
- ;; Allow module-related forms through intact.
- ((define-module use-modules use-syntax)
- x)
- ;; Escape to Scheme.
- ((scheme)
- (cons-source x scheme (cdr x)))
- ;; Quoting.
- ((quote function)
- (cons-source x quote (transform-quote (cdr x))))
- ((quasiquote)
- (cons-source x quasiquote (transform-quasiquote (cdr x))))
- ;; Anything else is a function or macro application.
- (else (transform-application x))))
- ((and (pair? (car x))
- (eq? (caar x) 'quasiquote))
- (transformer (car x)))
- (else (syntax-error x))))
- (else
- (transform-datum x))))
-
-(define (transform-datum x)
- (cond ((eq? x 'nil) %nil)
- ((eq? x 't) #t)
- ;; Could add other translations here, notably `?A' -> 65 etc.
- (else x)))
-
-(define (transform-quote x)
- (trc 'transform-quote x)
- (cond ((not (pair? x))
- (transform-datum x))
- (else
- (cons-source x
- (transform-quote (car x))
- (transform-quote (cdr x))))))
-
-(define (transform-quasiquote x)
- (trc 'transform-quasiquote x)
- (cond ((not (pair? x))
- (transform-datum x))
- ((symbol? (car x))
- (case (car x)
- ((unquote) (list 'unquote (transformer (cadr x))))
- ((unquote-splicing) (list 'unquote-splicing (transformer (cadr x))))
- (else (cons-source x
- (transform-datum (car x))
- (transform-quasiquote (cdr x))))))
- (else
- (cons-source x
- (transform-quasiquote (car x))
- (transform-quasiquote (cdr x))))))
-
-(define (transform-application x)
- (cons-source x @fop `(,(car x) (,transformer-macro ,@(map transform-quote (cdr x))))))
-
-(define transformer-macro
- (procedure->memoizing-macro
- (let ((cdr cdr))
- (lambda (exp env)
- (cons-source exp list (map transformer (cdr exp)))))))
-
-(define transform transformer)
diff --git a/lang/elisp/variables.scm b/lang/elisp/variables.scm
deleted file mode 100644
index 36243739e..000000000
--- a/lang/elisp/variables.scm
+++ /dev/null
@@ -1,42 +0,0 @@
-(define-module (lang elisp variables))
-
-;;; The only purpose of this module is to provide a place where the
-;;; variables holding Elisp function definitions can be bound to
-;;; symbols.
-;;;
-;;; This can be useful when looking at unmemoized procedure source
-;;; code for Elisp functions and macros. Elisp function and macro
-;;; symbols get memoized into variables. When the unmemoizer tries to
-;;; unmemoize a variables, it does so by looking for a symbol that is
-;;; bound to that variable, starting from the module in which the
-;;; function or macro was defined and then trying the interfaces on
-;;; that module's uses list. If it can't find any such symbol, it
-;;; returns the symbol '???.
-;;;
-;;; Normally we don't want to bind Elisp function definition variables
-;;; to symbols that are visible from the Elisp evaluation module (lang
-;;; elisp base), because they would pollute the namespace available
-;;; to Elisp variables. On the other hand, if we are trying to debug
-;;; something, and looking at unmemoized source code, it's far more
-;;; informative if that code has symbols that indicate the Elisp
-;;; function being called than if it just says ??? everywhere.
-;;;
-;;; So we have a compromise, which achieves a reasonable balance of
-;;; correctness (for general operation) and convenience (for
-;;; debugging).
-;;;
-;;; 1. We bind Elisp function definition variables to symbols in this
-;;; module (lang elisp variables).
-;;;
-;;; 2. By default, the Elisp evaluation module (lang elisp base) does
-;;; not use (lang elisp variables), so the Elisp variable namespace
-;;; stays clean.
-;;;
-;;; 3. When debugging, a simple (named-module-use! '(lang elisp base)
-;;; '(lang elisp variables)) makes the function definition symbols
-;;; visible in (lang elisp base) so that the unmemoizer can find
-;;; them, which makes the unmemoized source code much easier to read.
-;;;
-;;; 4. To reduce the effects of namespace pollution even after step 3,
-;;; the symbols that we bind are all prefixed with `<elisp' and
-;;; suffixed with `>'.
diff --git a/libguile.h b/libguile.h
deleted file mode 100644
index 85db31c48..000000000
--- a/libguile.h
+++ /dev/null
@@ -1,149 +0,0 @@
-#ifndef SCM_LIBGUILE_H
-#define SCM_LIBGUILE_H
-
-/* Copyright (C) 1995,1996,1997,1998,2000,2001 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, 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 GUILE.
- *
- * The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
- * code from other Free Software Foundation releases into a copy of
- * GUILE, 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 GUILE, it is your choice
- * whether to permit this exception to apply to your modifications.
- * If you do not wish that, delete this exception notice. */
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "libguile/__scm.h"
-#include "libguile/alist.h"
-#include "libguile/arbiters.h"
-#include "libguile/async.h"
-#include "libguile/boolean.h"
-#include "libguile/chars.h"
-#include "libguile/continuations.h"
-#include "libguile/dynl.h"
-#include "libguile/dynwind.h"
-#include "libguile/eq.h"
-#include "libguile/error.h"
-#include "libguile/eval.h"
-#include "libguile/evalext.h"
-#include "libguile/extensions.h"
-#include "libguile/feature.h"
-#include "libguile/filesys.h"
-#include "libguile/fluids.h"
-#include "libguile/fports.h"
-#include "libguile/gc.h"
-#include "libguile/gdbint.h"
-#include "libguile/goops.h"
-#include "libguile/gsubr.h"
-#include "libguile/guardians.h"
-#include "libguile/hash.h"
-#include "libguile/hashtab.h"
-#include "libguile/init.h"
-#include "libguile/ioext.h"
-#include "libguile/rdelim.h"
-#include "libguile/rw.h"
-#include "libguile/keywords.h"
-#include "libguile/list.h"
-#include "libguile/load.h"
-#include "libguile/macros.h"
-#include "libguile/mallocs.h"
-#include "libguile/modules.h"
-#include "libguile/net_db.h"
-#include "libguile/numbers.h"
-#include "libguile/objects.h"
-#include "libguile/objprop.h"
-#include "libguile/options.h"
-#include "libguile/pairs.h"
-#include "libguile/ports.h"
-#include "libguile/posix.h"
-#include "libguile/print.h"
-#include "libguile/procprop.h"
-#include "libguile/properties.h"
-#include "libguile/procs.h"
-#include "libguile/ramap.h"
-#include "libguile/random.h"
-#include "libguile/read.h"
-#include "libguile/root.h"
-#include "libguile/scmsigs.h"
-#include "libguile/script.h"
-#include "libguile/simpos.h"
-#include "libguile/smob.h"
-#include "libguile/snarf.h"
-#include "libguile/socket.h"
-#include "libguile/sort.h"
-#include "libguile/srcprop.h"
-#include "libguile/stackchk.h"
-#include "libguile/stime.h"
-#include "libguile/strings.h"
-#include "libguile/strop.h"
-#include "libguile/strorder.h"
-#include "libguile/strports.h"
-#include "libguile/struct.h"
-#include "libguile/symbols.h"
-#include "libguile/tags.h"
-#include "libguile/throw.h"
-#include "libguile/unif.h"
-#include "libguile/validate.h"
-#include "libguile/values.h"
-#include "libguile/variable.h"
-#include "libguile/vectors.h"
-#include "libguile/version.h"
-#include "libguile/vports.h"
-#include "libguile/weaks.h"
-#ifdef DEBUG_EXTENSIONS
-#include "libguile/backtrace.h"
-#include "libguile/debug.h"
-#include "libguile/stacks.h"
-#endif
-#ifdef USE_THREADS
-#include "libguile/threads.h"
-#endif
-#include "libguile/inline.h"
-
-#ifdef __cplusplus
-}
-#endif
-
-
-
-#endif /* SCM_LIBGUILE_H */
-
-/*
- Local Variables:
- c-file-style: "gnu"
- End:
-*/
diff --git a/oop/.cvsignore b/oop/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/oop/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/oop/ChangeLog b/oop/ChangeLog
deleted file mode 100644
index f72fa4175..000000000
--- a/oop/ChangeLog
+++ /dev/null
@@ -1,151 +0,0 @@
-2002-07-13 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * goops.scm (define-generic, define-accessor): Make sure that
- define-generic and define-accessor will continue to work when
- mmacros are expanded before execution.
-
-2002-07-13 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * goops.scm (define-class): Make sure that define-class will
- continue to work when mmacros are expanded before execution.
-
-2002-07-08 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * goops.scm (define-generic, define-accessor): Make sure that
- implicit redefines only happen on top level.
-
- * goops.scm (define-class, define-generic, define-accessor),
- goops/stklos.scm (define-class): Use mmacros instead of macros.
-
-2002-07-07 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * goops/save.scm (restore): Replaced "macro" by mmacro.
-
-2001-10-21 Mikael Djurfeldt <mdj@linnaeus>
-
- * goops.scm, goops/active-slot.scm, goops/compile.scm,
- goops/composite-slot.scm, goops/describe.scm, goops/dispatch.scm,
- goops/old-define-method.scm, goops/save.scm, goops/util.scm: Move
- module the system directives `export', `export-syntax',
- `re-export' and `re-export-syntax' into the `define-module' form.
- This is the recommended way of exporting bindings.
-
-2001-08-25 Marius Vollmer <mvo@zagadka.ping.de>
-
- * Makefile.am, goops/Makefile.am: (AUTOMAKE_OPTIONS): Change
- "foreign" to "gnu".
-
-2001-07-29 Marius Vollmer <mvo@zagadka.ping.de>
-
- * goops/dispatch.scm (hashset-index): Renumbered, since the vcell
- slot of structs has been removed.
-
-2001-07-18 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * goops/util.scm: Updated copyright notice.
-
-2001-07-17 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * goops/save.scm: Use `re-export' instead of `export' when
- re-exporting `make-unbound'.
-
-2001-06-05 Marius Vollmer <mvo@zagadka.ping.de>
-
- * goops.scm: Use `re-export' instead of `export' when re-exporting
- `class-of'.
-
-2001-05-19 Marius Vollmer <mvo@zagadka.ping.de>
-
- * goops.scm: Call `%init-goops-builtins' instead of using the
- `(oop goops goopscore)' module.
-
-2001-05-10 Marius Vollmer <mvo@zagadka.ping.de>
-
- * goops/compile.scm (compile-method): Insert comment that
- `procedure-source' can not be guaranteed to be reliable or
- efficient.
-
-2001-05-05 Marius Vollmer <mvo@zagadka.ping.de>
-
- * goops.scm (initialize-object-procedure): Use
- `valid-object-procedure?' instead of explicit tag magic.
- (object-procedure-tags): Removed.
-
- * goops/util.scm (top-level-env): Use `current-module' instead of
- the deprecated *top-level-lookup-closure*.
-
-2001-04-28 Rob Browning <rlb@cs.utexas.edu>
-
- * goops/save.scm (write-readably): rename list* to cons*.
-
- * goops.scm (method): rename list* to cons*.
-
-2001-04-10 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * goops/Makefile.am, goops/goopscore.scm: Reverted changes of
- 2001-04-03, 2001-03-09.
-
-2001-04-03 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * goops/Makefile.am (goops_sources): Include goopscore.scm.
- Thanks to Dale P. Smith.
-
-2001-03-29 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * goops/goopscore.scm: New file.
-
-2001-03-09 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * goops.scm (define-method): Only accept new syntax.
-
- * Makefile.am: Added old-define-method.scm.
-
- * goops/old-define-method.scm: New file.
-
- * goops.scm, goops/save.scm, goops/composite-slot.scm,
- goops/active-slot.scm: Use new method syntax.
-
-2001-03-04 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * goops/compile.scm (compile-method): Tag method closure for body
- expansion.
-
- * goops.scm (change-object-class): Quote empty list constants.
- (method): Reverted previous change (enclosing body);
- Quote empty list.
- (initialize <method>): Supply `dummy-procedure' as default instead
- of creating a new closure.
-
- * goops/internal.scm: Re-export (oop goops) without copying
- bindings.
-
-2001-02-23 Keisuke Nishida <kxn30@po.cwru.edu>
-
- * goops.scm (method): Enclosed BODY by `(let () ...)'.
- This allows local defines at the beginning of methods.
-
-2000-12-15 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * goops/save.scm (load-objects): eval-in-module is deprecated.
- Use eval instead.
-
-2000-11-24 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * goops.scm: Don't export removed %logand any more.
-
- * goops/dispatch.scm (cache-try-hash!): Use logand instead of
- %logand.
-
-2000-11-06 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * goops.scm (internal-add-method!): Set n-specialized of a generic
- function to the number of specializers regardless if it has rest
- args or not.
-
- * goops/dispatch.scm (method-cache-install!): Use n-specialized +
- 1 args for type matching. (Thanks to Lars J. Aas.)
-
-2000-10-23 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * goops.scm (goops-error): Removed use of oldfmt.
-
diff --git a/oop/Makefile.am b/oop/Makefile.am
deleted file mode 100644
index adf3fbb66..000000000
--- a/oop/Makefile.am
+++ /dev/null
@@ -1,33 +0,0 @@
-## Process this file with automake to produce Makefile.in.
-##
-## Copyright (C) 2000 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-AUTOMAKE_OPTIONS = gnu
-
-SUBDIRS = goops
-
-# These should be installed and distributed.
-oop_sources = goops.scm
-
-subpkgdatadir = $(pkgdatadir)/$(VERSION)/oop
-subpkgdata_DATA = $(oop_sources)
-ETAGS_ARGS = $(subpkgdata_DATA)
-
-EXTRA_DIST = $(oop_sources)
diff --git a/oop/goops.scm b/oop/goops.scm
deleted file mode 100644
index e9c50af88..000000000
--- a/oop/goops.scm
+++ /dev/null
@@ -1,1528 +0,0 @@
-;;; installed-scm-file
-
-;;;; Copyright (C) 1998,1999,2000,2001,2002 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-
-;;;; This software is a derivative work of other copyrighted softwares; the
-;;;; copyright notices of these softwares are placed in the file COPYRIGHTS
-;;;;
-;;;; This file is based upon stklos.stk from the STk distribution by
-;;;; Erick Gallesio <eg@unice.fr>.
-;;;;
-
-(define-module (oop goops)
- :export-syntax (define-class class
- define-generic define-accessor define-method
- method)
- :export (goops-version is-a?
- ensure-metaclass ensure-metaclass-with-supers
- make-class
- make-generic ensure-generic
- make-accessor ensure-accessor
- make-method add-method!
- object-eqv? object-equal?
- class-slot-ref class-slot-set! slot-unbound slot-missing
- slot-definition-name slot-definition-options
- slot-definition-allocation
- slot-definition-getter slot-definition-setter
- slot-definition-accessor
- slot-definition-init-value slot-definition-init-form
- slot-definition-init-thunk slot-definition-init-keyword
- slot-init-function class-slot-definition
- method-source
- compute-cpl compute-std-cpl compute-get-n-set compute-slots
- compute-getter-method compute-setter-method
- allocate-instance initialize make-instance make
- no-next-method no-applicable-method no-method
- change-class update-instance-for-different-class
- shallow-clone deep-clone
- class-redefinition
- apply-generic apply-method apply-methods
- compute-applicable-methods %compute-applicable-methods
- method-more-specific? sort-applicable-methods
- class-subclasses class-methods
- goops-error
- min-fixnum max-fixnum
- ;;; *fixme* Should go into goops.c
- instance? slot-ref-using-class
- slot-set-using-class! slot-bound-using-class?
- slot-exists-using-class? slot-ref slot-set! slot-bound?
- class-name class-direct-supers class-direct-subclasses
- class-direct-methods class-direct-slots class-precedence-list
- class-slots class-environment
- generic-function-name
- generic-function-methods method-generic-function method-specializers
- primitive-generic-generic enable-primitive-generic!
- method-procedure accessor-method-slot-definition
- slot-exists? make find-method get-keyword)
- :re-export (class-of) ;; from (guile)
- :no-backtrace)
-
-;; First initialize the builtin part of GOOPS
-(%init-goops-builtins)
-
-;; Then load the rest of GOOPS
-(use-modules (oop goops util)
- (oop goops dispatch)
- (oop goops compile))
-
-
-(define min-fixnum (- (expt 2 29)))
-
-(define max-fixnum (- (expt 2 29) 1))
-
-;;
-;; goops-error
-;;
-(define (goops-error format-string . args)
- (save-stack)
- (scm-error 'goops-error #f format-string args '()))
-
-;;
-;; is-a?
-;;
-(define (is-a? obj class)
- (and (memq class (class-precedence-list (class-of obj))) #t))
-
-
-;;;
-;;; {Meta classes}
-;;;
-
-(define ensure-metaclass-with-supers
- (let ((table-of-metas '()))
- (lambda (meta-supers)
- (let ((entry (assoc meta-supers table-of-metas)))
- (if entry
- ;; Found a previously created metaclass
- (cdr entry)
- ;; Create a new meta-class which inherit from "meta-supers"
- (let ((new (make <class> #:dsupers meta-supers
- #:slots '()
- #:name (gensym "metaclass"))))
- (set! table-of-metas (cons (cons meta-supers new) table-of-metas))
- new))))))
-
-(define (ensure-metaclass supers env)
- (if (null? supers)
- <class>
- (let* ((all-metas (map (lambda (x) (class-of x)) supers))
- (all-cpls (apply append
- (map (lambda (m)
- (cdr (class-precedence-list m)))
- all-metas)))
- (needed-metas '()))
- ;; Find the most specific metaclasses. The new metaclass will be
- ;; a subclass of these.
- (for-each
- (lambda (meta)
- (if (and (not (member meta all-cpls))
- (not (member meta needed-metas)))
- (set! needed-metas (append needed-metas (list meta)))))
- all-metas)
- ;; Now return a subclass of the metaclasses we found.
- (if (null? (cdr needed-metas))
- (car needed-metas) ; If there's only one, just use it.
- (ensure-metaclass-with-supers needed-metas)))))
-
-;;;
-;;; {Classes}
-;;;
-
-;;; (define-class NAME (SUPER ...) SLOT-DEFINITION ... OPTION ...)
-;;;
-;;; SLOT-DEFINITION ::= SLOT-NAME | (SLOT-NAME OPTION ...)
-;;; OPTION ::= KEYWORD VALUE
-;;;
-(define (define-class-pre-definition keyword exp env)
- (case keyword
- ((#:getter #:setter)
- (if (defined? exp env)
- `(define ,exp (ensure-generic ,exp ',exp))
- `(define ,exp (make-generic ',exp))))
- ((#:accessor)
- (if (defined? exp env)
- `(define ,exp (ensure-accessor ,exp ',exp))
- `(define ,exp (make-accessor ',exp))))
- (else #f)))
-
-;;; This code should be implemented in C.
-;;;
-(define define-class
- (letrec (;; Some slot options require extra definitions to be made.
- ;; In particular, we want to make sure that the generic
- ;; function objects which represent accessors exist
- ;; before `make-class' tries to add methods to them.
- ;;
- ;; Postpone error handling to class macro.
- ;;
- (pre-definitions
- (lambda (slots env)
- (do ((slots slots (cdr slots))
- (definitions '()
- (if (pair? (car slots))
- (do ((options (cdar slots) (cddr options))
- (definitions definitions
- (cond ((not (symbol? (cadr options)))
- definitions)
- ((define-class-pre-definition
- (car options)
- (cadr options)
- env)
- => (lambda (definition)
- (cons definition definitions)))
- (else definitions))))
- ((not (and (pair? options)
- (pair? (cdr options))))
- definitions))
- definitions)))
- ((or (not (pair? slots))
- (keyword? (car slots)))
- (reverse definitions)))))
-
- ;; Syntax
- (name cadr)
- (slots cdddr))
-
- (procedure->memoizing-macro
- (lambda (exp env)
- (cond ((not (top-level-env? env))
- (goops-error "define-class: Only allowed at top level"))
- ((not (and (list? exp) (>= (length exp) 3)))
- (goops-error "missing or extra expression"))
- (else
- (let ((name (name exp)))
- `(begin
- ;; define accessors
- ,@(pre-definitions (slots exp) env)
- ;; update the current-module
- (let* ((class (class ,@(cddr exp) #:name ',name))
- (var (module-ensure-local-variable!
- (current-module) ',name))
- (old (and (variable-bound? var)
- (variable-ref var))))
- (if (and old
- (is-a? old <class>)
- (memq <object> (class-precedence-list old)))
- (variable-set! var (class-redefinition old class))
- (variable-set! var class)))))))))))
-
-(define standard-define-class define-class)
-
-;;; (class (SUPER ...) SLOT-DEFINITION ... OPTION ...)
-;;;
-;;; SLOT-DEFINITION ::= SLOT-NAME | (SLOT-NAME OPTION ...)
-;;; OPTION ::= KEYWORD VALUE
-;;;
-(define class
- (letrec ((slot-option-keyword car)
- (slot-option-value cadr)
- (process-slot-options
- (lambda (options)
- (let loop ((options options)
- (res '()))
- (cond ((null? options)
- (reverse res))
- ((null? (cdr options))
- (goops-error "malformed slot option list"))
- ((not (keyword? (slot-option-keyword options)))
- (goops-error "malformed slot option list"))
- (else
- (case (slot-option-keyword options)
- ((#:init-form)
- (loop (cddr options)
- (append (list `(lambda ()
- ,(slot-option-value options))
- #:init-thunk
- (list 'quote
- (slot-option-value options))
- #:init-form)
- res)))
- (else
- (loop (cddr options)
- (cons (cadr options)
- (cons (car options)
- res)))))))))))
-
- (procedure->memoizing-macro
- (let ((supers cadr)
- (slots cddr)
- (options cdddr))
- (lambda (exp env)
- (cond ((not (and (list? exp) (>= (length exp) 2)))
- (goops-error "missing or extra expression"))
- ((not (list? (supers exp)))
- (goops-error "malformed superclass list: ~S" (supers exp)))
- (else
- (let ((slot-defs (cons #f '())))
- (do ((slots (slots exp) (cdr slots))
- (defs slot-defs (cdr defs)))
- ((or (null? slots)
- (keyword? (car slots)))
- `(make-class
- ;; evaluate super class variables
- (list ,@(supers exp))
- ;; evaluate slot definitions, except the slot name!
- (list ,@(cdr slot-defs))
- ;; evaluate class options
- ,@slots
- ;; place option last in case someone wants to
- ;; pass a different value
- #:environment ',env))
- (set-cdr!
- defs
- (list (if (pair? (car slots))
- `(list ',(slot-definition-name (car slots))
- ,@(process-slot-options
- (slot-definition-options
- (car slots))))
- `(list ',(car slots))))))))))))))
-
-(define (make-class supers slots . options)
- (let ((env (or (get-keyword #:environment options #f)
- (top-level-env))))
- (let* ((name (get-keyword #:name options (make-unbound)))
- (supers (if (not (or-map (lambda (class)
- (memq <object>
- (class-precedence-list class)))
- supers))
- (append supers (list <object>))
- supers))
- (metaclass (or (get-keyword #:metaclass options #f)
- (ensure-metaclass supers env))))
-
- ;; Verify that all direct slots are different and that we don't inherit
- ;; several time from the same class
- (let ((tmp1 (find-duplicate supers))
- (tmp2 (find-duplicate (map slot-definition-name slots))))
- (if tmp1
- (goops-error "make-class: super class ~S is duplicate in class ~S"
- tmp1 name))
- (if tmp2
- (goops-error "make-class: slot ~S is duplicate in class ~S"
- tmp2 name)))
-
- ;; Everything seems correct, build the class
- (apply make metaclass
- #:dsupers supers
- #:slots slots
- #:name name
- #:environment env
- options))))
-
-;;;
-;;; {Generic functions and accessors}
-;;;
-
-(define define-generic
- (procedure->memoizing-macro
- (lambda (exp env)
- (let ((name (cadr exp)))
- (cond ((not (symbol? name))
- (goops-error "bad generic function name: ~S" name))
- ((top-level-env? env)
- `(let* ((var (module-ensure-local-variable!
- (current-module) ',name))
- (old (and (variable-bound? var) (variable-ref var))))
- (if (or (not old) (is-a? old <generic>))
- (variable-set! var (make <generic> #:name ',name))
- (variable-set! var (ensure-generic old ',name)))))
- (else
- `(define ,name (make <generic> #:name ',name))))))))
-
-(define (make-generic . name)
- (let ((name (and (pair? name) (car name))))
- (make <generic> #:name name)))
-
-(define (ensure-generic old-definition . name)
- (let ((name (and (pair? name) (car name))))
- (cond ((is-a? old-definition <generic>) old-definition)
- ((procedure-with-setter? old-definition)
- (make <generic-with-setter>
- #:name name
- #:default (procedure old-definition)
- #:setter (setter old-definition)))
- ((procedure? old-definition)
- (make <generic> #:name name #:default old-definition))
- (else (make <generic> #:name name)))))
-
-(define define-accessor
- (procedure->memoizing-macro
- (lambda (exp env)
- (let ((name (cadr exp)))
- (cond ((not (symbol? name))
- (goops-error "bad accessor name: ~S" name))
- ((top-level-env? env)
- `(let* ((var (module-ensure-local-variable!
- (current-module) ',name))
- (old (and (variable-bound? var) (variable-ref var))))
- (if (or (not old)
- (and (is-a? old <generic-with-setter>)
- (is-a? (setter old) <generic>)))
- (variable-set! var (make-accessor ',name))
- (variable-set! var (ensure-accessor old ',name)))))
- (else
- `(define ,name (make-accessor ',name))))))))
-
-(define (make-setter-name name)
- (string->symbol (string-append "setter:" (symbol->string name))))
-
-(define (make-accessor . name)
- (let ((name (and (pair? name) (car name))))
- (make <generic-with-setter>
- #:name name
- #:setter (make <generic>
- #:name (and name (make-setter-name name))))))
-
-(define (ensure-accessor proc . name)
- (let ((name (and (pair? name) (car name))))
- (cond ((is-a? proc <generic-with-setter>)
- (if (is-a? (setter proc) <generic>)
- proc
- (upgrade-generic-with-setter proc (setter proc))))
- ((is-a? proc <generic>)
- (upgrade-generic-with-setter proc (make-generic name)))
- ((procedure-with-setter? proc)
- (make <generic-with-setter>
- #:name name
- #:default (procedure proc)
- #:setter (ensure-generic (setter proc) name)))
- ((procedure? proc)
- (ensure-accessor (ensure-generic proc name) name))
- (else
- (make-accessor name)))))
-
-(define (upgrade-generic-with-setter generic setter)
- (let ((methods (generic-function-methods generic))
- (gws (make <generic-with-setter>
- #:name (generic-function-name generic)
- #:setter setter)))
- ;; Steal old methods
- (for-each (lambda (method)
- (slot-set! method 'generic-function gws))
- methods)
- (slot-set! gws 'methods methods)
- gws))
-
-;;;
-;;; {Methods}
-;;;
-
-(define define-method
- (procedure->memoizing-macro
- (lambda (exp env)
- (let ((head (cadr exp)))
- (if (not (pair? head))
- (goops-error "bad method head: ~S" head)
- (let ((gf (car head)))
- (cond ((and (pair? gf)
- (eq? (car gf) 'setter)
- (pair? (cdr gf))
- (symbol? (cadr gf))
- (null? (cddr gf)))
- ;; named setter method
- (let ((name (cadr gf)))
- (cond ((not (symbol? name))
- `(add-method! (setter ,name)
- (method ,(cdadr exp)
- ,@(cddr exp))))
- ((defined? name env)
- `(begin
- ;; *fixme* Temporary hack for the current
- ;; module system
- (if (not ,name)
- (define-accessor ,name))
- (add-method! (setter ,name)
- (method ,(cdadr exp)
- ,@(cddr exp)))))
- (else
- `(begin
- (define-accessor ,name)
- (add-method! (setter ,name)
- (method ,(cdadr exp)
- ,@(cddr exp))))))))
- ((not (symbol? gf))
- `(add-method! ,gf (method ,(cdadr exp) ,@(cddr exp))))
- ((defined? gf env)
- `(begin
- ;; *fixme* Temporary hack for the current
- ;; module system
- (if (not ,gf)
- (define-generic ,gf))
- (add-method! ,gf
- (method ,(cdadr exp)
- ,@(cddr exp)))))
- (else
- `(begin
- (define-generic ,gf)
- (add-method! ,gf
- (method ,(cdadr exp)
- ,@(cddr exp))))))))))))
-
-(define (make-method specializers procedure)
- (make <method>
- #:specializers specializers
- #:procedure procedure))
-
-(define method
- (letrec ((specializers
- (lambda (ls)
- (cond ((null? ls) '('()))
- ((pair? ls) (cons (if (pair? (car ls))
- (cadar ls)
- '<top>)
- (specializers (cdr ls))))
- (else '(<top>)))))
- (formals
- (lambda (ls)
- (if (pair? ls)
- (cons (if (pair? (car ls)) (caar ls) (car ls))
- (formals (cdr ls)))
- ls))))
- (procedure->memoizing-macro
- (lambda (exp env)
- (let ((args (cadr exp))
- (body (cddr exp)))
- `(make <method>
- #:specializers (cons* ,@(specializers args))
- #:procedure (lambda ,(formals args)
- ,@(if (null? body)
- (list *unspecified*)
- body))))))))
-
-;;;
-;;; {add-method!}
-;;;
-
-(define (add-method-in-classes! m)
- ;; Add method in all the classes which appears in its specializers list
- (for-each* (lambda (x)
- (let ((dm (class-direct-methods x)))
- (if (not (memv m dm))
- (slot-set! x 'direct-methods (cons m dm)))))
- (method-specializers m)))
-
-(define (remove-method-in-classes! m)
- ;; Remove method in all the classes which appears in its specializers list
- (for-each* (lambda (x)
- (slot-set! x
- 'direct-methods
- (delv! m (class-direct-methods x))))
- (method-specializers m)))
-
-(define (compute-new-list-of-methods gf new)
- (let ((new-spec (method-specializers new))
- (methods (generic-function-methods gf)))
- (let loop ((l methods))
- (if (null? l)
- (cons new methods)
- (if (equal? (method-specializers (car l)) new-spec)
- (begin
- ;; This spec. list already exists. Remove old method from dependents
- (remove-method-in-classes! (car l))
- (set-car! l new)
- methods)
- (loop (cdr l)))))))
-
-(define (internal-add-method! gf m)
- (slot-set! m 'generic-function gf)
- (slot-set! gf 'methods (compute-new-list-of-methods gf m))
- (let ((specializers (slot-ref m 'specializers)))
- (slot-set! gf 'n-specialized
- (max (length* specializers)
- (slot-ref gf 'n-specialized))))
- (%invalidate-method-cache! gf)
- (add-method-in-classes! m)
- *unspecified*)
-
-(define-generic add-method!)
-
-(internal-add-method! add-method!
- (make <method>
- #:specializers (list <generic> <method>)
- #:procedure internal-add-method!))
-
-(define-method (add-method! (proc <procedure>) (m <method>))
- (if (generic-capability? proc)
- (begin
- (enable-primitive-generic! proc)
- (add-method! proc m))
- (next-method)))
-
-(define-method (add-method! (pg <primitive-generic>) (m <method>))
- (add-method! (primitive-generic-generic pg) m))
-
-(define-method (add-method! obj (m <method>))
- (goops-error "~S is not a valid generic function" obj))
-
-;;;
-;;; {Access to meta objects}
-;;;
-
-;;;
-;;; Methods
-;;;
-(define-method (method-source (m <method>))
- (let* ((spec (map* class-name (slot-ref m 'specializers)))
- (proc (procedure-source (slot-ref m 'procedure)))
- (args (cadr proc))
- (body (cddr proc)))
- (cons 'method
- (cons (map* list args spec)
- body))))
-
-;;;
-;;; Slots
-;;;
-(define slot-definition-name car)
-
-(define slot-definition-options cdr)
-
-(define (slot-definition-allocation s)
- (get-keyword #:allocation (cdr s) #:instance))
-
-(define (slot-definition-getter s)
- (get-keyword #:getter (cdr s) #f))
-
-(define (slot-definition-setter s)
- (get-keyword #:setter (cdr s) #f))
-
-(define (slot-definition-accessor s)
- (get-keyword #:accessor (cdr s) #f))
-
-(define (slot-definition-init-value s)
- ;; can be #f, so we can't use #f as non-value
- (get-keyword #:init-value (cdr s) (make-unbound)))
-
-(define (slot-definition-init-form s)
- (get-keyword #:init-form (cdr s) (make-unbound)))
-
-(define (slot-definition-init-thunk s)
- (get-keyword #:init-thunk (cdr s) #f))
-
-(define (slot-definition-init-keyword s)
- (get-keyword #:init-keyword (cdr s) #f))
-
-(define (class-slot-definition class slot-name)
- (assq slot-name (class-slots class)))
-
-(define (slot-init-function class slot-name)
- (cadr (assq slot-name (slot-ref class 'getters-n-setters))))
-
-
-;;;
-;;; {Standard methods used by the C runtime}
-;;;
-
-;;; Methods to compare objects
-;;;
-
-(define-method (object-eqv? x y) #f)
-(define-method (object-equal? x y) (eqv? x y))
-
-;;;
-;;; methods to display/write an object
-;;;
-
-; Code for writing objects must test that the slots they use are
-; bound. Otherwise a slot-unbound method will be called and will
-; conduct to an infinite loop.
-
-;; Write
-(define (display-address o file)
- (display (number->string (object-address o) 16) file))
-
-(define-method (write o file)
- (display "#<instance " file)
- (display-address o file)
- (display #\> file))
-
-(define write-object (primitive-generic-generic write))
-
-(define-method (write (o <object>) file)
- (let ((class (class-of o)))
- (if (slot-bound? class 'name)
- (begin
- (display "#<" file)
- (display (class-name class) file)
- (display #\space file)
- (display-address o file)
- (display #\> file))
- (next-method))))
-
-(define-method (write (o <foreign-object>) file)
- (let ((class (class-of o)))
- (if (slot-bound? class 'name)
- (begin
- (display "#<foreign-object " file)
- (display (class-name class) file)
- (display #\space file)
- (display-address o file)
- (display #\> file))
- (next-method))))
-
-(define-method (write (class <class>) file)
- (let ((meta (class-of class)))
- (if (and (slot-bound? class 'name)
- (slot-bound? meta 'name))
- (begin
- (display "#<" file)
- (display (class-name meta) file)
- (display #\space file)
- (display (class-name class) file)
- (display #\space file)
- (display-address class file)
- (display #\> file))
- (next-method))))
-
-(define-method (write (gf <generic>) file)
- (let ((meta (class-of gf)))
- (if (and (slot-bound? meta 'name)
- (slot-bound? gf 'methods))
- (begin
- (display "#<" file)
- (display (class-name meta) file)
- (let ((name (generic-function-name gf)))
- (if name
- (begin
- (display #\space file)
- (display name file))))
- (display " (" file)
- (display (length (generic-function-methods gf)) file)
- (display ")>" file))
- (next-method))))
-
-(define-method (write (o <method>) file)
- (let ((meta (class-of o)))
- (if (and (slot-bound? meta 'name)
- (slot-bound? o 'specializers))
- (begin
- (display "#<" file)
- (display (class-name meta) file)
- (display #\space file)
- (display (map* (lambda (spec)
- (if (slot-bound? spec 'name)
- (slot-ref spec 'name)
- spec))
- (method-specializers o))
- file)
- (display #\space file)
- (display-address o file)
- (display #\> file))
- (next-method))))
-
-;; Display (do the same thing as write by default)
-(define-method (display o file)
- (write-object o file))
-
-;;;
-;;; slot access
-;;;
-
-(define (class-slot-g-n-s class slot-name)
- (let* ((this-slot (assq slot-name (slot-ref class 'slots)))
- (g-n-s (cddr (or (assq slot-name (slot-ref class 'getters-n-setters))
- (slot-missing class slot-name)))))
- (if (not (memq (slot-definition-allocation this-slot)
- '(#:class #:each-subclass)))
- (slot-missing class slot-name))
- g-n-s))
-
-(define (class-slot-ref class slot)
- (let ((x ((car (class-slot-g-n-s class slot)) #f)))
- (if (unbound? x)
- (slot-unbound class slot)
- x)))
-
-(define (class-slot-set! class slot value)
- ((cadr (class-slot-g-n-s class slot)) #f value))
-
-(define-method (slot-unbound (c <class>) (o <object>) s)
- (goops-error "Slot `~S' is unbound in object ~S" s o))
-
-(define-method (slot-unbound (c <class>) s)
- (goops-error "Slot `~S' is unbound in class ~S" s c))
-
-(define-method (slot-unbound (o <object>))
- (goops-error "Unbound slot in object ~S" o))
-
-(define-method (slot-missing (c <class>) (o <object>) s)
- (goops-error "No slot with name `~S' in object ~S" s o))
-
-(define-method (slot-missing (c <class>) s)
- (goops-error "No class slot with name `~S' in class ~S" s c))
-
-
-(define-method (slot-missing (c <class>) (o <object>) s value)
- (slot-missing c o s))
-
-;;; Methods for the possible error we can encounter when calling a gf
-
-(define-method (no-next-method (gf <generic>) args)
- (goops-error "No next method when calling ~S\nwith arguments ~S" gf args))
-
-(define-method (no-applicable-method (gf <generic>) args)
- (goops-error "No applicable method for ~S in call ~S"
- gf (cons (generic-function-name gf) args)))
-
-(define-method (no-method (gf <generic>) args)
- (goops-error "No method defined for ~S" gf))
-
-;;;
-;;; {Cloning functions (from rdeline@CS.CMU.EDU)}
-;;;
-
-(define-method (shallow-clone (self <object>))
- (let ((clone (%allocate-instance (class-of self) '()))
- (slots (map slot-definition-name
- (class-slots (class-of self)))))
- (for-each (lambda (slot)
- (if (slot-bound? self slot)
- (slot-set! clone slot (slot-ref self slot))))
- slots)
- clone))
-
-(define-method (deep-clone (self <object>))
- (let ((clone (%allocate-instance (class-of self) '()))
- (slots (map slot-definition-name
- (class-slots (class-of self)))))
- (for-each (lambda (slot)
- (if (slot-bound? self slot)
- (slot-set! clone slot
- (let ((value (slot-ref self slot)))
- (if (instance? value)
- (deep-clone value)
- value)))))
- slots)
- clone))
-
-;;;
-;;; {Class redefinition utilities}
-;;;
-
-;;; (class-redefinition OLD NEW)
-;;;
-
-;;; Has correct the following conditions:
-
-;;; Methods
-;;;
-;;; 1. New accessor specializers refer to new header
-;;;
-;;; Classes
-;;;
-;;; 1. New class cpl refers to the new class header
-;;; 2. Old class header exists on old super classes direct-subclass lists
-;;; 3. New class header exists on new super classes direct-subclass lists
-
-(define-method (class-redefinition (old <class>) (new <class>))
- ;; Work on direct methods:
- ;; 1. Remove accessor methods from the old class
- ;; 2. Patch the occurences of new in the specializers by old
- ;; 3. Displace the methods from old to new
- (remove-class-accessors! old) ;; -1-
- (let ((methods (class-direct-methods new)))
- (for-each (lambda (m)
- (update-direct-method! m new old)) ;; -2-
- methods)
- (slot-set! new
- 'direct-methods
- (append methods (class-direct-methods old))))
-
- ;; Substitute old for new in new cpl
- (set-car! (slot-ref new 'cpl) old)
-
- ;; Remove the old class from the direct-subclasses list of its super classes
- (for-each (lambda (c) (slot-set! c 'direct-subclasses
- (delv! old (class-direct-subclasses c))))
- (class-direct-supers old))
-
- ;; Replace the new class with the old in the direct-subclasses of the supers
- (for-each (lambda (c)
- (slot-set! c 'direct-subclasses
- (cons old (delv! new (class-direct-subclasses c)))))
- (class-direct-supers new))
-
- ;; Swap object headers
- (%modify-class old new)
-
- ;; Now old is NEW!
-
- ;; Redefine all the subclasses of old to take into account modification
- (for-each
- (lambda (c)
- (update-direct-subclass! c new old))
- (class-direct-subclasses new))
-
- ;; Invalidate class so that subsequent instances slot accesses invoke
- ;; change-object-class
- (slot-set! new 'redefined old)
- (%invalidate-class new) ;must come after slot-set!
-
- old)
-
-;;;
-;;; remove-class-accessors!
-;;;
-
-(define-method (remove-class-accessors! (c <class>))
- (for-each (lambda (m)
- (if (is-a? m <accessor-method>)
- (remove-method-in-classes! m)))
- (class-direct-methods c)))
-
-;;;
-;;; update-direct-method!
-;;;
-
-(define-method (update-direct-method! (m <method>)
- (old <class>)
- (new <class>))
- (let loop ((l (method-specializers m)))
- ;; Note: the <top> in dotted list is never used.
- ;; So we can work as if we had only proper lists.
- (if (pair? l)
- (begin
- (if (eqv? (car l) old)
- (set-car! l new))
- (loop (cdr l))))))
-
-;;;
-;;; update-direct-subclass!
-;;;
-
-(define-method (update-direct-subclass! (c <class>)
- (old <class>)
- (new <class>))
- (class-redefinition c
- (make-class (class-direct-supers c)
- (class-direct-slots c)
- #:name (class-name c)
- #:environment (slot-ref c 'environment)
- #:metaclass (class-of c))))
-
-;;;
-;;; {Utilities for INITIALIZE methods}
-;;;
-
-;;; compute-slot-accessors
-;;;
-(define (compute-slot-accessors class slots env)
- (for-each
- (lambda (s g-n-s)
- (let ((name (slot-definition-name s))
- (getter-function (slot-definition-getter s))
- (setter-function (slot-definition-setter s))
- (accessor (slot-definition-accessor s)))
- (if getter-function
- (add-method! getter-function
- (compute-getter-method class g-n-s)))
- (if setter-function
- (add-method! setter-function
- (compute-setter-method class g-n-s)))
- (if accessor
- (begin
- (add-method! accessor
- (compute-getter-method class g-n-s))
- (add-method! (setter accessor)
- (compute-setter-method class g-n-s))))))
- slots (slot-ref class 'getters-n-setters)))
-
-(define-method (compute-getter-method (class <class>) slotdef)
- (let ((init-thunk (cadr slotdef))
- (g-n-s (cddr slotdef)))
- (make <accessor-method>
- #:specializers (list class)
- #:procedure (cond ((pair? g-n-s)
- (if init-thunk
- (car g-n-s)
- (make-generic-bound-check-getter (car g-n-s))
- ))
- (init-thunk
- (standard-get g-n-s))
- (else
- (bound-check-get g-n-s)))
- #:slot-definition slotdef)))
-
-(define-method (compute-setter-method (class <class>) slotdef)
- (let ((g-n-s (cddr slotdef)))
- (make <accessor-method>
- #:specializers (list class <top>)
- #:procedure (if (pair? g-n-s)
- (cadr g-n-s)
- (standard-set g-n-s))
- #:slot-definition slotdef)))
-
-(define (make-generic-bound-check-getter proc)
- (let ((source (and (closure? proc) (procedure-source proc))))
- (if (and source (null? (cdddr source)))
- (let ((obj (caadr source)))
- ;; smart closure compilation
- (local-eval
- `(lambda (,obj) (,assert-bound ,(caddr source) ,obj))
- (procedure-environment proc)))
- (lambda (o) (assert-bound (proc o) o)))))
-
-(define n-standard-accessor-methods 10)
-
-(define bound-check-get-methods (make-vector n-standard-accessor-methods #f))
-(define standard-get-methods (make-vector n-standard-accessor-methods #f))
-(define standard-set-methods (make-vector n-standard-accessor-methods #f))
-
-(define (standard-accessor-method make methods)
- (lambda (index)
- (cond ((>= index n-standard-accessor-methods) (make index))
- ((vector-ref methods index))
- (else (let ((m (make index)))
- (vector-set! methods index m)
- m)))))
-
-(define (make-bound-check-get index)
- (local-eval `(lambda (o) (@assert-bound-ref o ,index)) (the-environment)))
-
-(define (make-get index)
- (local-eval `(lambda (o) (@slot-ref o ,index)) (the-environment)))
-
-(define (make-set index)
- (local-eval `(lambda (o v) (@slot-set! o ,index v)) (the-environment)))
-
-(define bound-check-get
- (standard-accessor-method make-bound-check-get bound-check-get-methods))
-(define standard-get (standard-accessor-method make-get standard-get-methods))
-(define standard-set (standard-accessor-method make-set standard-set-methods))
-
-;;; compute-getters-n-setters
-;;;
-(define (compute-getters-n-setters class slots env)
-
- (define (compute-slot-init-function s)
- (or (slot-definition-init-thunk s)
- (let ((init (slot-definition-init-value s)))
- (and (not (unbound? init))
- (lambda () init)))))
-
- (define (verify-accessors slot l)
- (if (pair? l)
- (let ((get (car l))
- (set (cadr l)))
- (if (not (and (closure? get)
- (= (car (procedure-property get 'arity)) 1)))
- (goops-error "Bad getter closure for slot `~S' in ~S: ~S"
- slot class get))
- (if (not (and (closure? set)
- (= (car (procedure-property set 'arity)) 2)))
- (goops-error "Bad setter closure for slot `~S' in ~S: ~S"
- slot class set)))))
-
- (map (lambda (s)
- (let* ((g-n-s (compute-get-n-set class s))
- (name (slot-definition-name s)))
- ; For each slot we have '(name init-function getter setter)
- ; If slot, we have the simplest form '(name init-function . index)
- (verify-accessors name g-n-s)
- (cons name
- (cons (compute-slot-init-function s)
- g-n-s))))
- slots))
-
-;;; compute-cpl
-;;;
-;;; Correct behaviour:
-;;;
-;;; (define-class food ())
-;;; (define-class fruit (food))
-;;; (define-class spice (food))
-;;; (define-class apple (fruit))
-;;; (define-class cinnamon (spice))
-;;; (define-class pie (apple cinnamon))
-;;; => cpl (pie) = pie apple fruit cinnamon spice food object top
-;;;
-;;; (define-class d ())
-;;; (define-class e ())
-;;; (define-class f ())
-;;; (define-class b (d e))
-;;; (define-class c (e f))
-;;; (define-class a (b c))
-;;; => cpl (a) = a b d c e f object top
-;;;
-
-(define-method (compute-cpl (class <class>))
- (compute-std-cpl class class-direct-supers))
-
-;; Support
-
-(define (only-non-null lst)
- (filter (lambda (l) (not (null? l))) lst))
-
-(define (compute-std-cpl c get-direct-supers)
- (let ((c-direct-supers (get-direct-supers c)))
- (merge-lists (list c)
- (only-non-null (append (map class-precedence-list
- c-direct-supers)
- (list c-direct-supers))))))
-
-(define (merge-lists reversed-partial-result inputs)
- (cond
- ((every null? inputs)
- (reverse! reversed-partial-result))
- (else
- (let* ((candidate (lambda (c)
- (and (not (any (lambda (l)
- (memq c (cdr l)))
- inputs))
- c)))
- (candidate-car (lambda (l)
- (and (not (null? l))
- (candidate (car l)))))
- (next (any candidate-car inputs)))
- (if (not next)
- (goops-error "merge-lists: Inconsistent precedence graph"))
- (let ((remove-next (lambda (l)
- (if (eq? (car l) next)
- (cdr l)
- l))))
- (merge-lists (cons next reversed-partial-result)
- (only-non-null (map remove-next inputs))))))))
-
-;; Modified from TinyClos:
-;;
-;; A simple topological sort.
-;;
-;; It's in this file so that both TinyClos and Objects can use it.
-;;
-;; This is a fairly modified version of code I originally got from Anurag
-;; Mendhekar <anurag@moose.cs.indiana.edu>.
-;;
-
-(define (compute-clos-cpl c get-direct-supers)
- (top-sort ((build-transitive-closure get-direct-supers) c)
- ((build-constraints get-direct-supers) c)
- (std-tie-breaker get-direct-supers)))
-
-
-(define (top-sort elements constraints tie-breaker)
- (let loop ((elements elements)
- (constraints constraints)
- (result '()))
- (if (null? elements)
- result
- (let ((can-go-in-now
- (filter
- (lambda (x)
- (every (lambda (constraint)
- (or (not (eq? (cadr constraint) x))
- (memq (car constraint) result)))
- constraints))
- elements)))
- (if (null? can-go-in-now)
- (goops-error "top-sort: Invalid constraints")
- (let ((choice (if (null? (cdr can-go-in-now))
- (car can-go-in-now)
- (tie-breaker result
- can-go-in-now))))
- (loop
- (filter (lambda (x) (not (eq? x choice)))
- elements)
- constraints
- (append result (list choice)))))))))
-
-(define (std-tie-breaker get-supers)
- (lambda (partial-cpl min-elts)
- (let loop ((pcpl (reverse partial-cpl)))
- (let ((current-elt (car pcpl)))
- (let ((ds-of-ce (get-supers current-elt)))
- (let ((common (filter (lambda (x)
- (memq x ds-of-ce))
- min-elts)))
- (if (null? common)
- (if (null? (cdr pcpl))
- (goops-error "std-tie-breaker: Nothing valid")
- (loop (cdr pcpl)))
- (car common))))))))
-
-
-(define (build-transitive-closure get-follow-ons)
- (lambda (x)
- (let track ((result '())
- (pending (list x)))
- (if (null? pending)
- result
- (let ((next (car pending)))
- (if (memq next result)
- (track result (cdr pending))
- (track (cons next result)
- (append (get-follow-ons next)
- (cdr pending)))))))))
-
-(define (build-constraints get-follow-ons)
- (lambda (x)
- (let loop ((elements ((build-transitive-closure get-follow-ons) x))
- (this-one '())
- (result '()))
- (if (or (null? this-one) (null? (cdr this-one)))
- (if (null? elements)
- result
- (loop (cdr elements)
- (cons (car elements)
- (get-follow-ons (car elements)))
- result))
- (loop elements
- (cdr this-one)
- (cons (list (car this-one) (cadr this-one))
- result))))))
-
-;;; compute-get-n-set
-;;;
-(define-method (compute-get-n-set (class <class>) s)
- (case (slot-definition-allocation s)
- ((#:instance) ;; Instance slot
- ;; get-n-set is just its offset
- (let ((already-allocated (slot-ref class 'nfields)))
- (slot-set! class 'nfields (+ already-allocated 1))
- already-allocated))
-
- ((#:class) ;; Class slot
- ;; Class-slots accessors are implemented as 2 closures around
- ;; a Scheme variable. As instance slots, class slots must be
- ;; unbound at init time.
- (let ((name (slot-definition-name s)))
- (if (memq name (map slot-definition-name (class-direct-slots class)))
- ;; This slot is direct; create a new shared variable
- (make-closure-variable class)
- ;; Slot is inherited. Find its definition in superclass
- (let loop ((l (cdr (class-precedence-list class))))
- (let ((r (assoc name (slot-ref (car l) 'getters-n-setters))))
- (if r
- (cddr r)
- (loop (cdr l))))))))
-
- ((#:each-subclass) ;; slot shared by instances of direct subclass.
- ;; (Thomas Buerger, April 1998)
- (make-closure-variable class))
-
- ((#:virtual) ;; No allocation
- ;; slot-ref and slot-set! function must be given by the user
- (let ((get (get-keyword #:slot-ref (slot-definition-options s) #f))
- (set (get-keyword #:slot-set! (slot-definition-options s) #f))
- (env (class-environment class)))
- (if (not (and get set))
- (goops-error "You must supply a :slot-ref and a :slot-set! in ~S"
- s))
- (list get set)))
- (else (next-method))))
-
-(define (make-closure-variable class)
- (let ((shared-variable (make-unbound)))
- (list (lambda (o) shared-variable)
- (lambda (o v) (set! shared-variable v)))))
-
-(define-method (compute-get-n-set (o <object>) s)
- (goops-error "Allocation \"~S\" is unknown" (slot-definition-allocation s)))
-
-(define-method (compute-slots (class <class>))
- (%compute-slots class))
-
-;;;
-;;; {Initialize}
-;;;
-
-(define-method (initialize (object <object>) initargs)
- (%initialize-object object initargs))
-
-(define-method (initialize (class <class>) initargs)
- (next-method)
- (let ((dslots (get-keyword #:slots initargs '()))
- (supers (get-keyword #:dsupers initargs '()))
- (env (get-keyword #:environment initargs (top-level-env))))
-
- (slot-set! class 'name (get-keyword #:name initargs '???))
- (slot-set! class 'direct-supers supers)
- (slot-set! class 'direct-slots dslots)
- (slot-set! class 'direct-subclasses '())
- (slot-set! class 'direct-methods '())
- (slot-set! class 'cpl (compute-cpl class))
- (slot-set! class 'redefined #f)
- (slot-set! class 'environment env)
- (let ((slots (compute-slots class)))
- (slot-set! class 'slots slots)
- (slot-set! class 'nfields 0)
- (slot-set! class 'getters-n-setters (compute-getters-n-setters class
- slots
- env))
- ;; Build getters - setters - accessors
- (compute-slot-accessors class slots env))
-
- ;; Update the "direct-subclasses" of each inherited classes
- (for-each (lambda (x)
- (slot-set! x
- 'direct-subclasses
- (cons class (slot-ref x 'direct-subclasses))))
- supers)
-
- ;; Support for the underlying structs:
-
- ;; Inherit class flags (invisible on scheme level) from supers
- (%inherit-magic! class supers)
-
- ;; Set the layout slot
- (%prep-layout! class)))
-
-(define (initialize-object-procedure object initargs)
- (let ((proc (get-keyword #:procedure initargs #f)))
- (cond ((not proc))
- ((pair? proc)
- (apply set-object-procedure! object proc))
- ((valid-object-procedure? proc)
- (set-object-procedure! object proc))
- (else
- (set-object-procedure! object
- (lambda args (apply proc args)))))))
-
-(define-method (initialize (class <operator-class>) initargs)
- (next-method)
- (initialize-object-procedure class initargs))
-
-(define-method (initialize (owsc <operator-with-setter-class>) initargs)
- (next-method)
- (%set-object-setter! owsc (get-keyword #:setter initargs #f)))
-
-(define-method (initialize (entity <entity>) initargs)
- (next-method)
- (initialize-object-procedure entity initargs))
-
-(define-method (initialize (ews <entity-with-setter>) initargs)
- (next-method)
- (%set-object-setter! ews (get-keyword #:setter initargs #f)))
-
-(define-method (initialize (generic <generic>) initargs)
- (let ((previous-definition (get-keyword #:default initargs #f))
- (name (get-keyword #:name initargs #f)))
- (next-method)
- (slot-set! generic 'methods (if (is-a? previous-definition <procedure>)
- (list (make <method>
- #:specializers <top>
- #:procedure
- (lambda l
- (apply previous-definition
- l))))
- '()))
- (if name
- (set-procedure-property! generic 'name name))
- ))
-
-(define dummy-procedure (lambda args *unspecified*))
-
-(define-method (initialize (method <method>) initargs)
- (next-method)
- (slot-set! method 'generic-function (get-keyword #:generic-function initargs #f))
- (slot-set! method 'specializers (get-keyword #:specializers initargs '()))
- (slot-set! method 'procedure
- (get-keyword #:procedure initargs dummy-procedure))
- (slot-set! method 'code-table '()))
-
-(define-method (initialize (obj <foreign-object>) initargs))
-
-;;;
-;;; {Change-class}
-;;;
-
-(define (change-object-class old-instance old-class new-class)
- (let ((new-instance (allocate-instance new-class '())))
- ;; Initalize the slot of the new instance
- (for-each (lambda (slot)
- (if (and (slot-exists-using-class? old-class old-instance slot)
- (eq? (slot-definition-allocation
- (class-slot-definition old-class slot))
- #:instance)
- (slot-bound-using-class? old-class old-instance slot))
- ;; Slot was present and allocated in old instance; copy it
- (slot-set-using-class!
- new-class
- new-instance
- slot
- (slot-ref-using-class old-class old-instance slot))
- ;; slot was absent; initialize it with its default value
- (let ((init (slot-init-function new-class slot)))
- (if init
- (slot-set-using-class!
- new-class
- new-instance
- slot
- (apply init '()))))))
- (map slot-definition-name (class-slots new-class)))
- ;; Exchange old and new instance in place to keep pointers valid
- (%modify-instance old-instance new-instance)
- ;; Allow class specific updates of instances (which now are swapped)
- (update-instance-for-different-class new-instance old-instance)
- old-instance))
-
-
-(define-method (update-instance-for-different-class (old-instance <object>)
- (new-instance
- <object>))
- ;;not really important what we do, we just need a default method
- new-instance)
-
-(define-method (change-class (old-instance <object>) (new-class <class>))
- (change-object-class old-instance (class-of old-instance) new-class))
-
-;;;
-;;; {make}
-;;;
-;;; A new definition which overwrites the previous one which was built-in
-;;;
-
-(define-method (allocate-instance (class <class>) initargs)
- (%allocate-instance class initargs))
-
-(define-method (make-instance (class <class>) . initargs)
- (let ((instance (allocate-instance class initargs)))
- (initialize instance initargs)
- instance))
-
-(define make make-instance)
-
-;;;
-;;; {apply-generic}
-;;;
-;;; Protocol for calling standard generic functions. This protocol is
-;;; not used for real <generic> functions (in this case we use a
-;;; completely C hard-coded protocol). Apply-generic is used by
-;;; goops for calls to subclasses of <generic> and <generic-with-setter>.
-;;; The code below is similar to the first MOP described in AMOP. In
-;;; particular, it doesn't used the currified approach to gf
-;;; call. There are 2 reasons for that:
-;;; - the protocol below is exposed to mimic completely the one written in C
-;;; - the currified protocol would be imho inefficient in C.
-;;;
-
-(define-method (apply-generic (gf <generic>) args)
- (if (null? (slot-ref gf 'methods))
- (no-method gf args))
- (let ((methods (compute-applicable-methods gf args)))
- (if methods
- (apply-methods gf (sort-applicable-methods gf methods args) args)
- (no-applicable-method gf args))))
-
-;; compute-applicable-methods is bound to %compute-applicable-methods.
-;; *fixme* use let
-(define %%compute-applicable-methods
- (make <generic> #:name 'compute-applicable-methods))
-
-(define-method (%%compute-applicable-methods (gf <generic>) args)
- (%compute-applicable-methods gf args))
-
-(set! compute-applicable-methods %%compute-applicable-methods)
-
-(define-method (sort-applicable-methods (gf <generic>) methods args)
- (let ((targs (map class-of args)))
- (sort methods (lambda (m1 m2) (method-more-specific? m1 m2 targs)))))
-
-(define-method (method-more-specific? (m1 <method>) (m2 <method>) targs)
- (%method-more-specific? m1 m2 targs))
-
-(define-method (apply-method (gf <generic>) methods build-next args)
- (apply (method-procedure (car methods))
- (build-next (cdr methods) args)
- args))
-
-(define-method (apply-methods (gf <generic>) (l <list>) args)
- (letrec ((next (lambda (procs args)
- (lambda new-args
- (let ((a (if (null? new-args) args new-args)))
- (if (null? procs)
- (no-next-method gf a)
- (apply-method gf procs next a)))))))
- (apply-method gf l next args)))
-
-;; We don't want the following procedure to turn up in backtraces:
-(for-each (lambda (proc)
- (set-procedure-property! proc 'system-procedure #t))
- (list slot-unbound
- slot-missing
- no-next-method
- no-applicable-method
- no-method
- ))
-
-;;;
-;;; {<composite-metaclass> and <active-metaclass>}
-;;;
-
-;(autoload "active-slot" <active-metaclass>)
-;(autoload "composite-slot" <composite-metaclass>)
-;(export <composite-metaclass> <active-metaclass>)
-
-;;;
-;;; {Tools}
-;;;
-
-;; list2set
-;;
-;; duplicate the standard list->set function but using eq instead of
-;; eqv which really sucks a lot, uselessly here
-;;
-(define (list2set l)
- (let loop ((l l)
- (res '()))
- (cond
- ((null? l) res)
- ((memq (car l) res) (loop (cdr l) res))
- (else (loop (cdr l) (cons (car l) res))))))
-
-(define (class-subclasses c)
- (letrec ((allsubs (lambda (c)
- (cons c (mapappend allsubs
- (class-direct-subclasses c))))))
- (list2set (cdr (allsubs c)))))
-
-(define (class-methods c)
- (list2set (mapappend class-direct-methods
- (cons c (class-subclasses c)))))
-
-;;;
-;;; {Final initialization}
-;;;
-
-;; Tell C code that the main bulk of Goops has been loaded
-(%goops-loaded)
diff --git a/oop/goops/.cvsignore b/oop/goops/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/oop/goops/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/oop/goops/Makefile.am b/oop/goops/Makefile.am
deleted file mode 100644
index e447598f9..000000000
--- a/oop/goops/Makefile.am
+++ /dev/null
@@ -1,34 +0,0 @@
-## Process this file with automake to produce Makefile.in.
-##
-## Copyright (C) 2000, 2001 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-AUTOMAKE_OPTIONS = gnu
-
-# These should be installed and distributed.
-goops_sources = \
- active-slot.scm compile.scm composite-slot.scm describe.scm \
- dispatch.scm internal.scm save.scm stklos.scm util.scm \
- old-define-method.scm
-
-subpkgdatadir = $(pkgdatadir)/$(VERSION)/oop/goops
-subpkgdata_DATA = $(goops_sources)
-ETAGS_ARGS = $(subpkgdata_DATA)
-
-EXTRA_DIST = $(goops_sources)
diff --git a/oop/goops/active-slot.scm b/oop/goops/active-slot.scm
deleted file mode 100644
index 7060b83be..000000000
--- a/oop/goops/active-slot.scm
+++ /dev/null
@@ -1,91 +0,0 @@
-;;; installed-scm-file
-
-;;;; Copyright (C) 1999, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-
-;;;; This software is a derivative work of other copyrighted softwares; the
-;;;; copyright notices of these softwares are placed in the file COPYRIGHTS
-;;;;
-;;;; This file is based upon active-slot.stklos from the STk
-;;;; distribution by Erick Gallesio <eg@unice.fr>.
-;;;;
-
-(define-module (oop goops active-slot)
- :use-module (oop goops internal)
- :export (<active-class>))
-
-(define-class <active-class> (<class>))
-
-(define-method (compute-get-n-set (class <active-class>) slot)
- (if (eq? (slot-definition-allocation slot) #:active)
- (let* ((index (slot-ref class 'nfields))
- (name (car slot))
- (s (cdr slot))
- (env (class-environment class))
- (before-ref (get-keyword #:before-slot-ref s #f))
- (after-ref (get-keyword #:after-slot-ref s #f))
- (before-set! (get-keyword #:before-slot-set! s #f))
- (after-set! (get-keyword #:after-slot-set! s #f))
- (unbound (make-unbound)))
- (slot-set! class 'nfields (+ index 1))
- (list (lambda (o)
- (if before-ref
- (if (before-ref o)
- (let ((res (%fast-slot-ref o index)))
- (and after-ref (not (eqv? res unbound)) (after-ref o))
- res)
- (make-unbound))
- (let ((res (%fast-slot-ref o index)))
- (and after-ref (not (eqv? res unbound)) (after-ref o))
- res)))
-
- (lambda (o v)
- (if before-set!
- (if (before-set! o v)
- (begin
- (%fast-slot-set! o index v)
- (and after-set! (after-set! o v))))
- (begin
- (%fast-slot-set! o index v)
- (and after-set! (after-set! o v)))))))
- (next-method)))
diff --git a/oop/goops/compile.scm b/oop/goops/compile.scm
deleted file mode 100644
index e84d3d0d9..000000000
--- a/oop/goops/compile.scm
+++ /dev/null
@@ -1,164 +0,0 @@
-;;;; Copyright (C) 1999, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-
-(define-module (oop goops compile)
- :use-module (oop goops)
- :use-module (oop goops util)
- :export (compute-cmethod compute-entry-with-cmethod
- compile-method cmethod-code cmethod-environment)
- :no-backtrace
- )
-
-(define source-formals cadr)
-(define source-body cddr)
-
-(define cmethod-code cdr)
-(define cmethod-environment car)
-
-
-;;;
-;;; Method entries
-;;;
-
-(define code-table-lookup
- (letrec ((check-entry (lambda (entry types)
- (if (null? types)
- (and (not (struct? (car entry)))
- entry)
- (and (eq? (car entry) (car types))
- (check-entry (cdr entry) (cdr types)))))))
- (lambda (code-table types)
- (cond ((null? code-table) #f)
- ((check-entry (car code-table) types)
- => (lambda (cmethod)
- (cons (car code-table) cmethod)))
- (else (code-table-lookup (cdr code-table) types))))))
-
-(define (compute-entry-with-cmethod methods types)
- (or (code-table-lookup (slot-ref (car methods) 'code-table) types)
- (let* ((method (car methods))
- (place-holder (list #f))
- (entry (append types place-holder)))
- ;; In order to handle recursion nicely, put the entry
- ;; into the code-table before compiling the method
- (slot-set! (car methods) 'code-table
- (cons entry (slot-ref (car methods) 'code-table)))
- (let ((cmethod (compile-method methods types)))
- (set-car! place-holder (car cmethod))
- (set-cdr! place-holder (cdr cmethod)))
- (cons entry place-holder))))
-
-(define (compute-cmethod methods types)
- (cdr (compute-entry-with-cmethod methods types)))
-
-;;;
-;;; Next methods
-;;;
-
-;;; Temporary solution---return #f if x doesn't refer to `next-method'.
-(define (next-method? x)
- (and (pair? x)
- (or (eq? (car x) 'next-method)
- (next-method? (car x))
- (next-method? (cdr x)))))
-
-(define (make-final-make-next-method method)
- (lambda default-args
- (lambda args
- (@apply method (if (null? args) default-args args)))))
-
-(define (make-final-make-no-next-method gf)
- (lambda default-args
- (lambda args
- (no-next-method gf (if (null? args) default-args args)))))
-
-(define (make-make-next-method vcell gf methods types)
- (lambda default-args
- (lambda args
- (if (null? methods)
- (begin
- (set-cdr! vcell (make-final-make-no-next-method gf))
- (no-next-method gf (if (null? args) default-args args)))
- (let* ((cmethod (compute-cmethod methods types))
- (method (local-eval (cons 'lambda (cmethod-code cmethod))
- (cmethod-environment cmethod))))
- (set-cdr! vcell (make-final-make-next-method method))
- (@apply method (if (null? args) default-args args)))))))
-
-;;;
-;;; Method compilation
-;;;
-
-;;; NOTE: This section is far from finished. It will finally be
-;;; implemented on C level.
-
-(define %tag-body
- (nested-ref the-root-module '(app modules oop goops %tag-body)))
-
-(define (compile-method methods types)
- (let* ((proc (method-procedure (car methods)))
- ;; XXX - procedure-source can not be guaranteed to be
- ;; reliable or efficient
- (src (procedure-source proc))
- (formals (source-formals src))
- (body (source-body src)))
- (if (next-method? body)
- (let ((vcell (cons 'goops:make-next-method #f)))
- (set-cdr! vcell
- (make-make-next-method
- vcell
- (method-generic-function (car methods))
- (cdr methods) types))
- ;;*fixme*
- `(,(cons vcell (procedure-environment proc))
- ,formals
- ;;*fixme* Only do this on source where next-method can't be inlined
- (let ((next-method ,(if (list? formals)
- `(goops:make-next-method ,@formals)
- `(apply goops:make-next-method
- ,@(improper->proper formals)))))
- ,@body)))
- (cons (procedure-environment proc)
- (cons formals
- (%tag-body body)))
- )))
diff --git a/oop/goops/composite-slot.scm b/oop/goops/composite-slot.scm
deleted file mode 100644
index 84ce7937f..000000000
--- a/oop/goops/composite-slot.scm
+++ /dev/null
@@ -1,107 +0,0 @@
-;;; installed-scm-file
-
-;;;; Copyright (C) 1999, 2000, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-
-;;;; This software is a derivative work of other copyrighted softwares; the
-;;;; copyright notices of these softwares are placed in the file COPYRIGHTS
-;;;;
-;;;; This file is based upon composite-slot.stklos from the STk
-;;;; distribution by Erick Gallesio <eg@unice.fr>.
-;;;;
-
-(define-module (oop goops composite-slot)
- :use-module (oop goops)
- :export (<composite-class>))
-
-;;;
-;;; (define-class CLASS SUPERS
-;;; ...
-;;; (OBJECT ...)
-;;; ...
-;;; (SLOT #:allocation #:propagated
-;;; #:propagate-to '(PROPAGATION ...))
-;;; ...
-;;; #:metaclass <composite-class>)
-;;;
-;;; PROPAGATION ::= OBJECT | (OBJECT TARGETSLOT)
-;;;
-;;; The slot SLOT will be propagated to the slot TARGETSLOT in the object
-;;; stored in slot OBJECT. If TARGETSLOT is omitted, assume that the target
-;;; slot is named SLOT.
-;;;
-
-(define-class <composite-class> (<class>))
-
-(define-method (compute-get-n-set (class <composite-class>) slot)
- (if (eq? (slot-definition-allocation slot) #:propagated)
- (compute-propagated-get-n-set slot)
- (next-method)))
-
-(define (compute-propagated-get-n-set s)
- (let ((prop (get-keyword #:propagate-to (cdr s) #f))
- (s-name (slot-definition-name s)))
-
- (if (not prop)
- (goops-error "Propagation not specified for slot ~S" s-name))
- (if (not (pair? prop))
- (goops-error "Bad propagation list for slot ~S" s-name))
-
- (let ((objects (map (lambda (p) (if (pair? p) (car p) p)) prop))
- (slots (map (lambda (p) (if (pair? p) (cadr p) s-name)) prop)))
- (let ((first-object (car objects))
- (first-slot (car slots)))
- (list
- ;; The getter
- (lambda (o)
- (slot-ref (slot-ref o first-object) first-slot))
-
- ;; The setter
- (if (null? (cdr objects))
- (lambda (o v)
- (slot-set! (slot-ref o first-object) first-slot v))
- (lambda (o v)
- (for-each (lambda (object slot)
- (slot-set! (slot-ref o object) slot v))
- objects
- slots))))))))
diff --git a/oop/goops/describe.scm b/oop/goops/describe.scm
deleted file mode 100644
index dc0e63424..000000000
--- a/oop/goops/describe.scm
+++ /dev/null
@@ -1,225 +0,0 @@
-;;; installed-scm-file
-
-;;;; Copyright (C) 1998, 1999, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-
-;;;; This software is a derivative work of other copyrighted softwares; the
-;;;; copyright notices of these softwares are placed in the file COPYRIGHTS
-;;;;
-;;;; This file is based upon describe.stklos from the STk distribution by
-;;;; Erick Gallesio <eg@unice.fr>.
-;;;;
-
-(define-module (oop goops describe)
- :use-module (oop goops)
- :use-module (ice-9 session)
- :use-module (ice-9 format)
- :export (describe)) ; Export the describe generic function
-
-;;;
-;;; describe for simple objects
-;;;
-(define-method (describe (x <top>))
- (format #t "~s is " x)
- (cond
- ((integer? x) (format #t "an integer"))
- ((real? x) (format #t "a real"))
- ((complex? x) (format #t "a complex number"))
- ((null? x) (format #t "an empty list"))
- ((boolean? x) (format #t "a boolean value (~s)" (if x 'true 'false)))
- ((char? x) (format #t "a character, ascii value is ~s"
- (char->integer x)))
- ((symbol? x) (format #t "a symbol"))
- ((list? x) (format #t "a list"))
- ((pair? x) (if (pair? (cdr x))
- (format #t "an improper list")
- (format #t "a pair")))
- ((string? x) (if (eqv? x "")
- (format #t "an empty string")
- (format #t "a string of length ~s" (string-length x))))
- ((vector? x) (if (eqv? x '#())
- (format #t "an empty vector")
- (format #t "a vector of length ~s" (vector-length x))))
- ((eof-object? x) (format #t "the end-of-file object"))
- (else (format #t "an unknown object (~s)" x)))
- (format #t ".~%")
- *unspecified*)
-
-(define-method (describe (x <procedure>))
- (let ((name (procedure-name x)))
- (if name
- (format #t "`~s'" name)
- (display x))
- (display " is ")
- (display (if name #\a "an anonymous"))
- (display (cond ((closure? x) " procedure")
- ((not (struct? x)) " primitive procedure")
- ((entity? x) " entity")
- (else " operator")))
- (display " with ")
- (arity x)))
-
-;;;
-;;; describe for GOOPS instances
-;;;
-(define (safe-class-name class)
- (if (slot-bound? class 'name)
- (class-name class)
- class))
-
-(define-method (describe (x <object>))
- (format #t "~S is an instance of class ~A~%"
- x (safe-class-name (class-of x)))
-
- ;; print all the instance slots
- (format #t "Slots are: ~%")
- (for-each (lambda (slot)
- (let ((name (slot-definition-name slot)))
- (format #t " ~S = ~A~%"
- name
- (if (slot-bound? x name)
- (format #f "~S" (slot-ref x name))
- "#<unbound>"))))
- (class-slots (class-of x)))
- *unspecified*)
-
-;;;
-;;; Describe for classes
-;;;
-(define-method (describe (x <class>))
- (format #t "~S is a class. It's an instance of ~A~%"
- (safe-class-name x) (safe-class-name (class-of x)))
-
- ;; Super classes
- (format #t "Superclasses are:~%")
- (for-each (lambda (class) (format #t " ~A~%" (safe-class-name class)))
- (class-direct-supers x))
-
- ;; Direct slots
- (let ((slots (class-direct-slots x)))
- (if (null? slots)
- (format #t "(No direct slot)~%")
- (begin
- (format #t "Directs slots are:~%")
- (for-each (lambda (s)
- (format #t " ~A~%" (slot-definition-name s)))
- slots))))
-
-
- ;; Direct subclasses
- (let ((classes (class-direct-subclasses x)))
- (if (null? classes)
- (format #t "(No direct subclass)~%")
- (begin
- (format #t "Directs subclasses are:~%")
- (for-each (lambda (s)
- (format #t " ~A~%" (safe-class-name s)))
- classes))))
-
- ;; CPL
- (format #t "Class Precedence List is:~%")
- (for-each (lambda (s) (format #t " ~A~%" (safe-class-name s)))
- (class-precedence-list x))
-
- ;; Direct Methods
- (let ((methods (class-direct-methods x)))
- (if (null? methods)
- (format #t "(No direct method)~%")
- (begin
- (format #t "Class direct methods are:~%")
- (for-each describe methods))))
-
-; (format #t "~%Field Initializers ~% ")
-; (write (slot-ref x 'initializers)) (newline)
-
-; (format #t "~%Getters and Setters~% ")
-; (write (slot-ref x 'getters-n-setters)) (newline)
-)
-
-;;;
-;;; Describe for generic functions
-;;;
-(define-method (describe (x <generic>))
- (let ((name (generic-function-name x))
- (methods (generic-function-methods x)))
- ;; Title
- (format #t "~S is a generic function. It's an instance of ~A.~%"
- name (safe-class-name (class-of x)))
- ;; Methods
- (if (null? methods)
- (format #t "(No method defined for ~S)~%" name)
- (begin
- (format #t "Methods defined for ~S~%" name)
- (for-each (lambda (x) (describe x #t)) methods)))))
-
-;;;
-;;; Describe for methods
-;;;
-(define-method (describe (x <method>) . omit-generic)
- (letrec ((print-args (lambda (args)
- ;; take care of dotted arg lists
- (cond ((null? args) (newline))
- ((pair? args)
- (display #\space)
- (display (safe-class-name (car args)))
- (print-args (cdr args)))
- (else
- (display #\space)
- (display (safe-class-name args))
- (newline))))))
-
- ;; Title
- (format #t " Method ~A~%" x)
-
- ;; Associated generic
- (if (null? omit-generic)
- (let ((gf (method-generic-function x)))
- (if gf
- (format #t "\t Generic: ~A~%" (generic-function-name gf))
- (format #t "\t(No generic)~%"))))
-
- ;; GF specializers
- (format #t "\tSpecializers:")
- (print-args (method-specializers x))))
-
-(provide "describe")
diff --git a/oop/goops/dispatch.scm b/oop/goops/dispatch.scm
deleted file mode 100644
index 8f9cb2c1e..000000000
--- a/oop/goops/dispatch.scm
+++ /dev/null
@@ -1,293 +0,0 @@
-;;;; Copyright (C) 1999, 2000, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-
-(define-module (oop goops dispatch)
- :use-module (oop goops)
- :use-module (oop goops util)
- :use-module (oop goops compile)
- :export (memoize-method!)
- :no-backtrace
- )
-
-;;;
-;;; This file implements method memoization. It will finally be
-;;; implemented on C level in order to obtain fast generic function
-;;; application also during the first pass through the code.
-;;;
-
-;;;
-;;; Constants
-;;;
-
-(define hashsets 8)
-(define hashset-index 6)
-
-(define hash-threshold 3)
-(define initial-hash-size 4) ;must be a power of 2 and >= hash-threshold
-
-(define initial-hash-size-1 (- initial-hash-size 1))
-
-(define the-list-of-no-method '(no-method))
-
-;;;
-;;; Method cache
-;;;
-
-;; (#@dispatch args N-SPECIALIZED #((TYPE1 ... ENV FORMALS FORM1 ...) ...) GF)
-;; (#@dispatch args N-SPECIALIZED HASHSET MASK
-;; #((TYPE1 ... ENV FORMALS FORM1 ...) ...)
-;; GF)
-
-;;; Representation
-
-;; non-hashed form
-
-(define method-cache-entries cadddr)
-
-(define (set-method-cache-entries! mcache entries)
- (set-car! (cdddr mcache) entries))
-
-(define (method-cache-n-methods exp)
- (n-cache-methods (method-cache-entries exp)))
-
-(define (method-cache-methods exp)
- (cache-methods (method-cache-entries exp)))
-
-;; hashed form
-
-(define (set-hashed-method-cache-hashset! exp hashset)
- (set-car! (cdddr exp) hashset))
-
-(define (set-hashed-method-cache-mask! exp mask)
- (set-car! (cddddr exp) mask))
-
-(define (hashed-method-cache-entries exp)
- (list-ref exp 5))
-
-(define (set-hashed-method-cache-entries! exp entries)
- (set-car! (list-cdr-ref exp 5) entries))
-
-;; either form
-
-(define (method-cache-generic-function exp)
- (list-ref exp (if (method-cache-hashed? exp) 6 4)))
-
-;;; Predicates
-
-(define (method-cache-hashed? x)
- (integer? (cadddr x)))
-
-(define max-non-hashed-index (- hash-threshold 2))
-
-(define (passed-hash-threshold? exp)
- (and (> (vector-length (method-cache-entries exp)) max-non-hashed-index)
- (struct? (car (vector-ref (method-cache-entries exp)
- max-non-hashed-index)))))
-
-;;; Converting a method cache to hashed form
-
-(define (method-cache->hashed! exp)
- (set-cdr! (cddr exp) (cons 0 (cons initial-hash-size-1 (cdddr exp))))
- exp)
-
-;;;
-;;; Cache entries
-;;;
-
-(define (n-cache-methods entries)
- (do ((i (- (vector-length entries) 1) (- i 1)))
- ((or (< i 0) (struct? (car (vector-ref entries i))))
- (+ i 1))))
-
-(define (cache-methods entries)
- (do ((i (- (vector-length entries) 1) (- i 1))
- (methods '() (let ((entry (vector-ref entries i)))
- (if (struct? (car entry))
- (cons entry methods)
- methods))))
- ((< i 0) methods)))
-
-;;;
-;;; Method insertion
-;;;
-
-(define (method-cache-insert! exp entry)
- (let* ((entries (method-cache-entries exp))
- (n (n-cache-methods entries)))
- (if (>= n (vector-length entries))
- ;; grow cache
- (let ((new-entries (make-vector (* 2 (vector-length entries))
- the-list-of-no-method)))
- (do ((i 0 (+ i 1)))
- ((= i n))
- (vector-set! new-entries i (vector-ref entries i)))
- (vector-set! new-entries n entry)
- (set-method-cache-entries! exp new-entries))
- (vector-set! entries n entry))))
-
-(define (hashed-method-cache-insert! exp entry)
- (let* ((cache (hashed-method-cache-entries exp))
- (size (vector-length cache)))
- (let* ((entries (cons entry (cache-methods cache)))
- (size (if (<= (length entries) size)
- size
- ;; larger size required
- (let ((new-size (* 2 size)))
- (set-hashed-method-cache-mask! exp (- new-size 1))
- new-size)))
- (min-misses size)
- (best #f))
- (do ((hashset 0 (+ 1 hashset)))
- ((= hashset hashsets))
- (let* ((test-cache (make-vector size the-list-of-no-method))
- (misses (cache-try-hash! min-misses hashset test-cache entries)))
- (cond ((zero? misses)
- (set! min-misses 0)
- (set! best hashset)
- (set! cache test-cache)
- (set! hashset (- hashsets 1)))
- ((< misses min-misses)
- (set! min-misses misses)
- (set! best hashset)
- (set! cache test-cache)))))
- (set-hashed-method-cache-hashset! exp best)
- (set-hashed-method-cache-entries! exp cache))))
-
-;;;
-;;; Caching
-;;;
-
-(define environment? pair?)
-
-(define (cache-hashval hashset entry)
- (let ((hashset-index (+ hashset-index hashset)))
- (do ((sum 0)
- (classes entry (cdr classes)))
- ((environment? (car classes)) sum)
- (set! sum (+ sum (struct-ref (car classes) hashset-index))))))
-
-(define (cache-try-hash! min-misses hashset cache entries)
- (let ((max-misses 0)
- (mask (- (vector-length cache) 1)))
- (catch 'misses
- (lambda ()
- (do ((ls entries (cdr ls))
- (misses 0 0))
- ((null? ls) max-misses)
- (do ((i (logand mask (cache-hashval hashset (car ls)))
- (logand mask (+ i 1))))
- ((not (struct? (car (vector-ref cache i))))
- (vector-set! cache i (car ls)))
- (set! misses (+ 1 misses))
- (if (>= misses min-misses)
- (throw 'misses misses)))
- (if (> misses max-misses)
- (set! max-misses misses))))
- (lambda (key misses)
- misses))))
-
-;;;
-;;; Memoization
-;;;
-
-;; Backward compatibility
-(if (not (defined? 'lookup-create-cmethod))
- (define (lookup-create-cmethod gf args)
- (no-applicable-method (car args) (cadr args))))
-
-(define (memoize-method! gf args exp)
- (if (not (slot-ref gf 'used-by))
- (slot-set! gf 'used-by '()))
- (let ((applicable ((if (eq? gf compute-applicable-methods)
- %compute-applicable-methods
- compute-applicable-methods)
- gf args)))
- (cond (applicable
- ;; *fixme* dispatch.scm needs rewriting Since the current
- ;; code mutates the method cache, we have to work on a
- ;; copy. Otherwise we might disturb another thread
- ;; currently dispatching on the cache. (No need to copy
- ;; the vector.)
- (let* ((new (list-copy exp))
- (res
- (cond ((method-cache-hashed? new)
- (method-cache-install! hashed-method-cache-insert!
- new args applicable))
- ((passed-hash-threshold? new)
- (method-cache-install! hashed-method-cache-insert!
- (method-cache->hashed! new)
- args
- applicable))
- (else
- (method-cache-install! method-cache-insert!
- new args applicable)))))
- (set-cdr! (cdr exp) (cddr new))
- res))
- ((null? args)
- (lookup-create-cmethod no-applicable-method (list gf '())))
- (else
- ;; Mutate arglist to fit no-applicable-method
- (set-cdr! args (list (cons (car args) (cdr args))))
- (set-car! args gf)
- (lookup-create-cmethod no-applicable-method args)))))
-
-(set-procedure-property! memoize-method! 'system-procedure #t)
-
-(define method-cache-install!
- (letrec ((first-n
- (lambda (ls n)
- (if (or (zero? n) (null? ls))
- '()
- (cons (car ls) (first-n (cdr ls) (- n 1)))))))
- (lambda (insert! exp args applicable)
- (let* ((specializers (method-specializers (car applicable)))
- (n-specializers
- (if (list? specializers)
- (length specializers)
- (+ 1 (slot-ref (method-cache-generic-function exp)
- 'n-specialized)))))
- (let* ((types (map class-of (first-n args n-specializers)))
- (entry+cmethod (compute-entry-with-cmethod applicable types)))
- (insert! exp (car entry+cmethod)) ; entry = types + cmethod
- (cdr entry+cmethod) ; cmethod
- )))))
diff --git a/oop/goops/internal.scm b/oop/goops/internal.scm
deleted file mode 100644
index aa315066b..000000000
--- a/oop/goops/internal.scm
+++ /dev/null
@@ -1,50 +0,0 @@
-;;; installed-scm-file
-
-;;;; Copyright (C) 1999, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-
-(define-module (oop goops internal)
- :use-module (oop goops))
-
-(set-module-uses! %module-public-interface
- (list (nested-ref the-root-module '(app modules oop goops))))
diff --git a/oop/goops/old-define-method.scm b/oop/goops/old-define-method.scm
deleted file mode 100644
index 13f05c284..000000000
--- a/oop/goops/old-define-method.scm
+++ /dev/null
@@ -1,85 +0,0 @@
-;;; installed-scm-file
-
-;;;; Copyright (C) 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-
-(define-module (oop goops old-define-method)
- :use-module (oop goops)
- :export (define-method)
- :no-backtrace
- )
-
-(define define-method
- (procedure->memoizing-macro
- (lambda (exp env)
- (let ((name (cadr exp)))
- (if (and (pair? name)
- (eq? (car name) 'setter)
- (pair? (cdr name))
- (symbol? (cadr name))
- (null? (cddr name)))
- (let ((name (cadr name)))
- (cond ((not (symbol? name))
- (goops-error "bad method name: ~S" name))
- ((defined? name env)
- `(begin
- ;; *fixme* Temporary hack for the current module system
- (if (not ,name)
- (define-accessor ,name))
- (add-method! (setter ,name) (method ,@(cddr exp)))))
- (else
- `(begin
- (define-accessor ,name)
- (add-method! (setter ,name) (method ,@(cddr exp)))))))
- (cond ((not (symbol? name))
- (goops-error "bad method name: ~S" name))
- ((defined? name env)
- `(begin
- ;; *fixme* Temporary hack for the current module system
- (if (not ,name)
- (define-generic ,name))
- (add-method! ,name (method ,@(cddr exp)))))
- (else
- `(begin
- (define-generic ,name)
- (add-method! ,name (method ,@(cddr exp)))))))))))
diff --git a/oop/goops/save.scm b/oop/goops/save.scm
deleted file mode 100644
index d3d9ed374..000000000
--- a/oop/goops/save.scm
+++ /dev/null
@@ -1,899 +0,0 @@
-;;; installed-scm-file
-
-;;;; Copyright (C) 2000,2001,2002 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-
-(define-module (oop goops save)
- :use-module (oop goops internal)
- :use-module (oop goops util)
- :re-export (make-unbound)
- :export (save-objects load-objects restore
- enumerate! enumerate-component!
- write-readably write-component write-component-procedure
- literal? readable make-readable))
-
-;;;
-;;; save-objects ALIST PORT [EXCLUDED] [USES]
-;;;
-;;; ALIST ::= ((NAME . OBJECT) ...)
-;;;
-;;; Save OBJECT ... to PORT so that when the data is read and evaluated
-;;; OBJECT ... are re-created under names NAME ... .
-;;; Exclude any references to objects in the list EXCLUDED.
-;;; Add a (use-modules . USES) line to the top of the saved text.
-;;;
-;;; In some instances, when `save-object' doesn't know how to produce
-;;; readable syntax for an object, you can explicitly register read
-;;; syntax for an object using the special form `readable'.
-;;;
-;;; Example:
-;;;
-;;; The function `foo' produces an object of obscure structure.
-;;; Only `foo' can construct such objects. Because of this, an
-;;; object such as
-;;;
-;;; (define x (vector 1 (foo)))
-;;;
-;;; cannot be saved by `save-objects'. But if you instead write
-;;;
-;;; (define x (vector 1 (readable (foo))))
-;;;
-;;; `save-objects' will happily produce the necessary read syntax.
-;;;
-;;; To add new read syntax, hang methods on `enumerate!' and
-;;; `write-readably'.
-;;;
-;;; enumerate! OBJECT ENV
-;;; Should call `enumerate-component!' (which takes same args) on
-;;; each component object. Should return #t if the composite object
-;;; can be written as a literal. (`enumerate-component!' returns #t
-;;; if the component is a literal.
-;;;
-;;; write-readably OBJECT PORT ENV
-;;; Should write a readable representation of OBJECT to PORT.
-;;; Should use `write-component' to print each component object.
-;;; Use `literal?' to decide if a component is a literal.
-;;;
-;;; Utilities:
-;;;
-;;; enumerate-component! OBJECT ENV
-;;;
-;;; write-component OBJECT PATCHER PORT ENV
-;;; PATCHER is an expression which, when evaluated, stores OBJECT
-;;; into its current location.
-;;;
-;;; Example:
-;;;
-;;; (write-component (car ls) `(set-car! ,ls ,(car ls)) file env)
-;;;
-;;; write-component is a macro.
-;;;
-;;; literal? COMPONENT ENV
-;;;
-
-(define-method (immediate? (o <top>)) #f)
-
-(define-method (immediate? (o <null>)) #t)
-(define-method (immediate? (o <number>)) #t)
-(define-method (immediate? (o <boolean>)) #t)
-(define-method (immediate? (o <symbol>)) #t)
-(define-method (immediate? (o <char>)) #t)
-(define-method (immediate? (o <keyword>)) #t)
-
-;;; enumerate! OBJECT ENVIRONMENT
-;;;
-;;; Return #t if object is a literal.
-;;;
-(define-method (enumerate! (o <top>) env) #t)
-
-(define-method (write-readably (o <top>) file env)
- ;;(goops-error "No read-syntax defined for object `~S'" o)
- (write o file) ;doesn't catch bugs, but is much more flexible
- )
-
-;;;
-;;; Readables
-;;;
-
-(if (or (not (defined? 'readables))
- (not readables))
- (define readables (make-weak-key-hash-table 61)))
-
-(define readable
- (procedure->memoizing-macro
- (lambda (exp env)
- `(make-readable ,(cadr exp) ',(copy-tree (cadr exp))))))
-
-(define (make-readable obj expr)
- (hashq-set! readables obj expr)
- obj)
-
-(define (readable-expression obj)
- `(readable ,(hashq-ref readables obj)))
-
-(define (readable? obj)
- (hashq-get-handle readables obj))
-
-;;;
-;;; Strings
-;;;
-
-(define-method (enumerate! (o <string>) env) #f)
-
-;;;
-;;; Vectors
-;;;
-
-(define-method (enumerate! (o <vector>) env)
- (or (not (vector? o))
- (let ((literal? #t))
- (array-for-each (lambda (o)
- (if (not (enumerate-component! o env))
- (set! literal? #f)))
- o)
- literal?)))
-
-(define-method (write-readably (o <vector>) file env)
- (if (not (vector? o))
- (write o file)
- (let ((n (vector-length o)))
- (if (zero? n)
- (display "#()" file)
- (let ((not-literal? (not (literal? o env))))
- (display (if not-literal?
- "(vector "
- "#(")
- file)
- (if (and not-literal?
- (literal? (vector-ref o 0) env))
- (display #\' file))
- (write-component (vector-ref o 0)
- `(vector-set! ,o 0 ,(vector-ref o 0))
- file
- env)
- (do ((i 1 (+ 1 i)))
- ((= i n))
- (display #\space file)
- (if (and not-literal?
- (literal? (vector-ref o i) env))
- (display #\' file))
- (write-component (vector-ref o i)
- `(vector-set! ,o ,i ,(vector-ref o i))
- file
- env))
- (display #\) file))))))
-
-
-;;;
-;;; Arrays
-;;;
-
-(define-method (enumerate! (o <array>) env)
- (enumerate-component! (shared-array-root o) env))
-
-(define (make-mapper array)
- (let* ((dims (array-dimensions array))
- (n (array-rank array))
- (indices (reverse (if (<= n 11)
- (list-tail '(t s r q p n m l k j i) (- 11 n))
- (let loop ((n n)
- (ls '()))
- (if (zero? n)
- ls
- (loop (- n 1)
- (cons (gensym "i") ls))))))))
- `(lambda ,indices
- (+ ,(shared-array-offset array)
- ,@(map (lambda (ind dim inc)
- `(* ,inc ,(if (pair? dim) `(- ,ind ,(car dim)) ind)))
- indices
- (array-dimensions array)
- (shared-array-increments array))))))
-
-(define (write-array prefix o not-literal? file env)
- (letrec ((inner (lambda (n indices)
- (if (not (zero? n))
- (let ((el (apply array-ref o
- (reverse (cons 0 indices)))))
- (if (and not-literal?
- (literal? el env))
- (display #\' file))
- (write-component
- el
- `(array-set! ,o ,el ,@indices)
- file
- env)))
- (do ((i 1 (+ 1 i)))
- ((= i n))
- (display #\space file)
- (let ((el (apply array-ref o
- (reverse (cons i indices)))))
- (if (and not-literal?
- (literal? el env))
- (display #\' file))
- (write-component
- el
- `(array-set! ,o ,el ,@indices)
- file
- env))))))
- (display prefix file)
- (let loop ((dims (array-dimensions o))
- (indices '()))
- (cond ((null? (cdr dims))
- (inner (car dims) indices))
- (else
- (let ((n (car dims)))
- (do ((i 0 (+ 1 i)))
- ((= i n))
- (if (> i 0)
- (display #\space file))
- (display prefix file)
- (loop (cdr dims) (cons i indices))
- (display #\) file))))))
- (display #\) file)))
-
-(define-method (write-readably (o <array>) file env)
- (let ((root (shared-array-root o)))
- (cond ((literal? o env)
- (if (not (vector? root))
- (write o file)
- (begin
- (display #\# file)
- (display (array-rank o) file)
- (write-array #\( o #f file env))))
- ((binding? root env)
- (display "(make-shared-array " file)
- (if (literal? root env)
- (display #\' file))
- (write-component root
- (goops-error "write-readably(<array>): internal error")
- file
- env)
- (display #\space file)
- (display (make-mapper o) file)
- (for-each (lambda (dim)
- (display #\space file)
- (display dim file))
- (array-dimensions o))
- (display #\) file))
- (else
- (display "(list->uniform-array " file)
- (display (array-rank o) file)
- (display " '() " file)
- (write-array "(list " o file env)))))
-
-;;;
-;;; Pairs
-;;;
-
-;;; These methods have more complex structure than is required for
-;;; most objects, since they take over some of the logic of
-;;; `write-component'.
-;;;
-
-(define-method (enumerate! (o <pair>) env)
- (let ((literal? (enumerate-component! (car o) env)))
- (and (enumerate-component! (cdr o) env)
- literal?)))
-
-(define-method (write-readably (o <pair>) file env)
- (let ((proper? (let loop ((ls o))
- (or (null? ls)
- (and (pair? ls)
- (not (binding? (cdr ls) env))
- (loop (cdr ls))))))
- (1? (or (not (pair? (cdr o)))
- (binding? (cdr o) env)))
- (not-literal? (not (literal? o env)))
- (infos '())
- (refs (ref-stack env)))
- (display (cond ((not not-literal?) #\()
- (proper? "(list ")
- (1? "(cons ")
- (else "(cons* "))
- file)
- (if (and not-literal?
- (literal? (car o) env))
- (display #\' file))
- (write-component (car o) `(set-car! ,o ,(car o)) file env)
- (do ((ls (cdr o) (cdr ls))
- (prev o ls))
- ((or (not (pair? ls))
- (binding? ls env))
- (if (not (null? ls))
- (begin
- (if (not not-literal?)
- (display " ." file))
- (display #\space file)
- (if (and not-literal?
- (literal? ls env))
- (display #\' file))
- (write-component ls `(set-cdr! ,prev ,ls) file env)))
- (display #\) file))
- (display #\space file)
- (set! infos (cons (object-info ls env) infos))
- (push-ref! ls env) ;*fixme* optimize
- (set! (visiting? (car infos)) #t)
- (if (and not-literal?
- (literal? (car ls) env))
- (display #\' file))
- (write-component (car ls) `(set-car! ,ls ,(car ls)) file env)
- )
- (for-each (lambda (info)
- (set! (visiting? info) #f))
- infos)
- (set! (ref-stack env) refs)
- ))
-
-;;;
-;;; Objects
-;;;
-
-;;; Doesn't yet handle unbound slots
-
-;; Don't export this function! This is all very temporary.
-;;
-(define (get-set-for-each proc class)
- (for-each (lambda (slotdef g-n-s)
- (let ((g-n-s (cddr g-n-s)))
- (cond ((integer? g-n-s)
- (proc (standard-get g-n-s) (standard-set g-n-s)))
- ((not (memq (slot-definition-allocation slotdef)
- '(#:class #:each-subclass)))
- (proc (car g-n-s) (cadr g-n-s))))))
- (class-slots class)
- (slot-ref class 'getters-n-setters)))
-
-(define (access-for-each proc class)
- (for-each (lambda (slotdef g-n-s)
- (let ((g-n-s (cddr g-n-s))
- (a (slot-definition-accessor slotdef)))
- (cond ((integer? g-n-s)
- (proc (slot-definition-name slotdef)
- (and a (generic-function-name a))
- (standard-get g-n-s)
- (standard-set g-n-s)))
- ((not (memq (slot-definition-allocation slotdef)
- '(#:class #:each-subclass)))
- (proc (slot-definition-name slotdef)
- (and a (generic-function-name a))
- (car g-n-s)
- (cadr g-n-s))))))
- (class-slots class)
- (slot-ref class 'getters-n-setters)))
-
-(define restore
- (procedure->memoizing-macro
- (lambda (exp env)
- "(restore CLASS (SLOT-NAME1 ...) EXP1 ...)"
- `(let ((o (,%allocate-instance ,(cadr exp) '())))
- (for-each (lambda (name val)
- (,slot-set! o name val))
- ',(caddr exp)
- (list ,@(cdddr exp)))
- o))))
-
-(define-method (enumerate! (o <object>) env)
- (get-set-for-each (lambda (get set)
- (let ((val (get o)))
- (if (not (unbound? val))
- (enumerate-component! val env))))
- (class-of o))
- #f)
-
-(define-method (write-readably (o <object>) file env)
- (let ((class (class-of o)))
- (display "(restore " file)
- (display (class-name class) file)
- (display " (" file)
- (let ((slotdefs
- (filter (lambda (slotdef)
- (not (or (memq (slot-definition-allocation slotdef)
- '(#:class #:each-subclass))
- (and (slot-bound? o (slot-definition-name slotdef))
- (excluded?
- (slot-ref o (slot-definition-name slotdef))
- env)))))
- (class-slots class))))
- (if (not (null? slotdefs))
- (begin
- (display (slot-definition-name (car slotdefs)) file)
- (for-each (lambda (slotdef)
- (display #\space file)
- (display (slot-definition-name slotdef) file))
- (cdr slotdefs)))))
- (display #\) file)
- (access-for-each (lambda (name aname get set)
- (display #\space file)
- (let ((val (get o)))
- (cond ((unbound? val)
- (display '(make-unbound) file))
- ((excluded? val env))
- (else
- (if (literal? val env)
- (display #\' file))
- (write-component val
- (if aname
- `(set! (,aname ,o) ,val)
- `(slot-set! ,o ',name ,val))
- file env)))))
- class)
- (display #\) file)))
-
-;;;
-;;; Classes
-;;;
-
-;;; Currently, we don't support reading in class objects
-;;;
-
-(define-method (enumerate! (o <class>) env) #f)
-
-(define-method (write-readably (o <class>) file env)
- (display (class-name o) file))
-
-;;;
-;;; Generics
-;;;
-
-;;; Currently, we don't support reading in generic functions
-;;;
-
-(define-method (enumerate! (o <generic>) env) #f)
-
-(define-method (write-readably (o <generic>) file env)
- (display (generic-function-name o) file))
-
-;;;
-;;; Method
-;;;
-
-;;; Currently, we don't support reading in methods
-;;;
-
-(define-method (enumerate! (o <method>) env) #f)
-
-(define-method (write-readably (o <method>) file env)
- (goops-error "No read-syntax for <method> defined"))
-
-;;;
-;;; Environments
-;;;
-
-(define-class <environment> ()
- (object-info #:accessor object-info
- #:init-form (make-hash-table 61))
- (excluded #:accessor excluded
- #:init-form (make-hash-table 61))
- (pass-2? #:accessor pass-2?
- #:init-value #f)
- (ref-stack #:accessor ref-stack
- #:init-value '())
- (objects #:accessor objects
- #:init-value '())
- (pre-defines #:accessor pre-defines
- #:init-value '())
- (locals #:accessor locals
- #:init-value '())
- (stand-ins #:accessor stand-ins
- #:init-value '())
- (post-defines #:accessor post-defines
- #:init-value '())
- (patchers #:accessor patchers
- #:init-value '())
- (multiple-bound #:accessor multiple-bound
- #:init-value '())
- )
-
-(define-method (initialize (env <environment>) initargs)
- (next-method)
- (cond ((get-keyword #:excluded initargs #f)
- => (lambda (excludees)
- (for-each (lambda (e)
- (hashq-create-handle! (excluded env) e #f))
- excludees)))))
-
-(define-method (object-info o env)
- (hashq-ref (object-info env) o))
-
-(define-method ((setter object-info) o env x)
- (hashq-set! (object-info env) o x))
-
-(define (excluded? o env)
- (hashq-get-handle (excluded env) o))
-
-(define (add-patcher! patcher env)
- (set! (patchers env) (cons patcher (patchers env))))
-
-(define (push-ref! o env)
- (set! (ref-stack env) (cons o (ref-stack env))))
-
-(define (pop-ref! env)
- (set! (ref-stack env) (cdr (ref-stack env))))
-
-(define (container env)
- (car (ref-stack env)))
-
-(define-class <object-info> ()
- (visiting #:accessor visiting
- #:init-value #f)
- (binding #:accessor binding
- #:init-value #f)
- (literal? #:accessor literal?
- #:init-value #f)
- )
-
-(define visiting? visiting)
-
-(define-method (binding (info <boolean>))
- #f)
-
-(define-method (binding o env)
- (binding (object-info o env)))
-
-(define binding? binding)
-
-(define-method (literal? (info <boolean>))
- #t)
-
-;;; Note that this method is intended to be used only during the
-;;; writing pass
-;;;
-(define-method (literal? o env)
- (or (immediate? o)
- (excluded? o env)
- (let ((info (object-info o env)))
- ;; write-component sets all bindings first to #:defining,
- ;; then to #:defined
- (and (or (not (binding? info))
- ;; we might be using `literal?' in a write-readably method
- ;; to query about the object being defined
- (and (eq? (visiting info) #:defining)
- (null? (cdr (ref-stack env)))))
- (literal? info)))))
-
-;;;
-;;; Enumeration
-;;;
-
-;;; Enumeration has two passes.
-;;;
-;;; Pass 1: Detect common substructure, circular references and order
-;;;
-;;; Pass 2: Detect literals
-
-(define (enumerate-component! o env)
- (cond ((immediate? o) #t)
- ((readable? o) #f)
- ((excluded? o env) #t)
- ((pass-2? env)
- (let ((info (object-info o env)))
- (if (binding? info)
- ;; if circular reference, we print as a literal
- ;; (note that during pass-2, circular references are
- ;; forward references, i.e. *not* yet marked with #:pass-2
- (not (eq? (visiting? info) #:pass-2))
- (and (enumerate! o env)
- (begin
- (set! (literal? info) #t)
- #t)))))
- ((object-info o env)
- => (lambda (info)
- (set! (binding info) #t)
- (if (visiting? info)
- ;; circular reference--mark container
- (set! (binding (object-info (container env) env)) #t))))
- (else
- (let ((info (make <object-info>)))
- (set! (object-info o env) info)
- (push-ref! o env)
- (set! (visiting? info) #t)
- (enumerate! o env)
- (set! (visiting? info) #f)
- (pop-ref! env)
- (set! (objects env) (cons o (objects env)))))))
-
-(define (write-component-procedure o file env)
- "Return #f if circular reference"
- (cond ((immediate? o) (write o file) #t)
- ((readable? o) (write (readable-expression o) file) #t)
- ((excluded? o env) (display #f file) #t)
- (else
- (let ((info (object-info o env)))
- (cond ((not (binding? info)) (write-readably o file env) #t)
- ((not (eq? (visiting info) #:defined)) #f) ;forward reference
- (else (display (binding info) file) #t))))))
-
-;;; write-component OBJECT PATCHER FILE ENV
-;;;
-(define write-component
- (procedure->memoizing-macro
- (lambda (exp env)
- `(or (write-component-procedure ,(cadr exp) ,@(cdddr exp))
- (begin
- (display #f ,(cadddr exp))
- (add-patcher! ,(caddr exp) env))))))
-
-;;;
-;;; Main engine
-;;;
-
-(define binding-name car)
-(define binding-object cdr)
-
-(define (pass-1! alist env)
- ;; Determine object order and necessary bindings
- (for-each (lambda (binding)
- (enumerate-component! (binding-object binding) env))
- alist))
-
-(define (make-local i)
- (string->symbol (string-append "%o" (number->string i))))
-
-(define (name-bindings! alist env)
- ;; Name top-level bindings
- (for-each (lambda (b)
- (let ((o (binding-object b)))
- (if (not (or (immediate? o)
- (readable? o)
- (excluded? o env)))
- (let ((info (object-info o env)))
- (if (symbol? (binding info))
- ;; already bound to a variable
- (set! (multiple-bound env)
- (acons (binding info)
- (binding-name b)
- (multiple-bound env)))
- (set! (binding info)
- (binding-name b)))))))
- alist)
- ;; Name rest of bindings and create stand-in and definition lists
- (let post-loop ((ls (objects env))
- (post-defs '()))
- (cond ((or (null? ls)
- (eq? (binding (car ls) env) #t))
- (set! (post-defines env) post-defs)
- (set! (objects env) ls))
- ((not (binding (car ls) env))
- (post-loop (cdr ls) post-defs))
- (else
- (post-loop (cdr ls) (cons (car ls) post-defs)))))
- (let pre-loop ((ls (reverse (objects env)))
- (i 0)
- (pre-defs '())
- (locs '())
- (sins '()))
- (if (null? ls)
- (begin
- (set! (pre-defines env) (reverse pre-defs))
- (set! (locals env) (reverse locs))
- (set! (stand-ins env) (reverse sins)))
- (let ((info (object-info (car ls) env)))
- (cond ((not (binding? info))
- (pre-loop (cdr ls) i pre-defs locs sins))
- ((boolean? (binding info))
- ;; local
- (set! (binding info) (make-local i))
- (pre-loop (cdr ls)
- (+ 1 i)
- pre-defs
- (cons (car ls) locs)
- sins))
- ((null? locs)
- (pre-loop (cdr ls)
- i
- (cons (car ls) pre-defs)
- locs
- sins))
- (else
- (let ((real-name (binding info)))
- (set! (binding info) (make-local i))
- (pre-loop (cdr ls)
- (+ 1 i)
- pre-defs
- (cons (car ls) locs)
- (acons (binding info) real-name sins)))))))))
-
-(define (pass-2! env)
- (set! (pass-2? env) #t)
- (for-each (lambda (o)
- (let ((info (object-info o env)))
- (set! (literal? info) (enumerate! o env))
- (set! (visiting info) #:pass-2)))
- (append (pre-defines env)
- (locals env)
- (post-defines env))))
-
-(define (write-define! name val literal? file)
- (display "(define " file)
- (display name file)
- (display #\space file)
- (if literal? (display #\' file))
- (write val file)
- (display ")\n" file))
-
-(define (write-empty-defines! file env)
- (for-each (lambda (stand-in)
- (write-define! (cdr stand-in) #f #f file))
- (stand-ins env))
- (for-each (lambda (o)
- (write-define! (binding o env) #f #f file))
- (post-defines env)))
-
-(define (write-definition! prefix o file env)
- (display prefix file)
- (let ((info (object-info o env)))
- (display (binding info) file)
- (display #\space file)
- (if (literal? info)
- (display #\' file))
- (push-ref! o env)
- (set! (visiting info) #:defining)
- (write-readably o file env)
- (set! (visiting info) #:defined)
- (pop-ref! env)
- (display #\) file)))
-
-(define (write-let*-head! file env)
- (display "(let* (" file)
- (write-definition! "(" (car (locals env)) file env)
- (for-each (lambda (o)
- (write-definition! "\n (" o file env))
- (cdr (locals env)))
- (display ")\n" file))
-
-(define (write-rebindings! prefix bindings file env)
- (for-each (lambda (patch)
- (display prefix file)
- (display (cdr patch) file)
- (display #\space file)
- (display (car patch) file)
- (display ")\n" file))
- bindings))
-
-(define (write-definitions! selector prefix file env)
- (for-each (lambda (o)
- (write-definition! prefix o file env)
- (newline file))
- (selector env)))
-
-(define (write-patches! prefix file env)
- (for-each (lambda (patch)
- (display prefix file)
- (display (let name-objects ((patcher patch))
- (cond ((binding patcher env)
- => (lambda (name)
- (cond ((assq name (stand-ins env))
- => cdr)
- (else name))))
- ((pair? patcher)
- (cons (name-objects (car patcher))
- (name-objects (cdr patcher))))
- (else patcher)))
- file)
- (newline file))
- (reverse (patchers env))))
-
-(define (write-immediates! alist file)
- (for-each (lambda (b)
- (if (immediate? (binding-object b))
- (write-define! (binding-name b)
- (binding-object b)
- #t
- file)))
- alist))
-
-(define (write-readables! alist file env)
- (let ((written '()))
- (for-each (lambda (b)
- (cond ((not (readable? (binding-object b))))
- ((assq (binding-object b) written)
- => (lambda (p)
- (set! (multiple-bound env)
- (acons (cdr p)
- (binding-name b)
- (multiple-bound env)))))
- (else
- (write-define! (binding-name b)
- (readable-expression (binding-object b))
- #f
- file)
- (set! written (acons (binding-object b)
- (binding-name b)
- written)))))
- alist)))
-
-(define-method (save-objects (alist <pair>) (file <string>) . rest)
- (let ((port (open-output-file file)))
- (apply save-objects alist port rest)
- (close-port port)
- *unspecified*))
-
-(define-method (save-objects (alist <pair>) (file <output-port>) . rest)
- (let ((excluded (if (>= (length rest) 1) (car rest) '()))
- (uses (if (>= (length rest) 2) (cadr rest) '())))
- (let ((env (make <environment> #:excluded excluded)))
- (pass-1! alist env)
- (name-bindings! alist env)
- (pass-2! env)
- (if (not (null? uses))
- (begin
- (write `(use-modules ,@uses) file)
- (newline file)))
- (write-immediates! alist file)
- (if (null? (locals env))
- (begin
- (write-definitions! post-defines "(define " file env)
- (write-patches! "" file env))
- (begin
- (write-definitions! pre-defines "(define " file env)
- (write-empty-defines! file env)
- (write-let*-head! file env)
- (write-rebindings! " (set! " (stand-ins env) file env)
- (write-definitions! post-defines " (set! " file env)
- (write-patches! " " file env)
- (display " )\n" file)))
- (write-readables! alist file env)
- (write-rebindings! "(define " (reverse (multiple-bound env)) file env))))
-
-(define-method (load-objects (file <string>))
- (let* ((port (open-input-file file))
- (objects (load-objects port)))
- (close-port port)
- objects))
-
-(define-method (load-objects (file <input-port>))
- (let ((m (make-module)))
- (module-use! m the-scm-module)
- (module-use! m %module-public-interface)
- (save-module-excursion
- (lambda ()
- (set-current-module m)
- (let loop ((sexp (read file)))
- (if (not (eof-object? sexp))
- (begin
- (eval sexp m)
- (loop (read file)))))))
- (module-map (lambda (name var)
- (cons name (variable-ref var)))
- m)))
diff --git a/oop/goops/stklos.scm b/oop/goops/stklos.scm
deleted file mode 100644
index 10e0eba3b..000000000
--- a/oop/goops/stklos.scm
+++ /dev/null
@@ -1,122 +0,0 @@
-;;;; Copyright (C) 1999,2002 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-
-(define-module (oop goops stklos)
- :use-module (oop goops internal)
- :no-backtrace
- )
-
-;;;
-;;; This is the stklos compatibility module.
-;;;
-;;; WARNING: This module is under construction. While we expect to be able
-;;; to run most stklos code without problems in the future, this is not the
-;;; case now. The current compatibility is only superficial.
-;;;
-;;; Any comments/complaints/patches are welcome. Tell us about
-;;; your incompatibility problems (bug-guile@gnu.org).
-;;;
-
-;; Export all bindings that are exported from (oop goops)...
-(module-for-each (lambda (sym var)
- (module-add! %module-public-interface sym var))
- (nested-ref the-root-module '(app modules oop goops
- %module-public-interface)))
-
-;; ...but replace the following bindings:
-(export define-class define-method)
-
-;; Also export the following
-(export write-object)
-
-;;; Enable keyword support (*fixme*---currently this has global effect)
-(read-set! keywords 'prefix)
-
-(define standard-define-class-transformer
- (macro-transformer standard-define-class))
-
-(define define-class
- ;; Syntax
- (let ((name cadr)
- (supers caddr)
- (slots cadddr)
- (rest cddddr))
- (procedure->memoizing-macro
- (lambda (exp env)
- (standard-define-class-transformer
- `(define-class ,(name exp) ,(supers exp) ,@(slots exp)
- ,@(rest exp))
- env)))))
-
-(define define-method
- (procedure->memoizing-macro
- (lambda (exp env)
- (let ((name (cadr exp)))
- (if (and (pair? name)
- (eq? (car name) 'setter)
- (pair? (cdr name))
- (null? (cddr name)))
- (let ((name (cadr name)))
- (cond ((not (symbol? name))
- (goops-error "bad method name: ~S" name))
- ((defined? name env)
- `(begin
- (if (not (is-a? ,name <generic-with-setter>))
- (define-accessor ,name))
- (add-method! (setter ,name) (method ,@(cddr exp)))))
- (else
- `(begin
- (define-accessor ,name)
- (add-method! (setter ,name) (method ,@(cddr exp)))))))
- (cond ((not (symbol? name))
- (goops-error "bad method name: ~S" name))
- ((defined? name env)
- `(begin
- (if (not (or (is-a? ,name <generic>)
- (is-a? ,name <primitive-generic>)))
- (define-generic ,name))
- (add-method! ,name (method ,@(cddr exp)))))
- (else
- `(begin
- (define-generic ,name)
- (add-method! ,name (method ,@(cddr exp)))))))))))
diff --git a/oop/goops/util.scm b/oop/goops/util.scm
deleted file mode 100644
index 9e6a3c927..000000000
--- a/oop/goops/util.scm
+++ /dev/null
@@ -1,136 +0,0 @@
-;;;; Copyright (C) 1999, 2000, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-;;;;
-
-
-(define-module (oop goops util)
- :export (any every filter
- mapappend find-duplicate top-level-env top-level-env?
- map* for-each* length* improper->proper)
- :no-backtrace
- )
-
-
-;;;
-;;; {Utilities}
-;;;
-
-(define (any pred lst . rest)
- (if (null? rest) ;fast path
- (and (not (null? lst))
- (let loop ((head (car lst)) (tail (cdr lst)))
- (if (null? tail)
- (pred head)
- (or (pred head)
- (loop (car tail) (cdr tail))))))
- (let ((lsts (cons lst rest)))
- (and (not (any null? lsts))
- (let loop ((heads (map car lsts)) (tails (map cdr lsts)))
- (if (any null? tails)
- (apply pred heads)
- (or (apply pred heads)
- (loop (map car tails) (map cdr tails)))))))))
-
-(define (every pred lst . rest)
- (if (null? rest) ;fast path
- (or (null? lst)
- (let loop ((head (car lst)) (tail (cdr lst)))
- (if (null? tail)
- (pred head)
- (and (pred head)
- (loop (car tail) (cdr tail))))))
- (let ((lsts (cons lst rest)))
- (or (any null? lsts)
- (let loop ((heads (map car lsts)) (tails (map cdr lsts)))
- (if (any null? tails)
- (apply pred heads)
- (and (apply pred heads)
- (loop (map car tails) (map cdr tails)))))))))
-
-(define (filter test? list)
- (cond ((null? list) '())
- ((test? (car list)) (cons (car list) (filter test? (cdr list))))
- (else (filter test? (cdr list)))))
-
-(define (mapappend func . args)
- (if (memv '() args)
- '()
- (append (apply func (map car args))
- (apply mapappend func (map cdr args)))))
-
-(define (find-duplicate l) ; find a duplicate in a list; #f otherwise
- (cond
- ((null? l) #f)
- ((memv (car l) (cdr l)) (car l))
- (else (find-duplicate (cdr l)))))
-
-(define (top-level-env)
- (let ((mod (current-module)))
- (if mod
- (module-eval-closure mod)
- '())))
-
-(define (top-level-env? env)
- (or (null? env)
- (procedure? (car env))))
-
-(define (map* fn . l) ; A map which accepts dotted lists (arg lists
- (cond ; must be "isomorph"
- ((null? (car l)) '())
- ((pair? (car l)) (cons (apply fn (map car l))
- (apply map* fn (map cdr l))))
- (else (apply fn l))))
-
-(define (for-each* fn . l) ; A for-each which accepts dotted lists (arg lists
- (cond ; must be "isomorph"
- ((null? (car l)) '())
- ((pair? (car l)) (apply fn (map car l)) (apply for-each* fn (map cdr l)))
- (else (apply fn l))))
-
-(define (length* ls)
- (do ((n 0 (+ 1 n))
- (ls ls (cdr ls)))
- ((not (pair? ls)) n)))
-
-(define (improper->proper ls)
- (if (pair? ls)
- (cons (car ls) (improper->proper (cdr ls)))
- (list ls)))
diff --git a/pre-inst-guile.in b/pre-inst-guile.in
deleted file mode 100644
index 206eab174..000000000
--- a/pre-inst-guile.in
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/sh
-
-# Copyright (C) 2002 Free Software Foundation
-#
-# This file is part of GUILE.
-#
-# GUILE 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.
-#
-# GUILE 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 GUILE; see the file COPYING. If not, write
-# to the Free Software Foundation, Inc., 59 Temple Place, Suite
-# 330, Boston, MA 02111-1307 USA
-
-# Commentary:
-
-# Usage: pre-inst-guile [ARGS]
-#
-# This script arranges for the environment to support, and eventaully execs,
-# the uninstalled binary guile executable located somewhere under libguile/,
-# passing ARGS to it. In the process, env var GUILE is clobbered, and the
-# following env vars are modified (but not clobbered):
-# GUILE_LOAD_PATH
-# LTDL_LIBRARY_PATH
-#
-# This script can be used as a drop-in replacement for $bindir/guile;
-# if there is a discrepency in behavior, that's a bug.
-
-# Code:
-
-# config
-subdirs_with_ltlibs="srfi guile-readline" # maintain me
-
-# env (set by configure)
-top_srcdir="@top_srcdir_absolute@"
-top_builddir="@top_builddir_absolute@"
-
-[ x"$top_srcdir" = x -o ! -d "$top_srcdir" -o \
- x"$top_builddir" = x -o ! -d "$top_builddir" ] && {
- echo $0: bad environment
- echo top_srcdir=$top_srcdir
- echo top_builddir=$top_builddir
- exit 1
-}
-
-# handle GUILE_LOAD_PATH (no clobber)
-if [ x"$GUILE_LOAD_PATH" = x ] ; then
- GUILE_LOAD_PATH="${top_srcdir}"
-else
- # This hair prevents double inclusion.
- # The ":" prevents prefix aliasing.
- case x"$GUILE_LOAD_PATH" in x*${top_srcdir}:*) ;;
- *) GUILE_LOAD_PATH="${top_srcdir}:$GUILE_LOAD_PATH" ;;
- esac
-fi
-export GUILE_LOAD_PATH
-
-# handle LTDL_LIBRARY_PATH (no clobber)
-ltdl_prefix=""
-for dir in $subdirs_with_ltlibs ; do
- ltdl_prefix="${top_builddir}/${dir}:${ltdl_prefix}"
-done
-LTDL_LIBRARY_PATH="${ltdl_prefix}$LTDL_LIBRARY_PATH"
-export LTDL_LIBRARY_PATH
-
-# set GUILE (clobber)
-GUILE=${top_builddir}/libguile/guile
-export GUILE
-
-# do it
-exec $GUILE "$@"
-
-# never reached
-exit 1
-
-# pre-inst-guile ends here
diff --git a/qt/.cvsignore b/qt/.cvsignore
deleted file mode 100644
index c13e24c74..000000000
--- a/qt/.cvsignore
+++ /dev/null
@@ -1,9 +0,0 @@
-*.la
-*.lo
-.deps
-.libs
-Makefile
-Makefile.in
-config.log
-config.status
-qt.h
diff --git a/qt/CHANGES b/qt/CHANGES
deleted file mode 100644
index 1b74921ee..000000000
--- a/qt/CHANGES
+++ /dev/null
@@ -1,15 +0,0 @@
-QuickThreads 002: Changes since QuickThreads 001.
-
- - Now can be used by C++ programs.
- - Now *really* works with stacks that grow up.
- - Supports AXP OSF 2.x cc's varargs.
- - Supports HP Precision (HP-PA) on workstations and Convex.
- - Supports assemblers for Intel iX86 ith only '//'-style comments.
- - Supports Silicon Graphics Irix 5.x with dynamic linking.
- - Supports System V and Solaris 2.x with no `_' on compiler-generated
- identifiers; *some* platforms only.
-
-Note: not all "./config" arguments are compatible with QT 001.
-
-
-QuickThreads 001: Base version.
diff --git a/qt/ChangeLog b/qt/ChangeLog
deleted file mode 100644
index bc8f36856..000000000
--- a/qt/ChangeLog
+++ /dev/null
@@ -1,273 +0,0 @@
-2002-07-17 Marius Vollmer <mvo@zagadka.ping.de>
-
- * arm.s, arm.h: New.
-
-2002-02-24 Rob Browning <rlb@defaultvalue.org>
-
- * Makefile.am (libqthreads_la_LDFLAGS): use @LIBQTHREADS_INTERFACE@.
-
-2001-11-21 Gary Houston <ghouston@arglist.com>
-
- * Makefile.am (OMIT_DEPENDENCIES): removed, since it seems to be
- obsolete. autogen.sh says:
- invalid unused variable name: `OMIT_DEPENDENCIES'
-
-2001-11-04 Stefan Jahn <stefan@lkcc.org>
-
- * md/Makefile.am (EXTRA_DIST): Added `i386.asm'.
-
- * md/i386.asm: New file. Contains the Intel syntax version for
- nasm/tasm/masm of the file `i386.s'.
-
- * qt.h.in: Definition of QT_API, QT_IMPORT and QT_EXPORT.
- Prefixed each symbols which is meant to go into a DLL.
-
- * Makefile.am (libqthreads_la_LDFLAGS): Put `-no-undefined'
- into LDFLAGS to support linkers which do not allow unresolved
- symbols inside shared libraries.
- (EXTRA_DIST): Add `libqthreads.def', which is an export file
- definition for M$-Windows. It defines exported symbols. This is
- necessary because the M$VC linker does not know how to export
- assembler symbols into a DLL.
-
-2001-08-25 Marius Vollmer <mvo@zagadka.ping.de>
-
- * Makefile.am, md/Makefile.am, time/Makefile.am:
- (AUTOMAKE_OPTIONS): Change "foreign" to "gnu".
-
-2001-08-15 Rob Browning <rlb@defaultvalue.org>
-
- * Makefile.am (libqthreads_la_LDFLAGS): use libtool interface version
- variables.
-
-2000-06-12 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * Makefile.am (OMIT_DEPENDENCIES): Defined to contain the list of
- machine specific headers. This is necessary, otherwise automake
- will include a dependency specific for the machine on which the
- distribution archive was built.
-
-2000-04-21 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * *.*: Change includes so that they always use the "prefixes"
- libguile/, qt/, guile-readline/, or libltdl/.
-
- * Makefile.am (DEFS): Added. automake adds -I options to DEFS,
- and we don't want that.
- (INCLUDES): Removed all -I options except for the root source
- directory and the root build directory.
-
-1999-10-05 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * Makefile.in, md/Makefile.in, time/Makefile.in: Deleted from CVS
- repository. Run the autogen.sh script to create generated files
- like this one.
-
-1999-09-11 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * time/Makefile.in: Regenerated.
- * md/Makefile.in: Regenerated.
- * Makefile.in: Regenerated.
-
-1999-04-17 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * Makefile.in, time/Makefile.in: Regenerated.
-
-1998-10-16 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * md/i386.s: Remove nested comment starter, to quiet warnings.
-
- * Makefile.am (.s.lo): Supply our own rule here, which passes
- qthread_asflags through. See today's change to ../qthreads.m4.
- * Makefile.in, qt/Makefile.in, time/Makefile.in: Regenerated.
-
-1998-10-03 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * Makefile.in: Regenerated with a patched automake, to get
- dependency generation right when using EGCS.
-
-1998-09-29 Jim Blandy <jimb@totoro.red-bean.com>
-
- * stp.h (stp_create): Doc fix.
-
-1998-07-30 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * qt.h.in (qt_null, qt_error): Add prototypes for these.
-
-1998-07-29 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * Makefile.in, md/Makefile.in, time/Makefile.in: Regenerated using
- the last public version of automake, not the hacked Cygnus
- version.
-
-1998-07-28 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * time/Makefile.in, md/Makefile.in, Makefile.in: Regenerated,
- after removing Totoro kludge.
-
-1998-07-26 Jim Blandy <jimb@zwingli.cygnus.com>
-
- Use libtool, and the thread configuration mechanism.
- * Makefile.am (lib_LTLIBRARIES, EXTRA_LTLIBRARIES,
- libqthreads_la_SOURCES, libqthreads_la_LIBADD): These replace
- lib_LIBRARIES, EXTRA_LIBRARIES, libqthreads_a_SOURCES,
- libqthreads_a_LIBADD. Use the variables set by the new config
- system.
- (libqthreads_la_DEPENDENCIES): New var.
- (libqthreads_la_LDFLAGS): Add -rpath; automake claims it can't set
- it itself, but I don't completely understand why.
- (qtmds.o, qtmdc.o): Rules removed. Use implicit build rules.
- (qtmds.s, qtmdc.c, qtdmdb.s): Rules added, to make symlinks to the
- appropriate files in the source tree.
- * Makefile.in, md/Makefile.in, time/Makefile.in: Regenerated.
-
-1998-04-15 Mikael Djurfeldt <mdj@nada.kth.se>
-
- * qt.h.in: Declare return type of qt_abort as void.
-
-1997-12-02 Tim Pierce <twp@skepsis.com>
-
- * md/axp.s (qt_vstart): Typo fixes, thanks to Alexander Jolk.
-
-Sat Oct 25 02:54:11 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- * Makefile.am: Call the library libqthreads.a, not libqt.a. The
- old name conflicts with the Qt user interface toolkit.
- * Makefile.in: Regenerated.
-
-Mon Sep 29 23:54:28 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- * time/Makefile.in: Regenerated with automake 1.2c.
-
- * md/Makefile.in: Regenerated with automake 1.2c.
-
- * Makefile.in: Regenerated with automake 1.2c.
-
-Sat Sep 27 23:14:13 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- * Makefile.in, md/Makefile.in, time/Makefile.in: Regenerated with
- automake 1.2a.
-
-Thu Aug 28 23:49:19 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- * Makefile.in, md/Makefile.in, time/Makefile.in: Regenerated.
-
-Wed Aug 27 17:43:38 1997 Jim Blandy <jimb@totoro.red-bean.com>
-
- * Makefile.in, md/Makefile.in, time/Makefile.in: Regenerated, so
- it uses "tar", not "gtar".
-
- * config: Use the QuickThreads assembler fragment with Irix
- dynamic linking support for Irix 6 as well as Irix 5. Thanks to
- Jesse Glick.
-
-Wed Jul 23 20:32:42 1997 Mikael Djurfeldt <djurf@zafir.e.kth.se>
-
- * md/axp.s, md/axp_b.s: Changed comments from C-style to # to
- please the alpha assembler.
-
-Sun Jun 22 18:44:11 1997 Jim Blandy <jimb@floss.red-bean.com>
-
- * Makefile.in, md/Makefile.in, time/Makefile.in: Regenerated after
- timestamp change; see ../ChangeLog.
-
-Wed Jun 11 00:33:10 1997 Jim Blandy <jimb@floss.red-bean.com>
-
- * Makefile.in, md/Makefile.in, time/Makefile.in: Regenerated after
- xtra_PLUGIN_guile_libs change in ../configure.in.
-
-Tue May 13 16:40:06 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- * Makefile.in: Regenerated, using automake-1.1p.
-
-Sun Apr 27 18:00:06 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- * aclocal.m4: Removed; unnecessary, given changes of Apr 24.
-
-Thu Apr 24 01:37:49 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- Get 'make dist' to work again.
- * Makefile.am (EXTRA_DIST): Remove PLUGIN files.
- * Makefile.in: Regenerated, like the secret sachets of seven
- sultry sailors.
-
- Changes for reduced Guile distribution: one configure script,
- no plugins.
- * configure.in, configure: Removed.
- * Makefile.in, md/Makefile.in, time/Makefile.in: Regenerated.
-
-Tue Apr 15 17:46:54 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- * PLUGIN/OPT: Don't mention "threads", because that causes
- "threads" to appear in the list of directories to be configured.
- Just say enough to get qt to appear in the list. I don't think qt
- needs to be built before or after anything else in particular...
-
-Mon Feb 24 21:47:16 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * configure.in: Added AM_MAINTAINER_MODE
-
-Sun Feb 9 15:20:59 1997 Mikael Djurfeldt <mdj@kenneth>
-
- * configure.in: Added changequote(,) before the host case (since
- we use [ and ] in a pattern).
- * configure: Regenerated.
-
-Fri Feb 7 18:00:07 1997 Jim Blandy <jimb@floss.cyclic.com>
-
- * configure.in: Recognize i686 as an okay processor too.
- * configure: Regenerated.
-
-Mon Dec 9 17:55:59 1996 Jim Blandy <jimb@duality.gnu.ai.mit.edu>
-
- We need to name the object files produced from the
- machine-dependent C and assembler files qtmds.o and qtmdc.o, but
- using -c and -o together on the cc command line isn't portable.
- * configure.in: Generate the names of the .o files here, and
- substitute them into Makefile.
- * Makefile.am (qtmds.o, qtmdc.o): Let CC name them what it wants,
- and then rename them when it's done.
- (configure, Makefile.in): Regenerated.
-
-Sat Nov 30 23:59:06 1996 Tom Tromey <tromey@cygnus.com>
-
- * PLUGIN/greet: Removed.
- * Makefile.am, md/Makefile.am, time/Makefile.am, aclocal.m4: New
- files.
- * configure.in: Updated for Automake.
-
-Sun Nov 10 17:40:47 1996 Jim Blandy <jimb@floss.cyclic.com>
-
- * configure.in, Makefile.in: The 'install' and 'uninstall'
- Makefile targets should be affected by whether or not we have a
- port to the current target architecture too, not just the 'all'
- target.
-
-Wed Oct 9 19:40:13 1996 Jim Blandy <jimb@floss.cyclic.com>
-
- * configure.in: If we don't have a port to the current machine,
- just arrange for 'make all' to do nothing. Don't abort
- configuration. We need a fully configured directory tree in order
- to make distributions and the like.
-
- * Makefile.in (distfiles): Update for the new directory structure.
- (plugin_distfiles, md_distfiles, time_distfiles): New variables.
- (dist-dir): New target; use all the above to build a subtree of a
- distribution.
- (manifest): Target deleted.
-
-Tue Oct 1 02:06:19 1996 Mikael Djurfeldt <mdj@woody.nada.kth.se>
-
- * configure.in: Solaris 2 should use sparc.s.
- *Older* systems use _sparc.s
-
-Fri Mar 29 11:50:20 1996 Anthony Green <green@snuffle.cygnus.com>
-
- * configure: Rebuilt
- * Makefile.in, configure.in: Fixed installation.
-
-Fri Mar 22 16:20:27 1996 Anthony Green (green@gerbil.cygnus.com)
-
- * all files: installed qt-002 package. Autoconfiscated.
-
-
diff --git a/qt/INSTALL b/qt/INSTALL
deleted file mode 100644
index 5b20f5d5e..000000000
--- a/qt/INSTALL
+++ /dev/null
@@ -1,81 +0,0 @@
-Installation of the `QuickThreads' threads-building toolkit.
-
-* Notice
-
-QuickThreads -- Threads-building toolkit.
-Copyright (c) 1993 by David Keppel
-
-Permission to use, copy, modify and distribute this software and
-its documentation for any purpose and without fee is hereby
-granted, provided that the above copyright notice and this notice
-appear in all copies. This software is provided as a
-proof-of-concept and for demonstration purposes; there is no
-representation about the suitability of this software for any
-purpose.
-
-
-* Configuration
-
-Configure with
-
- ./config *machtype*
-
-where "*machtype*" is one of the supported target machines. As of
-October 1994, the supported machines (targets) are:
-
- axp -- All Digital Equipment Corporation AXP (DEC Alpha)
- processors, compile with GNU CC
- axp-osf1 -- AXP running OSF 1.x
- axp-osf2 -- AXP running OSF 2.x
- hppa -- HP's PA-RISC 1.1 processor
- hppa-cnx-spp -- Convex SPP (PA-RISC 1.1 processor)
- iX86 -- 80386, 80486, and 80586-compatible processors
- See notes below for OS/2.
- iX86-ss -- 'iX86 for assemblers that use slash-slash ('//')
- comments.
- ksr1 -- All KSR processors
- m88k -- All members of the Motorola 88000 family
- mips -- MIPS R2000 and R3000 processors
- mips-irix5 -- Irix 5.xx (use `mips' for Irix 4.xx)
- sparc-os1 -- V8-compliant SPARC processors using compilers
- that prefix labels (e.g. "foo" appears as "_foo")
- Includes Solaris 1 (SunOS 4.X).
- sparc-os2 -- V8-compliant SPARC processors using compilers
- that do not prefix labels. Includes Solaris 2.
- vax -- All VAX processors
-
-In addition, the target `clean' will deconfigure QuickThreads.
-
-Note that a given machine target may not work on all instances of that
-machine because e.g., the assembler syntax varies from machine to
-machine.
-
-Note also that additions to a processor family may require a new
-target. So, for example, the `vax' target might not work for all
-future VAX processors if, say, new VAX processors are introduced and
-they use separate floating-point registers.
-
-For OS/2, change `ranlib' to `ar -s', `configure' to `configure.cmd'
-(or was that `config' to `config.cmd'?), and replace the soft links
-(`ln -s') with plain copies.
-
-
-* Build
-
-To build the QuickThreads library, first configure (see above) then
-type `make libqt.a' in the top-level directory.
-
-To build the demonstration threads package, SimpleThreads, type
-`make libstp.a' in the top-level directory.
-
-To build an executable ``stress-test'' and measurement program, type
-`make run' in the top-level directory. Run `time/raw' to run the
-stress tests.
-
-
-* Installation
-
-Build the QuickThreads library (see above) and then copy `libqt.a' to
-the installation library directory (e.g., /usr/local/lib) and `qt.h'
-and `qtmd.h' to the installation include directory (e.g.,
-/usr/local/include).
diff --git a/qt/Makefile.am b/qt/Makefile.am
deleted file mode 100644
index b525cc1fe..000000000
--- a/qt/Makefile.am
+++ /dev/null
@@ -1,54 +0,0 @@
-## Process this file with automake to produce Makefile.in.
-##
-## Copyright (C) 1998, 2000 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-AUTOMAKE_OPTIONS = gnu
-
-## subdirs are for making distributions only.
-SUBDIRS = md time
-
-lib_LTLIBRARIES = @QTHREAD_LTLIBS@
-EXTRA_LTLIBRARIES = libqthreads.la
-
-## Prevent automake from adding extra -I options
-DEFS = @DEFS@
-INCLUDES = -I.. -I$(srcdir)/..
-
-libqthreads_la_SOURCES = qt.c copyright.h
-libqthreads_la_LIBADD = qtmds.lo qtmdc.lo
-libqthreads_la_DEPENDENCIES = qtmds.lo qtmdc.lo
-libqthreads_la_LDFLAGS = -rpath $(libdir) -export-dynamic -no-undefined \
- -version-info @LIBQTHREADS_INTERFACE@
-
-# Seems to be obsolete - autogen.sh is giving:
-# invalid unused variable name: `OMIT_DEPENDENCIES'
-#OMIT_DEPENDENCIES = axp.h hppa.h i386.h ksr.h m88k.h mips.h sparc.h vax.h
-
-.s.lo:
- $(LIBTOOL) --mode=compile $(COMPILE) $(qthread_asflags) -c $<
-qtmds.s:
- ${LN_S} ${srcdir}/${qtmds_s} qtmds.s
-qtmdc.c:
- ${LN_S} ${srcdir}/${qtmdc_c} qtmdc.c
-qtdmdb.s:
- ${LN_S} ${srcdir}/${qtdmdb_s} qtdmdb.s
-
-EXTRA_DIST = CHANGES README.MISC README.PORT b.h meas.c stp.c stp.h \
- Makefile.base config libqthreads.def
diff --git a/qt/Makefile.base b/qt/Makefile.base
deleted file mode 100644
index 73a082f50..000000000
--- a/qt/Makefile.base
+++ /dev/null
@@ -1,112 +0,0 @@
-.SUFFIXES: .c .o .s .E
-
-#
-# Need to include from the current directory because "qt.h"
-# will include <qtmd.h>.
-#
-CFLAGS = -I. -g
-
-#
-# Fix this to be something meaningful for your system.
-#
-DEST = /dev/null
-
-DOC = users.tout
-
-EXTHDRS = /usr/include/stdio.h
-
-HDRS = qt.h \
- qtmd.h \
- stp.h
-
-LDFLAGS = $(CFLAGS)
-
-EXTLIBS =
-
-LIBS = libstp.a libqt.a
-
-LINKER = $(CC)
-
-MAKEFILE = Makefile
-
-M = Makefile configuration
-
-OBJS = qtmdb.o \
- meas.o
-
-QTOBJS = qt.o qtmds.o qtmdc.o
-
-STPOBJS = stp.o
-
-PR = -Pps
-
-PRINT = pr
-
-PROGRAM = run
-
-SRCS = meas.c \
- qt.c \
- qtmdc.c \
- qtmds.s \
- qtmdb.s
-
-TMP_INIT = tmp.init
-TMP_SWAP = tmp.swap
-
-.DEFAULT:
- co -q $@
-
-.c.E: force
- $(CC) $(CFLAGS) -E $*.c > $*.E
-
-all: libqt.a libstp.a $(PROGRAM) $(M)
-
-libqt.a: $(QTOBJS) $(M)
- ar crv libqt.a $(QTOBJS)
- ranlib libqt.a
-
-libstp.a: $(STPOBJS) $(M)
- ar crv libstp.a $(STPOBJS)
- ranlib libstp.a
-
-$(PROGRAM): $(OBJS) $(LIBS) $(M)
- @echo "Loading $(PROGRAM) ... "
-# ld -o $(PROGRAM) /lib/crt0.o $(OBJS) -lc
- $(LINKER) $(LDFLAGS) $(OBJS) $(LIBS) $(EXTLIBS) -o $(PROGRAM)
- @echo "done"
-
-clean:
- rm -f $(OBJS) $(PROGRAM) $(TMP_INIT) $(TMP_SWAP) $(DOC)
- rm -f libqt.a libstp.a
- rm -f $(QTOBJS) $(STPOBJS)
-
-depend:; @mkmf -f $(MAKEFILE) PROGRAM=$(PROGRAM) DEST=$(DEST)
-
-doc: users.ms raw
- time/assim < raw | grep "^init" | sed 's/^init //' > $(TMP_INIT)
- time/assim < raw | grep "^swap" | sed 's/^swap //' > $(TMP_SWAP)
- soelim users.ms | tbl $(PR) | troff -t $(PR) -ms > $(DOC)
-
-index:; @ctags -wx $(HDRS) $(SRCS)
-
-print:; @$(PRINT) $(HDRS) $(SRCS)
-
-program: $(PROGRAM)
-
-tags: $(HDRS) $(SRCS); @ctags $(HDRS) $(SRCS)
-
-update: $(DEST)/$(PROGRAM)
-
-$(DEST)/$(PROGRAM): $(SRCS) $(LIBS) $(HDRS) $(EXTHDRS)
- @make -f $(MAKEFILE) DEST=$(DEST) install
-
-QT_H = qt.h $(QTMD_H)
-QTMD_H = qtmd.h
-
-###
-qtmdb.o: $(M) qtmdb.s b.h
-meas.o: $(M) meas.c /usr/include/stdio.h $(QT_H) b.h stp.h
-qt.o: $(M) qt.c $(QT_H)
-stp.o: $(M) stp.c stp.h $(QT_H)
-qtmds.o: $(M) qtmds.s
-qtmdc.o: $(M) qtmdc.c $(QT_H)
diff --git a/qt/README b/qt/README
deleted file mode 100644
index b014b91bf..000000000
--- a/qt/README
+++ /dev/null
@@ -1,89 +0,0 @@
-This is a source code distribution for QuickThreads. QuickThreads is a
-toolkit for building threads packages; it is described in detail in the
-University of Washington CS&E Technical report #93-05-06, available via
-anonymous ftp from `ftp.cs.washington.edu' (128.95.1.4, as of Oct. '94)
-in `tr/1993/05/UW-CSE-93-05-06.PS.Z'.
-
-This distribution shows basic ideas in QuickThreads and elaborates with
-example implementations for a gaggle of machines. As of October those
-machines included:
-
- 80386 faimly
- 88000 faimily
- DEC AXP (Alpha) family
- HP-PA family
- KSR
- MIPS family
- SPARC V8 family
- VAX family
-
-Configuration, build, and installation are described in INSTALL.
-
-Be aware: that there is no varargs code for the KSR.
-
-The HP-PA port was designed to work with both HP workstations
-and Convex SPP computers. It was generously provided by Uwe Reder
-<uereder@cip.informatik.uni-erlangen.de>. It is part of the ELiTE
-(Erlangen Lightweight Thread Environment) project directed by
-Frank Bellosa <bellosa@informatik.uni-erlangen.de> at the Operating
-Systems Department of the University of Erlangen (Germany).
-
-Other contributors include: Weihaw Chuang, Richard O'Keefe,
-Laurent Perron, John Polstra, Shinji Suzuki, Assar Westerlund,
-thanks also to Peter Buhr and Dirk Grunwald.
-
-
-Here is a brief summary:
-
-QuickThreads is a toolkit for building threads packages. It is my hope
-that you'll find it easier to use QuickThreads normally than to take it
-and modify the raw cswap code to fit your application. The idea behind
-QuickThreads is that it should make it easy for you to write & retarget
-threads packages. If you want the routine `t_create' to create threads
-and `t_block' to suspend threads, you write them using the QuickThreads
-`primitive' operations `QT_SP', `QT_INIT', and `QT_BLOCK', that perform
-machine-dependent initialization and blocking, plus code you supply for
-performing the portable operatons. For example, you might write:
-
- t_create (func, arg)
- {
- stk = malloc (STKSIZE);
- stackbase = QT_SP (stk, STKSIZE);
- sp = QT_INIT (stakcbase, func, arg);
- qput (runq, sp);
- }
-
-Threads block by doing something like:
-
- t_block()
- {
- sp_next = qget (runq);
- QT_BLOCK (helper, runq, sp_next);
- // wake up again here
- }
-
- // called by QT_BLOCK after the old thread has blocked,
- // puts the old thread on the queue `onq'.
- helper (sp_old, onq)
- {
- qput (onq, sp_old);
- }
-
-(Of course) it's actually a bit more complex than that, but the general
-idea is that you write portable code to allocate stacks and enqueue and
-dequeue threads. Than, to get your threads package up and running on a
-different machine, you just reconfigure QuickThreads and recompile, and
-that's it.
-
-The QuickThreads `distribution' includes a sample threads package (look
-at stp.{c,h}) that is written in terms of QuickThreads operations. The
-TR mentioned above explains the simple threads package in detail.
-
-
-
-If you do use QuickThreads, I'd like to hear both about what worked for
-you and what didn't work, problems you had, insights gleaned, etc.
-
-Let me know what you think.
-
-David Keppel <pardo@cs.washington.edu>
diff --git a/qt/README.MISC b/qt/README.MISC
deleted file mode 100644
index d10e487cf..000000000
--- a/qt/README.MISC
+++ /dev/null
@@ -1,56 +0,0 @@
-Here's some machine-specific informatin for various systems:
-
-m88k on g88.sim
-
- .g88init:
- echo (gdb) target sim\n
- target sim
- echo (gdb) ecatch all\n
- ecatch all
- echo (gdb) break exit\n
- break exit
- % vi Makefile // set CC and AS
- % setenv MEERKAT /projects/cer/meerkat
- % set path=($MEERKAT/bin $path)
- % make run
- % g88.sim run
- (g88) run run N // where `N' is the test number
-
-
-m88k on meerkats, cross compile as above (make run)
-
- Run w/ g88:
- %g88 run
- (g88) source /homes/rivers/robertb/.gdbinit
- (g88) me
- which does
- (g88) set $firstchars=6
- (g88) set $resetonattach=1
- (g88) attach /dev/pp0
- then download
- (g88) dl
- and run with
- (g88) continue
-
- Really the way to run it is:
- (g88) source
- (g88) me
- (g88) win
- (g88) dead 1
- (g88) dead 2
- (g88) dead 3
- (g88) dl
- (g88) cont
-
- To rerun
- (g88) init
- (g88) dl
-
- To run simulated meerkat:
- (g88) att sim
- <<then use normal commands>>
-
- On 4.5 g88:
- (g88) target sim memsize
- instead of attatch
- (g88) ecatch all # catch exception before becomes error
diff --git a/qt/README.PORT b/qt/README.PORT
deleted file mode 100644
index d56300923..000000000
--- a/qt/README.PORT
+++ /dev/null
@@ -1,112 +0,0 @@
-Date: Tue, 11 Jan 94 13:23:11 -0800
-From: "pardo@cs.washington.edu" <pardo@meitner.cs.washington.edu>
-
->[What's needed to get `qt' on an i860-based machine?]
-
-Almost certainly "some assembly required" (pun accepted).
-
-To write a cswap port, you need to understand the context switching
-model. Turn to figure 2 in the QT TR. Here's about what the assembly
-code looks like to implement that:
-
- qt_cswap:
- adjust stack pointer
- save callee-save registers on to old's stack
- argument register <- old sp
- sp <- new sp
- (*helper)(args...)
- restore callee-save registers from new's stack
- unadjust stack pointer
- return
-
-Once more in slow motion:
-
- - `old' thread calls context switch routine (new, a0, a1, h)
- - cswap routine saves registers that have useful values
- - cswap routine switches to new stack
- - cswap routine calls helper function (*h)(old, a0, a1)
- - when helper returns, cswap routine restores registers
- that were saved the last time `new' was suspended
- - cswap routine returns to whatever `new' routine called the
- context switch routine
-
-There's a few tricks here. First, how do you start a thread running
-for the very first time? Answer is: fake some stuff on the stack
-so it *looks* like it was called from the middle of some routine.
-When the new thread is restarted, it is treated like any other
-thread. It just so happens that it's never really run before, but
-you can't tell that because the saved state makes it look like like
-it's been run. The return pc is set to point at a little stub of
-assembly code that loads up registers with the right values and
-then calls `only'.
-
-Second, I advise you to forget about varargs routines (at least
-until you get single-arg routines up and running).
-
-Third, on most machines `qt_abort' is the same as `qt_cswap' except
-that it need not save any callee-save registers.
-
-Fourth, `qt_cswap' needs to save and restore any floating-point
-registers that are callee-save (see your processor handbook). On
-some machines, *no* floating-point registers are callee-save, so
-`qt_cswap' is exactly the same as the integer-only cswap routine.
-
-I suggest staring at the MIPS code for a few minutes. It's "mostly"
-generic RISC code, so it gets a lot of the flavor across without
-getting too bogged down in little nitty details.
-
-
-
-Now for a bit more detail: The stack is laid out to hold callee-save
-registers. On many machines, I implemented fp cswap as save fp
-regs, call integer cswap, and when integer cswap returns (when the
-thread wakes up again), restore fp regs.
-
-For thread startup, I figure out some callee-save registers that
-I use to hold parameters to the startup routine (`only'). When
-the thread is being started it doesn't have any saved registers
-that need to be restored, but I go ahead and let the integer context
-switch routine restore some registers then "return" to the stub
-code. The stub code then copies the "callee save" registers to
-argument registers and calls the startup routine. That keeps the
-stub code pretty darn simple.
-
-For each machine I need to know the machine's procedure calling
-convention before I write a port. I figure out how many callee-save
-registers are there and allocate enough stack space for those
-registers. I also figure out how parameters are passed, since I
-will need to call the helper function. On most RISC machines, I
-just need to put the old sp in the 0'th arg register and then call
-indirect through the 3rd arg register; the 1st and 2nd arg registers
-are already set up correctly. Likewise, I don't touch the return
-value register between the helper's return and the context switch
-routine's return.
-
-I have a bunch of macros set up to do the stack initialization.
-The easiest way to debug this stuff is to go ahead and write a C
-routine to do stack initialization. Once you're happy with it you
-can turn it in to a macro.
-
-In general there's a lot of ugly macros, but most of them do simple
-things like return constants, etc. Any time you're looking at it
-and it looks confusing you just need to remember "this is actually
-simple code, the only tricky thing is calling the helper between
-the stack switch and the new thread's register restore."
-
-
-You will almost certainly need to write the assembly code fragment
-that starts a thread. You might be able to do a lot of the context
-switch code with `setjmp' and `longjmp', if they *happen* to have
-the "right" implementation. But getting all the details right (the
-helper can return a value to the new thread's cswap routine caller)
-is probaby trickier than writing code that does the minimum and
-thus doesn't have any extra instructions (or generality) to cause
-problems.
-
-I don't know of any ports besides those included with the source
-code distribution. If you send me a port I will hapily add it to
-the distribution.
-
-Let me know as you have questions and/or comments.
-
- ;-D on ( Now *that*'s a switch... ) Pardo
diff --git a/qt/b.h b/qt/b.h
deleted file mode 100644
index 862e78ba0..000000000
--- a/qt/b.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef B_H
-#define B_H "$Header: /home/ludo/src/guile.cvs/gitification/guile-cvs/guile/guile-core/qt/b.h,v 1.1 1996-10-01 03:27:25 mdj Exp $"
-
-#include "copyright.h"
-
-extern void b_call_reg (int n);
-extern void b_call_imm (int n);
-extern void b_add (int n);
-extern void b_load (int n);
-
-#endif /* ndef B_H */
diff --git a/qt/config b/qt/config
deleted file mode 100755
index e5b9505ce..000000000
--- a/qt/config
+++ /dev/null
@@ -1,308 +0,0 @@
-#! /bin/sh -x
-
-rm -f Makefile Makefile.md README.md qtmd.h qtmdb.s qtmdc.c qtmds.s configuration
-
-case $1 in
- axp*)
- : "DEC AXP"
- case $1 in
- axp-osf1*)
- : "Compile using /bin/cc under OSF 1.x."
- ln -s md/axp.1.Makefile Makefile.md
- ;;
- axp-osf2*)
- : "Compile using /bin/cc under OSF 2.x."
- ln -s md/axp.1.Makefile Makefile.md
- ;;
- *)
- : "Compile using GNU CC."
- ln -s md/axp.Makefile Makefile.md
- ;;
- esac
-
- ln -s md/axp.h qtmd.h
- ln -s md/axp.c qtmdc.c
- ln -s md/axp.s qtmds.s
- ln -s md/axp_b.s qtmdb.s
- ln -s md/axp.README README.md
- iter_init=1000000000
- iter_runone=10000000
- iter_blockint=10000000
- iter_blockfloat=10000000
- iter_vainit0=10000000
- iter_vainit2=10000000
- iter_vainit4=10000000
- iter_vainit8=10000000
- iter_vastart0=10000000
- iter_vastart2=10000000
- iter_vastart4=10000000
- iter_vastart8=10000000
- iter_bench_call_reg=10000000
- iter_bench_call_imm=10000000
- iter_bench_add=100000000
- iter_bench_load=100000000
- ;;
-
- hppa*)
- : "HP's PA-RISC 1.1 processors."
-
- case $1 in
- hppa-cnx-spp*)
- : "Convex SPP (PA-RISC 1.1 processors)."
- ln -s md/hppa-cnx.Makefile Makefile.md
- ;;
- *)
- ln -s md/hppa.Makefile Makefile.md
- ;;
- esac
-
- ln -s md/hppa.h qtmd.h
- ln -s md/null.c qtmdc.c
- ln -s md/hppa.s qtmds.s
- ln -s md/hppa_b.s qtmdb.s
- iter_init=10000000
- iter_runone=1000000
- iter_blockint=1000000
- iter_blockfloat=1000000
- iter_vainit0=1000000
- iter_vainit2=1000000
- iter_vainit4=1000000
- iter_vainit8=1000000
- iter_vastart0=1000000
- iter_vastart2=1000000
- iter_vastart4=1000000
- iter_vastart8=1000000
- iter_bench_call_reg=10000000
- iter_bench_call_imm=10000000
- iter_bench_add=100000000
- iter_bench_load=100000000
- ;;
-
- iX86*)
- case $1 in
- iX86-ss*)
- : "Assemlber comments '//'"
- sed 's/\/\*/\/\//' < md/i386.s > qtmds.s
- sed 's/\/\*/\/\//' < md/i386_b.s > qtmdb.s
- ;;
-
- *)
- ln -s md/i386.s qtmds.s
- ln -s md/i386_b.s qtmdb.s
- ;;
- esac
- : "Intel 80386 and compatibles (not '286...)"
- ln -s md/default.Makefile Makefile.md
- ln -s md/i386.h qtmd.h
- ln -s md/null.c qtmdc.c
- ln -s md/i386.README README.md
- iter_init=10000000
- iter_runone=1000000
- iter_blockint=1000000
- iter_blockfloat=1000000
- iter_vainit0=1000000
- iter_vainit2=1000000
- iter_vainit4=1000000
- iter_vainit8=1000000
- iter_vastart0=1000000
- iter_vastart2=1000000
- iter_vastart4=1000000
- iter_vastart8=1000000
- iter_bench_call_reg=1000000
- iter_bench_call_imm=1000000
- iter_bench_add=100000000
- iter_bench_load=10000000
- ;;
-
- m68k)
- : "Motorola 68000 family -- incomplete!"
- ln -s md/default.Makefile Makefile.md
- ln -s md/m68k.h qtmd.h
- ln -s md/null.c qtmdc.c
- ln -s md/m68k.s qtmds.s
- ln -s md/m68k_b.s qtmdb.s
- ln -s md/null.README README.md
- ;;
-
- m88k)
- : "Motorola 88000 family"
- ln -s md/m88k.Makefile Makefile.md
- ln -s md/m88k.h qtmd.h
- ln -s md/m88k.c qtmdc.c
- ln -s md/m88k.s qtmds.s
- ln -s md/m88k_b.s qtmdb.s
- ln -s md/null.README README.md
- iter_init=1000000
- iter_runone=100000
- iter_blockint=100000
- iter_blockfloat=100000
- iter_vainit0=100000
- iter_vainit2=100000
- iter_vainit4=100000
- iter_vainit8=100000
- iter_vastart0=100000
- iter_vastart2=100000
- iter_vastart4=100000
- iter_vastart8=100000
- iter_bench_call_reg=100000000
- iter_bench_call_imm=100000000
- iter_bench_add=1000000000
- iter_bench_load=100000000
- ;;
-
- mips*)
- : "MIPS R2000 and R3000."
-
- case $1 in
- mips-irix[56]*)
- : "Silicon Graphics Irix with dynamic linking"
- : "Use mips for irix4."
- ln -s md/mips-irix5.s qtmds.s
- ;;
- *)
- ln -s md/mips.s qtmds.s
- ;;
- esac
-
- ln -s md/default.Makefile Makefile.md
- ln -s md/mips.h qtmd.h
- ln -s md/null.c qtmdc.c
- ln -s md/mips_b.s qtmdb.s
- ln -s md/null.README README.md
- iter_init=10000000
- iter_runone=10000000
- iter_blockint=10000000
- iter_blockfloat=10000000
- iter_vainit0=1000000
- iter_vainit2=1000000
- iter_vainit4=1000000
- iter_vainit8=1000000
- iter_vastart0=1000000
- iter_vastart2=1000000
- iter_vastart4=1000000
- iter_vastart8=1000000
- iter_bench_call_reg=100000000
- iter_bench_call_imm=100000000
- iter_bench_add=1000000000
- iter_bench_load=100000000
- ;;
-
- sparc*)
- : "SPARC processors"
- case $1 in
- sparc-os2*)
- sed 's/_qt_/qt_/' md/sparc.s > qtmds.s
- sed 's/_b_/b_/' md/sparc_b.s > qtmdb.s
- ln -s md/solaris.README README.md
- ;;
- *)
- ln -s md/sparc.s qtmds.s
- ln -s md/sparc_b.s qtmdb.s
- ln -s md/null.README README.md
- ;;
- esac
-
- ln -s md/default.Makefile Makefile.md
- ln -s md/sparc.h qtmd.h
- ln -s md/null.c qtmdc.c
- iter_init=10000000
- iter_runone=1000000
- iter_blockint=1000000
- iter_blockfloat=1000000
- iter_vainit0=1000000
- iter_vainit2=1000000
- iter_vainit4=1000000
- iter_vainit8=1000000
- iter_vastart0=1000000
- iter_vastart2=1000000
- iter_vastart4=1000000
- iter_vastart8=1000000
- iter_bench_call_reg=10000000
- iter_bench_call_imm=10000000
- iter_bench_add=100000000
- iter_bench_load=100000000
- ;;
-
- vax*)
- : "DEC VAX processors."
- ln -s md/default.Makefile Makefile.md
- ln -s md/vax.h qtmd.h
- ln -s md/null.c qtmdc.c
- ln -s md/vax.s qtmds.s
- ln -s md/vax_b.s qtmdb.s
- ln -s md/null.README README.md
- iter_init=1000000
- iter_runone=100000
- iter_blockint=100000
- iter_blockfloat=100000
- iter_vainit0=100000
- iter_vainit2=100000
- iter_vainit4=100000
- iter_vainit8=100000
- iter_vastart0=100000
- iter_vastart2=100000
- iter_vastart4=100000
- iter_vastart8=100000
- iter_bench_call_reg=10000000
- iter_bench_call_imm=10000000
- iter_bench_add=10000000
- iter_bench_load=1000000
- ;;
-
- ksr1)
- : "Kendall Square Research model KSR-1."
- : "Varargs is not currently supported."
- ln -s md/ksr1.Makefile Makefile.md
- ln -s md/ksr1.h qtmd.h
- ln -s md/null.c qtmdc.c
- ln -s md/ksr1.s qtmds.s
- ln -s md/ksr1_b.s qtmdb.s
- ln -s md/null.README README.md
- iter_init=1000000
- iter_runone=100000
- iter_blockint=100000
- iter_blockfloat=100000
- iter_vainit0=100000
- iter_vainit2=100000
- iter_vainit4=100000
- iter_vainit8=100000
- iter_vastart0=100000
- iter_vastart2=100000
- iter_vastart4=100000
- iter_vastart8=100000
- iter_bench_call_reg=10000000
- iter_bench_call_imm=10000000
- iter_bench_add=10000000
- iter_bench_load=1000000
- ;;
-
- clean)
- : Deconfigure
- exit 0
- ;;
-
- *)
- echo "Unknown configuration"
- exit 1
- ;;
-esac
-
-cat Makefile.md Makefile.base > Makefile
-
-echo set config_machine=$1 >> configuration
-echo set config_init=$iter_init >> configuration
-echo set config_runone=$iter_runone >> configuration
-echo set config_blockint=$iter_blockint >> configuration
-echo set config_blockfloat=$iter_blockfloat >> configuration
-echo set config_vainit0=$iter_vainit0 >> configuration
-echo set config_vainit2=$iter_vainit2 >> configuration
-echo set config_vainit4=$iter_vainit4 >> configuration
-echo set config_vainit8=$iter_vainit8 >> configuration
-echo set config_vastart0=$iter_vastart0 >> configuration
-echo set config_vastart2=$iter_vastart2 >> configuration
-echo set config_vastart4=$iter_vastart4 >> configuration
-echo set config_vastart8=$iter_vastart8 >> configuration
-echo set config_bcall_reg=$iter_bench_call_reg >> configuration
-echo set config_bcall_imm=$iter_bench_call_imm >> configuration
-echo set config_b_add=$iter_bench_add >> configuration
-echo set config_b_load=$iter_bench_load >> configuration
diff --git a/qt/copyright.h b/qt/copyright.h
deleted file mode 100644
index 8a2361f9e..000000000
--- a/qt/copyright.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
diff --git a/qt/libqthreads.def b/qt/libqthreads.def
deleted file mode 100644
index c7cfcd5f2..000000000
--- a/qt/libqthreads.def
+++ /dev/null
@@ -1,10 +0,0 @@
-LIBRARY libqthreads
-DESCRIPTION "libqthreads: QuickThreads Library"
-EXPORTS
- qt_abort
- qt_block
- qt_blocki
- qt_error
- qt_null
- qt_vargs
- qt_vstart
diff --git a/qt/md/.cvsignore b/qt/md/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/qt/md/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/qt/md/Makefile.am b/qt/md/Makefile.am
deleted file mode 100644
index 46fffd152..000000000
--- a/qt/md/Makefile.am
+++ /dev/null
@@ -1,30 +0,0 @@
-## Process this file with automake to produce Makefile.in.
-##
-## Copyright (C) 1998 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-AUTOMAKE_OPTIONS = gnu
-
-EXTRA_DIST = _sparc.s _sparc_b.s axp.1.Makefile axp.2.Makefile \
-axp.Makefile axp.README axp.c axp.h axp.s axp_b.s default.Makefile \
-hppa-cnx.Makefile hppa.Makefile hppa.h hppa.s hppa_b.s i386.README \
-i386.h i386.s i386_b.s ksr1.Makefile ksr1.h ksr1.s ksr1_b.s \
-m88k.Makefile m88k.c m88k.h m88k.s m88k_b.s mips-irix5.s mips.h mips.s \
-mips_b.s null.README null.c solaris.README sparc.h sparc.s sparc_b.s \
-vax.h vax.s vax_b.s i386.asm
diff --git a/qt/md/_sparc.s b/qt/md/_sparc.s
deleted file mode 100644
index 1d8adc77e..000000000
--- a/qt/md/_sparc.s
+++ /dev/null
@@ -1,142 +0,0 @@
-/* sparc.s -- assembly support for the `qt' thread building kit. */
-
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
-/* #include <machine/trap.h> */
-
- .text
- .align 4
- .global _qt_blocki
- .global _qt_block
- .global _qt_abort
- .global _qt_start
- .global _qt_vstart
-
-/* Register assignment:
-// %o0: incoming `helper' function to call after cswap
-// also used as outgoing sp of old thread (qt_t *)
-// %o1, %o2:
-// parameters to `helper' function called after cswap
-// %o3: sp of new thread
-// %o5: tmp used to save old thread sp, while using %o0
-// to call `helper' f() after cswap.
-//
-//
-// Aborting a thread is easy if there are no cached register window
-// frames: just switch to the new stack and away we go. If there are
-// cached register window frames they must all be written back to the
-// old stack before we move to the new stack. If we fail to do the
-// writeback then the old stack memory can be written with register
-// window contents e.g., after the stack memory has been freed and
-// reused.
-//
-// If you don't believe this, try setting the frame pointer to zero
-// once we're on the new stack. This will not affect correctnes
-// otherwise because the frame pointer will eventually get reloaded w/
-// the new thread's frame pointer. But it will be zero briefly before
-// the reload. You will eventually (100,000 cswaps later on a small
-// SPARC machine that I tried) get an illegal instruction trap from
-// the kernel trying to flush a cached window to location 0x0.
-//
-// Solution: flush windows before switching stacks, which invalidates
-// all the other register windows. We could do the trap
-// conditionally: if we're in the lowest frame of a thread, the fp is
-// zero already so we know there's nothing cached. But we expect most
-// aborts will be done from a first function that does a `save', so we
-// will rarely save anything and always pay the cost of testing to see
-// if we should flush.
-//
-// All floating-point registers are caller-save, so this routine
-// doesn't need to do anything to save and restore them.
-//
-// `qt_block' and `qt_blocki' return the same value as the value
-// returned by the helper function. We get this ``for free''
-// since we don't touch the return value register between the
-// return from the helper function and return from qt_block{,i}.
-*/
-
-_qt_block:
-_qt_blocki:
- sub %sp, 8, %sp /* Allocate save area for return pc. */
- st %o7, [%sp+64] /* Save return pc. */
-_qt_abort:
- ta 0x03 /* Save locals and ins. */
- mov %sp, %o5 /* Remember old sp w/o chng ins/locals. */
- sub %o3, 64, %sp /* Allocate kwsa, switch stacks. */
- call %o0, 0 /* Call `helper' routine. */
- mov %o5, %o0 /* Pass old thread to qt_after_t() */
- /* .. along w/ args in %o1 & %o2. */
-
- /* Restore callee-save regs. The kwsa
- // is on this stack, so offset all
- // loads by sizeof(kwsa), 64 bytes.
- */
- ldd [%sp+ 0+64], %l0
- ldd [%sp+ 8+64], %l2
- ldd [%sp+16+64], %l4
- ldd [%sp+24+64], %l6
- ldd [%sp+32+64], %i0
- ldd [%sp+40+64], %i2
- ldd [%sp+48+64], %i4
- ldd [%sp+56+64], %i6
- ld [%sp+64+64], %o7 /* Restore return pc. */
-
- retl /* Return to address in %o7. */
- add %sp, 72, %sp /* Deallocate kwsa, ret pc area. */
-
-
-/* The function calling conventions say there has to be a 1-word area
-// in the caller's stack to hold a pointer to space for aggregate
-// return values. It also says there should be a 6-word area to hold
-// %o0..%o5 if the callee wants to save them (why? I don't know...)
-// Round up to 8 words to maintain alignment.
-//
-// Parameter values were stored in callee-save regs and are moved to
-// the parameter registers.
-*/
-_qt_start:
- mov %i1, %o0 /* `pu': Set up args to `only'. */
- mov %i2, %o1 /* `pt'. */
- mov %i4, %o2 /* `userf'. */
- call %i5, 0 /* Call client function. */
- sub %sp, 32, %sp /* Allocate 6-word callee space. */
-
- call _qt_error, 0 /* `only' erroniously returned. */
- nop
-
-
-/* Same comments as `_qt_start' about allocating rounded-up 7-word
-// save areas. */
-
-_qt_vstart:
- sub %sp, 32, %sp /* Allocate 7-word callee space. */
- call %i5, 0 /* call `startup'. */
- mov %i2, %o0 /* .. with argument `pt'. */
-
- add %sp, 32, %sp /* Use 7-word space in varargs. */
- ld [%sp+ 4+64], %o0 /* Load arg0 ... */
- ld [%sp+ 8+64], %o1
- ld [%sp+12+64], %o2
- ld [%sp+16+64], %o3
- ld [%sp+20+64], %o4
- call %i4, 0 /* Call `userf'. */
- ld [%sp+24+64], %o5
-
- /* Use 6-word space in varargs. */
- mov %o0, %o1 /* Pass return value from userf */
- call %i3, 0 /* .. when call `cleanup. */
- mov %i2, %o0 /* .. along with argument `pt'. */
-
- call _qt_error, 0 /* `cleanup' erroniously returned. */
- nop
diff --git a/qt/md/_sparc_b.s b/qt/md/_sparc_b.s
deleted file mode 100644
index cd26672d7..000000000
--- a/qt/md/_sparc_b.s
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
- .globl _b_call_reg
- .globl _b_call_imm
- .globl _b_add
- .globl _b_load
-
-_b_null:
- retl
- nop
-
-_b_call_reg:
- sethi %hi(_b_null),%o4
- or %o4,%lo(_b_null),%o4
- add %o7,%g0, %o3
-L0:
- call %o4
- nop
- call %o4
- nop
- call %o4
- nop
- call %o4
- nop
- call %o4
- nop
-
- subcc %o0,1,%o0
- bg L0
- nop
- add %o3,%g0, %o7
- retl
- nop
-
-_b_call_imm:
- sethi %hi(_b_null),%o4
- or %o4,%lo(_b_null),%o4
- add %o7,%g0, %o3
-L1:
- call _b_null
- call _b_null
- call _b_null
- call _b_null
- call _b_null
-
- subcc %o0,1,%o0
- bg L0
- nop
- add %o3,%g0, %o7
- retl
- nop
-
-
-_b_add:
- add %o0,%g0,%o1
- add %o0,%g0,%o2
- add %o0,%g0,%o3
- add %o0,%g0,%o4
-L2:
- sub %o0,5,%o0
- sub %o1,5,%o1
- sub %o2,5,%o2
- sub %o3,5,%o3
- sub %o4,5,%o4
-
- subcc %o0,5,%o0
- sub %o1,5,%o1
- sub %o2,5,%o2
- sub %o3,5,%o3
- sub %o4,5,%o4
-
- bg L2
- nop
- retl
- nop
-
-
-_b_load:
- ld [%sp+ 0], %g0
-L3:
- ld [%sp+ 4],%g0
- ld [%sp+ 8],%g0
- ld [%sp+12],%g0
- ld [%sp+16],%g0
- ld [%sp+20],%g0
- ld [%sp+24],%g0
- ld [%sp+28],%g0
- ld [%sp+32],%g0
- ld [%sp+36],%g0
-
- subcc %o0,10,%o0
- bg L3
- ld [%sp+ 0],%g0
- retl
- nop
diff --git a/qt/md/arm.h b/qt/md/arm.h
deleted file mode 100644
index 016cbb873..000000000
--- a/qt/md/arm.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- * Copyright (c) 2002 by Marius Vollmer
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
-#ifndef QT_ARM_H
-#define QT_ARM_H
-
-typedef unsigned long qt_word_t;
-
-#define QT_GROW_DOWN
-
-/* Stack layout on the ARM:
-
- Callee-save registers are: r4-r11 (f4-f7)
- Also save r14, link register, and restore as pc.
-
- +---
- | lr/pc
- | r11
- | r10
- | r9
- | r8
- | r7
- | r6
- | r5
- | r4 <- sp of a suspended thread
- +---
-
- Startup:
-
- +---
- | only
- | user
- | argt
- | argu <- sp on entry to qt_start
- +---
- | pc == qt_start
- | r11
- | r10
- | r9
- | r8
- | r7
- | r6
- | r5
- | r4
- +---
-
-*/
-
-/* Stack must be word aligned. */
-#define QT_STKALIGN (4) /* Doubleword aligned. */
-
-/* How much space is allocated to hold all the crud for
- initialization: r4-r11, r14, and the four args for qt_start. */
-
-#define QT_STKBASE ((9+4)*4)
-
-
-/* Offsets of various registers, in words, relative to final value of SP. */
-#define QT_LR 8
-#define QT_11 7
-#define QT_10 6
-#define QT_9 5
-#define QT_8 4
-#define QT_7 3
-#define QT_6 2
-#define QT_5 1
-#define QT_4 0
-
-
-/* When a never-before-run thread is restored, the return pc points
- to a fragment of code that starts the thread running. For
- non-vargs functions, it just calls the client's `only' function.
- */
-
-extern void qt_start(void);
-#define QT_ARGS_MD(sp) (QT_SPUT (sp, QT_LR, qt_start))
-
-
-/* The *index* (positive offset) of where to put each value. */
-#define QT_ONLY_INDEX (12)
-#define QT_USER_INDEX (11)
-#define QT_ARGT_INDEX (10)
-#define QT_ARGU_INDEX (9)
-
-#endif /* ndef QT_ARM_H */
diff --git a/qt/md/arm.s b/qt/md/arm.s
deleted file mode 100644
index cd322a373..000000000
--- a/qt/md/arm.s
+++ /dev/null
@@ -1,34 +0,0 @@
- .text
- .align 2
- .global qt_abort
- .global qt_block
- .global qt_blocki
-
- # r0: helper
- # r1: arg1
- # r2: arg2
- # r3: new_sp
-qt_abort:
-qt_block:
-qt_blocki:
- stmfd sp!, {r4-r11,lr}
- mov ip, r0
- mov r0, sp
- mov sp, r3
- mov lr, pc
- mov pc, ip
- ldmfd sp!, {r4-r11,pc}
-
-
- .global qt_start
- .global qt_error
- .type qt_start,function
-qt_start:
- ldr r0, [sp]
- ldr r1, [sp, #4]
- ldr r2, [sp, #8]
- ldr lr, qt_error_loc
- ldr pc, [sp, #12]
-
-qt_error_loc:
- .word qt_error
diff --git a/qt/md/axp.1.Makefile b/qt/md/axp.1.Makefile
deleted file mode 100644
index 86ccd8f42..000000000
--- a/qt/md/axp.1.Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-
-#
-# Compiling for the DEC AXP (alpha) with GNU CC or version 1.x of OSF.
-#
-CC = cc -std1 -D__AXP__ -D__OSF1__
diff --git a/qt/md/axp.2.Makefile b/qt/md/axp.2.Makefile
deleted file mode 100644
index 268636fc9..000000000
--- a/qt/md/axp.2.Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-
-#
-# Compiling for the DEC AXP (alpha) with GNU CC or version 2.x of OSF.
-#
-CC = cc -std1 -D__AXP__ -D__OSF2__
diff --git a/qt/md/axp.Makefile b/qt/md/axp.Makefile
deleted file mode 100644
index 4e6d74da4..000000000
--- a/qt/md/axp.Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-
-#
-# GNU CC
-#
-CC = gcc -D__AXP__
diff --git a/qt/md/axp.README b/qt/md/axp.README
deleted file mode 100644
index b6a705c07..000000000
--- a/qt/md/axp.README
+++ /dev/null
@@ -1,10 +0,0 @@
-The handling of varargs is platform-dependent. Assar Westerlund
-stared at the problem for a while and deduces the following table:
-
-vers / compiler cc gcc
-----------------------------------------------------------------------
-1.3 a0, offset __base, __offset
-2.0 _a0, _offset __base, __offset
-
-The current code should handle both cc and gcc versions, provided
-you configure for the correct compiler.
diff --git a/qt/md/axp.c b/qt/md/axp.c
deleted file mode 100644
index 26c15c0ea..000000000
--- a/qt/md/axp.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
-#include <stdarg.h>
-#include "qt.h"
-
-
-/* Varargs is harder on the AXP. Parameters are saved on the stack as
- something like (stack grows down to low memory; low at bottom of
- picture):
-
- | :
- | arg6
- +---
- | iarg5
- | :
- | iarg3 <-- va_list._a0 + va_list._offset
- | :
- | iarg0 <-- va_list._a0
- +---
- | farg5
- | :
- | farg0
- +---
-
- When some of the arguments have known type, there is no need to
- save all of them in the struct. So, for example, if the routine is
- called
-
- zork (int a0, float a1, int a2, ...)
- {
- va_list ap;
- va_start (ap, a2);
- qt_vargs (... &ap ...);
- }
-
- then offset is set to 3 * 8 (8 === sizeof machine word) = 24.
-
- What this means for us is that the user's routine needs to be
- called with an arg list where some of the words in the `any type'
- parameter list have to be split and moved up in to the int/fp
- region.
-
- Ways in which this can fail:
- - The user might not know the size of the pushed arguments anyway.
- - Structures have funny promotion rules.
- - Probably lots of other things.
-
- All in all, we never promised varargs would work reliably. */
-
-
-
-#define QT_VADJ(sp) (((char *)sp) - QT_VSTKBASE)
-
-#define QT_VARGS_MD0(sp, vabytes) \
- ((qt_t *)(((char *)(sp)) - 6*2*8 - QT_STKROUNDUP(vabytes)))
-
-extern void qt_vstart(void);
-#define QT_VARGS_MD1(sp) (QT_SPUT (sp, QT_R26, qt_vstart))
-
-
-/* Different machines use different implementations for varargs.
- Unfortunately, the code below ``looks in to'' the varargs
- structure, `va_list', and thus depends on the conventions.
- The following #defines try to deal with it but don't catch
- everything. */
-
-#ifdef __GNUC__
-#define _a0 __base
-#define _offset __offset
-#else
-#ifdef __OSF1__
-#define _a0 a0
-#define _offset offset
-#endif
-#endif /* def __GNUC__ */
-
-
- struct qt_t *
-qt_vargs (struct qt_t *qsp, int nbytes, struct va_list *vargs,
- void *pt, qt_function_t *startup,
- qt_function_t *vuserf, qt_function_t *cleanup)
-{
- va_list ap;
- int i;
- int max; /* Maximum *words* of args to copy. */
- int tmove; /* *Words* of args moved typed->typed. */
- qt_word_t *sp;
-
- ap = *(va_list *)vargs;
- qsp = QT_VARGS_MD0 (qsp, nbytes);
- sp = (qt_word_t *)qsp;
-
- tmove = 6 - ap._offset/sizeof(qt_word_t);
-
- /* Copy from one typed area to the other. */
- for (i=0; i<tmove; ++i) {
- /* Integer args: */
- sp[i+6] = ((qt_word_t *)(ap._a0 + ap._offset))[i];
- /* Fp args: */
- sp[i] = ((qt_word_t *)(ap._a0 + ap._offset))[i-6];
- }
-
- max = nbytes/sizeof(qt_word_t);
-
- /* Copy from the untyped area to the typed area. Split each arg.
- in to integer and floating-point save areas. */
- for (; i<6 && i<max; ++i) {
- sp[i] = sp[i+6] = ((qt_word_t *)(ap._a0 + ap._offset))[i];
- }
-
- /* Copy from the untyped area to the other untyped area. */
- for (; i<max; ++i) {
- sp[i+6] = ((qt_word_t *)(ap._a0 + ap._offset))[i];
- }
-
- QT_VARGS_MD1 (QT_VADJ(sp));
- QT_SPUT (QT_VADJ(sp), QT_VARGT_INDEX, pt);
- QT_SPUT (QT_VADJ(sp), QT_VSTARTUP_INDEX, startup);
- QT_SPUT (QT_VADJ(sp), QT_VUSERF_INDEX, vuserf);
- QT_SPUT (QT_VADJ(sp), QT_VCLEANUP_INDEX, cleanup);
- return ((qt_t *)QT_VADJ(sp));
-}
diff --git a/qt/md/axp.h b/qt/md/axp.h
deleted file mode 100644
index ff951a0d3..000000000
--- a/qt/md/axp.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
-#ifndef QT_AXP_H
-#define QT_AXP_H
-
-#define QT_GROW_DOWN
-
-typedef unsigned long qt_word_t;
-
-
-/* Stack layout on the Alpha:
-
- Integer:
-
- Caller-save: r0..r8, r22..r25, r27..r29
- argument/caller-save: r16..r21
- callee-save: r9..r15
- return pc *callee-save*: r26
- stack pointer: r30
- zero: r31
-
- Floating-point:
-
- Caller-save: f0..f1, f10..f15
- argument/caller-save: f16..f21, f22..f30
- callee-save: f2..f9
- zero: f31
-
- Non-varargs:
-
- +---
- | padding
- | f9
- | f8
- | f7
- | f6
- | f5
- | f4
- | f3
- | f2
- | r26
- +---
- | padding
- | r29
- | r15
- | r14
- | r13
- | r12 on startup === `only'
- | r11 on startup === `userf'
- | r10 on startup === `qt'
- | r9 on startup === `qu'
- | r26 on startup === qt_start <--- qt.sp
- +---
-
- Conventions for varargs startup:
-
- | :
- | arg6
- | iarg5
- | :
- | iarg0
- | farg5
- | :
- | farg0
- +---
- | padding
- | r29
- | r15
- | r14
- | r13
- | r12 on startup === `startup'
- | r11 on startup === `vuserf'
- | r10 on startup === `cleanup'
- | r9 on startup === `qt'
- | r26 on startup === qt_vstart <--- qt.sp
- +---
-
- Note: this is a pretty cheap/sleazy way to get things going,
- but ``there must be a better way.'' For instance, some varargs
- parameters could be loaded in to integer registers, or the return
- address could be stored on top of the stack. */
-
-
-/* Stack must be 16-byte aligned. */
-#define QT_STKALIGN (16)
-
-/* How much space is allocated to hold all the crud for
- initialization: 7 registers times 8 bytes/register. */
-
-#define QT_STKBASE (10 * 8)
-#define QT_VSTKBASE QT_STKBASE
-
-
-/* Offsets of various registers. */
-#define QT_R26 0
-#define QT_R9 1
-#define QT_R10 2
-#define QT_R11 3
-#define QT_R12 4
-
-
-/* When a never-before-run thread is restored, the return pc points
- to a fragment of code that starts the thread running. For
- non-vargs functions, it just calls the client's `only' function.
- For varargs functions, it calls the startup, user, and cleanup
- functions.
-
- The varargs startup routine always reads 12 8-byte arguments from
- the stack. If fewer argumets were pushed, the startup routine
- would read off the top of the stack. To prevent errors we always
- allocate enough space. When there are fewer args, the preallocated
- words are simply wasted. */
-
-extern void qt_start(void);
-#define QT_ARGS_MD(sp) (QT_SPUT (sp, QT_R26, qt_start))
-
-
-/* The AXP uses a struct for `va_list', so pass a pointer to the
- struct. This may break some uses of `QT_VARGS', but then we never
- claimed it was totally portable. */
-
-typedef void (qt_function_t)(void);
-
-struct qt_t;
-struct va_list;
-extern struct qt_t *qt_vargs (struct qt_t *sp, int nbytes,
- struct va_list *vargs, void *pt,
- qt_function_t *startup,
- qt_function_t *vuserf,
- qt_function_t *cleanup);
-
-#define QT_VARGS(sp, nbytes, vargs, pt, startup, vuserf, cleanup) \
- (qt_vargs (sp, nbytes, (struct va_list *)(&(vargs)), pt, \
- (qt_function_t *) startup, (qt_function_t *)vuserf, \
- (qt_function_t *)cleanup));
-
-
-/* The *index* (positive offset) of where to put each value. */
-#define QT_ONLY_INDEX (QT_R12)
-#define QT_USER_INDEX (QT_R11)
-#define QT_ARGT_INDEX (QT_R10)
-#define QT_ARGU_INDEX (QT_R9)
-
-#define QT_VCLEANUP_INDEX (QT_R10)
-#define QT_VUSERF_INDEX (QT_R11)
-#define QT_VSTARTUP_INDEX (QT_R12)
-#define QT_VARGT_INDEX (QT_R9)
-
-#endif /* ndef QT_AXP_H */
diff --git a/qt/md/axp.s b/qt/md/axp.s
deleted file mode 100644
index 1f8555c51..000000000
--- a/qt/md/axp.s
+++ /dev/null
@@ -1,160 +0,0 @@
- #
- # QuickThreads -- Threads-building toolkit.
- # Copyright (c) 1993 by David Keppel
- #
- # Permission to use, copy, modify and distribute this software and
- # its documentation for any purpose and without fee is hereby
- # granted, provided that the above copyright notice and this notice
- # appear in all copies. This software is provided as a
- # proof-of-concept and for demonstration purposes# there is no
- # representation about the suitability of this software for any
- # purpose.
- #
-
- # axp.s -- assembly support.
-
- .text
- .align 4
- .file 2 "axp.s"
-
- .globl qt_block
- .globl qt_blocki
- .globl qt_abort
- .globl qt_start
- .globl qt_vstart
-
- #
- # $16: ptr to function to call once curr is suspended
- # and control is on r19's stack.
- # $17: 1'th arg to (*$16)(...).
- # $18: 2'th arg to (*$16)(...).
- # $19: sp of thread to resume.
- #
- # The helper routine returns a value that is passed on as the
- # return value from the blocking routine. Since we don't
- # touch r0 between the helper's return and the end of
- # function, we get this behavior for free.
- #
-
- .ent qt_blocki
-qt_blocki:
- subq $30,80, $30 # Allocate save area.
- stq $26, 0($30) # Save registers.
- stq $9, 8($30)
- stq $10,16($30)
- stq $11,24($30)
- stq $12,32($30)
- stq $13,40($30)
- stq $14,48($30)
- stq $15,56($30)
- stq $29,64($30)
- .end qt_blocki
- .ent qt_abort
-qt_abort:
- addq $16,$31, $27 # Put argument function in PV.
- addq $30,$31, $16 # Save stack ptr in outgoing arg.
- addq $19,$31, $30 # Set new stack pointer.
- jsr $26,($27),0 # Call helper function.
-
- ldq $26, 0($30) # Restore registers.
- ldq $9, 8($30)
- ldq $10,16($30)
- ldq $11,24($30)
- ldq $12,32($30)
- ldq $13,40($30)
- ldq $14,48($30)
- ldq $15,56($30)
- ldq $29,64($30)
-
- addq $30,80, $30 # Deallocate save area.
- ret $31,($26),1 # Return, predict===RET.
- .end qt_abort
-
-
- #
- # Non-varargs thread startup.
- #
- .ent qt_start
-qt_start:
- addq $9,$31, $16 # Load up `qu'.
- addq $10,$31, $17 # ... user function's `pt'.
- addq $11,$31, $18 # ... user function's `userf'.
- addq $12,$31, $27 # ... set procedure value to `only'.
- jsr $26,($27),0 # Call `only'.
-
- jsr $26,qt_error # `only' erroniously returned.
- .end qt_start
-
-
- .ent qt_vstart
-qt_vstart:
- # Call startup function.
- addq $9,$31, $16 # Arg0 to `startup'.
- addq $12,$31, $27 # Set procedure value.
- jsr $26,($27),0 # Call `startup'.
-
- # Call user function.
- ldt $f16, 0($30) # Load fp arg regs.
- ldt $f17, 8($30)
- ldt $f18,16($30)
- ldt $f19,24($30)
- ldt $f20,32($30)
- ldt $f21,40($30)
- ldq $16,48($30) # And integer arg regs.
- ldq $17,56($30)
- ldq $18,64($30)
- ldq $19,72($30)
- ldq $20,80($30)
- ldq $21,88($30)
- addq $30,96, $30 # Pop 6*2*8 saved arg regs.
- addq $11,$31, $27 # Set procedure value.
- jsr $26,($27),0 # Call `vuserf'.
-
- # Call cleanup.
- addq $9,$31, $16 # Arg0 to `cleanup'.
- addq $0,$31, $17 # Users's return value is arg1.
- addq $10,$31, $27 # Set procedure value.
- jsr $26,($27),0 # Call `cleanup'.
-
- jsr $26,qt_error # Cleanup erroniously returned.
- .end qt_start
-
-
- #
- # Save calle-save floating-point regs $f2..$f9.
- # Also save return pc from whomever called us.
- #
- # Return value from `qt_block' is the same as the return from
- # `qt_blocki'. We get that for free since we don't touch $0
- # between the return from `qt_blocki' and the return from
- # `qt_block'.
- #
- .ent qt_block
-qt_block:
- subq $30,80, $30 # Allocate a save space.
- stq $26, 0($30) # Save registers.
- stt $f2, 8($30)
- stt $f3,16($30)
- stt $f4,24($30)
- stt $f5,32($30)
- stt $f6,40($30)
- stt $f7,48($30)
- stt $f8,56($30)
- stt $f9,64($30)
-
- jsr $26,qt_blocki # Call helper.
- # .. who will also restore $gp.
-
- ldq $26, 0($30) # restore registers.
- ldt $f2, 8($30)
- ldt $f3,16($30)
- ldt $f4,24($30)
- ldt $f5,32($30)
- ldt $f6,40($30)
- ldt $f7,48($30)
- ldt $f8,56($30)
- ldt $f9,64($30)
-
- addq $30,80, $30 # Deallcate save space.
- ret $31,($26),1 # Return, predict===RET.
- .end qt_block
diff --git a/qt/md/axp_b.s b/qt/md/axp_b.s
deleted file mode 100644
index 82194d52c..000000000
--- a/qt/md/axp_b.s
+++ /dev/null
@@ -1,111 +0,0 @@
- #
- # QuickThreads -- Threads-building toolkit.
- # Copyright (c) 1993 by David Keppel
- #
- # Permission to use, copy, modify and distribute this software and
- # its documentation for any purpose and without fee is hereby
- # granted, provided that the above copyright notice and this notice
- # appear in all copies. This software is provided as a
- # proof-of-concept and for demonstration purposes; there is no
- # representation about the suitability of this software for any
- # purpose.
- #
-
- .text
- .globl b_call_reg
- .globl b_call_imm
- .globl b_add
- .globl b_load
-
- .ent b_null
-b_null:
- ret $31,($18),1
- .end b_null
-
- .ent b_call_reg
-b_call_reg:
- lda $27,b_null
-$L0:
- jsr $18,($27)
- jsr $18,($27)
- jsr $18,($27)
- jsr $18,($27)
- jsr $18,($27)
-
- jsr $18,($27)
- jsr $18,($27)
- jsr $18,($27)
- jsr $18,($27)
- jsr $18,($27)
-
- subq $16,1,$16
- bgt $16,$L0
-
- ret $31,($26),1
- .end
-
-
- .ent b_call_imm
-b_call_imm:
-$L1:
- jsr $18,b_null
- jsr $18,b_null
- jsr $18,b_null
- jsr $18,b_null
- jsr $18,b_null
-
- jsr $18,b_null
- jsr $18,b_null
- jsr $18,b_null
- jsr $18,b_null
- jsr $18,b_null
-
- subq $16,1,$16
- bgt $16,$L1
-
- ret $31,($26),1
- .end
-
-
- .ent b_add
-b_add:
-$L2:
- addq $31,$31,$31
- addq $31,$31,$31
- addq $31,$31,$31
- addq $31,$31,$31
- addq $31,$31,$31
-
- addq $31,$31,$31
- addq $31,$31,$31
- addq $31,$31,$31
- addq $31,$31,$31
- addq $31,$31,$31
-
- subq $16,1,$16
- bgt $16,$L2
-
- ret $31,($26),1
- .end
-
-
- .ent b_load
-b_load:
-$L3:
- ldq $31,0($30)
- ldq $31,8($30)
- ldq $31,16($30)
- ldq $31,24($30)
- ldq $31,32($30)
-
- ldq $31,0($30)
- ldq $31,8($30)
- ldq $31,16($30)
- ldq $31,24($30)
- ldq $31,32($30)
-
- subq $16,1,$16
- bgt $16,$L3
-
- ret $31,($26),1
- .end
diff --git a/qt/md/default.Makefile b/qt/md/default.Makefile
deleted file mode 100644
index e240ca270..000000000
--- a/qt/md/default.Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-
-#
-# `Normal' configuration.
-#
-CC = gcc -ansi -Wall -pedantic
-
diff --git a/qt/md/hppa-cnx.Makefile b/qt/md/hppa-cnx.Makefile
deleted file mode 100644
index bff257d9f..000000000
--- a/qt/md/hppa-cnx.Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-# This file (cnx_spp.Makefile) is part of the port of QuickThreads for
-# PA-RISC 1.1 architecture on a Convex SPP. This file is a machine dependent
-# makefile for QuickThreads. It was written in 1994 by Uwe Reder
-# (`uereder@cip.informatik.uni-erlangen.de') for the Operating Systems
-# Department (IMMD4) at the University of Erlangen/Nuernberg Germany.
-
-# `Normal' configuration.
-
-CC = /usr/convex/bin/cc
diff --git a/qt/md/hppa.Makefile b/qt/md/hppa.Makefile
deleted file mode 100644
index a15e28c99..000000000
--- a/qt/md/hppa.Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-# This file (pa-risc.Makefile) is part of the port of QuickThreads for
-# PA-RISC 1.1 architecture. This file is a machine dependent makefile
-# for QuickThreads. It was written in 1994 by Uwe Reder
-# (`uereder@cip.informatik.uni-erlangen.de') for the Operating Systems
-# Department (IMMD4) at the University of Erlangen/Nuernberg Germany.
-
-# `Normal' configuration.
-
-CC = cc -Aa
diff --git a/qt/md/hppa.h b/qt/md/hppa.h
deleted file mode 100644
index 0df98de88..000000000
--- a/qt/md/hppa.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
-/*
- * This file (pa-risc.h) is part of the port of QuickThreads for the
- * PA-RISC 1.1 architecture. This file is a machine dependent header
- * file. It was written in 1994 by Uwe Reder
- * (`uereder@cip.informatik.uni-erlangen.de') for the Operating Systems
- * Department (IMMD4) at the University of Erlangen/Nuernberg Germany.
- */
-
-
-#ifndef QT_PA_RISC_H
-#define QT_PA_RISC_H
-
-#include <qt.h>
-
-/* size of an integer-register (32 bit) */
-typedef unsigned long qt_word_t;
-
-/* PA-RISC's stack grows up */
-#define QT_GROW_UP
-
-/* Stack layout on PA-RISC according to PA-RISC Procedure Calling Conventions:
-
- Callee-save registers are: gr3-gr18, fr12-fr21.
- Also save gr2, return pointer.
-
- +---
- | fr12 Each floating register is a double word (8 bytes).
- | fr13 Floating registers are only saved if `qt_block' is
- | fr14 called, in which case it saves the floating-point
- | fr15 registers then calls `qt_blocki' to save the integer
- | fr16 registers.
- | fr17
- | fr18
- | fr19
- | fr20
- | fr21
- | <arg word 3> fixed arguments (must be allocated; may remain unused)
- | <arg word 2>
- | <arg word 1>
- | <arg word 0>
- | <LPT> frame marker
- | <LPT'>
- | <RP'>
- | <Current RP>
- | <Static Link>
- | <Clean Up>
- | <RP''>
- | <Previous SP>
- +---
- | gr3 word each (4 bytes)
- | gr4
- | gr5
- | gr6
- | gr7
- | gr8
- | gr9
- | gr10
- | gr11
- | gr12
- | gr13
- | gr14
- | gr15
- | gr16
- | gr17
- | gr18
- | <16 bytes filled in (sp has to be 64-bytes aligned)>
- | <arg word 3> fixed arguments (must be allocated; may remain unused)
- | <arg word 2>
- | <arg word 1>
- | <arg word 0>
- | <LPT> frame marker
- | <LPT'>
- | <RP'>
- | <Current RP>
- | <Static Link>
- | <Clean Up>
- | <RP''>
- | <Previous SP>
- +--- <--- sp
-*/
-
-/* When a never-before-run thread is restored, the return pc points
- to a fragment of code that starts the thread running. For
- non-vargs functions, it just calls the client's `only' function.
- For varargs functions, it calls the startup, user, and cleanup
- functions. */
-
-/* Note: Procedue Labels on PA-RISC
-
- <--2--><-------28---------><1-><1->
- -----------------------------------
- | SID | Adress Part | L | X |
- -----------------------------------
-
- On HP-UX the L field is used to flag wheather the procedure
- label (plabel) is a pointer to an LT entry or to the entry point
- of the procedure (PA-RISC Procedure Calling Conventions Reference
- Manual, 5.3.2 Procedure Labels and Dynamic Calls). */
-
-#define QT_PA_RISC_READ_PLABEL(plabel) \
- ( (((int)plabel) & 2) ? \
- ( (*((int *)(((int)plabel) & 0xfffffffc)))) : ((int)plabel) )
-
-/* Stack must be 64 bytes aligned. */
-#define QT_STKALIGN (64)
-
-/* Internal helper for putting stuff on stack (negative index!). */
-#define QT_SPUT(top, at, val) \
- (((qt_word_t *)(top))[-(at)] = (qt_word_t)(val))
-
-/* Offsets of various registers which are modified on the stack.
- rp (return-pointer) has to be stored in the frame-marker-area
- of the "older" stack-segment. */
-
-#define QT_crp (12+4+16+5)
-#define QT_15 (12+4+4)
-#define QT_16 (12+4+3)
-#define QT_17 (12+4+2)
-#define QT_18 (12+4+1)
-
-
-/** This stuff is for NON-VARARGS. **/
-
-/* Stack looks like this (2 stack frames):
-
- <--- 64-bytes aligned --><------- 64-bytes aligned ------------>
- | || |
- <--16--><------48-------><----16*4-----><--16-><------48------->
- || | || | | ||
- ||filler|arg|frame-marker||register-save|filler|arg|frame-marker||
- ------------------------------------------------------------------
- */
-
-#define QT_STKBASE (16+48+(16*sizeof(qt_word_t))+16+48)
-
-/* The index, relative to sp, of where to put each value. */
-#define QT_ONLY_INDEX (QT_15)
-#define QT_USER_INDEX (QT_16)
-#define QT_ARGT_INDEX (QT_17)
-#define QT_ARGU_INDEX (QT_18)
-
-extern void qt_start(void);
-#define QT_ARGS_MD(sp) \
- (QT_SPUT (sp, QT_crp, QT_PA_RISC_READ_PLABEL(qt_start)))
-
-
-/** This is for VARARGS. **/
-
-#define QT_VARGS_DEFAULT
-
-/* Stack looks like this (2 stack frames):
-
- <------ 64-bytes aligned -------><--------- 64-bytes aligned ---------->
- | || |
- <---?--><--?---><16><----32-----><----16*4-----><-16--><16><----32----->
- || | | | || | | | ||
- ||filler|varargs|arg|frame-marker||register-save|filler|arg|frame-marker||
- --------------------------------------------------------------------------
- */
-
-/* Sp is moved to the end of the first stack frame. */
-#define QT_VARGS_MD0(sp, vasize) \
- ((qt_t *)(((char *)sp) + QT_STKROUNDUP(vasize + 4*4 + 32)))
-
-/* To reach the arguments from the end of the first stack frame use 32
- as a negative adjustment. */
-#define QT_VARGS_ADJUST(sp) ((qt_t *)(((char *)sp) - 32))
-
-/* Offset to reach the end of the second stack frame. */
-#define QT_VSTKBASE ((16*sizeof(qt_word_t)) + 16 + 4*4 + 32)
-
-extern void qt_vstart(void);
-#define QT_VARGS_MD1(sp) \
- (QT_SPUT (sp, QT_crp, QT_PA_RISC_READ_PLABEL(qt_vstart)))
-
-#define QT_VARGT_INDEX (QT_15)
-#define QT_VSTARTUP_INDEX (QT_16)
-#define QT_VUSERF_INDEX (QT_17)
-#define QT_VCLEANUP_INDEX (QT_18)
-
-#endif /* ndef QT_PA_RISC_H */
diff --git a/qt/md/hppa.s b/qt/md/hppa.s
deleted file mode 100644
index 84d8e875b..000000000
--- a/qt/md/hppa.s
+++ /dev/null
@@ -1,237 +0,0 @@
-; pa-risc.s -- assembly support.
-
-; QuickThreads -- Threads-building toolkit.
-; Copyright (c) 1993 by David Keppel
-;
-; Permission to use, copy, modify and distribute this software and
-; its documentation for any purpose and without fee is hereby
-; granted, provided that the above copyright notice and this notice
-; appear in all copies. This software is provided as a
-; proof-of-concept and for demonstration purposes; there is no
-; representation about the suitability of this software for any
-; purpose.
-
-; This file (pa-risc.s) is part of the port of QuickThreads for
-; PA-RISC 1.1 architecture. This file implements context switches
-; and thread startup. It was written in 1994 by Uwe Reder
-; (`uereder@cip.informatik.uni-erlangen.de') for the Operating
-; Systems Department (IMMD4) at the University of Erlangen/Nuernberg
-; Germany.
-
-
-; Callee saves general registers gr3..gr18,
-; floating-point registers fr12..fr21.
-
- .CODE
-
- .IMPORT $$dyncall, MILLICODE
- .IMPORT qt_error, CODE
-
- .EXPORT qt_blocki, ENTRY
- .EXPORT qt_block, ENTRY
- .EXPORT qt_abort, ENTRY
- .EXPORT qt_start, ENTRY
- .EXPORT qt_vstart, ENTRY
-
-
-; arg0: ptr to function (helper) to call once curr is suspended
-; and control is on arg3's stack.
-; arg1: 1'th arg to *arg0.
-; arg2: 2'th arg to *arg0.
-; arg3: sp of new thread.
-
-qt_blocki
- .PROC
- .CALLINFO CALLER, FRAME=0, SAVE_RP, ENTRY_GR=18
- .ENTRY
-
- stw %rp,-20(%sp) ; save rp to old frame-marker
-
- stwm %r3,128(%sp) ; save callee-saves general registers
- stw %r4,-124(%sp)
- stw %r5,-120(%sp)
- stw %r6,-116(%sp)
- stw %r7,-112(%sp)
- stw %r8,-108(%sp)
- stw %r9,-104(%sp)
- stw %r10,-100(%sp)
- stw %r11,-96(%sp)
- stw %r12,-92(%sp)
- stw %r13,-88(%sp)
- stw %r14,-84(%sp)
- stw %r15,-80(%sp)
- stw %r16,-76(%sp)
- stw %r17,-72(%sp)
- stw %r18,-68(%sp)
-
-qt_abort
- copy %arg0,%r22 ; helper to be called by $$dyncall
- copy %sp,%arg0 ; pass current sp as arg0 to helper
- copy %arg3,%sp ; set new sp
-
- .CALL
- bl $$dyncall,%mrp ; call helper
- copy %mrp,%rp
-
- ldw -68(%sp),%r18 ; restore general registers
- ldw -72(%sp),%r17
- ldw -76(%sp),%r16
- ldw -80(%sp),%r15
- ldw -84(%sp),%r14
- ldw -88(%sp),%r13
- ldw -92(%sp),%r12
- ldw -96(%sp),%r11
- ldw -100(%sp),%r10
- ldw -104(%sp),%r9
- ldw -108(%sp),%r8
- ldw -112(%sp),%r7
- ldw -116(%sp),%r6
- ldw -120(%sp),%r5
- ldw -124(%sp),%r4
-
- ldw -148(%sp),%rp ; restore return-pointer
-
- bv %r0(%rp) ; return to caller
- ldwm -128(%sp),%r3
-
- .EXIT
- .PROCEND
-
-
-qt_block
- .PROC
- .CALLINFO CALLER, FRAME=0, SAVE_RP, ENTRY_FR=21
- .ENTRY
-
- stw %rp,-20(%sp) ; save rp to old frame-marker
-
- fstds,ma %fr12,8(%sp) ; save callee-saves float registers
- fstds,ma %fr13,8(%sp)
- fstds,ma %fr14,8(%sp)
- fstds,ma %fr15,8(%sp)
- fstds,ma %fr16,8(%sp)
- fstds,ma %fr17,8(%sp)
- fstds,ma %fr18,8(%sp)
- fstds,ma %fr19,8(%sp)
- fstds,ma %fr20,8(%sp)
- fstds,ma %fr21,8(%sp)
-
- .CALL
- bl qt_blocki,%rp
- ldo 48(%sp),%sp
-
- ldo -48(%sp),%sp
-
- fldds,mb -8(%sp),%fr21 ; restore callee-saves float registers
- fldds,mb -8(%sp),%fr20
- fldds,mb -8(%sp),%fr19
- fldds,mb -8(%sp),%fr18
- fldds,mb -8(%sp),%fr17
- fldds,mb -8(%sp),%fr16
- fldds,mb -8(%sp),%fr15
- fldds,mb -8(%sp),%fr14
- fldds,mb -8(%sp),%fr13
-
- ldw -28(%sp),%rp ; restore return-pointer
-
- bv %r0(%rp) ; return to caller.
- fldds,mb -8(%sp),%fr12
-
- .EXIT
- .PROCEND
-
-
-qt_start
- .PROC
- .CALLINFO CALLER, FRAME=0
- .ENTRY
-
- copy %r18,%arg0 ; set user arg `pu'.
- copy %r17,%arg1 ; ... user function pt.
- copy %r16,%arg2 ; ... user function userf.
- ; %r22 is a caller-saves register
- copy %r15,%r22 ; function to be called by $$dyncall
-
- .CALL ; in=%r22
- bl $$dyncall,%mrp ; call `only'.
- copy %mrp,%rp
-
- bl,n qt_error,%r0 ; `only' erroniously returned.
-
- .EXIT
- .PROCEND
-
-
-; Varargs
-;
-; First, call `startup' with the `pt' argument.
-;
-; Next, call the user's function with all arguments.
-; We don't know whether arguments are integers, 32-bit floating-points or
-; even 64-bit floating-points, so we reload all the registers, possibly
-; with garbage arguments. The thread creator provided non-garbage for
-; the arguments that the callee actually uses, so the callee never gets
-; garbage.
-;
-; -48 -44 -40 -36 -32
-; | arg3 | arg2 | arg1 | arg0 |
-; -----------------------------
-; integers: arg3 arg2 arg1 arg0
-; 32-bit fps: farg3 farg2 farg1 farg0
-; 64-bit fps: <---farg3--> <---farg1-->
-;
-; Finally, call `cleanup' with the `pt' argument and with the return value
-; from the user's function. It is an error for `cleanup' to return.
-
-qt_vstart
- .PROC
- .CALLINFO CALLER, FRAME=0
- .ENTRY
-
- ; Because the startup function may damage the fixed arguments
- ; on the stack (PA-RISC Procedure Calling Conventions Reference
- ; Manual, 2.4 Fixed Arguments Area), we allocate a seperate
- ; stack frame for it.
- ldo 64(%sp),%sp
-
- ; call: void startup(void *pt)
-
- copy %r15,%arg0 ; `pt' is arg0 to `startup'.
- copy %r16,%r22
- .CALL
- bl $$dyncall,%mrp ; Call `startup'.
- copy %mrp,%rp
-
- ldo -64(%sp),%sp
-
- ; call: void *qt_vuserf_t(...)
-
- ldw -36(%sp),%arg0 ; Load args to integer registers.
- ldw -40(%sp),%arg1
- ldw -44(%sp),%arg2
- ldw -48(%sp),%arg3
- ; Index of fld[w|d]s only ranges from -16 to 15, so we
- ; take r22 to be our new base register.
- ldo -32(%sp),%r22
- fldws -4(%r22),%farg0 ; Load args to floating-point registers.
- fldds -8(%r22),%farg1
- fldws -12(%r22),%farg2
- fldds -16(%r22),%farg3
- copy %r17,%r22
- .CALL
- bl $$dyncall,%mrp ; Call `userf'.
- copy %mrp,%rp
-
- ; call: void cleanup(void *pt, void *vuserf_return)
-
- copy %r15,%arg0 ; `pt' is arg0 to `cleanup'.
- copy %ret0,%arg1 ; Return-value is arg1 to `cleanup'.
- copy %r18,%r22
- .CALL
- bl $$dyncall,%mrp ; Call `cleanup'.
- copy %mrp,%rp
-
- bl,n qt_error,%r0
-
- .EXIT
- .PROCEND
diff --git a/qt/md/hppa_b.s b/qt/md/hppa_b.s
deleted file mode 100644
index 1b1e8264e..000000000
--- a/qt/md/hppa_b.s
+++ /dev/null
@@ -1,203 +0,0 @@
-; QuickThreads -- Threads-building toolkit.
-; Copyright (c) 1993 by David Keppel
-
-; Permission to use, copy, modify and distribute this software and
-; its documentation for any purpose and without fee is hereby
-; granted, provided that the above copyright notice and this notice
-; appear in all copies. This software is provided as a
-; proof-of-concept and for demonstration purposes; there is no
-; representation about the suitability of this software for any
-; purpose.
-
-; This file (pa-risc_b.s) is part of the port of QuickThreads for
-; PA-RISC 1.1 architecture. It contains assembly-level support for
-; raw processor performance measurement. It was written in 1994 by
-; Uwe Reder (`uereder@cip.informatik.uni-erlangen.de')
-; for the Operating Systems Department (IMMD4) at the
-; University of Erlangen/Nuernberg Germany.
-
-
-; Note that the number of instructions in the measurement-loops, differ
-; from implementation to implementation. I took eight instructions in a loop
-; for every test (execute eight instructions and loop to the start).
-
- .CODE
-
- .IMPORT $global$,DATA
- .IMPORT $$dyncall,MILLICODE
- .EXPORT b_call_reg
- .EXPORT b_call_imm
- .EXPORT b_add
- .EXPORT b_load
-
-; Just do nothing, only return to caller. This procedure is called by
-; `b_call_reg' and `b_call_imm'.
-
-b_null
- .PROC
- .CALLINFO NO_CALLS, FRAME=0
- .ENTRY
-
- bv,n %r0(%rp) ; just return
-
- .EXIT
- .PROCEND
-
-; Call the procedure `b_null' with function pointer in a register.
-
-b_call_reg
- .PROC
- .CALLINFO CALLER, FRAME=0
- .ENTRY
-
- stwm %r3,64(%sp) ; store r3 (may be used by caller)
- stw %rp,-20(%sp) ; save return-pointer to frame-marker
-
- addil LR'to_call-$global$,%r27
- ldw RR'to_call-$global$(%r1),%r3
-
-_loop0
- copy %r3,%r22 ; copy the procedure label to r22, ...
- .CALL ; ...this is the input to $$dyncall
- bl $$dyncall,%mrp ; call $$dyncall (millicode function)
- copy %mrp,%rp ; remember the return-pointer
-
- copy %r3,%r22
- .CALL
- bl $$dyncall,%mrp
- copy %mrp,%rp
-
- copy %r3,%r22
- .CALL
- bl $$dyncall,%mrp
- copy %mrp,%rp
-
- copy %r3,%r22
- .CALL
- bl $$dyncall,%mrp
- copy %mrp,%rp
-
- copy %r3,%r22
- .CALL
- bl $$dyncall,%mrp
- copy %mrp,%rp
-
- copy %r3,%r22
- .CALL
- bl $$dyncall,%mrp
- copy %mrp,%rp
-
- copy %r3,%r22
- .CALL
- bl $$dyncall,%mrp
- copy %mrp,%rp
-
- copy %r3,%r22
- .CALL
- bl $$dyncall,%mrp
- copy %mrp,%rp
-
- addibf,<= -8,%arg0,_loop0 ; decrement counter by 8 and loop
- nop
-
- ldw -20(%sp),%rp ; restore return-pointer
- bv %r0(%rp) ; return to caller
- ldwm -64(%sp),%r3 ; resore r3 and remove stack frame
-
- .EXIT
- .PROCEND
-
-; Call the procedure `b_null' immediate.
-
-b_call_imm
- .PROC
- .CALLINFO CALLER, FRAME=0, SAVE_RP
- .ENTRY
-
- ldo 64(%sp),%sp ; caller needs a stack-frame
- stw %rp,-20(%sp) ; save return-pointer to frame-marker
-
-_loop1
- bl b_null,%rp ; call `b_null' immediate (8 times)
- nop
- bl b_null,%rp
- nop
- bl b_null,%rp
- nop
- bl b_null,%rp
- nop
- bl b_null,%rp
- nop
- bl b_null,%rp
- nop
- bl b_null,%rp
- nop
- bl b_null,%rp
- nop
-
- addibf,<= -8,%arg0,_loop1 ; decrement counter by 8 and loop
- nop
-
- ldw -20(%sp),%rp ; restore return-pointer
- bv %r0(%rp) ; return to caller
- ldo -64(%sp),%sp ; remove stack-frame
-
- .EXIT
- .PROCEND
-
-; Copy register-to-register.
-; On PA-RISC this is implemented with an `or'.
-; The `or' is hidden by a pseudo-operation called `copy'.
-
-b_add
- .PROC
- .CALLINFO NO_CALLS, FRAME=0
- .ENTRY
-
-_loop2
- copy %r19,%r20 ; copy register-to-register
- copy %r20,%r21 ; use caller-saves registers
- copy %r21,%r22
- copy %r22,%r21
- copy %r21,%r20
- copy %r20,%r19
- copy %r19,%r20
- copy %r20,%r21
-
- addibf,<= -8,%arg0,_loop2 ; decrement counter by 8 and loop
- nop
-
- bv,n %r0(%rp)
-
- .EXIT
- .PROCEND
-
-; Load memory to a register.
-
-b_load
- .PROC
- .CALLINFO NO_CALLS, FRAME=0
- .ENTRY
-
-_loop3
- ldw -4(%sp),%r22 ; load data from frame-marker
- ldw -8(%sp),%r22 ; use a caller-saves register
- ldw -12(%sp),%r22
- ldw -16(%sp),%r22
- ldw -20(%sp),%r22
- ldw -24(%sp),%r22
- ldw -28(%sp),%r22
- ldw -32(%sp),%r22
-
- addibf,<= -8,%arg0,_loop3 ; decrement counter by 8 and loop
- nop
-
- bv,n %r0(%rp)
-
- .EXIT
- .PROCEND
-
-
- .ALIGN 8
-to_call
- .WORD b_null
diff --git a/qt/md/i386.README b/qt/md/i386.README
deleted file mode 100644
index 8ffb92198..000000000
--- a/qt/md/i386.README
+++ /dev/null
@@ -1,7 +0,0 @@
-Note that some machines want labels to have leading underscores,
-while others (e.g. System V) do not. Thus, several labels appear
-duplicated except for the leading underscore, e.g.
-
- _qt_cswap:
- qt_cswap:
-
diff --git a/qt/md/i386.asm b/qt/md/i386.asm
deleted file mode 100644
index b79f165df..000000000
--- a/qt/md/i386.asm
+++ /dev/null
@@ -1,112 +0,0 @@
-;; i386.asm -- assembly support.
-
-;;
-;; QuickThreads -- Threads-building toolkit.
-;; Copyright (c) 2001 Free Software Foundation, Inc.
-;;
-;; Permission to use, copy, modify and distribute this software and
-;; its documentation for any purpose and without fee is hereby
-;; granted, provided that the above copyright notice and this notice
-;; appear in all copies. This software is provided as a
-;; proof-of-concept and for demonstration purposes; there is no
-;; representation about the suitability of this software for any
-;; purpose.
-
-;; NOTE: double-labeled `_name' and `name' for System V compatability.
-;; NOTE: Comment lines start like this one, or with '//' ONLY. Sorry!
-
-;; Callee-save: %esi, %edi, %ebx, %ebp
-;; Caller-save: %eax, %ecx
-;; Can't tell: %edx (seems to work w/o saving it.)
-;;
-;; Assignment:
-;;
-;; See ``i386.h'' for the somewhat unconventional stack layout.
-
-
- .386p
- .model flat
- .code
-
- public _qt_abort
- public qt_abort
- public _qt_block
- public qt_block
- public _qt_blocki
- public qt_blocki
-
-;; These all have the type signature
-;;
-;; void *blocking (helper, arg0, arg1, new)
-;;
-;; On procedure entry, the helper is at 4(sp), args at 8(sp) and
-;; 12(sp) and the new thread's sp at 16(sp). It *appears* that the
-;; calling convention for the 8X86 requires the caller to save all
-;; floating-point registers, this makes our life easy.
-
-;; Halt the currently-running thread. Save it's callee-save regs on
-;; to the stack, 32 bytes. Switch to the new stack (next == 16+32(sp))
-;; and call the user function (f == 4+32(sp) with arguments: old sp
-;; arg1 (8+32(sp)) and arg2 (12+32(sp)). When the user function is
-;; done, restore the new thread's state and return.
-;;
-;; `qt_abort' is (currently) an alias for `qt_block' because most of
-;; the work is shared. We could save the insns up to `qt_common' by
-;; replicating, but w/o replicating we need an inital subtract (to
-;; offset the stack as if it had been a qt_block) and then a jump
-;; to qt_common. For the cost of a jump, we might as well just do
-;; all the work.
-;;
-;; The helper function (4(sp)) can return a void* that is returned
-;; by the call to `qt_blockk{,i}'. Since we don't touch %eax in
-;; between, we get that ``for free''.
-
-_qt_abort:
-qt_abort:
-_qt_block:
-qt_block:
-_qt_blocki:
-qt_blocki:
- push ebp ; Save callee-save, sp-=4.
- push esi ; Save callee-save, sp-=4.
- push edi ; Save callee-save, sp-=4.
- push ebx ; Save callee-save, sp-=4.
- mov eax, esp ; Remember old stack pointer.
-
-qt_common:
- mov esp, [esp+32] ; Move to new thread.
- push [eax+28] ; Push arg 2.
- push [eax+24] ; Push arg 1.
- push eax ; Push arg 0.
- mov ebx, [eax+20] ; Get function to call.
- call ebx ; Call f.
- add esp, 12 ; Pop args.
-
- pop ebx ; Restore callee-save, sp+=4.
- pop edi ; Restore callee-save, sp+=4.
- pop esi ; Restore callee-save, sp+=4.
- pop ebp ; Restore callee-save, sp+=4.
- ret ; Resume the stopped function.
- hlt
-
-
-;; Start a varargs thread.
-
- public _qt_vstart
- public qt_vstart
-
-_qt_vstart:
-qt_vstart:
- push edi ; Push `pt' arg to `startup'.
- call ebp ; Call `startup'.
- pop eax ; Clean up the stack.
-
- call ebx ; Call the user's function.
-
- push eax ; Push return from user's.
- push edi ; Push `pt' arg to `cleanup'.
- call esi ; Call `cleanup'.
-
- hlt ; `cleanup' never returns.
-
- end
diff --git a/qt/md/i386.h b/qt/md/i386.h
deleted file mode 100644
index d7feba010..000000000
--- a/qt/md/i386.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
-#ifndef QT_386_H
-#define QT_386_H
-
-typedef unsigned long qt_word_t;
-
-/* Thread's initial stack layout on the i386:
-
- non-varargs:
-
- +---
- | arg[2] === `userf' on startup
- | arg[1] === `pt' on startup
- | arg[0] === `pu' on startup
- +---
- | ret pc === qt_error
- +---
- | ret pc === `only' on startup
- +---
- | %ebp
- | %esi
- | %edi
- | %ebx <--- qt_t.sp
- +---
-
- When a non-varargs thread is started, it ``returns'' directly to
- the client's `only' function.
-
- varargs:
-
- +---
- | arg[n-1]
- | ..
- | arg[0]
- +---
- | ret pc === `qt_vstart'
- +---
- | %ebp === `startup'
- | %esi === `cleanup'
- | %edi === `pt'
- | %ebx === `vuserf' <--- qt_t.sp
- +---
-
- When a varargs thread is started, it ``returns'' to the `qt_vstart'
- startup code. The startup code calls the appropriate functions. */
-
-
-/* What to do to start a varargs thread running. */
-QT_API void qt_vstart (void);
-
-
-/* Hold 4 saved regs plus two return pcs (qt_error, qt_start) plus
- three args. */
-#define QT_STKBASE (9 * 4)
-
-/* Hold 4 saved regs plus one return pc (qt_vstart). */
-#define QT_VSTKBASE (5 * 4)
-
-
-/* Stack must be 4-byte aligned. */
-#define QT_STKALIGN (4)
-
-
-/* Where to place various arguments. */
-#define QT_ONLY_INDEX (QT_PC)
-#define QT_USER_INDEX (QT_ARG2)
-#define QT_ARGT_INDEX (QT_ARG1)
-#define QT_ARGU_INDEX (QT_ARG0)
-
-#define QT_VSTARTUP_INDEX (QT_EBP)
-#define QT_VUSERF_INDEX (QT_EBX)
-#define QT_VCLEANUP_INDEX (QT_ESI)
-#define QT_VARGT_INDEX (QT_EDI)
-
-
-#define QT_EBX 0
-#define QT_EDI 1
-#define QT_ESI 2
-#define QT_EBP 3
-#define QT_PC 4
-/* The following are defined only for non-varargs. */
-#define QT_RPC 5
-#define QT_ARG0 6
-#define QT_ARG1 7
-#define QT_ARG2 8
-
-
-/* Stack grows down. The top of the stack is the first thing to
- pop off (preincrement, postdecrement). */
-#define QT_GROW_DOWN
-
-QT_API void qt_error (void);
-
-/* Push on the error return address. */
-#define QT_ARGS_MD(sto) \
- (QT_SPUT (sto, QT_RPC, qt_error))
-
-
-/* When varargs are pushed, allocate space for all the args. */
-#define QT_VARGS_MD0(sto, nbytes) \
- ((qt_t *)(((char *)(sto)) - QT_STKROUNDUP(nbytes)))
-
-#define QT_VARGS_MD1(sto) \
- (QT_SPUT (sto, QT_PC, qt_vstart))
-
-#define QT_VARGS_DEFAULT
-
-#endif /* QT_386_H */
diff --git a/qt/md/i386.s b/qt/md/i386.s
deleted file mode 100644
index 2872639b1..000000000
--- a/qt/md/i386.s
+++ /dev/null
@@ -1,108 +0,0 @@
-/* i386.s -- assembly support. */
-
-/*
-// QuickThreads -- Threads-building toolkit.
-// Copyright (c) 1993 by David Keppel
-//
-// Permission to use, copy, modify and distribute this software and
-// its documentation for any purpose and without fee is hereby
-// granted, provided that the above copyright notice and this notice
-// appear in all copies. This software is provided as a
-// proof-of-concept and for demonstration purposes; there is no
-// representation about the suitability of this software for any
-// purpose. */
-
-/* NOTE: double-labeled `_name' and `name' for System V compatability. */
-/* NOTE: Comment lines start like this one, or with '//' ONLY. Sorry! */
-
-/* Callee-save: %esi, %edi, %ebx, %ebp
-// Caller-save: %eax, %ecx
-// Can't tell: %edx (seems to work w/o saving it.)
-//
-// Assignment:
-//
-// See ``i386.h'' for the somewhat unconventional stack layout. */
-
-
- .text
- .align 2
-
- .globl _qt_abort
- .globl qt_abort
- .globl _qt_block
- .globl qt_block
- .globl _qt_blocki
- .globl qt_blocki
-
-/* These all have the type signature
-//
-// void *blocking (helper, arg0, arg1, new)
-//
-// On procedure entry, the helper is at 4(sp), args at 8(sp) and
-// 12(sp) and the new thread's sp at 16(sp). It *appears* that the
-// calling convention for the 8X86 requires the caller to save all
-// floating-point registers, this makes our life easy. */
-
-/* Halt the currently-running thread. Save it's callee-save regs on
-// to the stack, 32 bytes. Switch to the new stack (next == 16+32(sp))
-// and call the user function (f == 4+32(sp) with arguments: old sp
-// arg1 (8+32(sp)) and arg2 (12+32(sp)). When the user function is
-// done, restore the new thread's state and return.
-//
-// `qt_abort' is (currently) an alias for `qt_block' because most of
-// the work is shared. We could save the insns up to `qt_common' by
-// replicating, but w/o replicating we need an inital subtract (to
-// offset the stack as if it had been a qt_block) and then a jump
-// to qt_common. For the cost of a jump, we might as well just do
-// all the work.
-//
-// The helper function (4(sp)) can return a void* that is returned
-// by the call to `qt_blockk{,i}'. Since we don't touch %eax in
-// between, we get that ``for free''. */
-
-_qt_abort:
-qt_abort:
-_qt_block:
-qt_block:
-_qt_blocki:
-qt_blocki:
- pushl %ebp /* Save callee-save, sp-=4. */
- pushl %esi /* Save callee-save, sp-=4. */
- pushl %edi /* Save callee-save, sp-=4. */
- pushl %ebx /* Save callee-save, sp-=4. */
- movl %esp, %eax /* Remember old stack pointer. */
-
-qt_common:
- movl 32(%esp), %esp /* Move to new thread. */
- pushl 28(%eax) /* Push arg 2. */
- pushl 24(%eax) /* Push arg 1. */
- pushl %eax /* Push arg 0. */
- movl 20(%eax), %ebx /* Get function to call. */
- call *%ebx /* Call f. */
- addl $12, %esp /* Pop args. */
-
- popl %ebx /* Restore callee-save, sp+=4. */
- popl %edi /* Restore callee-save, sp+=4. */
- popl %esi /* Restore callee-save, sp+=4. */
- popl %ebp /* Restore callee-save, sp+=4. */
- ret /* Resume the stopped function. */
- hlt
-
-
-/* Start a varargs thread. */
-
- .globl _qt_vstart
- .globl qt_vstart
-_qt_vstart:
-qt_vstart:
- pushl %edi /* Push `pt' arg to `startup'. */
- call *%ebp /* Call `startup'. */
- popl %eax /* Clean up the stack. */
-
- call *%ebx /* Call the user's function. */
-
- pushl %eax /* Push return from user's. */
- pushl %edi /* Push `pt' arg to `cleanup'. */
- call *%esi /* Call `cleanup'. */
-
- hlt /* `cleanup' never returns. */
diff --git a/qt/md/i386_b.s b/qt/md/i386_b.s
deleted file mode 100644
index 32129a5d1..000000000
--- a/qt/md/i386_b.s
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-// QuickThreads -- Threads-building toolkit.
-// Copyright (c) 1993 by David Keppel
-//
-// Permission to use, copy, modify and distribute this software and
-// its documentation for any purpose and without fee is hereby
-// granted, provided that the above copyright notice and this notice
-// appear in all copies. This software is provided as a
-// proof-of-concept and for demonstration purposes; there is no
-// representation about the suitability of this software for any
-// purpose. */
-
- .globl _b_call_reg
- .globl b_call_reg
- .globl _b_call_imm
- .globl b_call_imm
- .globl _b_add
- .globl b_add
- .globl _b_load
- .globl b_load
-
-_b_call_reg:
-b_call_reg:
-_b_call_imm:
-b_call_imm:
-_b_add:
-b_add:
-_b_load:
-b_load:
- hlt
diff --git a/qt/md/ksr1.Makefile b/qt/md/ksr1.Makefile
deleted file mode 100644
index aa195839a..000000000
--- a/qt/md/ksr1.Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-
-#
-# KSR1 configuration.
-#
-CC = cc -ansi
-
diff --git a/qt/md/ksr1.h b/qt/md/ksr1.h
deleted file mode 100644
index 83537a3c2..000000000
--- a/qt/md/ksr1.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
-#ifndef QT_KSR1_H
-#define QT_KSR1_H
-
-/*
- Stack layout:
-
- Registers are saved in strictly low to high order, FPU regs first
- (only if qt_block is called), CEU regs second, IPU regs next, with no
- padding between the groups.
-
- Callee-save: f16..f63; c15..c30; i12..i30.
- Args passed in i2..i5.
-
- Note: c31 is a private data pointer. It is not changed on thread
- swaps with the assumption that it represents per-processor rather
- than per-thread state.
-
- Note: i31 is an instruction count register that is updated by the
- context switch routines. Like c31, it is not changed on context
- switches.
-
- This is what we want on startup:
-
-
- +------ <-- BOS: Bottom of stack (grows down)
- | 80 (128 - 48) bytes of padding to a 128-byte boundary
- +---
- | only
- | userf
- | t
- | u
- | qt_start$TXT
- | (empty) <-- qt.sp
- +------ <-- (BOS - 128)
-
- This is why we want this on startup:
-
- A thread begins running when the restore procedure switches thread stacks
- and pops a return address off of the top of the new stack (see below
- for the reason why we explicitly store qt_start$TXT). The
- block procedure pushes two jump addresses on a thread's stack before
- it switches stacks. The first is the return address for the block
- procedure, and the second is a restore address. The return address
- is used to jump back to the thread that has been switched to; the
- restore address is a jump within the block code to restore the registers.
- Normally, this is just a jump to the next address. However, on thread
- startup, this is a jump to qt_start$TXT. (The block procedure stores
- the restore address at an offset of 8 bytes from the top of the stack,
- which is also the offset at which qt_start$TXT is stored on the stacks
- of new threads. Hence, when the block procedure switches to a new
- thread stack, it will initially jump to qt_start$TXT; thereafter,
- it jumps to the restore code.)
-
- qt_start$TXT, after it has read the initial data on the new thread's
- stack and placed it in registers, pops the initial stack frame
- and gives the thread the entire stack to use for execution.
-
- The KSR runtime system has an unusual treatment of pointers to
- functions. From C, taking the `name' of a function yields a
- pointer to a _constant block_ and *not* the address of the
- function. The zero'th entry in the constant block is a pointer to
- the function.
-
- We have to be careful: the restore procedure expects a return
- address on the top of the stack (pointed to by qt.sp). This is not
- a problem when restoring a thread that has run before, since the
- block routine would have stored the return address on top of the
- stack. However, when ``faking up'' a thread start (bootstrapping a
- thread stack frame), the top of the stack needs to contain a
- pointer to the code that will start the thread running.
-
- The pointer to the startup code is *not* `qt_start'. It is the
- word *pointed to* by `qt_start'. Thus, we dereference `qt_start',
- see QT_ARGS_MD below.
-
- On varargs startup (still unimplemented):
-
- | padding to 128 byte boundary
- | varargs <-- padded to a 128-byte-boundary
- +---
- | caller's frame, 16 bytes
- | 80 bytes of padding (frame padded to a 128-byte boundary)
- +---
- | cleanup
- | vuserf
- | startup
- | t
- +---
- | qt_start <-- qt.sp
- +---
-
- Of a suspended thread:
-
- +---
- | caller's frame, 16 bytes
- | fpu registers 47 regs * 8 bytes/reg 376 bytes
- | ceu registers 16 regs * 8 bytes/reg 128 bytes
- | ipu registers 19 regs * 8 bytes/reg 152 bytes
- | :
- | 80 bytes of padding
- | :
- | qt_restore <-- qt.sp
- +---
-
- */
-
-
-#define QT_STKALIGN 128
-#define QT_GROW_DOWN
-typedef unsigned long qt_word_t;
-
-#define QT_STKBASE QT_STKALIGN
-#define QT_VSTKBASE QT_STKBASE
-
-extern void qt_start(void);
-/*
- * See the discussion above for what indexing into a procedure ptr
- * does for us (it's lovely, though, isn't it?).
- *
- * This assumes that the address of a procedure's code is the
- * first word in a procedure's constant block. That's how the manual
- * says it will be arranged.
- */
-#define QT_ARGS_MD(sp) (QT_SPUT (sp, 1, ((qt_word_t *)qt_start)[0]))
-
-/*
- * The *index* (positive offset) of where to put each value.
- * See the picture of the stack above that explains the offsets.
- */
-#define QT_ONLY_INDEX (5)
-#define QT_USER_INDEX (4)
-#define QT_ARGT_INDEX (3)
-#define QT_ARGU_INDEX (2)
-
-#define QT_VARGS_DEFAULT
-#define QT_VARGS(sp, nb, vargs, pt, startup, vuserf, cleanup) \
- (qt_vargs (sp, nbytes, &vargs, pt, startup, vuserf, cleanup))
-
-
-#define QT_VARGS_MD0(sp, vabytes) \
- ((qt_t *)(((char *)(sp)) - 4*8 - QT_STKROUNDUP(vabytes)))
-
-extern void qt_vstart(void);
-#define QT_VARGS_MD1(sp) (QT_SPUT (sp, 0, ((qt_word_t *)qt_vstart)[0]))
-
-#define QT_VCLEANUP_INDEX (4)
-#define QT_VUSERF_INDEX (3)
-#define QT_VSTARTUP_INDEX (2)
-#define QT_VARGT_INDEX (1)
-
-#endif /* def QT_KSR1_H */
diff --git a/qt/md/ksr1.s b/qt/md/ksr1.s
deleted file mode 100644
index d4d51a0a6..000000000
--- a/qt/md/ksr1.s
+++ /dev/null
@@ -1,424 +0,0 @@
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
- .file "ksr1.s"
- .def .debug; .endef
-
- .align 128
- .globl qt_blocki
- .globl qt_blocki$TXT
- .globl qt_block
- .globl qt_block$TXT
- .globl qt_start$TXT
- .globl qt_start
- .globl qt_abort$TXT
- .globl qt_abort
- .globl qt_vstart
- .globl qt_vstart$TXT
-
-#
-# KSR convention: on procedure calls, load both the procedure address
-# and a pointer to a constant block. The address of function `f' is
-# `f$TXT', and the constant block address is `f'. The constant block
-# has several reserved values:
-#
-# 8 bytes fpu register save mask
-# 4 bytes ipu register save mask
-# 4 bytes ceu register save mask
-# f: f$TXT
-# ... whatever you want ... (not quite...read on)
-#
-# Note, by the way, that a pointer to a function is passed as a
-# pointer to the constant area, and the constant area has the text
-# address.
-#
-
-#
-# Procedures that do not return structures prefix their code with
-#
-# proc$TXT:
-# finop; cxnop
-# finop; cxnop
-# <proc code>
-#
-# Calls to those procedures branch to a 16 byte offset (4 instrs) in
-# to the procedure to skip those instructions.
-#
-# Procedures that return structures use a different code prefix:
-#
-# proc$TXT:
-# finop; beq.qt %rc, %rc, 24 # return value entry
-# finop; cxnop
-# finop; movi8 0, %rc # no return value entry
-# <proc code>
-#
-# Calls that want the returned structure branch directly to the
-# procedure address. Callers that don't want (or aren't expecting) a
-# return value branche 16 bytes in to the procedure, which will zero
-# %rc, telling the called procedure not to return a structure.
-#
-
-#
-# On entry:
-# %i2 -- control block of helper function to run
-# (dereference to get helper)
-# %i3 -- a1
-# %i4 -- a2
-# %i5 -- sp of new to run
-#
-
- .data
- .half 0x0, 0x0, 0x7ffff000, 0x7fff8000
-qt_blocki:
-qt_abort:
- .word qt_blocki$TXT
- .word qt_restore$TXT
-
- .text
-qt_abort$TXT:
-qt_blocki$TXT:
- finop ; cxnop # entry prefix
- finop ; cxnop # entry prefix
- add8.ntr 75,%i31,%i31 ; movi8 512,%c5 # ICR; stk adjust
- finop ; ssub8.ntr 0,%sp,%c5,%sp
- finop ; st8 %fp,504(%sp) # Save caller's fp
- finop ; st8 %cp,496(%sp) # Save caller's cp
- finop ; ld8 8(%c10),%c5 # ld qt_restore$TXT
- finop ; st8 %c14,0(%sp) # Save special ret addr
- finop ; mov8_8 %c10, %cp # Our cp
- finop ; sadd8.ntr 0,%sp,%c5,%fp # Our frame ptr
- finop ; st8 %c5,8(%sp) # st qt_restore$TXT
-#
-# CEU registers %c15-%c24, %c26-%c30 (%c14 we restore later)
-#
- finop ; st8 %c15,456(%sp)
- finop ; st8 %c16,448(%sp)
- finop ; st8 %c17,440(%sp)
- finop ; st8 %c18,432(%sp)
- finop ; st8 %c19,424(%sp)
- finop ; st8 %c20,416(%sp)
- finop ; st8 %c21,408(%sp)
- finop ; st8 %c22,400(%sp)
- finop ; st8 %c23,392(%sp)
- finop ; st8 %c24,384(%sp)
-#
-# %c25 is the Enclosing Frame Pointer (EFP) -- since C doesn't
-# use nested procedures, we ignore it (leaving a gap, though)
-#
- finop ; st8 %c26,368(%sp)
- finop ; st8 %c27,360(%sp)
- finop ; st8 %c28,352(%sp)
- finop ; st8 %c29,344(%sp)
- finop ; st8 %c30,336(%sp)
-#
-# IPU registers %i12-%i30
-#
- finop ; st8 %i12,328(%sp)
- finop ; st8 %i13,320(%sp)
- finop ; st8 %i14,312(%sp)
- finop ; st8 %i15,304(%sp)
-# (gap to get alignment for st64)
-# -- Doesn't work on version 1.1.3 of the OS
-# finop ; st64 %i16,256(%sp)
-
- finop ; st8 %i16,256(%sp)
- finop ; st8 %i17,248(%sp)
- finop ; st8 %i18,240(%sp)
- finop ; st8 %i19,232(%sp)
- finop ; st8 %i20,224(%sp)
- finop ; st8 %i21,216(%sp)
- finop ; st8 %i22,208(%sp)
- finop ; st8 %i23,200(%sp)
- finop ; st8 %i24,192(%sp)
- finop ; st8 %i25,184(%sp)
- finop ; st8 %i26,176(%sp)
- finop ; st8 %i27,168(%sp)
- finop ; st8 %i28,160(%sp)
- finop ; st8 %i29,152(%sp)
- finop ; st8 %i30,144(%sp)
-#
-# FPU already saved, or saving not necessary
-#
-
-#
-# Switch to the stack passed in as fourth argument to the block
-# routine (%i5) and call the helper routine passed in as the first
-# argument (%i2). Note that the address of the helper's constant
-# block is passed in, so we must derefence it to get the helper's text
-# address.
-#
- finop ; movb8_8 %i2,%c10 # helper's ConstBlock
- finop ; cxnop # Delay slot, fill w/
- finop ; cxnop # .. 2 st8 from above
- finop ; ld8 0(%c10),%c4 # load addr of helper
- finop ; movb8_8 %sp, %i2 # 1st arg to helper
- # is this stack; other
- # args remain in regs
- finop ; movb8_8 %i5,%sp # switch stacks
- finop ; jsr %c14,16(%c4) # call helper
- movi8 3, %i0 ; movi8 0,%c8 # nargs brain dmg
- finop ; cxnop
- finop ; cxnop
-#
-# Here is where behavior differs for threads being restored and threads
-# being started. Blocked threads have a pointer to qt_restore$TXT on
-# the top of their stacks; manufactured stacks have a pointer to qt_start$TXT
-# on the top of their stacks. With this setup, starting threads
-# skip the (unecessary) restore operations.
-#
-# We jump to an offset of 16 to either (1) skip past the two noop pairs
-# at the start of qt_start$TXT, or (2) skip past the two noop pairs
-# after qt_restore$TXT.
-#
- finop ; ld8 8(%sp),%c4
- finop ; cxnop
- finop ; cxnop
- finop ; jmp 16(%c4)
-qt_restore$TXT:
- finop ; cxnop
- finop ; cxnop
-#
-# Point of Restore:
-#
-# The helper funtion will return here. Any result it has placed in
-# a return register (most likely %i0) will not get overwritten below
-# and will consequently be the return value of the blocking routine.
-#
-
-#
-# CEU registers %c15-%c24, %c26-%c30 (%c14 we restore later)
-#
- finop ; ld8 456(%sp),%c15
- finop ; ld8 448(%sp),%c16
- finop ; ld8 440(%sp),%c17
- finop ; ld8 432(%sp),%c18
- finop ; ld8 424(%sp),%c19
- finop ; ld8 416(%sp),%c20
- finop ; ld8 408(%sp),%c21
- finop ; ld8 400(%sp),%c22
- finop ; ld8 392(%sp),%c23
- finop ; ld8 384(%sp),%c24
-#
-# %c25 is the Enclosing Frame Pointer (EFP) -- since C doesn't
-# use nested procedures, we ignore it (leaving a gap, though)
-#
- finop ; ld8 368(%sp),%c26
- finop ; ld8 360(%sp),%c27
- finop ; ld8 352(%sp),%c28
- finop ; ld8 344(%sp),%c29
- finop ; ld8 336(%sp),%c30
-#
-# IPU registers %i12-%i30
-#
- finop ; ld8 328(%sp),%i12
- finop ; ld8 320(%sp),%i13
- finop ; ld8 312(%sp),%i14
- finop ; ld8 304(%sp),%i15
-# (gap to get alignment for ld64)
-# -- Doesn't work on version 1.1.3 of the OS
-# finop ; ld64 256(%sp),%i16
-
- finop ; ld8 256(%sp),%i16
- finop ; ld8 248(%sp),%i17
- finop ; ld8 240(%sp),%i18
- finop ; ld8 232(%sp),%i19
- finop ; ld8 224(%sp),%i20
- finop ; ld8 216(%sp),%i21
- finop ; ld8 208(%sp),%i22
- finop ; ld8 200(%sp),%i23
- finop ; ld8 192(%sp),%i24
- finop ; ld8 184(%sp),%i25
- finop ; ld8 176(%sp),%i26
- finop ; ld8 168(%sp),%i27
- finop ; ld8 160(%sp),%i28
- finop ; ld8 152(%sp),%i29
- finop ; ld8 144(%sp),%i30
-
-#
-# FPU registers don't need to be loaded, or will be loaded by an
-# enclosing scope (e.g., if this is called by qt_block).
-#
-
-#
-# Load the special registers. We don't load the stack ptr because
-# the new stack is passed in as an argument, we don't load the EFP
-# because we don't use it, and we load the return address specially
-# off the top of the stack.
-#
- finop ; ld8 0(%sp),%c14 # return addr
- finop ; ld8 496(%sp),%cp
- finop ; ld8 504(%sp),%fp
-
- finop ; jmp 32(%c14) # jump back to thread
- finop ; movi8 512,%c5 # stack adjust
- finop ; sadd8.ntr 0,%sp,%c5,%sp
-
- .data
- .half 0x0, 0x0, 0x7ffff000, 0x7fff8000
-qt_block:
- .word qt_block$TXT
- .word qt_error
- .word qt_error$TXT
- .word qt_blocki
-#
-# Handle saving and restoring the FPU regs, relying on qt_blocki
-# to save and restore the remaining registers.
-#
- .text
-qt_block$TXT:
- finop ; cxnop # entry prefix
- finop ; cxnop # entry prefix
-
- add8.ntr 29,%i31,%i31 ; movi8 512,%c5 # ICR; stk adjust
- finop ; ssub8.ntr 0,%sp,%c5,%sp
- finop ; st8 %fp,504(%sp) # Save caller's fp
- finop ; st8 %cp,496(%sp) # Save caller's cp
- finop ; st8 %c14,488(%sp) # store ret addr
- finop ; sadd8.ntr 0,%sp,%c5,%fp # Our frame ptr
- finop ; mov8_8 %c10, %cp # Our cp
-
-#
-# Store 8 registers at once...destination must be a multiple of 64
-#
- finop ; st64 %f16,384(%sp)
- finop ; st64 %f24,320(%sp)
- finop ; st64 %f32,256(%sp)
- finop ; st64 %f40,192(%sp)
- finop ; st64 %f48,128(%sp)
- finop ; st64 %f56,64(%sp)
-
-#
-# Call the integer blocking routine, passing the arguments passed to us
-#
- finop ; ld8 24(%cp), %c10
- finop ; cxnop
- finop ; jsr %c14, qt_blocki$TXT
- finop ; cxnop
- finop ; cxnop
- movi8 4,%i0 ; movi8 0,%c8 # nargs brain dmg
-
-#
-# Load 8 registers at once...source must be a multiple of 64
-#
- finop ; ld64 64(%sp),%f56
- finop ; ld64 128(%sp),%f48
- finop ; ld64 192(%sp),%f40
- finop ; ld64 256(%sp),%f32
- finop ; ld64 320(%sp),%f24
- finop ; ld64 384(%sp),%f16
-
- finop ; ld8 488(%sp),%c14
- finop ; ld8 496(%sp),%cp
- finop ; ld8 504(%sp),%fp
- finop ; jmp 32(%c14) # jump back to thread
- finop ; movi8 512,%c5 # stack adjust
- finop ; sadd8.ntr 0,%sp,%c5,%sp
-
-
- .data
- .half 0x0, 0x0, 0x7ffff000, 0x7fff8000
-qt_start:
- .word qt_start$TXT
-#
-# A new thread is set up to "appear" as if it were executing code at
-# the beginning of qt_start and then it called a blocking routine
-# (qt_blocki). So when a new thread starts to run, it gets unblocked
-# by the code above and "returns" to `qt_start$TXT' in the
-# restore step of the switch. Blocked threads jump to 16(qt_restore$TXT),
-# and starting threads jump to 16(qt_start$TXT).
-#
- .text
-qt_start$TXT:
- finop ; cxnop #
- finop ; cxnop #
- finop ; ld8 40(%sp),%c10 # `only' constant block
- finop ; ld8 32(%sp),%i4 # `userf' arg.
- finop ; ld8 24(%sp),%i3 # `t' arg.
- finop ; ld8 0(%c10),%c4 # `only' text location
- finop ; ld8 16(%sp),%i2 # `u' arg.
- finop ; cxnop
- finop ; jsr %c14,16(%c4) # call `only'
-#
-# Pop the frame used to store the thread's initial data
-#
- finop ; sadd8.ntr 0,%sp,128,%sp
- finop ; cxnop
- movi8 2,%i0 ; movi8 0,%c8 # nargs brain dmg
-#
-# If we ever return, it's an error.
-#
- finop ; jmp qt_error$TXT
- finop ; cxnop
- finop ; cxnop
- movi8 0,%i0 ; movi8 0,%c8 # nargs brain dmg
-
-
-#
-# This stuff is broken
-#
- .data
- .half 0x0, 0x0, 0x7ffff000, 0x7fff8000
-qt_vstart:
- .word qt_vstart$TXT
-
- .text
-qt_vstart$TXT:
- finop ; cxnop # entry prefix
- finop ; cxnop # entry prefix
- finop ; cxnop
- finop ; cxnop
- add8.ntr 11,%i31,%i31 ; movi8 512,%c5
- finop ; ssub8.ntr 0,%sp,%c5,%sp # fix stack
- finop ; ld8 8(%sp),%i2 # load `t' as arg to
- finop ; cxnop # `startup'
- finop ; cxnop
- finop ; ld8 16(%sp),%c10 # `startup' const block
- finop ; cxnop
- finop ; cxnop
- finop ; ld8 0(%c10),%c4 # `startup' text loc.
- finop ; cxnop
- finop ; cxnop
- finop ; jsr %c14,16(%c4) # call `startup'
- finop ; cxnop
- finop ; cxnop
- movi8 1, %i0 ; movi8 0,%c8 # nargs brain dmg
-#
-# finop ; sadd 0,%sp,128,%sp # alter stack
-#
- finop ; ld8 8(%sp),%i2 # load `t' as arg to
- finop ; ld8 8(%sp),%i2 # load `t' as arg to
- finop ; ld8 8(%sp),%i2 # load `t' as arg to
- finop ; ld8 8(%sp),%i2 # load `t' as arg to
-
- finop ; ld8 32(%sp),%c10 # `only' constant block
- finop ; ld8 8(%sp),%i2 # `u' arg.
- finop ; ld8 16(%sp),%i3 # `t' arg.
- finop ; ld8 0(%c10),%c4 # `only' text location
- finop ; ld8 24(%sp),%i4 # `userf' arg.
- finop ; cxnop
- finop ; jsr %c4,16(%c4) # call `only'
- finop ; cxnop
- finop ; cxnop
-#
-# If the callee ever calls `nargs', the following instruction (pair)
-# will be executed. However, we don't know when we compile this code
-# how many args are being passed. So we give our best guess: 0.
-#
- movi8 0,%i0 ; movi8 0,%c8 # nargs brain dmg
-#
-# If we ever return, it's an error.
-#
- finop ; jmp qt_error$TXT
- finop ; cxnop
- finop ; cxnop
- movi8 0,%i0 ; movi8 0,%c8 # nargs brain dmg
diff --git a/qt/md/ksr1_b.s b/qt/md/ksr1_b.s
deleted file mode 100644
index 80b0c59eb..000000000
--- a/qt/md/ksr1_b.s
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
- .file "ksr1_b.s"
- .def .debug; .endef
-
- .globl b_call_reg$TXT
- .globl b_call_reg
- .globl b_call_imm$TXT
- .globl b_call_imm
- .globl b_add$TXT
- .globl b_add
- .globl b_load$TXT
- .globl b_load
-
-
-b_call_reg:
-b_call_imm:
-b_add:
-b_load:
- .word b_call_reg$TXT
- .word qt_error
- .word qt_error$TXT
-
-
-b_call_reg$TXT:
-b_call_imm$TXT:
-b_add$TXT:
-b_load$TXT:
- finop ; cxnop
- finop ; cxnop
- finop ; ld8 16(%cp),%c4
- finop ; ld8 8(%cp),%cp
- finop ; cxnop
- finop ; cxnop
- finop ; jsr %c4,0(%c4)
- finop ; cxnop
- finop ; cxnop
-
diff --git a/qt/md/m88k.Makefile b/qt/md/m88k.Makefile
deleted file mode 100644
index 608c70690..000000000
--- a/qt/md/m88k.Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-
-#
-# Hosted compilers for 88k for Meerkat.
-#
-CC = gcc88 -Dm88k -ansi -pedantic -Wall -fno-builtin
-AS = as88
diff --git a/qt/md/m88k.c b/qt/md/m88k.c
deleted file mode 100644
index 9e3ae8ba8..000000000
--- a/qt/md/m88k.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
-#include <stdarg.h>
-#include "qt.h"
-
-/* Varargs is harder on the m88k. Parameters are saved on the stack as
- something like (stack grows down to low memory; low at bottom of
- picture):
-
- | :
- | arg8 <-- va_list.__va_stk
- +---
- | :
- +---
- | arg7
- | :
- | iarg0 <-- va_list.__va_reg
- +---
- | :
- | va_list { __va_arg, __va_stk, __va_reg }
- | :
- +---
-
- Here, `va_list.__va_arg' is the number of word-size arguments
- that have already been skipped. Doubles must be double-arligned.
-
- What this means for us is that the user's routine needs to be
- called with an arg list where some of the words in the `__va_stk'
- part of the parameter list have to be promoted to registers.
-
- BUG: doubleword register arguments must be double-aligned. If
- something is passed as an even # arg and used as an odd # arg or
- vice-versa, the code in the called routine (in the new thread) that
- decides how to adjust the index will get it wrong, because it will
- be expect it to be, say, doubleword aligned and it will really be
- singleword aligned.
-
- I'm not sure you can solve this without knowing the types of all
- the arguments. All in all, we never promised varargs would work
- reliably. */
-
-
-
-#define QT_VADJ(sp) (((char *)sp) - QT_VSTKBASE)
-
-/* Always allocate at least enough space for 8 args; waste some space
- at the base of the stack to ensure the startup routine doesn't read
- off the end of the stack. */
-
-#define QT_VARGS_MD0(sp, vabytes) \
- ((qt_t *)(((char *)(sp)) - 8*4 - QT_STKROUNDUP(vabytes)))
-
-extern void qt_vstart(void);
-#define QT_VARGS_MD1(sp) (QT_SPUT (sp, QT_1, qt_vstart))
-
-
- struct qt_t *
-qt_vargs (struct qt_t *qsp, int nbytes, void *vargs,
- void *pt, qt_function_t *startup,
- qt_function_t *vuserf, qt_function_t *cleanup)
-{
- va_list ap;
- int i;
- int n; /* Number of words into original arg list. */
- qt_word_t *sp;
- int *reg; /* Where to read passed-in-reg args. */
- int *stk; /* Where to read passed-on-stk args. */
-
- ap = *(va_list *)vargs;
- qsp = QT_VARGS_MD0 (qsp, nbytes);
- sp = (qt_word_t *)qsp;
-
- reg = (ap.__va_arg < 8)
- ? &ap.__va_reg[ap.__va_arg]
- : 0;
- stk = &ap.__va_stk[8];
- n = ap.__va_arg;
- for (i=0; i<nbytes/sizeof(qt_word_t) && n<8; ++i,++n) {
- sp[i] = *reg++;
- }
- for (; i<nbytes/sizeof(qt_word_t); ++i) {
- sp[i] = *stk++;
- }
-
-#ifdef QT_NDEF
- for (i=0; i<nbytes/sizeof(qt_word_t); ++i) {
- sp[i] = (n < 8)
- ? *reg++
- : *stk++;
- ++n;
- }
-#endif
-
- QT_VARGS_MD1 (QT_VADJ(sp));
- QT_SPUT (QT_VADJ(sp), QT_VARGT_INDEX, pt);
- QT_SPUT (QT_VADJ(sp), QT_VSTARTUP_INDEX, startup);
- QT_SPUT (QT_VADJ(sp), QT_VUSERF_INDEX, vuserf);
- QT_SPUT (QT_VADJ(sp), QT_VCLEANUP_INDEX, cleanup);
- return ((qt_t *)QT_VADJ(sp));
-}
diff --git a/qt/md/m88k.h b/qt/md/m88k.h
deleted file mode 100644
index df7e07a85..000000000
--- a/qt/md/m88k.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
-#ifndef QT_M88K_H
-#define QT_M88K_H
-
-typedef unsigned long qt_word_t;
-
-#define QT_GROW_DOWN
-
-/* Stack layout on the mips:
-
- Callee-save registers are: $16-$23, $30; $f20-$f30.
- Also save $31, return pc.
-
- Non-varargs:
-
- +---
- | r30 (fp) on startup === 0
- | r25
- | r24
- | r23
- | r22
- | r21
- | r20
- | r19
- | r18
- | r17 on startup === `only'
- | r16 on startup === `userf'
- | r15 on startup === `pt'
- | r14 on startup === `pu'
- | r1 on startup === `qt_start'
- | 0
- | 0
- +---
- | 0
- | ... (8 regs worth === 32 bytes of homing area)
- | 0 <--- sp
- +---
-
- Conventions for varargs:
-
- | :
- | arg8
- +---
- | r30 (fp) arg7
- | r25 arg6
- | r24 arg5
- | r23 arg4
- | r22 arg3
- | r21 arg2
- | r20 arg1
- | r19 arg0
- | r18
- | r17 on startup === `startup'
- | r16 on startup === `vuserf'
- | r15 on startup === `pt'
- | r14 on startup === `cleanup'
- | r1 on startup === `qt_vstart'
- | 0
- | 0
- +---
- | 0
- | ... (8 regs worth === 32 bytes of homing area)
- | 0 <--- sp
- +---
-
- */
-
-
-/* Stack must be doubleword aligned. */
-#define QT_STKALIGN (16) /* Doubleword aligned. */
-
-/* How much space is allocated to hold all the crud for
- initialization: saved registers plus padding to keep the stack
- aligned plus 8 words of padding to use as a `homing area' (for
- r2-r9) when calling helper functions on the stack of the (not yet
- started) thread. The varargs save area is small because it gets
- overlapped with the top of the parameter list. In case the
- parameter list is less than 8 args, QT_ARGS_MD0 adds some dead
- space at the top of the stack. */
-
-#define QT_STKBASE (16*4 + 8*4)
-#define QT_VSTKBASE (8*4 + 8*4)
-
-
-/* Index of various registers. */
-#define QT_1 (8+2)
-#define QT_14 (8+3)
-#define QT_15 (8+4)
-#define QT_16 (8+5)
-#define QT_17 (8+6)
-#define QT_30 (8+15)
-
-
-/* When a never-before-run thread is restored, the return pc points
- to a fragment of code that starts the thread running. For
- non-vargs functions, it sets up arguments and calls the client's
- `only' function. For varargs functions, the startup code calls the
- startup, user, and cleanup functions.
-
- For non-varargs functions, we set the frame pointer to 0 to
- null-terminate the call chain.
-
- For varargs functions, the frame pointer register is used to hold
- one of the arguments, so that all arguments can be laid out in
- memory by the conventional `qt_vargs' varargs initialization
- routine.
-
- The varargs startup routine always reads 8 words of arguments from
- the stack. If there are less than 8 words of arguments, then the
- arg list could call off the top of the stack. To prevent fall-off,
- always allocate 8 words. */
-
-extern void qt_start(void);
-#define QT_ARGS_MD(sp) \
- (QT_SPUT (sp, QT_1, qt_start), \
- QT_SPUT (sp, QT_30, 0))
-
-
-/* The m88k uses a struct for `va_list', so pass a pointer to the
- struct. */
-
-typedef void (qt_function_t)(void);
-
-struct qt_t;
-extern struct qt_t *qt_vargs (struct qt_t *sp, int nbytes,
- void *vargs, void *pt,
- qt_function_t *startup,
- qt_function_t *vuserf,
- qt_function_t *cleanup);
-
-#define QT_VARGS(sp, nbytes, vargs, pt, startup, vuserf, cleanup) \
- (qt_vargs (sp, nbytes, &(vargs), pt, (qt_function_t *)startup, \
- (qt_function_t *)vuserf, (qt_function_t *)cleanup))
-
-
-/* The *index* (positive offset) of where to put each value. */
-#define QT_ONLY_INDEX (QT_17)
-#define QT_USER_INDEX (QT_16)
-#define QT_ARGT_INDEX (QT_15)
-#define QT_ARGU_INDEX (QT_14)
-
-#define QT_VCLEANUP_INDEX (QT_14)
-#define QT_VUSERF_INDEX (QT_16)
-#define QT_VSTARTUP_INDEX (QT_17)
-#define QT_VARGT_INDEX (QT_15)
-
-#endif /* ndef QT_M88K_H */
diff --git a/qt/md/m88k.s b/qt/md/m88k.s
deleted file mode 100644
index 42467e8d5..000000000
--- a/qt/md/m88k.s
+++ /dev/null
@@ -1,132 +0,0 @@
-/* m88k.s -- assembly support. */
-
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
-/* Callee-save r14..r25, r31(sp), r30(fp). r1 === return pc.
- * Argument registers r2..r9, return value r2..r3.
- *
- * On startup, restore regs so retpc === call to a function to start.
- *
- * We're going to call a function (r2) from within the context switch
- * routine. Call it on the new thread's stack on behalf of the old
- * thread.
- */
-
- .globl _qt_block
- .globl _qt_blocki
- .globl _qt_abort
- .globl _qt_start
- .globl _qt_vstart
-
- /*
- ** r2: ptr to function to call once curr is suspended
- ** and control is on r5's stack.
- ** r3: 1'th arg to *r2.
- ** r4: 2'th arg to *r2.
- ** r5: sp of thread to suspend.
- **
- ** The helper routine returns a value that is passed on as the
- ** return value from the blocking routine. Since we don't
- ** touch r2 between the helper's return and the end of
- ** function, we get this behavior for free.
- **
- ** Same entry for integer-only and floating-point, since there
- ** are no separate integer and floating-point registers.
- **
- ** Each procedure call sets aside a ``home region'' of 8 regs
- ** for r2-r9 for varargs. For context switches we don't use
- ** the ``home region'' for varargs so use it to save regs.
- ** Allocate 64 bytes of save space -- use 32 bytes of register
- ** save area passed in to us plus 32 bytes we allcated, use
- ** the other 32 bytes for save area for a save area to call
- ** the helper function.
- */
-_qt_block:
-_qt_blocki:
- sub r31, r31,64 /* Allocate reg save space. */
- st r1, r31,8+32 /* Save callee-save registers. */
- st r14, r31,12+32
- st.d r15, r31,16+32
- st.d r17, r31,24+32
- st.d r19, r31,32+32
- st.d r21, r31,40+32
- st.d r23, r31,48+32
- st r25, r31,56+32
- st r30, r31,60+32
-
-_qt_abort:
- addu r14, r31,0 /* Remember old sp. */
- addu r31, r5,0 /* Set new sp. */
- jsr.n r2 /* Call helper. */
- addu r2, r14,0 /* Pass old sp as an arg0 to helper. */
-
- ld r1, r31,8+32 /* Restore callee-save registers. */
- ld r14, r31,12+32
- ld.d r15, r31,16+32
- ld.d r17, r31,24+32
- ld.d r19, r31,32+32
- ld.d r21, r31,40+32
- ld.d r23, r31,48+32
- ld r25, r31,56+32
- ld r30, r31,60+32
-
- jmp.n r1 /* Return to new thread's caller. */
- addu r31, r31,64 /* Free register save space. */
-
-
- /*
- ** Non-varargs thread startup.
- ** See `m88k.h' for register use conventions.
- */
-_qt_start:
- addu r2, r14,0 /* Set user arg `pu'. */
- addu r3, r15,0 /* ... user function pt. */
- jsr.n r17 /* Call `only'. */
- addu r4, r16,0 /* ... user function userf. */
-
- bsr _qt_error /* `only' erroniously returned. */
-
-
- /*
- ** Varargs thread startup.
- ** See `m88k.h' for register use conventions.
- **
- ** Call the `startup' function with just argument `pt'.
- ** Then call `vuserf' with 8 register args plus any
- ** stack args.
- ** Then call `cleanup' with `pt' and the return value
- ** from `vuserf'.
- */
-_qt_vstart:
- addu r18, r30,0 /* Remember arg7 to `vuserf'. */
- addu r30, r0,0 /* Null-terminate call chain. */
-
- jsr.n r17 /* Call `startup'. */
- addu r2, r15,0 /* `pt' is arg0 to `startup'. */
-
- addu r2, r19,0 /* Set arg0. */
- addu r3, r20,0 /* Set arg1. */
- addu r4, r21,0 /* Set arg2. */
- addu r5, r22,0 /* Set arg3. */
- addu r6, r23,0 /* Set arg4. */
- addu r7, r24,0 /* Set arg5. */
- addu r8, r25,0 /* Set arg6. */
- jsr.n r16 /* Call `vuserf'. */
- addu r9, r18,0 /* Set arg7. */
-
- addu r3, r2,0 /* Ret. value is arg1 to `cleanup'. */
- jsr.n r14 /* Call `cleanup'. */
- addu r2, r15,0 /* `pt' is arg0 to `cleanup'. */
-
- bsr _qt_error /* `cleanup' erroniously returned. */
diff --git a/qt/md/m88k_b.s b/qt/md/m88k_b.s
deleted file mode 100644
index 1926e6ae8..000000000
--- a/qt/md/m88k_b.s
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
- .text
- .globl _b_call_reg
- .globl _b_call_imm
- .globl _b_add
- .globl _b_load
-
-_b_null:
- jmp r1
-
-_b_call_reg:
- subu r31, r31,8 /* Alloc ret pc save space. */
- st r1, r31,32 /* Save ret pc. */
- or.u r3, r0,hi16(_b_null) /* Put call addr in a reg. */
- or r3, r3,lo16(_b_null)
- jsr r3
-L0:
- jsr r3
- jsr r3
- jsr r3
- jsr.n r3
- subu r2, r2,5 /* Decrement #of iter to go. */
- bcnd.n gt0,r2,L0
- jsr r3
-
- ld r1, r31,32
- jmp r1
-
-
-_b_call_imm:
- subu r31, r31,8 /* Alloc ret pc save space. */
- st r1, r31,32 /* Save ret pc. */
- bsr _b_null
-L1:
- bsr _b_null
- bsr _b_null
- bsr _b_null
- bsr.n _b_null
- subu r2, r2,5 /* Decrement #of iter to go. */
- bcnd.n gt0,r2,L1
- bsr _b_null
-
- ld r1, r31,32
- jmp r1
-
-_b_add:
- add r0, r3,r4
-L2:
- add r3, r4,r5
- add r4, r5,r6
- add r5, r6,r7
- add r8, r9,r0
- add r0, r3,r4
- add r3, r4,r5
- add r4, r5,r6
- add r5, r6,r7
- add r8, r9,r0
-
- add r0, r3,r4
- add r3, r4,r5
- add r4, r5,r6
- add r5, r6,r7
- add r8, r9,r0
- add r0, r3,r4
- add r3, r4,r5
- add r4, r5,r6
- add r5, r6,r7
- add r8, r9,r0
-
- subu r2, r2,20 /* Decrement #of iter to go. */
- bcnd.n gt0,r2,L2
- add r0, r3,r4
-
- jmp r1
-
-
-_b_load:
- ld r0, r31,0
-L3:
- ld r3, r31,4
- ld r4, r31,8
- ld r5, r31,12
- ld r6, r31,16
- ld r0, r31,0
- ld r3, r31,4
- ld r4, r31,8
- ld r5, r31,12
- ld r6, r31,16
-
- ld r0, r31,0
- ld r3, r31,4
- ld r4, r31,8
- ld r5, r31,12
- ld r6, r31,16
- ld r0, r31,0
- ld r3, r31,4
- ld r4, r31,8
- ld r5, r31,12
- ld r6, r31,16
-
- subu r2, r2,20 /* Decrement #of iter to go. */
- bcnd.n gt0,r2,L3
- ld r0, r31,0
-
- jmp r1
diff --git a/qt/md/mips-irix5.s b/qt/md/mips-irix5.s
deleted file mode 100644
index 234a953ed..000000000
--- a/qt/md/mips-irix5.s
+++ /dev/null
@@ -1,182 +0,0 @@
-/* mips.s -- assembly support. */
-
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
-/* Callee-save $16-$23, $30-$31.
- *
- * $25 is used as a procedure value pointer, used to discover constants
- * in a callee. Thus, each caller here sets $25 before the call.
- *
- * On startup, restore regs so retpc === call to a function to start.
- * We're going to call a function ($4) from within this routine.
- * We're passing 3 args, therefore need to allocate 12 extra bytes on
- * the stack for a save area. The start routine needs a like 16-byte
- * save area. Must be doubleword aligned (_mips r3000 risc
- * architecture_, gerry kane, pg d-23).
- */
-
-/*
- * Modified by Assar Westerlund <assar@sics.se> to support Irix 5.x
- * calling conventions for dynamically-linked code.
- */
-
- /* Make this position-independent code. */
- .option pic2
-
- .globl qt_block
- .globl qt_blocki
- .globl qt_abort
- .globl qt_start
- .globl qt_vstart
-
- /*
- ** $4: ptr to function to call once curr is suspended
- ** and control is on $7's stack.
- ** $5: 1'th arg to $4.
- ** $6: 2'th arg to $4
- ** $7: sp of thread to suspend.
- **
- ** Totally gross hack: The MIPS calling convention reserves
- ** 4 words on the stack for a0..a3. This routine "ought" to
- ** allocate space for callee-save registers plus 4 words for
- ** the helper function, but instead we use the 4 words
- ** provided by the function that called us (we don't need to
- ** save our argument registers). So what *appears* to be
- ** allocating only 40 bytes is actually allocating 56, by
- ** using the caller's 16 bytes.
- **
- ** The helper routine returns a value that is passed on as the
- ** return value from the blocking routine. Since we don't
- ** touch $2 between the helper's return and the end of
- ** function, we get this behavior for free.
- */
-qt_blocki:
- sub $sp,$sp,40 /* Allocate reg save space. */
- sw $16, 0+16($sp)
- sw $17, 4+16($sp)
- sw $18, 8+16($sp)
- sw $19,12+16($sp)
- sw $20,16+16($sp)
- sw $21,20+16($sp)
- sw $22,24+16($sp)
- sw $23,28+16($sp)
- sw $30,32+16($sp)
- sw $31,36+16($sp)
- add $2, $sp,$0 /* $2 <= old sp to pass to func@$4. */
-qt_abort:
- add $sp, $7,$0 /* $sp <= new sp. */
- .set noreorder
- add $25, $4,$0 /* Set helper function procedure value. */
- jal $31,$25 /* Call helper func@$4 . */
- add $4, $2,$0 /* $a0 <= pass old sp as a parameter. */
- .set reorder
- lw $31,36+16($sp) /* Restore callee-save regs... */
- lw $30,32+16($sp)
- lw $23,28+16($sp)
- lw $22,24+16($sp)
- lw $21,20+16($sp)
- lw $20,16+16($sp)
- lw $19,12+16($sp)
- lw $18, 8+16($sp)
- lw $17, 4+16($sp)
- lw $16, 0+16($sp) /* Restore callee-save */
-
- add $sp,$sp,40 /* Deallocate reg save space. */
- j $31 /* Return to caller. */
-
- /*
- ** Non-varargs thread startup.
- ** Note: originally, 56 bytes were allocated on the stack.
- ** The thread restore routine (_blocki/_abort) removed 40
- ** of them, which means there is still 16 bytes for the
- ** argument area required by the MIPS calling convention.
- */
-qt_start:
- add $4, $16,$0 /* Load up user function pu. */
- add $5, $17,$0 /* ... user function pt. */
- add $6, $18,$0 /* ... user function userf. */
- add $25, $19,$0 /* Set `only' procedure value. */
- jal $31,$25 /* Call `only'. */
- la $25,qt_error /* Set `qt_error' procedure value. */
- j $25
-
-
- /*
- ** Save calle-save floating-point regs $f20-$f30
- ** See comment in `qt_block' about calling conventinos and
- ** reserved space. Use the same trick here, but here we
- ** actually have to allocate all the bytes since we have to
- ** leave 4 words leftover for `qt_blocki'.
- **
- ** Return value from `qt_block' is the same as the return from
- ** `qt_blocki'. We get that for free since we don't touch $2
- ** between the return from `qt_blocki' and the return from
- ** `qt_block'.
- */
-qt_block:
- sub $sp, $sp,56 /* 6 8-byte regs, saved ret pc, aligned. */
- swc1 $f20, 0+16($sp)
- swc1 $f22, 8+16($sp)
- swc1 $f24, 16+16($sp)
- swc1 $f26, 24+16($sp)
- swc1 $f28, 32+16($sp)
- swc1 $f30, 40+16($sp)
- sw $31, 48+16($sp)
- jal qt_blocki
- lwc1 $f20, 0+16($sp)
- lwc1 $f22, 8+16($sp)
- lwc1 $f24, 16+16($sp)
- lwc1 $f26, 24+16($sp)
- lwc1 $f28, 32+16($sp)
- lwc1 $f30, 40+16($sp)
- lw $31, 48+16($sp)
- add $sp, $sp,56
- j $31
-
-
- /*
- ** First, call `startup' with the `pt' argument.
- **
- ** Next, call the user's function with all arguments.
- ** Note that we don't know whether args were passed in
- ** integer regs, fp regs, or on the stack (See Gerry Kane
- ** "MIPS R2000 RISC Architecture" pg D-22), so we reload
- ** all the registers, possibly with garbage arguments.
- **
- ** Finally, call `cleanup' with the `pt' argument and with
- ** the return value from the user's function. It is an error
- ** for `cleanup' to return.
- */
-qt_vstart:
- add $4, $17,$0 /* `pt' is arg0 to `startup'. */
- add $25, $18,$0 /* Set `startup' procedure value. */
- jal $31, $25 /* Call `startup'. */
-
- add $sp, $sp,16 /* Free extra save space. */
- lw $4, 0($sp) /* Load up args. */
- lw $5, 4($sp)
- lw $6, 8($sp)
- lw $7, 12($sp)
- lwc1 $f12, 0($sp) /* Load up fp args. */
- lwc1 $f14, 8($sp)
- add $25, $19,$0 /* Set `userf' procedure value. */
- jal $31,$25 /* Call `userf'. */
-
- add $4, $17,$0 /* `pt' is arg0 to `cleanup'. */
- add $5, $2,$0 /* Ret. val is arg1 to `cleanup'. */
- add $25, $16,$0 /* Set `cleanup' procedure value. */
- jal $31, $25 /* Call `cleanup'. */
-
- la $25,qt_error /* Set `qt_error' procedure value. */
- j $25
diff --git a/qt/md/mips.h b/qt/md/mips.h
deleted file mode 100644
index c584a681e..000000000
--- a/qt/md/mips.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
-#ifndef QT_MIPS_H
-#define QT_MIPS_H
-
-typedef unsigned long qt_word_t;
-
-#define QT_GROW_DOWN
-
-/* Stack layout on the mips:
-
- Callee-save registers are: $16-$23, $30; $f20-$f30.
- Also save $31, return pc.
-
- Non-varargs:
-
- +---
- | $f30 The first clump is only saved if `qt_block'
- | $f28 is called, in which case it saves the fp regs
- | $f26 then calls `qt_blocki' to save the int regs.
- | $f24
- | $f22
- | $f20
- | $31 === return pc in `qt_block'
- +---
- | $31 === return pc; on startup == qt_start
- | $30
- | $23
- | $22
- | $21
- | $20
- | $19 on startup === only
- | $18 on startup === $a2 === userf
- | $17 on startup === $a1 === pt
- | $16 on startup === $a0 === pu
- | <a3> save area req'd by MIPS calling convention
- | <a2> save area req'd by MIPS calling convention
- | <a1> save area req'd by MIPS calling convention
- | <a0> save area req'd by MIPS calling convention <--- sp
- +---
-
- Conventions for varargs:
-
- | args ...
- +---
- | :
- | :
- | $21
- | $20
- | $19 on startup === `userf'
- | $18 on startup === `startup'
- | $17 on startup === `pt'
- | $16 on startup === `cleanup'
- | <a3>
- | <a2>
- | <a1>
- | <a0> <--- sp
- +---
-
- Note: if we wanted to, we could muck about and try to get the 4
- argument registers loaded in to, e.g., $22, $23, $30, and $31,
- and the return pc in, say, $20. Then, the first 4 args would
- not need to be loaded from memory, they could just use
- register-to-register copies. */
-
-
-/* Stack must be doubleword aligned. */
-#define QT_STKALIGN (8) /* Doubleword aligned. */
-
-/* How much space is allocated to hold all the crud for
- initialization: $16-$23, $30, $31. Just do an integer restore,
- no need to restore floating-point. Four words are needed for the
- argument save area for the helper function that will be called for
- the old thread, just before the new thread starts to run. */
-
-#define QT_STKBASE (14 * 4)
-#define QT_VSTKBASE QT_STKBASE
-
-
-/* Offsets of various registers. */
-#define QT_31 (9+4)
-#define QT_19 (3+4)
-#define QT_18 (2+4)
-#define QT_17 (1+4)
-#define QT_16 (0+4)
-
-
-/* When a never-before-run thread is restored, the return pc points
- to a fragment of code that starts the thread running. For
- non-vargs functions, it just calls the client's `only' function.
- For varargs functions, it calls the startup, user, and cleanup
- functions.
-
- The varargs startup routine always reads 4 words of arguments from
- the stack. If there are less than 4 words of arguments, then the
- startup routine can read off the top of the stack. To prevent
- errors we always allocate 4 words. If there are more than 3 words
- of arguments, the 4 preallocated words are simply wasted. */
-
-extern void qt_start(void);
-#define QT_ARGS_MD(sp) (QT_SPUT (sp, QT_31, qt_start))
-
-#define QT_VARGS_MD0(sp, vabytes) \
- ((qt_t *)(((char *)(sp)) - 4*4 - QT_STKROUNDUP(vabytes)))
-
-extern void qt_vstart(void);
-#define QT_VARGS_MD1(sp) (QT_SPUT (sp, QT_31, qt_vstart))
-
-#define QT_VARGS_DEFAULT
-
-
-/* The *index* (positive offset) of where to put each value. */
-#define QT_ONLY_INDEX (QT_19)
-#define QT_USER_INDEX (QT_18)
-#define QT_ARGT_INDEX (QT_17)
-#define QT_ARGU_INDEX (QT_16)
-
-#define QT_VCLEANUP_INDEX (QT_16)
-#define QT_VUSERF_INDEX (QT_19)
-#define QT_VSTARTUP_INDEX (QT_18)
-#define QT_VARGT_INDEX (QT_17)
-
-#endif /* ndef QT_MIPS_H */
diff --git a/qt/md/mips.s b/qt/md/mips.s
deleted file mode 100644
index b074b98dc..000000000
--- a/qt/md/mips.s
+++ /dev/null
@@ -1,164 +0,0 @@
-/* mips.s -- assembly support. */
-
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
-/* Callee-save $16-$23, $30-$31.
- *
- * On startup, restore regs so retpc === call to a function to start.
- * We're going to call a function ($4) from within this routine.
- * We're passing 3 args, therefore need to allocate 12 extra bytes on
- * the stack for a save area. The start routine needs a like 16-byte
- * save area. Must be doubleword aligned (_mips r3000 risc
- * architecture_, gerry kane, pg d-23).
- */
-
- .globl qt_block
- .globl qt_blocki
- .globl qt_abort
- .globl qt_start
- .globl qt_vstart
-
- /*
- ** $4: ptr to function to call once curr is suspended
- ** and control is on $7's stack.
- ** $5: 1'th arg to $4.
- ** $6: 2'th arg to $4
- ** $7: sp of thread to suspend.
- **
- ** Totally gross hack: The MIPS calling convention reserves
- ** 4 words on the stack for a0..a3. This routine "ought" to
- ** allocate space for callee-save registers plus 4 words for
- ** the helper function, but instead we use the 4 words
- ** provided by the function that called us (we don't need to
- ** save our argument registers). So what *appears* to be
- ** allocating only 40 bytes is actually allocating 56, by
- ** using the caller's 16 bytes.
- **
- ** The helper routine returns a value that is passed on as the
- ** return value from the blocking routine. Since we don't
- ** touch $2 between the helper's return and the end of
- ** function, we get this behavior for free.
- */
-qt_blocki:
- sub $sp,$sp,40 /* Allocate reg save space. */
- sw $16, 0+16($sp)
- sw $17, 4+16($sp)
- sw $18, 8+16($sp)
- sw $19,12+16($sp)
- sw $20,16+16($sp)
- sw $21,20+16($sp)
- sw $22,24+16($sp)
- sw $23,28+16($sp)
- sw $30,32+16($sp)
- sw $31,36+16($sp)
- add $2, $sp,$0 /* $2 <= old sp to pass to func@$4. */
-qt_abort:
- add $sp, $7,$0 /* $sp <= new sp. */
- .set noreorder
- jal $31,$4 /* Call helper func@$4 . */
- add $4, $2,$0 /* $a0 <= pass old sp as a parameter. */
- .set reorder
- lw $31,36+16($sp) /* Restore callee-save regs... */
- lw $30,32+16($sp)
- lw $23,28+16($sp)
- lw $22,24+16($sp)
- lw $21,20+16($sp)
- lw $20,16+16($sp)
- lw $19,12+16($sp)
- lw $18, 8+16($sp)
- lw $17, 4+16($sp)
- lw $16, 0+16($sp) /* Restore callee-save */
-
- add $sp,$sp,40 /* Deallocate reg save space. */
- j $31 /* Return to caller. */
-
- /*
- ** Non-varargs thread startup.
- ** Note: originally, 56 bytes were allocated on the stack.
- ** The thread restore routine (_blocki/_abort) removed 40
- ** of them, which means there is still 16 bytes for the
- ** argument area required by the MIPS calling convention.
- */
-qt_start:
- add $4, $16,$0 /* Load up user function pu. */
- add $5, $17,$0 /* ... user function pt. */
- add $6, $18,$0 /* ... user function userf. */
- jal $31,$19 /* Call `only'. */
- j qt_error
-
-
- /*
- ** Save calle-save floating-point regs $f20-$f30
- ** See comment in `qt_block' about calling conventinos and
- ** reserved space. Use the same trick here, but here we
- ** actually have to allocate all the bytes since we have to
- ** leave 4 words leftover for `qt_blocki'.
- **
- ** Return value from `qt_block' is the same as the return from
- ** `qt_blocki'. We get that for free since we don't touch $2
- ** between the return from `qt_blocki' and the return from
- ** `qt_block'.
- */
-qt_block:
- sub $sp, $sp,56 /* 6 8-byte regs, saved ret pc, aligned. */
- swc1 $f20, 0+16($sp)
- swc1 $f22, 8+16($sp)
- swc1 $f24, 16+16($sp)
- swc1 $f26, 24+16($sp)
- swc1 $f28, 32+16($sp)
- swc1 $f30, 40+16($sp)
- sw $31, 48+16($sp)
- jal qt_blocki
- lwc1 $f20, 0+16($sp)
- lwc1 $f22, 8+16($sp)
- lwc1 $f24, 16+16($sp)
- lwc1 $f26, 24+16($sp)
- lwc1 $f28, 32+16($sp)
- lwc1 $f30, 40+16($sp)
- lw $31, 48+16($sp)
- add $sp, $sp,56
- j $31
-
-
- /*
- ** First, call `startup' with the `pt' argument.
- **
- ** Next, call the user's function with all arguments.
- ** Note that we don't know whether args were passed in
- ** integer regs, fp regs, or on the stack (See Gerry Kane
- ** "MIPS R2000 RISC Architecture" pg D-22), so we reload
- ** all the registers, possibly with garbage arguments.
- **
- ** Finally, call `cleanup' with the `pt' argument and with
- ** the return value from the user's function. It is an error
- ** for `cleanup' to return.
- */
-qt_vstart:
- add $4, $17,$0 /* `pt' is arg0 to `startup'. */
- jal $31, $18 /* Call `startup'. */
-
- add $sp, $sp,16 /* Free extra save space. */
- lw $4, 0($sp) /* Load up args. */
- lw $5, 4($sp)
- lw $6, 8($sp)
- lw $7, 12($sp)
- lwc1 $f12, 0($sp) /* Load up fp args. */
- lwc1 $f14, 8($sp)
- jal $31,$19 /* Call `userf'. */
-
- add $4, $17,$0 /* `pt' is arg0 to `cleanup'. */
- add $5, $2,$0 /* Ret. val is arg1 to `cleanup'. */
- jal $31, $16 /* Call `cleanup'. */
-
- j qt_error
diff --git a/qt/md/mips_b.s b/qt/md/mips_b.s
deleted file mode 100644
index 5b3740843..000000000
--- a/qt/md/mips_b.s
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
- .globl b_call_reg
- .globl b_call_imm
- .globl b_add
- .globl b_load
-
- .ent b_null
-b_null:
- j $31
- .end b_null
-
- .ent b_call_reg
-b_call_reg:
- la $5,b_null
- add $6, $31,0
-$L0:
- jal $5
- jal $5
- jal $5
- jal $5
- jal $5
-
- sub $4, $4,5
- bgtz $4,$L0
- j $6
- .end
-
-
- .ent b_call_imm
-b_call_imm:
- add $6, $31,0
-$L1:
- jal b_null
- jal b_null
- jal b_null
- jal b_null
- jal b_null
-
- sub $4, $4,5
- bgtz $4,$L1
- j $6
- .end
-
-
- .ent b_add
-b_add:
- add $5, $0,$4
- add $6, $0,$4
- add $7, $0,$4
- add $8, $0,$4
-$L2:
- sub $4, $4,5
- sub $5, $5,5
- sub $6, $6,5
- sub $7, $7,5
- sub $8, $8,5
-
- sub $4, $4,5
- sub $5, $5,5
- sub $6, $6,5
- sub $7, $7,5
- sub $8, $8,5
-
- bgtz $4,$L2
- j $31
- .end
-
-
- .ent b_load
-b_load:
-$L3:
- ld $0, 0($sp)
- ld $0, 4($sp)
- ld $0, 8($sp)
- ld $0, 12($sp)
- ld $0, 16($sp)
-
- ld $0, 20($sp)
- ld $0, 24($sp)
- ld $0, 28($sp)
- ld $0, 32($sp)
- ld $0, 36($sp)
-
- sub $4, $4,10
- bgtz $4,$L3
- j $31
- .end
diff --git a/qt/md/null.README b/qt/md/null.README
deleted file mode 100644
index e69de29bb..000000000
--- a/qt/md/null.README
+++ /dev/null
diff --git a/qt/md/null.c b/qt/md/null.c
deleted file mode 100644
index 775db62be..000000000
--- a/qt/md/null.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
-char const qtmd_rcsid[] = "$Header: /home/ludo/src/guile.cvs/gitification/guile-cvs/guile/guile-core/qt/md/null.c,v 1.1 1996-10-01 03:34:16 mdj Exp $";
diff --git a/qt/md/solaris.README b/qt/md/solaris.README
deleted file mode 100644
index 04f855c44..000000000
--- a/qt/md/solaris.README
+++ /dev/null
@@ -1,19 +0,0 @@
-Solaris 2.x is like System V (maybe it *is* System V?) and is different
-from older versions in that it uses no leading underscore for variable
-and function names. That is, the old convention was:
-
- foo(){}
-
-got compiled as
-
- .globl _foo
- _foo:
-
-and is now compiled as
-
- .globl foo
- foo:
-
-The `config' script should fix up the older (leading underscore) versions
-of the machine-dependent files to use the newer (no leading underscore)
-calling conventions.
diff --git a/qt/md/sparc.h b/qt/md/sparc.h
deleted file mode 100644
index e2ab281b4..000000000
--- a/qt/md/sparc.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
-#ifndef QT_SPARC_H
-#define QT_SPARC_H
-
-typedef unsigned long qt_word_t;
-
-/* Stack layout on the sparc:
-
- non-varargs:
-
- +---
- | <blank space for alignment>
- | %o7 == return address -> qt_start
- | %i7
- | %i6 == frame pointer -> 0 (NULL-terminated stack frame chain)
- | %i5 -> only
- | %i4 -> userf
- | %i3
- | %i2 -> pt
- | %i1 -> pu
- | %i0
- | %l7
- | %l6
- | %l5
- | %l4
- | %l3
- | %l2
- | %l1
- | %l0 <--- qt_t.sp
- +---
-
- varargs:
-
- | :
- | :
- | argument list
- | one-word aggregate return pointer
- +---
- | <blank space for alignment>
- | %o7 == return address -> qt_vstart
- | %i7
- | %i6 == frame pointer -> 0 (NULL-terminated stack frame chain)
- | %i5 -> startup
- | %i4 -> userf
- | %i3 -> cleanup
- | %i2 -> pt
- | %i1
- | %i0
- | %l7
- | %l6
- | %l5
- | %l4
- | %l3
- | %l2
- | %l1
- | %l0 <--- qt_t.sp
- +---
-
- */
-
-
-/* What to do to start a thread running. */
-extern void qt_start (void);
-extern void qt_vstart (void);
-
-
-/* Hold 17 saved registers + 1 word for alignment. */
-#define QT_STKBASE (18 * 4)
-#define QT_VSTKBASE QT_STKBASE
-
-
-/* Stack must be doubleword aligned. */
-#define QT_STKALIGN (8) /* Doubleword aligned. */
-
-#define QT_ONLY_INDEX (QT_I5)
-#define QT_USER_INDEX (QT_I4)
-#define QT_ARGT_INDEX (QT_I2)
-#define QT_ARGU_INDEX (QT_I1)
-
-#define QT_VSTARTUP_INDEX (QT_I5)
-#define QT_VUSERF_INDEX (QT_I4)
-#define QT_VCLEANUP_INDEX (QT_I3)
-#define QT_VARGT_INDEX (QT_I2)
-
-#define QT_O7 (16)
-#define QT_I6 (14)
-#define QT_I5 (13)
-#define QT_I4 (12)
-#define QT_I3 (11)
-#define QT_I2 (10)
-#define QT_I1 ( 9)
-
-
-/* The thread will ``return'' to the `qt_start' routine to get things
- going. The normal return sequence takes us to QT_O7+8, so we
- pre-subtract 8. The frame pointer chain is 0-terminated to prevent
- the trap handler from chasing off in to random memory when flushing
- stack windows. */
-
-#define QT_ARGS_MD(top) \
- (QT_SPUT ((top), QT_O7, ((void *)(((int)qt_start)-8))), \
- QT_SPUT ((top), QT_I6, 0))
-
-
-/* The varargs startup routine always reads 6 words of arguments
- (6 argument registers) from the stack, offset by one word to
- allow for an aggregate return area pointer. If the varargs
- routine actually pushed fewer words than that, qt_vstart could read
- off the top of the stack. To prevent errors, we always allocate 8
- words. The space is often just wasted. */
-
-#define QT_VARGS_MD0(sp, vabytes) \
- ((qt_t *)(((char *)(sp)) - 8*4 - QT_STKROUNDUP(vabytes)))
-
-#define QT_VARGS_MD1(sp) \
- (QT_SPUT (sp, QT_O7, ((void *)(((int)qt_vstart)-8))))
-
-/* The SPARC has wierdo calling conventions which stores a hidden
- parameter for returning aggregate values, so the rest of the
- parameters are shoved up the stack by one place. */
-#define QT_VARGS_ADJUST(sp) (((char *)sp)+4)
-
-#define QT_VARGS_DEFAULT
-
-
-#define QT_GROW_DOWN
-
-#endif /* ndef QT_SPARC_H */
diff --git a/qt/md/sparc.s b/qt/md/sparc.s
deleted file mode 100644
index d9bdf0c58..000000000
--- a/qt/md/sparc.s
+++ /dev/null
@@ -1,142 +0,0 @@
-/* sparc.s -- assembly support for the `qt' thread building kit. */
-
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
-/* #include <machine/trap.h> */
-
- .text
- .align 4
- .global qt_blocki
- .global qt_block
- .global qt_abort
- .global qt_start
- .global qt_vstart
-
-/* Register assignment:
-// %o0: incoming `helper' function to call after cswap
-// also used as outgoing sp of old thread (qt_t *)
-// %o1, %o2:
-// parameters to `helper' function called after cswap
-// %o3: sp of new thread
-// %o5: tmp used to save old thread sp, while using %o0
-// to call `helper' f() after cswap.
-//
-//
-// Aborting a thread is easy if there are no cached register window
-// frames: just switch to the new stack and away we go. If there are
-// cached register window frames they must all be written back to the
-// old stack before we move to the new stack. If we fail to do the
-// writeback then the old stack memory can be written with register
-// window contents e.g., after the stack memory has been freed and
-// reused.
-//
-// If you don't believe this, try setting the frame pointer to zero
-// once we're on the new stack. This will not affect correctnes
-// otherwise because the frame pointer will eventually get reloaded w/
-// the new thread's frame pointer. But it will be zero briefly before
-// the reload. You will eventually (100,000 cswaps later on a small
-// SPARC machine that I tried) get an illegal instruction trap from
-// the kernel trying to flush a cached window to location 0x0.
-//
-// Solution: flush windows before switching stacks, which invalidates
-// all the other register windows. We could do the trap
-// conditionally: if we're in the lowest frame of a thread, the fp is
-// zero already so we know there's nothing cached. But we expect most
-// aborts will be done from a first function that does a `save', so we
-// will rarely save anything and always pay the cost of testing to see
-// if we should flush.
-//
-// All floating-point registers are caller-save, so this routine
-// doesn't need to do anything to save and restore them.
-//
-// `qt_block' and `qt_blocki' return the same value as the value
-// returned by the helper function. We get this ``for free''
-// since we don't touch the return value register between the
-// return from the helper function and return from qt_block{,i}.
-*/
-
-qt_block:
-qt_blocki:
- sub %sp, 8, %sp /* Allocate save area for return pc. */
- st %o7, [%sp+64] /* Save return pc. */
-qt_abort:
- ta 0x03 /* Save locals and ins. */
- mov %sp, %o5 /* Remember old sp w/o chng ins/locals. */
- sub %o3, 64, %sp /* Allocate kwsa, switch stacks. */
- call %o0, 0 /* Call `helper' routine. */
- mov %o5, %o0 /* Pass old thread to qt_after_t() */
- /* .. along w/ args in %o1 & %o2. */
-
- /* Restore callee-save regs. The kwsa
- // is on this stack, so offset all
- // loads by sizeof(kwsa), 64 bytes.
- */
- ldd [%sp+ 0+64], %l0
- ldd [%sp+ 8+64], %l2
- ldd [%sp+16+64], %l4
- ldd [%sp+24+64], %l6
- ldd [%sp+32+64], %i0
- ldd [%sp+40+64], %i2
- ldd [%sp+48+64], %i4
- ldd [%sp+56+64], %i6
- ld [%sp+64+64], %o7 /* Restore return pc. */
-
- retl /* Return to address in %o7. */
- add %sp, 72, %sp /* Deallocate kwsa, ret pc area. */
-
-
-/* The function calling conventions say there has to be a 1-word area
-// in the caller's stack to hold a pointer to space for aggregate
-// return values. It also says there should be a 6-word area to hold
-// %o0..%o5 if the callee wants to save them (why? I don't know...)
-// Round up to 8 words to maintain alignment.
-//
-// Parameter values were stored in callee-save regs and are moved to
-// the parameter registers.
-*/
-qt_start:
- mov %i1, %o0 /* `pu': Set up args to `only'. */
- mov %i2, %o1 /* `pt'. */
- mov %i4, %o2 /* `userf'. */
- call %i5, 0 /* Call client function. */
- sub %sp, 32, %sp /* Allocate 6-word callee space. */
-
- call qt_error, 0 /* `only' erroniously returned. */
- nop
-
-
-/* Same comments as `qt_start' about allocating rounded-up 7-word
-// save areas. */
-
-qt_vstart:
- sub %sp, 32, %sp /* Allocate 7-word callee space. */
- call %i5, 0 /* call `startup'. */
- mov %i2, %o0 /* .. with argument `pt'. */
-
- add %sp, 32, %sp /* Use 7-word space in varargs. */
- ld [%sp+ 4+64], %o0 /* Load arg0 ... */
- ld [%sp+ 8+64], %o1
- ld [%sp+12+64], %o2
- ld [%sp+16+64], %o3
- ld [%sp+20+64], %o4
- call %i4, 0 /* Call `userf'. */
- ld [%sp+24+64], %o5
-
- /* Use 6-word space in varargs. */
- mov %o0, %o1 /* Pass return value from userf */
- call %i3, 0 /* .. when call `cleanup. */
- mov %i2, %o0 /* .. along with argument `pt'. */
-
- call qt_error, 0 /* `cleanup' erroniously returned. */
- nop
diff --git a/qt/md/sparc_b.s b/qt/md/sparc_b.s
deleted file mode 100644
index 08351d76d..000000000
--- a/qt/md/sparc_b.s
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
- .globl b_call_reg
- .globl b_call_imm
- .globl b_add
- .globl b_load
-
-b_null:
- retl
- nop
-
-b_call_reg:
- sethi %hi(b_null),%o4
- or %o4,%lo(b_null),%o4
- add %o7,%g0, %o3
-L0:
- call %o4
- nop
- call %o4
- nop
- call %o4
- nop
- call %o4
- nop
- call %o4
- nop
-
- subcc %o0,1,%o0
- bg L0
- nop
- add %o3,%g0, %o7
- retl
- nop
-
-b_call_imm:
- sethi %hi(b_null),%o4
- or %o4,%lo(b_null),%o4
- add %o7,%g0, %o3
-L1:
- call b_null
- call b_null
- call b_null
- call b_null
- call b_null
-
- subcc %o0,1,%o0
- bg L0
- nop
- add %o3,%g0, %o7
- retl
- nop
-
-
-b_add:
- add %o0,%g0,%o1
- add %o0,%g0,%o2
- add %o0,%g0,%o3
- add %o0,%g0,%o4
-L2:
- sub %o0,5,%o0
- sub %o1,5,%o1
- sub %o2,5,%o2
- sub %o3,5,%o3
- sub %o4,5,%o4
-
- subcc %o0,5,%o0
- sub %o1,5,%o1
- sub %o2,5,%o2
- sub %o3,5,%o3
- sub %o4,5,%o4
-
- bg L2
- nop
- retl
- nop
-
-
-b_load:
- ld [%sp+ 0], %g0
-L3:
- ld [%sp+ 4],%g0
- ld [%sp+ 8],%g0
- ld [%sp+12],%g0
- ld [%sp+16],%g0
- ld [%sp+20],%g0
- ld [%sp+24],%g0
- ld [%sp+28],%g0
- ld [%sp+32],%g0
- ld [%sp+36],%g0
-
- subcc %o0,10,%o0
- bg L3
- ld [%sp+ 0],%g0
- retl
- nop
diff --git a/qt/md/vax.h b/qt/md/vax.h
deleted file mode 100644
index 1a5af0f2b..000000000
--- a/qt/md/vax.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
-#ifndef QT_VAX_H
-#define QT_VAX_H
-
-typedef unsigned long qt_word_t;
-
-/* Thread's initial stack layout on the VAX:
-
- non-varargs:
-
- +---
- | arg[2] === `userf' on startup
- | arg[1] === `pt' on startup
- | arg[0] === `pu' on startup
- | ... === `only' on startup.
- +---
- | ret pc === `qt_start' on startup
- | fp === 0 on startup
- | ap === 0 on startup
- | <mask>
- | 0 (handler) <--- qt_t.sp
- +---
-
- When a non-varargs thread is started, it ``returns'' to the start
- routine, which calls the client's `only' function.
-
- The varargs case is clearly bad code. The various values should be
- stored in a save area and snarfed in to callee-save registers on
- startup. However, it's too painful to figure out the register
- mask (right now), so do it the slow way.
-
- +---
- | arg[n-1]
- | ..
- | arg[0]
- | nargs
- +---
- | === `cleanup'
- | === `vuserf'
- | === `startup'
- | === `pt'
- +---
- | ret pc === `qt_start' on startup
- | fp === 0 on startup
- | ap === 0 on startup
- | <mask>
- | 0 (handler) <--- qt_t.sp
- +---
-
- When a varargs thread is started, it ``returns'' to the `qt_vstart'
- startup code. The startup code pops all the extra arguments, then
- calls the appropriate functions. */
-
-
-/* What to do to start a thread running. */
-extern void qt_start (void);
-extern void qt_vstart (void);
-
-
-/* Initial call frame for non-varargs and varargs cases. */
-#define QT_STKBASE (10 * 4)
-#define QT_VSTKBASE (9 * 4)
-
-
-/* Stack "must be" 4-byte aligned. (Actually, no, but it's
- easiest and probably fastest to do so.) */
-
-#define QT_STKALIGN (4)
-
-
-/* Where to place various arguments. */
-#define QT_ONLY_INDEX (5)
-#define QT_USER_INDEX (8)
-#define QT_ARGT_INDEX (7)
-#define QT_ARGU_INDEX (6)
-
-#define QT_VSTARTUP_INDEX (6)
-#define QT_VUSERF_INDEX (7)
-#define QT_VCLEANUP_INDEX (8)
-#define QT_VARGT_INDEX (5)
-
-
-/* Stack grows down. The top of the stack is the first thing to
- pop off (predecrement, postincrement). */
-#define QT_GROW_DOWN
-
-
-extern void qt_error (void);
-
-#define QT_VAX_GMASK_NOREGS (0)
-
-/* Push on the error return address, null termination to call chains,
- number of arguments to `only', register save mask (save no
- registers). */
-
-#define QT_ARGS_MD(sto) \
- (QT_SPUT (sto, 0, 0), \
- QT_SPUT (sto, 1, QT_VAX_GMASK_NOREGS), \
- QT_SPUT (sto, 2, 0), \
- QT_SPUT (sto, 3, 0), \
- QT_SPUT (sto, 4, qt_start))
-
-#define QT_VARGS_MD0(sto, nbytes) \
- (QT_SPUT (sto, (-(nbytes)/4)-1, (nbytes)/4), \
- ((char *)(((sto)-4) - QT_STKROUNDUP(nbytes))))
-
-#define QT_VARGS_ADJUST(sp) ((char *)sp + 4)
-
-#define QT_VARGS_MD1(sto) \
- (QT_SPUT (sto, 0, 0), \
- QT_SPUT (sto, 1, QT_VAX_GMASK_NOREGS), \
- QT_SPUT (sto, 2, 0), \
- QT_SPUT (sto, 3, 0), \
- QT_SPUT (sto, 4, qt_vstart))
-
-#define QT_VARGS_DEFAULT
-
-#endif /* QT_VAX_H */
diff --git a/qt/md/vax.s b/qt/md/vax.s
deleted file mode 100644
index fed03f043..000000000
--- a/qt/md/vax.s
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
- .text
-
- .globl _qt_abort
- .globl _qt_block
- .globl _qt_blocki
- .globl _qt_start
- .globl _qt_vstart
-
-
-/*
-// Calls to these routines have the signature
-//
-// void *block (func, arg1, arg2, newsp)
-//
-// Since the prologue saves 5 registers, nargs, pc, fp, ap, mask, and
-// a condition handler (at sp+0), the first argument is 40=4*10 bytes
-// offset from the stack pointer.
-*/
-_qt_block:
-_qt_blocki:
-_qt_abort:
- .word 0x7c0 /* Callee-save mask: 5 registers. */
- movl 56(sp),r1 /* Get stack pointer of new thread. */
- movl 52(sp),-(r1) /* Push arg2 */
- movl 48(sp),-(r1) /* Push arg1 */
- movl sp,-(r1) /* Push arg0 */
-
- movl 44(sp),r0 /* Get helper to call. */
- movl r1,sp /* Move to new thread's stack. */
- addl3 sp,$12,fp /* .. including the frame pointer. */
- calls $3,(r0) /* Call helper. */
-
- ret
-
-_qt_start:
- movl (sp)+,r0 /* Get `only'. */
- calls $3,(r0) /* Call `only'. */
- calls $0,_qt_error /* `only' erroniously returned. */
-
-
-_qt_vstart:
- movl (sp)+,r10 /* Get `pt'. */
- movl (sp)+,r9 /* Get `startup'. */
- movl (sp)+,r8 /* Get `vuserf'. */
- movl (sp)+,r7 /* Get `cleanup'. */
-
- pushl r10 /* Push `qt'. */
- calls $1,(r9) /* Call `startup', pop `qt' on return. */
-
- calls (sp)+,(r8) /* Call user's function. */
-
- pushl r0 /* Push `vuserf_retval'. */
- pushl r10 /* Push `qt'. */
- calls $2,(r7) /* Call `cleanup', never return. */
-
- calls $0,_qt_error /* `cleanup' erroniously returned. */
diff --git a/qt/md/vax_b.s b/qt/md/vax_b.s
deleted file mode 100644
index 2db2d4fec..000000000
--- a/qt/md/vax_b.s
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
- .text
- .globl _b_call_reg
- .globl _b_call_imm
- .globl _b_add
- .globl _b_load
-
-_b_null:
- .word 0x0
- ret
-
-_b_call_reg:
- .word 0x0
- movl 4(ap),r0
- moval _b_null,r1
-L0:
- calls $0,(r1)
- calls $0,(r1)
- calls $0,(r1)
- calls $0,(r1)
- calls $0,(r1)
-
- subl2 $5,r0
- bgtr L0
- ret
-
-
-_b_call_imm:
- .word 0x0
- movl 4(ap),r0
-L1:
- calls $0,_b_null
- calls $0,_b_null
- calls $0,_b_null
- calls $0,_b_null
- calls $0,_b_null
-
- subl2 $5,r0
- bgtr L1
- ret
-
-
-_b_add:
- .word 0x0
- movl 4(ap),r0
-L2:
- subl2 $1,r0
- subl2 $1,r0
- subl2 $1,r0
- subl2 $1,r0
- subl2 $1,r0
-
- subl2 $1,r0
- subl2 $1,r0
- subl2 $1,r0
- subl2 $1,r0
- subl2 $1,r0
-
- bgtr L2
- ret
-
-
-_b_load:
- .word 0x0
- movl 4(ap),r0
-L3:
- movl 0(sp),r1
- movl 4(sp),r1
- movl 8(sp),r1
- movl 12(sp),r1
- movl 16(sp),r1
- movl 20(sp),r1
- movl 24(sp),r1
- movl 28(sp),r1
- movl 32(sp),r1
- movl 36(sp),r1
-
- subl2 $1,r0
- bgtr L3
- ret
diff --git a/qt/meas.c b/qt/meas.c
deleted file mode 100644
index 3faab3c52..000000000
--- a/qt/meas.c
+++ /dev/null
@@ -1,1049 +0,0 @@
-/* meas.c -- measure qt stuff. */
-
-#include "copyright.h"
-
-/* Need this to get assertions under Mach on the Sequent/i386: */
-#ifdef __i386__
-#define assert(ex) \
- do { \
- if (!(ex)) { \
- fprintf (stderr, "[%s:%d] Assertion " #ex " failed\n", __FILE__, __LINE__); \
- abort(); \
- } \
- } while (0)
-#else
-#include <assert.h>
-#endif
-
-/* This really ought to be defined in some ANSI include file (*I*
- think...), but it's defined here instead, which leads us to another
- machine dependency.
-
- The `iaddr_t' type is an integer representation of a pointer,
- suited for doing arithmetic on addresses, e.g. to round an address
- to an alignment boundary. */
-typedef unsigned long iaddr_t;
-
-#include <stdarg.h> /* For varargs tryout. */
-#include <stdio.h>
-#include "b.h"
-#include "qt.h"
-#include "stp.h"
-
-extern void exit (int status);
-extern int atoi (char const *s);
-extern int fprintf (FILE *out, char const *fmt, ...);
-extern int fputs (char const *s, FILE *fp);
-extern void free (void *sto);
-extern void *malloc (unsigned nbytes);
-extern void perror (char const *s);
-
-void usage (void);
-void tracer(void);
-
-/* Round `v' to be `a'-aligned, assuming `a' is a power of two. */
-#define ROUND(v, a) (((v) + (a) - 1) & ~((a)-1))
-
-typedef struct thread_t {
- qt_t *qt; /* Pointer to thread of function... */
- void *stk;
- void *top; /* Set top of stack if reuse. */
- struct thread_t *next;
-} thread_t;
-
-
- static thread_t *
-t_alloc (void)
-{
- thread_t *t;
- int ssz = 0x1000;
-
- t = malloc (sizeof(thread_t));
- if (!t) {
- perror ("malloc");
- exit (1);
- }
- assert (ssz > QT_STKBASE);
- t->stk = malloc (ssz);
- t->stk = (void *)ROUND (((iaddr_t)t->stk), QT_STKALIGN);
- if (!t->stk) {
- perror ("malloc");
- exit (1);
- }
- assert ((((iaddr_t)t->stk) & (QT_STKALIGN-1)) == 0);
- t->top = QT_SP (t->stk, ssz - QT_STKBASE);
-
- return (t);
-}
-
-
- static thread_t *
-t_create (qt_only_t *starter, void *p0, qt_userf_t *f)
-{
- thread_t *t;
-
- t = t_alloc();
- t->qt = QT_ARGS (t->top, p0, t, f, starter);
- return (t);
-}
-
-
- static void
-t_free (thread_t *t)
-{
- free (t->stk);
- free (t);
-}
-
-
- static void *
-t_null (qt_t *old, void *p1, void *p2)
-{
- /* return (garbage); */
-}
-
-
- static void *
-t_splat (qt_t *old, void *oldp, void *null)
-{
- *(qt_t **)oldp = old;
- /* return (garbage); */
-}
-
-
-static char const test01_msg[] =
- "*QT_SP(sto,sz), QT_ARGS(top,p0,p1,userf,first)";
-
-static char const *test01_descr[] = {
- "Performs 1 QT_SP and one QT_ARGS per iteration.",
- NULL
-};
-
-/* This test gives a guess on how long it takes to initalize
- a thread. */
-
- static void
-test01 (int n)
-{
- char stack[QT_STKBASE+QT_STKALIGN];
- char *stk;
- qt_t *top;
-
- stk = (char *)ROUND (((iaddr_t)stack), QT_STKALIGN);
-
- {
- int i;
-
- for (i=0; i<QT_STKBASE; ++i) {
- stk[i] = 0;
- }
- }
-
- while (n>0) {
- /* RETVALUSED */
- top = QT_SP (stk, QT_STKBASE); QT_ARGS (top, 0, 0, 0, 0);
-#ifdef NDEF
- top = QT_SP (stk, QT_STKBASE); QT_ARGS (top, 0, 0, 0, 0);
- top = QT_SP (stk, QT_STKBASE); QT_ARGS (top, 0, 0, 0, 0);
- top = QT_SP (stk, QT_STKBASE); QT_ARGS (top, 0, 0, 0, 0);
- top = QT_SP (stk, QT_STKBASE); QT_ARGS (top, 0, 0, 0, 0);
-
- top = QT_SP (stk, QT_STKBASE); QT_ARGS (top, 0, 0, 0, 0);
- top = QT_SP (stk, QT_STKBASE); QT_ARGS (top, 0, 0, 0, 0);
- top = QT_SP (stk, QT_STKBASE); QT_ARGS (top, 0, 0, 0, 0);
- top = QT_SP (stk, QT_STKBASE); QT_ARGS (top, 0, 0, 0, 0);
- top = QT_SP (stk, QT_STKBASE); QT_ARGS (top, 0, 0, 0, 0);
-
- n -= 10;
-#else
- n -= 1;
-#endif
- }
-}
-
-
-static char const test02_msg[] = "QT_BLOCKI (0, 0, test02_aux, t->qt)";
-static qt_t *rootthread;
-
- static void
-test02_aux1 (void *pu, void *pt, qt_userf_t *f)
-{
- QT_ABORT (t_null, 0, 0, rootthread);
-}
-
- static void *
-test02_aux2 (qt_t *old, void *farg1, void *farg2)
-{
- rootthread = old;
- /* return (garbage); */
-}
-
- static void
-test02 (int n)
-{
- thread_t *t;
-
- while (n>0) {
- t = t_create (test02_aux1, 0, 0);
- QT_BLOCKI (test02_aux2, 0, 0, t->qt);
- t_free (t);
- t = t_create (test02_aux1, 0, 0);
- QT_BLOCKI (test02_aux2, 0, 0, t->qt);
- t_free (t);
- t = t_create (test02_aux1, 0, 0);
- QT_BLOCKI (test02_aux2, 0, 0, t->qt);
- t_free (t);
- t = t_create (test02_aux1, 0, 0);
- QT_BLOCKI (test02_aux2, 0, 0, t->qt);
- t_free (t);
- t = t_create (test02_aux1, 0, 0);
- QT_BLOCKI (test02_aux2, 0, 0, t->qt);
- t_free (t);
-
- n -= 5;
- }
-}
-
-
-static char const test03_msg[] = "QT_BLOCKI (...) test vals are right.";
-
-
-/* Called by the thread function when it wants to shut down.
- Return a value to the main thread. */
-
- static void *
-test03_aux0 (qt_t *old_is_garbage, void *farg1, void *farg2)
-{
- assert (farg1 == (void *)5);
- assert (farg2 == (void *)6);
- return ((void *)15); /* Some unlikely value. */
-}
-
-
-/* Called during new thread startup by main thread. Since the new
- thread has never run before, return value is ignored. */
-
- static void *
-test03_aux1 (qt_t *old, void *farg1, void *farg2)
-{
- assert (old != NULL);
- assert (farg1 == (void *)5);
- assert (farg2 == (void *)6);
- rootthread = old;
- return ((void *)16); /* Different than `15'. */
-}
-
- static void
-test03_aux2 (void *pu, void *pt, qt_userf_t *f)
-{
- assert (pu == (void *)1);
- assert (f == (qt_userf_t *)4);
- QT_ABORT (test03_aux0, (void *)5, (void *)6, rootthread);
-}
-
- static void
-test03 (int n)
-{
- thread_t *t;
- void *rv;
-
- while (n>0) {
- t = t_create (test03_aux2, (void *)1, (qt_userf_t *)4);
- rv = QT_BLOCKI (test03_aux1, (void *)5, (void *)6, t->qt);
- assert (rv == (void *)15);
- t_free (t);
-
- --n;
- }
-}
-
-
-static char const test04_msg[] = "stp_start w/ no threads.";
-
- static void
-test04 (int n)
-{
- while (n>0) {
- stp_init(); stp_start();
- stp_init(); stp_start();
- stp_init(); stp_start();
- stp_init(); stp_start();
- stp_init(); stp_start();
-
- stp_init(); stp_start();
- stp_init(); stp_start();
- stp_init(); stp_start();
- stp_init(); stp_start();
- stp_init(); stp_start();
-
- n -= 10;
- }
-}
-
-
-static char const test05_msg[] = "stp w/ 2 yielding thread.";
-
- static void
-test05_aux (void *null)
-{
- stp_yield();
- stp_yield();
-}
-
- static void
-test05 (int n)
-{
- while (n>0) {
- stp_init();
- stp_create (test05_aux, 0);
- stp_create (test05_aux, 0);
- stp_start();
-
- --n;
- }
-}
-
-
-static char const test06_msg[] = "*QT_ARGS(...), QT_BLOCKI one thread";
-
-static char const *test06_descr[] = {
- "Does a QT_ARGS, QT_BLOCKI to a helper function that saves the",
- "stack pointer of the main thread, calls an `only' function that",
- "saves aborts the thread, calling a null helper function.",
- ":: start/stop = QT_ARGS + QT_BLOCKI + QT_ABORT + 3 procedure calls.",
- NULL
-};
-
-/* This test initializes a thread, runs it, then returns to the main
- program, which reinitializes the thread, runs it again, etc. Each
- iteration corresponds to 1 init, 1 abort, 1 block. */
-
-static qt_t *test06_sp;
-
-
- static void
-test06_aux2 (void *null0a, void *null1b, void *null2b, qt_userf_t *null)
-{
- QT_ABORT (t_null, 0, 0, test06_sp);
-}
-
-
- static void *
-test06_aux3 (qt_t *sp, void *null0c, void *null1c)
-{
- test06_sp = sp;
- /* return (garbage); */
-}
-
-
- static void
-test06 (int n)
-{
- thread_t *t;
-
- t = t_create (0, 0, 0);
-
- while (n>0) {
- /* RETVALUSED */
- QT_ARGS (t->top, 0, 0, 0, test06_aux2);
- QT_BLOCKI (test06_aux3, 0, 0, t->qt);
-#ifdef NDEF
- /* RETVALUSED */
- QT_ARGS (t->top, 0, 0, 0, test06_aux2);
- QT_BLOCKI (test06_aux3, 0, 0, t->qt);
-
- /* RETVALUSED */
- QT_ARGS (t->top, 0, 0, 0, test06_aux2);
- QT_BLOCKI (test06_aux3, 0, 0, t->qt);
-
- /* RETVALUSED */
- QT_ARGS (t->top, 0, 0, 0, test06_aux2);
- QT_BLOCKI (test06_aux3, 0, 0, t->qt);
-
- /* RETVALUSED */
- QT_ARGS (t->top, 0, 0, 0, test06_aux2);
- QT_BLOCKI (test06_aux3, 0, 0, t->qt);
-
- n -= 5;
-#else
- --n;
-#endif
- }
-}
-
-static char test07_msg[] = "*cswap between threads";
-
-static char const *test07_descr[] = {
- "Build a chain of threads where each thread has a fixed successor.",
- "There is no scheduling performed. Each thread but one is a loop",
- "that simply blocks with QT_BLOCKI, calling a helper that saves the",
- "current stack pointer. The last thread decrements a count, and,",
- "if zero, aborts back to the main thread. Else it continues with",
- "the blocking chain. The count is divided by the number of threads",
- "in the chain, so `n' is the number of integer block operations.",
- ":: integer cswap = QT_BLOCKI + a procedure call.",
- NULL
-};
-
-/* This test repeatedly blocks a bunch of threads.
- Each iteration corresponds to one block operation.
-
- The threads are arranged so that there are TEST07_N-1 of them that
- run `test07_aux2'. Each one of those blocks saving it's sp to
- storage owned by the preceding thread; a pointer to that storage is
- passed in via `mep'. Each thread has a handle on it's own storage
- for the next thread, referenced by `nxtp', and it blocks by passing
- control to `*nxtp', telling the helper function to save its state
- in `*mep'. The last thread in the chain decrements a count and, if
- it's gone below zero, returns to `test07'; otherwise, it invokes
- the first thread in the chain. */
-
-static qt_t *test07_heavy;
-
-#define TEST07_N (4)
-
-
- static void
-test07_aux2 (void *null0, void *mep, void *nxtp, qt_userf_t *null)
-{
- qt_t *nxt;
-
- while (1) {
- nxt = *(qt_t **)nxtp;
-#ifdef NDEF
- printf ("Helper 0x%p\n", nxtp);
-#endif
- QT_BLOCKI (t_splat, mep, 0, nxt);
- }
-}
-
- static void
-test07_aux3 (void *np, void *mep, void *nxtp, qt_userf_t *null)
-{
- int n;
-
- n = *(int *)np;
- while (1) {
- n -= TEST07_N;
- if (n<0) {
- QT_ABORT (t_splat, mep, 0, test07_heavy);
- }
- QT_BLOCKI (t_splat, mep, 0, *(qt_t **)nxtp);
- }
-}
-
-
- static void
-test07 (int n)
-{
- int i;
- thread_t *t[TEST07_N];
-
- for (i=0; i<TEST07_N; ++i) {
- t[i] = t_create (0, 0, 0);
- }
- for (i=0; i<TEST07_N-1; ++i) {
- /* RETVALUSED */
- QT_ARGS (t[i]->top, 0, &t[i]->qt, &t[i+1]->qt, test07_aux2);
- }
- /* RETVALUSED */
- QT_ARGS (t[i]->top, &n, &t[TEST07_N-1]->qt, &t[0]->qt, test07_aux3);
- QT_BLOCKI (t_splat, &test07_heavy, 0, t[0]->qt);
-}
-
-
-static char test08_msg[] = "Floating-point cswap between threads";
-
-static char const *test08_descr[] = {
- "Measure context switch times including floating-point, use QT_BLOCK.",
- NULL
-};
-
-static qt_t *test08_heavy;
-
-#define TEST08_N (4)
-
-
- static void
-test08_aux2 (void *null0, void *mep, void *nxtp, qt_userf_t *null)
-{
- qt_t *nxt;
-
- while (1) {
- nxt = *(qt_t **)nxtp;
- QT_BLOCK (t_splat, mep, 0, nxt);
- }
-}
-
- static void
-test08_aux3 (void *np, void *mep, void *nxtp, qt_userf_t *null)
-{
- int n;
-
- n = *(int *)np;
- while (1) {
- n -= TEST08_N;
- if (n<0) {
- QT_ABORT (t_splat, mep, 0, test08_heavy);
- }
- QT_BLOCK (t_splat, mep, 0, *(qt_t **)nxtp);
- }
-}
-
-
- static void
-test08 (int n)
-{
- int i;
- thread_t *t[TEST08_N];
-
- for (i=0; i<TEST08_N; ++i) {
- t[i] = t_create (0, 0, 0);
- }
- for (i=0; i<TEST08_N-1; ++i) {
- /* RETVALUSED */
- QT_ARGS (t[i]->top, 0, &t[i]->qt, &t[i+1]->qt, test08_aux2);
- }
- /* RETVALUSED */
- QT_ARGS (t[i]->top, &n, &t[TEST08_N-1]->qt, &t[0]->qt, test08_aux3);
- QT_BLOCK (t_splat, &test08_heavy, 0, t[0]->qt);
-}
-
-
-/* Test the varargs procedure calling. */
-
-char const test09_msg[] = { "Start and run threads using varargs." };
-
-thread_t *test09_t0, *test09_t1, *test09_t2, *test09_main;
-
- thread_t *
-test09_create (qt_startup_t *start, qt_vuserf_t *f,
- qt_cleanup_t *cleanup, int nbytes, ...)
-{
- va_list ap;
- thread_t *t;
-
- t = t_alloc();
- va_start (ap, nbytes);
- t->qt = QT_VARGS (t->top, nbytes, ap, t, start, f, cleanup);
- va_end (ap);
- return (t);
-}
-
-
- static void
-test09_cleanup (void *pt, void *vuserf_retval)
-{
- assert (vuserf_retval == (void *)17);
- QT_ABORT (t_splat, &((thread_t *)pt)->qt, 0,
- ((thread_t *)pt)->next->qt);
-}
-
-
- static void
-test09_start (void *pt)
-{
-}
-
-
- static void *
-test09_user0 (void)
-{
- QT_BLOCKI (t_splat, &test09_t0->qt, 0, test09_t1->qt);
- return ((void *)17);
-}
-
- static void *
-test09_user2 (int one, int two)
-{
- assert (one == 1);
- assert (two == 2);
- QT_BLOCKI (t_splat, &test09_t1->qt, 0, test09_t2->qt);
- assert (one == 1);
- assert (two == 2);
- return ((void *)17);
-}
-
- static void *
-test09_user10 (int one, int two, int three, int four, int five,
- int six, int seven, int eight, int nine, int ten)
-{
- assert (one == 1);
- assert (two == 2);
- assert (three == 3);
- assert (four == 4);
- assert (five == 5);
- assert (six == 6);
- assert (seven == 7);
- assert (eight == 8);
- assert (nine == 9);
- assert (ten == 10);
- QT_BLOCKI (t_splat, &test09_t2->qt, 0, test09_main->qt);
- assert (one == 1);
- assert (two == 2);
- assert (three == 3);
- assert (four == 4);
- assert (five == 5);
- assert (six == 6);
- assert (seven == 7);
- assert (eight == 8);
- assert (nine == 9);
- assert (ten == 10);
- return ((void *)17);
-}
-
-
- void
-test09 (int n)
-{
- thread_t main;
-
- test09_main = &main;
-
- while (--n >= 0) {
- test09_t0 = test09_create (test09_start, (qt_vuserf_t*)test09_user0,
- test09_cleanup, 0);
- test09_t1 = test09_create (test09_start, (qt_vuserf_t*)test09_user2,
- test09_cleanup, 2 * sizeof(qt_word_t), 1, 2);
- test09_t2 = test09_create (test09_start, (qt_vuserf_t*)test09_user10,
- test09_cleanup, 10 * sizeof(qt_word_t),
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
-
- /* Chaining used by `test09_cleanup' to determine who is next. */
- test09_t0->next = test09_t1;
- test09_t1->next = test09_t2;
- test09_t2->next = test09_main;
-
- QT_BLOCKI (t_splat, &test09_main->qt, 0, test09_t0->qt);
- QT_BLOCKI (t_splat, &test09_main->qt, 0, test09_t0->qt);
-
- t_free (test09_t0);
- t_free (test09_t1);
- t_free (test09_t2);
- }
-}
-
-
- /* Test 10/11/12: time the cost of various number of args. */
-
-char const test10_msg[] = { "*Test varargs init & startup w/ 0 args." };
-
-char const *test10_descr[] = {
- "Start and stop threads that use variant argument lists (varargs).",
- "Each thread is initialized by calling a routine that calls",
- "QT_VARARGS. Then runs the thread by calling QT_BLOCKI to hald the",
- "main thread, a helper that saves the main thread's stack pointer,",
- "a null startup function, a null user function, a cleanup function",
- "that calls QT_ABORT and restarts the main thread. Copies no user",
- "parameters.",
- ":: varargs start/stop = QT_BLOCKI + QT_ABORT + 6 function calls.",
- NULL
-};
-
-/* Helper function to send control back to main.
- Don't save anything. */
-
-
-/* Helper function for starting the varargs thread. Save the stack
- pointer of the main thread so we can get back there eventually. */
-
-
-/* Startup function for a varargs thread. */
-
- static void
-test10_startup (void *pt)
-{
-}
-
-
-/* User function for a varargs thread. */
-
- static void *
-test10_run (int arg0, ...)
-{
- /* return (garbage); */
-}
-
-
-/* Cleanup function for a varargs thread. Send control
- back to the main thread. Don't save any state from the thread that
- is halting. */
-
- void
-test10_cleanup (void *pt, void *vuserf_retval)
-{
- QT_ABORT (t_null, 0, 0, ((thread_t *)pt)->qt);
-}
-
-
- void
-test10_init (thread_t *new, thread_t *next, int nbytes, ...)
-{
- va_list ap;
-
- va_start (ap, nbytes);
- new->qt = QT_VARGS (new->top, nbytes, ap, next, test10_startup,
- test10_run, test10_cleanup);
- va_end (ap);
-}
-
-
- void
-test10 (int n)
-{
- thread_t main;
- thread_t *t;
-
- t = t_alloc();
- t->next = &main;
-
- while (--n >= 0) {
- test10_init (t, &main, 0);
- QT_BLOCKI (t_splat, &main.qt, 0, t->qt);
- }
- t_free (t);
-}
-
-
-char const test11_msg[] = { "*Test varargs init & startup w/ 2 args." };
-
-char const *test11_descr[] = {
- "Varargs initialization/run. Copies 2 user arguments.",
- ":: varargs 2 start/stop = QT_VARGS(2 args), QT_BLOCKI, QT_ABORT, 6 f() calls.",
- NULL
-};
-
-
- void
-test11 (int n)
-{
- thread_t main;
- thread_t *t;
-
- t = t_alloc();
- t->next = &main;
-
- while (--n >= 0) {
- test10_init (t, &main, 2 * sizeof(int), 2, 1);
- QT_BLOCKI (t_splat, &main.qt, 0, t->qt);
- }
- t_free (t);
-}
-
-char const test12_msg[] = { "*Test varargs init & startup w/ 4 args." };
-
-char const *test12_descr[] = {
- "Varargs initialization/run. Copies 4 user arguments.",
- ":: varargs 4 start/stop = QT_VARGS(4 args), QT_BLOCKI, QT_ABORT, 6 f() calls.",
- NULL
-};
-
-
- void
-test12 (int n)
-{
- thread_t main;
- thread_t *t;
-
- t = t_alloc();
- t->next = &main;
-
- while (--n >= 0) {
- test10_init (t, &main, 4 * sizeof(int), 4, 3, 2, 1);
- QT_BLOCKI (t_splat, &main.qt, 0, t->qt);
- }
- t_free (t);
-}
-
-
-char const test13_msg[] = { "*Test varargs init & startup w/ 8 args." };
-
-char const *test13_descr[] = {
- "Varargs initialization/run. Copies 8 user arguments.",
- ":: varargs 8 start/stop = QT_VARGS(8 args), QT_BLOCKI, QT_ABORT, 6 f() calls.",
- NULL
-};
-
- void
-test13 (int n)
-{
- thread_t main;
- thread_t *t;
-
- t = t_alloc();
- t->next = &main;
-
- while (--n >= 0) {
- test10_init (t, &main, 8 * sizeof(int), 8, 7, 6, 5, 4, 3, 2, 1);
- QT_BLOCKI (t_splat, &main.qt, 0, t->qt);
- }
- t_free (t);
-}
-
-
-char const test14_msg[] = { "*Test varargs initialization w/ 0 args." };
-
-char const *test14_descr[] = {
- "Varargs initialization without running the thread. Just calls",
- "QT_VARGS.",
- ":: varargs 0 init = QT_VARGS()",
- NULL
-};
-
- void
-test14 (int n)
-{
- thread_t main;
- thread_t *t;
-
- t = t_alloc();
- t->next = &main;
-
- while (--n >= 0) {
- test10_init (t, &main, 0 * sizeof(int));
- }
- t_free (t);
-}
-
-
-char const test15_msg[] = { "*Test varargs initialization w/ 2 args." };
-
-char const *test15_descr[] = {
- "Varargs initialization without running the thread. Just calls",
- "QT_VARGS.",
- ":: varargs 2 init = QT_VARGS(2 args)",
- NULL
-};
-
- void
-test15 (int n)
-{
- thread_t main;
- thread_t *t;
-
- t = t_alloc();
- t->next = &main;
-
- while (--n >= 0) {
- test10_init (t, &main, 2 * sizeof(int), 2, 1);
- }
- t_free (t);
-}
-
-char const test16_msg[] = { "*Test varargs initialization w/ 4 args." };
-
-char const *test16_descr[] = {
- "Varargs initialization without running the thread. Just calls",
- "QT_VARGS.",
- ":: varargs 4 init = QT_VARGS(4 args)",
- NULL
-};
-
-
- void
-test16 (int n)
-{
- thread_t main;
- thread_t *t;
-
- t = t_alloc();
- t->next = &main;
-
- while (--n >= 0) {
- test10_init (t, &main, 4 * sizeof(int), 4, 3, 2, 1);
- }
- t_free (t);
-}
-
-
-char const test17_msg[] = { "*Test varargs initialization w/ 8 args." };
-
-char const *test17_descr[] = {
- "Varargs initialization without running the thread. Just calls",
- "QT_VARGS.",
- ":: varargs 8 init = QT_VARGS(8 args)",
- NULL
-};
-
-
- void
-test17 (int n)
-{
- thread_t main;
- thread_t *t;
-
- t = t_alloc();
- t->next = &main;
-
- while (--n >= 0) {
- test10_init (t, &main, 8 * sizeof(int), 8, 7, 6, 5, 4, 3, 2, 1);
- }
- t_free (t);
-}
-
- /* Test times for basic machine operations. */
-
-char const test18_msg[] = { "*Call register indirect." };
-char const *test18_descr[] = { NULL };
-
- void
-test18 (int n)
-{
- b_call_reg (n);
-}
-
-
-char const test19_msg[] = { "*Call immediate." };
-char const *test19_descr[] = { NULL };
-
- void
-test19 (int n)
-{
- b_call_imm (n);
-}
-
-
-char const test20_msg[] = { "*Add register-to-register." };
-char const *test20_descr[] = { NULL };
-
- void
-test20 (int n)
-{
- b_add (n);
-}
-
-
-char const test21_msg[] = { "*Load memory to a register." };
-char const *test21_descr[] = { NULL };
-
- void
-test21 (int n)
-{
- b_load (n);
-}
-
- /* Driver. */
-
-typedef struct foo_t {
- char const *msg; /* Message to print for generic help. */
- char const **descr; /* A description of what is done by the test. */
- void (*f)(int n);
-} foo_t;
-
-
-static foo_t foo[] = {
- { "Usage:\n", NULL, (void(*)(int n))usage },
- { test01_msg, test01_descr, test01 },
- { test02_msg, NULL, test02 },
- { test03_msg, NULL, test03 },
- { test04_msg, NULL, test04 },
- { test05_msg, NULL, test05 },
- { test06_msg, test06_descr, test06 },
- { test07_msg, test07_descr, test07 },
- { test08_msg, test08_descr, test08 },
- { test09_msg, NULL, test09 },
- { test10_msg, test10_descr, test10 },
- { test11_msg, test11_descr, test11 },
- { test12_msg, test12_descr, test12 },
- { test13_msg, test13_descr, test13 },
- { test14_msg, test14_descr, test14 },
- { test15_msg, test15_descr, test15 },
- { test16_msg, test16_descr, test16 },
- { test17_msg, test17_descr, test17 },
- { test18_msg, test18_descr, test18 },
- { test19_msg, test19_descr, test19 },
- { test20_msg, test20_descr, test20 },
- { test21_msg, test21_descr, test21 },
- { 0, 0 }
-};
-
-static int tv = 0;
-
- void
-tracer ()
-{
-
- fprintf (stderr, "tracer\t%d\n", tv++);
- fflush (stderr);
-}
-
- void
-tracer2 (void *val)
-{
- fprintf (stderr, "tracer2\t%d val=0x%p", tv++, val);
- fflush (stderr);
-}
-
-
- void
-describe()
-{
- int i;
- FILE *out = stdout;
-
- for (i=0; foo[i].msg; ++i) {
- if (foo[i].descr) {
- int j;
-
- putc ('\n', out);
- fprintf (out, "[%d]\n", i);
- for (j=0; foo[i].descr[j]; ++j) {
- fputs (foo[i].descr[j], out);
- putc ('\n', out);
- }
- }
- }
- exit (0);
-}
-
-
- void
-usage()
-{
- int i;
-
- fputs (foo[0].msg, stderr);
- for (i=1; foo[i].msg; ++i) {
- fprintf (stderr, "%2d\t%s\n", i, foo[i].msg);
- }
- exit (1);
-}
-
-
- void
-args (int *which, int *n, int argc, char **argv)
-{
- static int nfuncs = 0;
-
- if (argc == 2 && argv[1][0] == '-' && argv[1][1] == 'h') {
- describe();
- }
-
- if (nfuncs == 0) {
- for (nfuncs=0; foo[nfuncs].msg; ++nfuncs)
- ;
- }
-
- if (argc != 2 && argc != 3) {
- usage();
- }
-
- *which = atoi (argv[1]);
- if (*which < 0 || *which >= nfuncs) {
- usage();
- }
- *n = (argc == 3)
- ? atoi (argv[2])
- : 1;
-}
-
-
- int
-main (int argc, char **argv)
-{
- int which, n;
- args (&which, &n, argc, argv);
- (*(foo[which].f))(n);
- exit (0);
- return (0);
-}
diff --git a/qt/qt.c b/qt/qt.c
deleted file mode 100644
index d3e50bc17..000000000
--- a/qt/qt.c
+++ /dev/null
@@ -1,48 +0,0 @@
-#include "qt/copyright.h"
-#include "qt/qt.h"
-
-#ifdef QT_VARGS_DEFAULT
-
-/* If the stack grows down, `vargs' is a pointer to the lowest
- address in the block of arguments. If the stack grows up, it is a
- pointer to the highest address in the block. */
-
- qt_t *
-qt_vargs (qt_t *sp, int nbytes, void *vargs,
- void *pt, qt_startup_t *startup,
- qt_vuserf_t *vuserf, qt_cleanup_t *cleanup)
-{
- int i;
-
- sp = QT_VARGS_MD0 (sp, nbytes);
-#ifdef QT_GROW_UP
- for (i=nbytes/sizeof(qt_word_t); i>0; --i) {
- QT_SPUT (QT_VARGS_ADJUST(sp), i, ((qt_word_t *)vargs)[-i]);
- }
-#else
- for (i=nbytes/sizeof(qt_word_t); i>0; --i) {
- QT_SPUT (QT_VARGS_ADJUST(sp), i-1, ((qt_word_t *)vargs)[i-1]);
- }
-#endif
-
- QT_VARGS_MD1 (QT_VADJ(sp));
- QT_SPUT (QT_VADJ(sp), QT_VARGT_INDEX, pt);
- QT_SPUT (QT_VADJ(sp), QT_VSTARTUP_INDEX, startup);
- QT_SPUT (QT_VADJ(sp), QT_VUSERF_INDEX, vuserf);
- QT_SPUT (QT_VADJ(sp), QT_VCLEANUP_INDEX, cleanup);
- return ((qt_t *)QT_VADJ(sp));
-}
-#endif /* def QT_VARGS_DEFAULT */
-
- void
-qt_null (void)
-{
-}
-
- void
-qt_error (void)
-{
- extern void abort(void);
-
- abort();
-}
diff --git a/qt/qt.h.in b/qt/qt.h.in
deleted file mode 100644
index 6399a89d1..000000000
--- a/qt/qt.h.in
+++ /dev/null
@@ -1,186 +0,0 @@
-#ifndef QT_H
-#define QT_H
-
-#if defined (QT_IMPORT)
-# define QT_API __declspec (dllimport) extern
-#elif defined (QT_EXPORT) || defined (DLL_EXPORT)
-# define QT_API __declspec (dllexport) extern
-#else
-# define QT_API extern
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <qt/@qtmd_h@>
-
-
-/* A QuickThreads thread is represented by it's current stack pointer.
- To restart a thread, you merely need pass the current sp (qt_t*) to
- a QuickThreads primitive. `qt_t*' is a location on the stack. To
- improve type checking, represent it by a particular struct. */
-
-typedef struct qt_t {
- char dummy;
-} qt_t;
-
-
-/* Alignment is guaranteed to be a power of two. */
-#ifndef QT_STKALIGN
- #error "Need to know the machine-dependent stack alignment."
-#endif
-
-#define QT_STKROUNDUP(bytes) \
- (((bytes)+QT_STKALIGN) & ~(QT_STKALIGN-1))
-
-
-/* Find ``top'' of the stack, space on the stack. */
-#ifndef QT_SP
-#ifdef QT_GROW_DOWN
-#define QT_SP(sto, size) ((qt_t *)(&((char *)(sto))[(size)]))
-#endif
-#ifdef QT_GROW_UP
-#define QT_SP(sto, size) ((void *)(sto))
-#endif
-#if !defined(QT_SP)
- #error "QT_H: Stack must grow up or down!"
-#endif
-#endif
-
-
-/* The type of the user function:
- For non-varargs, takes one void* function.
- For varargs, takes some number of arguments. */
-typedef void *(qt_userf_t)(void *pu);
-typedef void *(qt_vuserf_t)(int arg0, ...);
-
-/* For non-varargs, just call a client-supplied function,
- it does all startup and cleanup, and also calls the user's
- function. */
-typedef void (qt_only_t)(void *pu, void *pt, qt_userf_t *userf);
-
-/* For varargs, call `startup', then call the user's function,
- then call `cleanup'. */
-typedef void (qt_startup_t)(void *pt);
-typedef void (qt_cleanup_t)(void *pt, void *vuserf_return);
-
-
-/* Internal helper for putting stuff on stack. */
-#ifndef QT_SPUT
-#define QT_SPUT(top, at, val) \
- (((qt_word_t *)(top))[(at)] = (qt_word_t)(val))
-#endif
-
-
-/* Push arguments for the non-varargs case. */
-#ifndef QT_ARGS
-
-#ifndef QT_ARGS_MD
-#define QT_ARGS_MD (0)
-#endif
-
-#ifndef QT_STKBASE
- #error "Need to know the machine-dependent stack allocation."
-#endif
-
-/* All things are put on the stack relative to the final value of
- the stack pointer. */
-#ifdef QT_GROW_DOWN
-#define QT_ADJ(sp) (((char *)sp) - QT_STKBASE)
-#else
-#define QT_ADJ(sp) (((char *)sp) + QT_STKBASE)
-#endif
-
-#define QT_ARGS(sp, pu, pt, userf, only) \
- (QT_ARGS_MD (QT_ADJ(sp)), \
- QT_SPUT (QT_ADJ(sp), QT_ONLY_INDEX, only), \
- QT_SPUT (QT_ADJ(sp), QT_USER_INDEX, userf), \
- QT_SPUT (QT_ADJ(sp), QT_ARGT_INDEX, pt), \
- QT_SPUT (QT_ADJ(sp), QT_ARGU_INDEX, pu), \
- ((qt_t *)QT_ADJ(sp)))
-
-#endif
-
-
-/* Push arguments for the varargs case.
- Has to be a function call because initialization is an expression
- and we need to loop to copy nbytes of stuff on to the stack.
- But that's probably OK, it's not terribly cheap, anyway. */
-
-#ifdef QT_VARGS_DEFAULT
-#ifndef QT_VARGS_MD0
-#define QT_VARGS_MD0(sp, vasize) (sp)
-#endif
-#ifndef QT_VARGS_MD1
-#define QT_VARGS_MD1(sp) do { ; } while (0)
-#endif
-
-#ifndef QT_VSTKBASE
- #error "Need base stack size for varargs functions."
-#endif
-
-/* Sometimes the stack pointer needs to munged a bit when storing
- the list of arguments. */
-#ifndef QT_VARGS_ADJUST
-#define QT_VARGS_ADJUST(sp) (sp)
-#endif
-
-/* All things are put on the stack relative to the final value of
- the stack pointer. */
-#ifdef QT_GROW_DOWN
-#define QT_VADJ(sp) (((char *)sp) - QT_VSTKBASE)
-#else
-#define QT_VADJ(sp) (((char *)sp) + QT_VSTKBASE)
-#endif
-
-QT_API qt_t *qt_vargs (qt_t *sp, int nbytes, void *vargs,
- void *pt, qt_startup_t *startup,
- qt_vuserf_t *vuserf, qt_cleanup_t *cleanup);
-
-#ifndef QT_VARGS
-#define QT_VARGS(sp, nbytes, vargs, pt, startup, vuserf, cleanup) \
- (qt_vargs (sp, nbytes, vargs, pt, startup, vuserf, cleanup))
-#endif
-
-#endif
-
-QT_API void qt_null (void);
-QT_API void qt_error (void);
-
-/* Save the state of the thread and call the helper function
- using the stack of the new thread. */
-typedef void *(qt_helper_t)(qt_t *old, void *a0, void *a1);
-typedef void *(qt_block_t)(qt_helper_t *helper, void *a0, void *a1,
- qt_t *newthread);
-
-/* Rearrange the parameters so that things passed to the helper
- function are already in the right argument registers. */
-#ifndef QT_ABORT
-QT_API void qt_abort (qt_helper_t *h, void *a0, void *a1, qt_t *newthread);
-/* The following does, technically, `return' a value, but the
- user had better not rely on it, since the function never
- returns. */
-#define QT_ABORT(h, a0, a1, newthread) \
- do { qt_abort (h, a0, a1, newthread); } while (0)
-#endif
-
-#ifndef QT_BLOCK
-QT_API void *qt_block (qt_helper_t *h, void *a0, void *a1,
- qt_t *newthread);
-#define QT_BLOCK(h, a0, a1, newthread) \
- (qt_block (h, a0, a1, newthread))
-#endif
-
-#ifndef QT_BLOCKI
-QT_API void *qt_blocki (qt_helper_t *h, void *a0, void *a1,
- qt_t *newthread);
-#define QT_BLOCKI(h, a0, a1, newthread) \
- (qt_blocki (h, a0, a1, newthread))
-#endif
-
-#ifdef __cplusplus
-} /* Match `extern "C" {' at top. */
-#endif
-
-#endif /* ndef QT_H */
diff --git a/qt/stp.c b/qt/stp.c
deleted file mode 100644
index bfacc893b..000000000
--- a/qt/stp.c
+++ /dev/null
@@ -1,199 +0,0 @@
-#include "copyright.h"
-#include "qt.h"
-#include "stp.h"
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#define STP_STKSIZE (0x1000)
-
-/* `alignment' must be a power of 2. */
-#define STP_STKALIGN(sp, alignment) \
- ((void *)((((qt_word_t)(sp)) + (alignment) - 1) & ~((alignment)-1)))
-
-
-/* The notion of a thread is merged with the notion of a queue.
- Thread stuff: thread status (sp) and stuff to use during
- (re)initialization. Queue stuff: next thread in the queue
- (next). */
-
-struct stp_t {
- qt_t *sp; /* QuickThreads handle. */
- void *sto; /* `malloc'-allocated stack. */
- struct stp_t *next; /* Next thread in the queue. */
-};
-
-
-/* A queue is a circular list of threads. The queue head is a
- designated list element. If this is a uniprocessor-only
- implementation we can store the `main' thread in this, but in a
- multiprocessor there are several `heavy' threads but only one run
- queue. A fancier implementation might have private run queues,
- which would lead to a simpler (trivial) implementation */
-
-typedef struct stp_q_t {
- stp_t t;
- stp_t *tail;
-} stp_q_t;
-
-
- /* Helper functions. */
-
-extern void *malloc (unsigned size);
-extern void perror (char const *msg);
-extern void free (void *sto);
-
- void *
-xmalloc (unsigned size)
-{
- void *sto;
-
- sto = malloc (size);
- if (!sto) {
- perror ("malloc");
- exit (1);
- }
- return (sto);
-}
-
- /* Queue access functions. */
-
- static void
-stp_qinit (stp_q_t *q)
-{
- q->t.next = q->tail = &q->t;
-}
-
-
- static stp_t *
-stp_qget (stp_q_t *q)
-{
- stp_t *t;
-
- t = q->t.next;
- q->t.next = t->next;
- if (t->next == &q->t) {
- if (t == &q->t) { /* If it was already empty .. */
- return (NULL); /* .. say so. */
- }
- q->tail = &q->t; /* Else now it is empty. */
- }
- return (t);
-}
-
-
- static void
-stp_qput (stp_q_t *q, stp_t *t)
-{
- q->tail->next = t;
- t->next = &q->t;
- q->tail = t;
-}
-
-
- /* Thread routines. */
-
-static stp_q_t stp_global_runq; /* A queue of runable threads. */
-static stp_t stp_global_main; /* Thread for the process. */
-static stp_t *stp_global_curr; /* Currently-executing thread. */
-
-static void *stp_starthelp (qt_t *old, void *ignore0, void *ignore1);
-static void stp_only (void *pu, void *pt, qt_userf_t *f);
-static void *stp_aborthelp (qt_t *sp, void *old, void *null);
-static void *stp_yieldhelp (qt_t *sp, void *old, void *blockq);
-
-
- void
-stp_init()
-{
- stp_qinit (&stp_global_runq);
-}
-
-
- void
-stp_start()
-{
- stp_t *next;
-
- while ((next = stp_qget (&stp_global_runq)) != NULL) {
- stp_global_curr = next;
- QT_BLOCK (stp_starthelp, 0, 0, next->sp);
- }
-}
-
-
- static void *
-stp_starthelp (qt_t *old, void *ignore0, void *ignore1)
-{
- stp_global_main.sp = old;
- stp_qput (&stp_global_runq, &stp_global_main);
- /* return (garbage); */
-}
-
-
- void
-stp_create (stp_userf_t *f, void *pu)
-{
- stp_t *t;
- void *sto;
-
- t = xmalloc (sizeof(stp_t));
- t->sto = xmalloc (STP_STKSIZE);
- sto = STP_STKALIGN (t->sto, QT_STKALIGN);
- t->sp = QT_SP (sto, STP_STKSIZE - QT_STKALIGN);
- t->sp = QT_ARGS (t->sp, pu, t, (qt_userf_t *)f, stp_only);
- stp_qput (&stp_global_runq, t);
-}
-
-
- static void
-stp_only (void *pu, void *pt, qt_userf_t *f)
-{
- stp_global_curr = (stp_t *)pt;
- (*(stp_userf_t *)f)(pu);
- stp_abort();
- /* NOTREACHED */
-}
-
-
- void
-stp_abort (void)
-{
- stp_t *old, *newthread;
-
- newthread = stp_qget (&stp_global_runq);
- old = stp_global_curr;
- stp_global_curr = newthread;
- QT_ABORT (stp_aborthelp, old, (void *)NULL, newthread->sp);
-}
-
-
- static void *
-stp_aborthelp (qt_t *sp, void *old, void *null)
-{
- free (((stp_t *)old)->sto);
- free (old);
- /* return (garbage); */
-}
-
-
- void
-stp_yield()
-{
- stp_t *old, *newthread;
-
- newthread = stp_qget (&stp_global_runq);
- old = stp_global_curr;
- stp_global_curr = newthread;
- QT_BLOCK (stp_yieldhelp, old, &stp_global_runq, newthread->sp);
-}
-
-
- static void *
-stp_yieldhelp (qt_t *sp, void *old, void *blockq)
-{
- ((stp_t *)old)->sp = sp;
- stp_qput ((stp_q_t *)blockq, (stp_t *)old);
- /* return (garbage); */
-}
diff --git a/qt/stp.h b/qt/stp.h
deleted file mode 100644
index f786f048d..000000000
--- a/qt/stp.h
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef STP_H
-#define STP_H
-
-/*
- * QuickThreads -- Threads-building toolkit.
- * Copyright (c) 1993 by David Keppel
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice and this notice
- * appear in all copies. This software is provided as a
- * proof-of-concept and for demonstration purposes; there is no
- * representation about the suitability of this software for any
- * purpose.
- */
-
-typedef struct stp_t stp_t;
-
-/* Each thread starts by calling a user-supplied function of this
- type. */
-
-typedef void (stp_userf_t)(void *p0);
-
-/* Call this before any other primitives. */
-extern void stp_init();
-
-/* When one or more threads are created by the main thread,
- the system goes multithread when this is called. It is done
- (no more runable threads) when this returns. */
-
-extern void stp_start (void);
-
-/* Create a thread and make it runable. When the thread starts
- running it will call `f' with the argument `p0'. */
-
-extern void stp_create (stp_userf_t *f, void *p0);
-
-/* The current thread stops running but stays runable.
- It is an error to call `stp_yield' before `stp_start'
- is called or after `stp_start' returns. */
-
-extern void stp_yield (void);
-
-/* Like `stp_yield' but the thread is discarded. Any intermediate
- state is lost. The thread can also terminate by simply
- returning. */
-
-extern void stp_abort (void);
-
-
-#endif /* ndef STP_H */
diff --git a/qt/time/.cvsignore b/qt/time/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/qt/time/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/qt/time/Makefile.am b/qt/time/Makefile.am
deleted file mode 100644
index ab4fffee1..000000000
--- a/qt/time/Makefile.am
+++ /dev/null
@@ -1,24 +0,0 @@
-## Process this file with automake to produce Makefile.in.
-##
-## Copyright (C) 1998 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-AUTOMAKE_OPTIONS = gnu
-
-EXTRA_DIST = README.time assim cswap go init prim raw
diff --git a/qt/time/README.time b/qt/time/README.time
deleted file mode 100644
index 4bb190e18..000000000
--- a/qt/time/README.time
+++ /dev/null
@@ -1,17 +0,0 @@
-The program `raw', when run in `..' runs the program `run' produced
-from `meas.c'. It produces a raw output file (see `../tmp/*.raw').
-`raw' will die with an error if run in the current directory. Note
-that some versions of `time' produce output in an unexpected format;
-edit them by hand.
-
-`prim', `init', `cswap' and `go' produce formatted table entries used
-in the documentation (in `../doc'). For example, from `..',
-
- foreach i (tmp/*.raw)
- time/prim $i
- end
-
-See notes in the QuickThreads document about the applicability of
-these microbenchmark measurements -- in general, you can expect all
-QuickThreads operations to be a bit slower when used in a real
-application.
diff --git a/qt/time/assim b/qt/time/assim
deleted file mode 100755
index 6c4c52183..000000000
--- a/qt/time/assim
+++ /dev/null
@@ -1,42 +0,0 @@
-#! /bin/awk -f
-
-BEGIN {
- nmach = 0;
-
- init_test = "1";
- abort_test = "6";
- blocki_test = "7";
- block_test = "8";
-}
-
-{
- mach = $1
- test = $2
- iter = $3
- time = $6 + $8
-
- if (machi[mach] == 0) {
- machn[nmach] = mach;
- machi[mach] = 1;
- ++nmach;
- }
-
- us_per_op = time / iter * 1000000
- times[mach "_" test] = us_per_op;
-}
-
-
-END {
- for (i=0; i<nmach; ++i) {
- m = machn[i];
- init = times[m "_" init_test];
- printf ("init %s | %f\n", m, init);
-
- init_abort_blocki = times[m "_" abort_test];
- abort_blocki = init_abort_blocki - init;
- blocki = times[m "_" blocki_test];
- abort = abort_blocki - blocki;
- blockf = times[m "_" block_test];
- printf ("swap %s | %f | %f | %f\n", m, abort, blocki, blockf);
- }
-}
diff --git a/qt/time/cswap b/qt/time/cswap
deleted file mode 100755
index 0ec811bcd..000000000
--- a/qt/time/cswap
+++ /dev/null
@@ -1,37 +0,0 @@
-#! /bin/awk -f
-
-BEGIN {
- purpose = "report time used by int only and int+fp cswaps";
-
- nmach = 0;
-
- test_int = "7";
- test_fp = "8";
-}
-
-{
- mach = $1
- test = $2
- iter = $3
- time = $6 + $8
-
- if (machi[mach] == 0) {
- machn[nmach] = mach;
- machi[mach] = 1;
- ++nmach;
- }
-
- us_per_op = time / iter * 1000000
- times[mach "_" test] = us_per_op;
-}
-
-
-END {
- for (i=0; i<nmach; ++i) {
- m = machn[i];
-
- integer = times[m "_" test_int];
- fp = times[m "_" test_fp];
- printf ("%s|%3.1f|%3.1f\n", m, integer, fp);
- }
-}
diff --git a/qt/time/go b/qt/time/go
deleted file mode 100755
index 489d53882..000000000
--- a/qt/time/go
+++ /dev/null
@@ -1,43 +0,0 @@
-#! /bin/awk -f
-
-BEGIN {
- purpose = "report times used for init/start/stop";
-
- nmach = 0;
-
- test_single = "6";
- test_v0 = "10";
- test_v2 = "11";
- test_v4 = "12";
- test_v8 = "13";
-}
-
-{
- mach = $1
- test = $2
- iter = $3
- time = $6 + $8
-
- if (machi[mach] == 0) {
- machn[nmach] = mach;
- machi[mach] = 1;
- ++nmach;
- }
-
- us_per_op = time / iter * 1000000
- times[mach "_" test] = us_per_op;
-}
-
-
-END {
- for (i=0; i<nmach; ++i) {
- m = machn[i];
-
- single = times[m "_" test_single];
- v0 = times[m "_" test_v0];
- v2 = times[m "_" test_v2];
- v4 = times[m "_" test_v4];
- v8 = times[m "_" test_v8];
- printf ("%s|%3.1f|%3.1f|%3.1f|%3.1f|%3.1f\n", m, single, v0, v2, v4, v8);
- }
-}
diff --git a/qt/time/init b/qt/time/init
deleted file mode 100755
index 8bcbf3428..000000000
--- a/qt/time/init
+++ /dev/null
@@ -1,42 +0,0 @@
-#! /bin/awk -f
-
-BEGIN {
- purpose = "Report time used to initialize a thread."
- nmach = 0;
-
- test_single = "1";
- test_v0 = "14";
- test_v2 = "15";
- test_v4 = "16";
- test_v8 = "17";
-}
-
-{
- mach = $1
- test = $2
- iter = $3
- time = $6 + $8
-
- if (machi[mach] == 0) {
- machn[nmach] = mach;
- machi[mach] = 1;
- ++nmach;
- }
-
- us_per_op = time / iter * 1000000
- times[mach "_" test] = us_per_op;
-}
-
-
-END {
- for (i=0; i<nmach; ++i) {
- m = machn[i];
-
- single = times[m "_" test_single];
- v0 = times[m "_" test_v0];
- v2 = times[m "_" test_v2];
- v4 = times[m "_" test_v4];
- v8 = times[m "_" test_v8];
- printf ("%s|%3.1f|%3.1f|%3.1f|%3.1f|%3.1f\n", m, single, v0, v2, v4, v8);
- }
-}
diff --git a/qt/time/prim b/qt/time/prim
deleted file mode 100755
index 22b323f6f..000000000
--- a/qt/time/prim
+++ /dev/null
@@ -1,41 +0,0 @@
-#! /bin/awk -f
-
-BEGIN {
- purpose = "report times for microbenchmarks"
-
- nmach = 0;
-
- test_callind = "18";
- test_callimm = "18";
- test_addreg = "20";
- test_loadreg = "21";
-}
-
-{
- mach = $1
- test = $2
- iter = $3
- time = $6 + $8
-
- if (machi[mach] == 0) {
- machn[nmach] = mach;
- machi[mach] = 1;
- ++nmach;
- }
-
- ns_per_op = time / iter * 1000000
- times[mach "_" test] = ns_per_op;
-}
-
-
-END {
- for (i=0; i<nmach; ++i) {
- m = machn[i];
-
- ind = times[m "_" test_callind];
- imm = times[m "_" test_callimm];
- add = times[m "_" test_addreg];
- load = times[m "_" test_loadreg];
- printf ("%s|%1.3f|%1.3f|%1.3f|%1.3f\n", m, ind, imm, add, load);
- }
-}
diff --git a/qt/time/raw b/qt/time/raw
deleted file mode 100755
index 96ae10ad1..000000000
--- a/qt/time/raw
+++ /dev/null
@@ -1,58 +0,0 @@
-#! /bin/csh
-
-rm -f timed
-
-set init=1
-set runone=6
-set blockint=7
-set blockfloat=8
-set vainit0=14
-set vainit2=15
-set vainit4=16
-set vainit8=17
-set vastart0=10
-set vastart2=11
-set vastart4=12
-set vastart8=13
-set bench_regcall=18
-set bench_immcall=19
-set bench_add=20
-set bench_load=21
-
-source configuration
-
-echo -n $config_machine $init $config_init
-/bin/time run $init $config_init
-echo -n $config_machine $runone $config_runone
-/bin/time run $runone $config_runone
-echo -n $config_machine $blockint $config_blockint
-/bin/time run $blockint $config_blockint
-echo -n $config_machine $blockfloat $config_blockfloat
-/bin/time run $blockfloat $config_blockfloat
-
-echo -n $config_machine $vainit0 $config_vainit0
-/bin/time run $vainit0 $config_vainit0
-echo -n $config_machine $vainit2 $config_vainit2
-/bin/time run $vainit2 $config_vainit2
-echo -n $config_machine $vainit4 $config_vainit4
-/bin/time run $vainit4 $config_vainit4
-echo -n $config_machine $vainit8 $config_vainit8
-/bin/time run $vainit8 $config_vainit8
-
-echo -n $config_machine $vastart0 $config_vastart0
-/bin/time run $vastart0 $config_vastart0
-echo -n $config_machine $vastart2 $config_vastart2
-/bin/time run $vastart2 $config_vastart2
-echo -n $config_machine $vastart4 $config_vastart4
-/bin/time run $vastart4 $config_vastart4
-echo -n $config_machine $vastart8 $config_vastart8
-/bin/time run $vastart8 $config_vastart8
-
-echo -n $config_machine $bench_regcall $config_bcall_reg
-/bin/time run $bench_regcall $config_bcall_reg
-echo -n $config_machine $bench_immcall $config_bcall_imm
-/bin/time run $bench_immcall $config_bcall_imm
-echo -n $config_machine $bench_add $config_b_add
-/bin/time run $bench_add $config_b_add
-echo -n $config_machine $bench_load $config_b_load
-/bin/time run $bench_load $config_b_load
diff --git a/scripts/.cvsignore b/scripts/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/scripts/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/scripts/ChangeLog b/scripts/ChangeLog
deleted file mode 100644
index e6b36f8f1..000000000
--- a/scripts/ChangeLog
+++ /dev/null
@@ -1,286 +0,0 @@
-2002-05-18 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * api-diff (group-diff): Also output +N and -N adds and subs
- details, respectively.
-
-2002-05-13 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * read-rfc822: New script.
-
- * Makefile.am (scripts_sources): Add api-diff and read-rfc822.
-
- * scan-api (scan-api): No longer include timestamp.
-
-2002-05-11 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * scan-api (scan-api): Fix bug: No longer omit `C' and `Scheme' in
- groups in the presence of the grouper.
-
- * api-diff: Use modules (ice-9 format), (ice-9 getopt-long).
- Autoload module (srfi srfi-13).
- No longer export `diff-alists'.
-
- (diff, diff-alists, display-list): Remove.
- (put, get, read-api-alist-file, hang-by-the-roots, diff?,
- diff+note!, group-diff): New procs.
- (api-diff): Rewrite.
-
-2002-05-10 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * scan-api (add-props): New proc.
- (make-grok-proc): Renamed from `make-grok-hook'.
- (make-members-proc): Renamed from `make-members-hook'.
- (make-grouper): Renamed from `make-grouping-hook'. Update callers.
- Add handling for multiple grouping-defs files.
- (scan-api): Add handling for multiple grouping-defs files.
- Cache `symbol->string' result; adjust `sort' usage.
-
-2002-05-09 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * scan-api (scan-C!): Use more robust regexp.
-
-2002-05-08 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * scan-api: New script.
- (scan-api): Handle case where `grouping-hook' is #f.
-
- Remove top-level `debug-enable' form.
- Add TODO comment; nfc.
-
- * Makefile.am (scripts_sources): Add "scan-api".
-
-2002-04-30 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * summarize-guile-TODO (make-display-item):
- Hoist some lambdas; nfc.
-
-2002-04-29 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * summarize-guile-TODO: Fix commentary typo; nfc.
-
-2002-04-08 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * summarize-guile-TODO: Use (ice-9 getopt-long).
- Autoload (ice-9 common-list).
-
- (select-items): New proc.
- (make-display-item): New proc.
- (display-item): Delete.
- (display-items): Use `make-display-item'.
- (summarize-guile-TODO): Add option handling.
-
-2002-04-07 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * summarize-guile-TODO: Add "Bugs" section to commentary.
- Autoload (srfi srfi-13) on `string-tokenize'.
-
- (as-leaf): New proc.
- (hang-by-the-leaves): Use `as-leaf'.
- (read-TODO-file): Expand regexp and specs
- to handle "D", "X" and "N%". Fix regexp
- to make isolating `who' easier.
- (display-item): Handle "D", "X" and "N%".
-
-2002-04-06 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * summarize-guile-TODO: New script.
-
- * Makefile.am (scripts_sources): Add "summarize-guile-TODO".
-
-2002-04-05 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * read-text-outline (display-outline-tree): No longer export this proc.
-
- (*depth-cue-rx*, *subm-number*, *level-divisor*, >>,
- display-outline-tree): Delete these vars and procs.
-
- (??, msub, ??-predicates, make-line-parser,
- make-text-outline-reader): New procs.
-
- (make-text-outline-reader): Export.
- (read-text-outline-silently): Rewrite
- using `make-text-outline-reader'.
-
-2002-04-04 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * lint: New script.
-
- * Makefile.am (scripts_sources): Add "lint".
-
-2002-04-02 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * PROGRAM: Update copyright; nfc.
-
- * read-text-outline: New script.
-
- * Makefile.am (scripts_sources): Add "read-text-outline".
-
- * read-text-outline (read-text-outline-silently):
- Move `tp' inside `loop'; nfc.
-
-2002-03-12 Neil Jerram <neil@ossau.uklinux.net>
-
- * snarf-check-and-output-texi (snarf-check-and-output-texi): If
- supplied, the `--manual' flag arrives as a string, not a symbol,
- so test for it as such.
-
-2002-03-03 Neil Jerram <neil@ossau.uklinux.net>
-
- * snarf-guile-m4-docs (display-texi): Strip off `# ' from start of
- docstring lines if possible, rather than just `#'.
-
-2002-02-26 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * Makefile.am: Update path to pre-inst-guile automake frag.
-
-2002-02-22 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * api-diff: New script.
-
-2002-02-05 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * Include $(top_srcdir)/pre-inst-guile.am.
-
- (overview): Use $(preinstguiletool).
-
-2002-01-11 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * Makefile.am (scripts_sources): Add autofrisk.
-
- * autofrisk: New script.
-
- * frisk: Fix typo in commentary; nfc.
-
- * use2dot: Autoload module (ice-9 getopt-long).
- Use module (srfi srfi-13).
- Export `use2dot'.
-
- (string-append/separator, mapconcat): Delete.
- (vv): Now take list of pairs, and return the mapping..
- (>>header): Use `string-join'.
- (>>): New proc.
- (use2dot): Use `getopt-long'. Use `>>'.
-
-2002-01-08 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * Makefile.am (scripts_sources): Add frisk.
- (list): New target.
- (overview): Also report module interfaces.
-
- * use2dot: Rewrite using (scripts frisk).
-
- * frisk: Initial revision.
-
-2002-01-02 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * snarf-guile-m4-docs: New script.
-
-2001-11-28 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * punify (write-punily): Handle symbols w/ ":" prefix specially.
-
- * use2dot (ferret): New proc.
- (grok): Use `ferret'.
-
-2001-11-16 Neil Jerram <neil@ossau.uklinux.net>
-
- * snarf-check-and-output-texi: Change generated @deffn categories
- from "function" and "primitive" to "C Function" and "Scheme
- Procedure".
- (end-multiline): Take out @findex generation again; not needed
- since index entries are implicit in @deffn forms.
-
- These changes add a @deffnx C function declaration and function
- index entries for each Guile primitive to the copy of the doc
- snarf output that is used for reference manual synchronization.
- Online help is unchanged.
-
- * snarf-check-and-output-texi (*manual-flag*,
- snarf-check-and-output-texi): Handle `--manual' invocation arg
- passed through from libguile/Makefile.am.
- (*c-function-name*, begin-multiline, do-command): Pick out C
- function name from snarfed token stream.
- (end-multiline): Add @deffnx C declaration and function index
- entries to output.
- (*primitive-deffnx-signature*, *primitive-deffnx-sig-length*):
- Fluff to help insert the C declaration after any "@deffnx
- primitive" lines in the snarfed docstring.
-
-2001-10-05 Thien-Thi Nguyen <ttn@glug.org>
-
- * read-scheme-source (quoted?, clump): New procs, exported.
-
-2001-09-30 Thien-Thi Nguyen <ttn@glug.org>
-
- * display-commentary (module-name->filename-frag,
- display-module-commentary): New procs.
- (display-commentary): Also handle refs that look like module
- names.
-
-2001-08-25 Marius Vollmer <mvo@zagadka.ping.de>
-
- * Makefile.am (AUTOMAKE_OPTIONS): Change "foreign" to "gnu".
-
-2001-08-07 Michael Livshin <mlivshin@bigfoot.com>
-
- * snarf-check-and-output-texi: print optional args in a prettier
- manner.
-
-2001-08-01 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * PROGRAM, README, display-commentary, doc-snarf,
- generate-autoload, punify, read-scheme-source,
- snarf-check-and-output-texi, use2dot:
- In boilerplate, use -l$0.
- Thanks to Daniel Skarda.
-
-2001-07-22 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * generate-autoload (autoload-info):
- Also handle `defmacro-public' forms.
-
-2001-07-14 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * PROGRAM, display-commentary, doc-snarf, generate-autoload,
- punify, read-scheme-source, snarf-check-and-output-texi, use2dot:
- Re-add authorship info.
-
-2001-07-12 Michael Livshin <mlivshin@bigfoot.com>
-
- * snarf-check-and-output-texi (do-argpos): complain to the stderr,
- not stdout. thanks to Dale P. Smith!
- (nice-sig): cosmetic fix.
-
-2001-07-09 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * PROGRAM, generate-autoload, use2dot, punify, display-commentary,
- doc-snarf, read-scheme-source, snarf-check-and-output-texi:
- Remove authorship info.
-
-2001-06-25 Michael Livshin <mlivshin@bigfoot.com>
-
- * snarf-check-and-output-texi: rewrite.
-
-2001-05-31 Michael Livshin <mlivshin@bigfoot.com>
-
- * snarf-check-and-output-texi: new file.
-
- * Makefile.am (scripts_sources): add snarf-check-and-output-texi.
-
-2001-05-14 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * PROGRAM, display-commentary, doc-snarf, generate-autoload,
- punify, read-scheme-source, use2dot: Move author tag outside
- commentary; nfc.
-
-2001-05-08 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * read-scheme-source: New file
-
- * Makefile.am (scripts_sources): Add read-scheme-source.
-
-2001-04-29 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * Makefile.am, PROGRAM, README, display-commentary,
- doc-snarf, generate-autoload, punify, use2dot: New file
-
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
deleted file mode 100644
index 46d1885d0..000000000
--- a/scripts/Makefile.am
+++ /dev/null
@@ -1,67 +0,0 @@
-## Process this file with automake to produce Makefile.in.
-##
-## Copyright (C) 2002 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-AUTOMAKE_OPTIONS = gnu
-
-# These should be installed and distributed.
-scripts_sources = \
- PROGRAM \
- autofrisk \
- display-commentary \
- doc-snarf \
- frisk \
- generate-autoload \
- lint \
- punify \
- read-scheme-source \
- read-text-outline \
- use2dot \
- snarf-check-and-output-texi \
- summarize-guile-TODO \
- scan-api \
- api-diff \
- read-rfc822
-
-subpkgdatadir = $(pkgdatadir)/$(VERSION)/scripts
-subpkgdata_SCRIPTS = $(scripts_sources)
-
-EXTRA_DIST = $(scripts_sources)
-
-list:
- @echo $(scripts_sources)
-
-include $(top_srcdir)/am/pre-inst-guile
-
-overview: $(scripts_sources)
- @echo '----------------------------'
- @echo Overview
- @echo I. Commentaries
- @echo II. Module Interfaces
- @echo '----------------------------'
- @echo I. Commentaries
- @echo '----------------------------'
- $(preinstguiletool)/display-commentary $^
- @echo '----------------------------'
- @echo II. Module Interfaces
- @echo '----------------------------'
- $(preinstguiletool)/frisk $^
-
-# Makefile.am ends here
diff --git a/scripts/PROGRAM b/scripts/PROGRAM
deleted file mode 100755
index 9ce5f022a..000000000
--- a/scripts/PROGRAM
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/sh
-# aside from this initial boilerplate, this is actually -*- scheme -*- code
-main='(module-ref (resolve-module '\''(scripts PROGRAM)) '\'main')'
-exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@"
-!#
-;;; PROGRAM --- Does something
-
-;; Copyright (C) 2002 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, Inc., 59 Temple Place, Suite 330,
-;; Boston, MA 02111-1307 USA
-
-;;; Author: J.R.Hacker
-
-;;; Commentary:
-
-;; Usage: PROGRAM [ARGS]
-;;
-;; PROGRAM does something.
-;;
-;; TODO: Write it!
-
-;;; Code:
-
-(define-module (scripts PROGRAM)
- :export (PROGRAM))
-
-(define (PROGRAM . args)
- #t)
-
-(define main PROGRAM)
-
-;;; PROGRAM ends here
diff --git a/scripts/README b/scripts/README
deleted file mode 100644
index 56dd286fb..000000000
--- a/scripts/README
+++ /dev/null
@@ -1,76 +0,0 @@
-Overview and Usage
-------------------
-
-This directory contains Scheme programs, some useful in maintaining Guile.
-On "make install", these programs are copied to PKGDATADIR/VERSION/scripts.
-
-You can invoke a program from the shell, or alternatively, load its file
-as a Guile Scheme module, and use its exported procedure(s) from Scheme code.
-Typically for any PROGRAM:
-
- (use-modules (scripts PROGRAM))
- (PROGRAM ARG1 ARG2 ...)
-
-For programs that write to stdout, you might try, instead:
-
- (use-modules (scripts PROGRAM))
- (with-output-to-string (lambda () (PROGRAM ARG1 ARG2 ...)))
-
-Note that all args must be strings.
-
-To see PROGRAM's commentary, which may or may not be helpful:
-
- (help (scripts PROGRAM))
-
-To see all commentaries and module dependencies, try: "make overview".
-
-If you want to try the programs before installing Guile, you will probably
-need to set environment variable GUILE_LOAD_PATH to be the parent directory.
-This can be done in Bourne-compatible shells like so:
-
- GUILE_LOAD_PATH=`(cd .. ; pwd)`
- export GUILE_LOAD_PATH
-
-[FIXME: Can someone supply the csh-compatible equivalent?]
-
-
-
-How to Contribute
------------------
-
-See template file PROGRAM for a quick start.
-
-Programs must follow the "executable module" convention, documented here:
-
-- The file name must not end in ".scm".
-
-- The file must be executable (chmod +x).
-
-- The module name must be "(scripts PROGRAM)". A procedure named PROGRAM w/
- signature "(PROGRAM . args)" must be exported. Basically, use some variant
- of the form:
-
- (define-module (scripts PROGRAM)
- :export (PROGRAM))
-
- Feel free to export other definitions useful in the module context.
-
-- There must be the alias:
-
- (define main PROGRAM)
-
- However, `main' must NOT be exported.
-
-- The beginning of the file must use the following invocation sequence:
-
- #!/bin/sh
- main='(module-ref (resolve-module '\''(scripts PROGRAM)) '\'main')'
- exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@"
- !#
-
-Following these conventions allows the program file to be used as module
-(scripts PROGRAM) in addition to as a standalone executable. Please also
-include a helpful Commentary section w/ some usage info.
-
-
-[README ends here]
diff --git a/scripts/api-diff b/scripts/api-diff
deleted file mode 100755
index 433ff0f45..000000000
--- a/scripts/api-diff
+++ /dev/null
@@ -1,181 +0,0 @@
-#!/bin/sh
-# aside from this initial boilerplate, this is actually -*- scheme -*- code
-main='(module-ref (resolve-module '\''(scripts api-diff)) '\'main')'
-exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@"
-!#
-;;; api-diff --- diff guile-api.alist files
-
-;; Copyright (C) 2002 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, Inc., 59 Temple Place, Suite 330,
-;; Boston, MA 02111-1307 USA
-
-;;; Author: Thien-Thi Nguyen <ttn@gnu.org>
-
-;;; Commentary:
-
-;; Usage: api-diff [-d GROUPS] ALIST-FILE-A ALIST-FILE-B
-;;
-;; Read in the alists from files ALIST-FILE-A and ALIST-FILE-B
-;; and display a (count) summary of the groups defined therein.
-;; Optional arg "--details" (or "-d") specifies a comma-separated
-;; list of groups, in which case api-diff displays instead the
-;; elements added and deleted for each of the specified groups.
-;;
-;; For scheme programming, this module exports the proc:
-;; (api-diff A-file B-file)
-;;
-;; Note that the convention is that the "older" alist/file is
-;; specified first.
-;;
-;; TODO: Develop scheme interface.
-
-;;; Code:
-
-(define-module (scripts api-diff)
- :use-module (ice-9 common-list)
- :use-module (ice-9 format)
- :use-module (ice-9 getopt-long)
- :autoload (srfi srfi-13) (string-tokenize)
- :export (api-diff))
-
-(define (read-alist-file file)
- (with-input-from-file file
- (lambda () (read))))
-
-(define put set-object-property!)
-(define get object-property)
-
-(define (read-api-alist-file file)
- (let* ((alist (read-alist-file file))
- (meta (assq-ref alist 'meta))
- (interface (assq-ref alist 'interface)))
- (put interface 'meta meta)
- (put interface 'groups (let ((ht (make-hash-table 31)))
- (for-each (lambda (group)
- (hashq-set! ht group '()))
- (assq-ref meta 'groups))
- ht))
- interface))
-
-(define (hang-by-the-roots interface)
- (let ((ht (get interface 'groups)))
- (for-each (lambda (x)
- (for-each (lambda (group)
- (hashq-set! ht group
- (cons (car x)
- (hashq-ref ht group))))
- (assq-ref x 'groups)))
- interface))
- interface)
-
-(define (diff? a b)
- (let ((result (set-difference a b)))
- (if (null? result)
- #f ; CL weenies bite me
- result)))
-
-(define (diff+note! a b note-removals note-additions note-same)
- (let ((same? #t))
- (cond ((diff? a b) => (lambda (x) (note-removals x) (set! same? #f))))
- (cond ((diff? b a) => (lambda (x) (note-additions x) (set! same? #f))))
- (and same? (note-same))))
-
-(define (group-diff i-old i-new . options)
- (let* ((i-old (hang-by-the-roots i-old))
- (g-old (hash-fold acons '() (get i-old 'groups)))
- (g-old-names (map car g-old))
- (i-new (hang-by-the-roots i-new))
- (g-new (hash-fold acons '() (get i-new 'groups)))
- (g-new-names (map car g-new)))
- (cond ((null? options)
- (diff+note! g-old-names g-new-names
- (lambda (removals)
- (format #t "groups-removed: ~A\n" removals))
- (lambda (additions)
- (format #t "groups-added: ~A\n" additions))
- (lambda () #t))
- (for-each (lambda (group)
- (let* ((old (assq-ref g-old group))
- (new (assq-ref g-new group))
- (old-count (and old (length old)))
- (new-count (and new (length new)))
- (delta (and old new (- new-count old-count))))
- (format #t " ~5@A ~5@A : "
- (or old-count "-")
- (or new-count "-"))
- (cond ((and old new)
- (let ((add-count 0) (sub-count 0))
- (diff+note!
- old new
- (lambda (subs)
- (set! sub-count (length subs)))
- (lambda (adds)
- (set! add-count (length adds)))
- (lambda () #t))
- (format #t "~5@D ~5@D : ~5@D"
- add-count (- sub-count) delta)))
- (else
- (format #t "~5@A ~5@A : ~5@A" "-" "-" "-")))
- (format #t " ~A\n" group)))
- (sort (union g-old-names g-new-names)
- (lambda (a b)
- (string<? (symbol->string a)
- (symbol->string b))))))
- ((assq-ref options 'details)
- => (lambda (groups)
- (for-each (lambda (group)
- (let* ((old (or (assq-ref g-old group) '()))
- (new (or (assq-ref g-new group) '()))
- (>>! (lambda (label ls)
- (format #t "~A ~A:\n" group label)
- (for-each (lambda (x)
- (format #t " ~A\n" x))
- ls))))
- (diff+note! old new
- (lambda (removals)
- (>>! 'removals removals))
- (lambda (additions)
- (>>! 'additions additions))
- (lambda ()
- (format #t "~A: no changes\n"
- group)))))
- groups)))
- (else
- (error "api-diff: group-diff: bad options")))))
-
-(define (api-diff . args)
- (let* ((p (getopt-long (cons 'api-diff args)
- '((details (single-char #\d)
- (value #t))
- ;; Add options here.
- )))
- (rest (option-ref p '() '("/dev/null" "/dev/null")))
- (i-old (read-api-alist-file (car rest)))
- (i-new (read-api-alist-file (cadr rest)))
- (options '()))
- (cond ((option-ref p 'details #f)
- => (lambda (groups)
- (set! options (cons (cons 'details
- (map string->symbol
- (string-tokenize
- groups
- #\,)))
- options)))))
- (apply group-diff i-old i-new options)))
-
-(define main api-diff)
-
-;;; api-diff ends here
diff --git a/scripts/autofrisk b/scripts/autofrisk
deleted file mode 100755
index cbb91d271..000000000
--- a/scripts/autofrisk
+++ /dev/null
@@ -1,221 +0,0 @@
-#!/bin/sh
-# aside from this initial boilerplate, this is actually -*- scheme -*- code
-main='(module-ref (resolve-module '\''(scripts autofrisk)) '\'main')'
-exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@"
-!#
-;;; autofrisk --- Generate module checks for use with auto* tools
-
-;; Copyright (C) 2002 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, Inc., 59 Temple Place, Suite 330,
-;; Boston, MA 02111-1307 USA
-
-;;; Author: Thien-Thi Nguyen <ttn@gnu.org>
-
-;;; Commentary:
-
-;; Usage: autofrisk [file]
-;;
-;; This program looks for the file modules.af in the current directory
-;; and writes out modules.af.m4 containing autoconf definitions.
-;; If given, look for FILE instead of modules.af and output to FILE.m4.
-;;
-;; After running autofrisk, you should add to configure.ac the lines:
-;; AUTOFRISK_CHECKS
-;; AUTOFRISK_SUMMARY
-;; Then run "aclocal -I ." to update aclocal.m4, and finally autoconf.
-;;
-;; The modules.af file consists of a series of configuration forms (Scheme
-;; lists), which have one of the following formats:
-;; (files-glob PATTERN ...)
-;; (non-critical-external MODULE ...)
-;; (non-critical-internal MODULE ...)
-;; (programs (MODULE PROG ...) ...)
-;; (pww-varname VARNAME)
-;; PATTERN is a string that may contain "*" and "?" characters to be
-;; expanded into filenames. MODULE is a list of symbols naming a
-;; module, such as `(srfi srfi-1)'. VARNAME is a shell-safe name to use
-;; instead of "probably_wont_work", the default. This var is passed to
-;; `AC_SUBST'. PROG is a string.
-;;
-;; Only the `files-glob' form is required.
-;;
-;; TODO: Write better commentary.
-;; Make "please see README" configurable.
-
-;;; Code:
-
-(define-module (scripts autofrisk)
- :autoload (ice-9 popen) (open-input-pipe)
- :use-module (srfi srfi-1)
- :use-module (srfi srfi-8)
- :use-module (srfi srfi-13)
- :use-module (srfi srfi-14)
- :use-module (scripts read-scheme-source)
- :use-module (scripts frisk)
- :export (autofrisk))
-
-(define *recognized-keys* '(files-glob
- non-critical-external
- non-critical-internal
- programs
- pww-varname))
-
-(define (canonical-configuration forms)
- (let ((chk (lambda (condition . x)
- (or condition (apply error "syntax error:" x)))))
- (chk (list? forms) "input not a list")
- (chk (every list? forms) "non-list element")
- (chk (every (lambda (form) (< 1 (length form))) forms) "list too short")
- (let ((un #f))
- (chk (every (lambda (form)
- (let ((key (car form)))
- (and (symbol? key)
- (or (eq? 'quote key)
- (memq key *recognized-keys*)
- (begin
- (set! un key)
- #f)))))
- forms)
- "unrecognized key:" un))
- (let ((bunched (map (lambda (key)
- (fold (lambda (form so-far)
- (or (and (eq? (car form) key)
- (cdr form)
- (append so-far (cdr form)))
- so-far))
- (list key)
- forms))
- *recognized-keys*)))
- (lambda (key)
- (assq-ref bunched key)))))
-
-(define (>>strong modules)
- (for-each (lambda (module)
- (format #t "GUILE_MODULE_REQUIRED~A\n" module))
- modules))
-
-(define (safe-name module)
- (let ((var (object->string module)))
- (string-map! (lambda (c)
- (if (char-set-contains? char-set:letter+digit c)
- c
- #\_))
- var)
- var))
-
-(define *pww* "probably_wont_work")
-
-(define (>>weak weak-edges)
- (for-each (lambda (edge)
- (let* ((up (edge-up edge))
- (down (edge-down edge))
- (var (format #f "have_guile_module~A" (safe-name up))))
- (format #t "GUILE_MODULE_AVAILABLE(~A, ~A)\n" var up)
- (format #t "test \"$~A\" = no &&\n ~A=\"~A $~A\"~A"
- var *pww* down *pww* "\n\n")))
- weak-edges))
-
-(define (>>program module progs)
- (let ((vars (map (lambda (prog)
- (format #f "guile_module~Asupport_~A"
- (safe-name module)
- prog))
- progs)))
- (for-each (lambda (var prog)
- (format #t "AC_PATH_PROG(~A, ~A)\n" var prog))
- vars progs)
- (format #t "test \\\n")
- (for-each (lambda (var)
- (format #t " \"$~A\" = \"\" -o \\\n" var))
- vars)
- (format #t "~A &&\n~A=\"~A $~A\"\n\n"
- (list-ref (list "war = peace"
- "freedom = slavery"
- "ignorance = strength")
- (random 3))
- *pww* module *pww*)))
-
-(define (>>programs programs)
- (for-each (lambda (form)
- (>>program (car form) (cdr form)))
- programs))
-
-(define (unglob pattern)
- (let ((p (open-input-pipe (format #f "echo '(' ~A ')'" pattern))))
- (map symbol->string (read p))))
-
-(define (>>checks forms)
- (let* ((cfg (canonical-configuration forms))
- (files (apply append (map unglob (cfg 'files-glob))))
- (ncx (cfg 'non-critical-external))
- (nci (cfg 'non-critical-internal))
- (prog (cfg 'non-critical))
- (report ((make-frisker) files))
- (external (report 'external)))
- (let ((pww-varname (cfg 'pww-varname)))
- (or (null? pww-varname) (set! *pww* (car pww-varname))))
- (receive (weak strong)
- (partition (lambda (module)
- (or (member module ncx)
- (every (lambda (i)
- (member i nci))
- (map edge-down (mod-down-ls module)))))
- external)
- (format #t "AC_DEFUN([AUTOFRISK_CHECKS],[\n\n")
- (>>strong strong)
- (format #t "\n~A=~S\n\n" *pww* "")
- (>>weak (fold (lambda (module so-far)
- (append so-far (mod-down-ls module)))
- (list)
- weak))
- (>>programs (cfg 'programs))
- (format #t "AC_SUBST(~A)\n])\n\n" *pww*))))
-
-(define (>>summary)
- (format #t
- (symbol->string
- '#{
-AC_DEFUN([AUTOFRISK_SUMMARY],[
-if test ! "$~A" = "" ; then
- p=" ***"
- echo "$p"
- echo "$p NOTE:"
- echo "$p The following modules probably won't work:"
- echo "$p $~A"
- echo "$p They can be installed anyway, and will work if their"
- echo "$p dependencies are installed later. Please see README."
- echo "$p"
-fi
-])
-}#)
- *pww* *pww*))
-
-(define (autofrisk . args)
- (let ((file (if (null? args) "modules.af" (car args))))
- (or (file-exists? file)
- (error "could not find input file:" file))
- (with-output-to-file (format #f "~A.m4" file)
- (lambda ()
- (>>checks (read-scheme-source-silently file))
- (>>summary)))))
-
-(define main autofrisk)
-
-;; Local variables:
-;; eval: (put 'receive 'scheme-indent-function 2)
-;; End:
-
-;;; autofrisk ends here
diff --git a/scripts/display-commentary b/scripts/display-commentary
deleted file mode 100755
index 59b0890fc..000000000
--- a/scripts/display-commentary
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/bin/sh
-# aside from this initial boilerplate, this is actually -*- scheme -*- code
-main='(module-ref (resolve-module '\''(scripts display-commentary)) '\'main')'
-exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@"
-!#
-;;; display-commentary --- As advertized
-
-;; Copyright (C) 2001 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, Inc., 59 Temple Place, Suite 330,
-;; Boston, MA 02111-1307 USA
-
-;;; Author: Thien-Thi Nguyen
-
-;;; Commentary:
-
-;; Usage: display-commentary REF1 REF2 ...
-;;
-;; Display Commentary section from REF1, REF2 and so on.
-;; Each REF may be a filename or module name (list of symbols).
-;; In the latter case, a filename is computed by searching `%load-path'.
-
-;;; Code:
-
-(define-module (scripts display-commentary)
- :use-module (ice-9 documentation)
- :export (display-commentary))
-
-(define (display-commentary-one file)
- (format #t "~A commentary:\n~A" file (file-commentary file)))
-
-(define (module-name->filename-frag ls) ; todo: export or move
- (let ((ls (map symbol->string ls)))
- (let loop ((ls (cdr ls)) (acc (car ls)))
- (if (null? ls)
- acc
- (loop (cdr ls) (string-append acc "/" (car ls)))))))
-
-(define (display-module-commentary module-name)
- (cond ((%search-load-path (module-name->filename-frag module-name))
- => (lambda (file)
- (format #t "module ~A\n" module-name)
- (display-commentary-one file)))))
-
-(define (display-commentary . refs)
- (for-each (lambda (ref)
- (cond ((string? ref)
- (if (equal? 0 (string-index ref #\())
- (display-module-commentary
- (with-input-from-string ref read))
- (display-commentary-one ref)))
- ((list? ref)
- (display-module-commentary ref))))
- refs))
-
-(define main display-commentary)
-
-;;; display-commentary ends here
diff --git a/scripts/doc-snarf b/scripts/doc-snarf
deleted file mode 100755
index 5b72fc5f8..000000000
--- a/scripts/doc-snarf
+++ /dev/null
@@ -1,442 +0,0 @@
-#!/bin/sh
-# aside from this initial boilerplate, this is actually -*- scheme -*- code
-main='(module-ref (resolve-module '\''(scripts doc-snarf)) '\'main')'
-exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@"
-!#
-;;; doc-snarf --- Extract documentation from source files
-
-;; Copyright (C) 2001 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, Inc., 59 Temple Place, Suite 330,
-;; Boston, MA 02111-1307 USA
-
-;;; Author: Martin Grabmueller
-
-;;; Commentary:
-
-;; Usage: doc-snarf FILE
-;;
-;; This program reads in a Scheme source file and extracts docstrings
-;; in the format specified below. Additionally, a procedure protoype
-;; is infered from the procedure definition line starting with
-;; (define... ).
-;;
-;; Currently, two output modi are implemented: texinfo and plaintext.
-;; Default is plaintext, texinfo can be switched on with the
-;; `--texinfo, -t' command line option.
-;;
-;; Format: A docstring can span multiple lines and a docstring line
-;; begins with `;; ' (two semicoli and a space). A docstring is ended
-;; by either a line beginning with (define ...) or one or more lines
-;; beginning with `;;-' (two semicoli and a dash). These lines are
-;; called `options' and begin with a keyword, followed by a colon and
-;; a string.
-;;
-;; Additionally, "standard internal docstrings" (for Scheme source) are
-;; recognized and output as "options". The output formatting is likely
-;; to change in the future.
-;;
-;; Example:
-
-;; This procedure foos, or bars, depending on the argument @var{braz}.
-;;-Author: Martin Grabmueller
-(define (foo/bar braz)
- (if braz 'foo 'bar))
-
-;;; Which results in the following docstring if texinfo output is
-;;; enabled:
-#!
- foo/bar
-@deffn procedure foo/bar braz
-This procedure foos, or bars, depending on the argument @var{braz}.
-@c Author: Martin Grabmueller
-@end deffn
-!#
-
-;;; Or in this if plaintext output is used:
-#!
-Procedure: foo/bar braz
-This procedure foos, or bars, depending on the argument @var{braz}.
-;; Author: Martin Grabmueller
-^L
-!#
-
-;; TODO: Convert option lines to alist.
-;; More parameterization.
-;; ../libguile/guile-doc-snarf emulation
-
-(define doc-snarf-version "0.0.2") ; please update before publishing!
-
-;;; Code:
-
-(define-module (scripts doc-snarf)
- :use-module (ice-9 getopt-long)
- :use-module (ice-9 regex)
- :use-module (ice-9 string-fun)
- :use-module (ice-9 rdelim)
- :export (doc-snarf))
-
-(define command-synopsis
- '((version (single-char #\v) (value #f))
- (help (single-char #\h) (value #f))
- (output (single-char #\o) (value #t))
- (texinfo (single-char #\t) (value #f))
- (lang (single-char #\l) (value #t))))
-
-;; Display version information and exit.
-;;-ttn-mod: use var
-(define (display-version)
- (display "doc-snarf ") (display doc-snarf-version) (newline))
-
-;; Display the usage help message and exit.
-;;-ttn-mod: change option "source" to "lang"
-(define (display-help)
- (display "Usage: doc-snarf [options...] inputfile\n")
- (display " --help, -h Show this usage information\n")
- (display " --version, -v Show version information\n")
- (display
- " --output=FILE, -o Specify output file [default=stdout]\n")
- (display " --texinfo, -t Format output as texinfo\n")
- (display " --lang=[c,scheme], -l Specify the input language\n"))
-
-;; Main program.
-;;-ttn-mod: canonicalize lang
-(define (doc-snarf . args)
- (let ((options (getopt-long (cons "doc-snarf" args) command-synopsis)))
- (let ((help-wanted (option-ref options 'help #f))
- (version-wanted (option-ref options 'version #f))
- (texinfo-wanted (option-ref options 'texinfo #f))
- (lang (string->symbol
- (string-downcase (option-ref options 'lang "scheme")))))
- (cond
- (version-wanted (display-version))
- (help-wanted (display-help))
- (else
- (let ((input (option-ref options '() #f))
- (output (option-ref options 'output #f)))
- (if
- ;; Bonard B. Timmons III says `(pair? input)' alone is sufficient.
- ;; (and input (pair? input))
- (pair? input)
- (snarf-file (car input) output texinfo-wanted lang)
- (display-help))))))))
-
-(define main doc-snarf)
-
-;; Supported languages and their parameters. Each element has form:
-;; (LANG DOC-START DOC-END DOC-PREFIX OPT-PREFIX SIG-START STD-INT-DOC?)
-;; LANG is a symbol, STD-INT-DOC? is a boolean indicating whether or not
-;; LANG supports "standard internal docstring" (a string after the formals),
-;; everything else is a string specifying a regexp.
-;;-ttn-mod: new var
-(define supported-languages
- '((c
- "^/\\*(.*)"
- "^ \\*/"
- "^ \\* (.*)"
- "^ \\*-(.*)"
- "NOTHING AT THIS TIME!!!"
- #f
- )
- (scheme
- "^;; (.*)"
- "^;;\\."
- "^;; (.*)"
- "^;;-(.*)"
- "^\\(define"
- #t
- )))
-
-;; Get @var{lang}'s @var{parameter}. Both args are symbols.
-;;-ttn-mod: new proc
-(define (lang-parm lang parm)
- (list-ref (assq-ref supported-languages lang)
- (case parm
- ((docstring-start) 0)
- ((docstring-end) 1)
- ((docstring-prefix) 2)
- ((option-prefix) 3)
- ((signature-start) 4)
- ((std-int-doc?) 5))))
-
-;; Snarf all docstrings from the file @var{input} and write them to
-;; file @var{output}. Use texinfo format for the output if
-;; @var{texinfo?} is true.
-;;-ttn-mod: don't use string comparison, consult table instead
-(define (snarf-file input output texinfo? lang)
- (or (memq lang (map car supported-languages))
- (error "doc-snarf: input language must be c or scheme."))
- (write-output (snarf input lang) output
- (if texinfo? format-texinfo format-plain)))
-
-;; fixme: this comment is required to trigger standard internal
-;; docstring snarfing... ideally, it wouldn't be necessary.
-;;-ttn-mod: new proc, from snarf-docs (aren't these names fun?)
-(define (find-std-int-doc line input-port)
- "Unread @var{line} from @var{input-port}, then read in the entire form and
-return the standard internal docstring if found. Return #f if not."
- (unread-string line input-port) ; ugh
- (let ((form (read input-port)))
- (cond ((and (list? form) ; (define (PROC ARGS) "DOC" ...)
- (< 3 (length form))
- (eq? 'define (car form))
- (pair? (cadr form))
- (symbol? (caadr form))
- (string? (caddr form)))
- (caddr form))
- ((and (list? form) ; (define VAR (lambda ARGS "DOC" ...))
- (< 2 (length form))
- (eq? 'define (car form))
- (symbol? (cadr form))
- (list? (caddr form))
- (< 3 (length (caddr form)))
- (eq? 'lambda (car (caddr form)))
- (string? (caddr (caddr form))))
- (caddr (caddr form)))
- (else #f))))
-
-;; Split @var{string} into lines, adding @var{prefix} to each.
-;;-ttn-mod: new proc
-(define (split-prefixed string prefix)
- (separate-fields-discarding-char
- #\newline string
- (lambda lines
- (map (lambda (line)
- (string-append prefix line))
- lines))))
-
-;; snarf input-file output-file
-;; Extract docstrings from the input file @var{input}, presumed
-;; to be written in language @var{lang}.
-;;-Author: Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-;;-Created: 2001-02-17
-;;-ttn-mod: regluarize lang parm lookup, add "std int doc" snarfing (2 places)
-(define (snarf input-file lang)
- (let* ((i-p (open-input-file input-file))
- (parm-regexp (lambda (parm) (make-regexp (lang-parm lang parm))))
- (docstring-start (parm-regexp 'docstring-start))
- (docstring-end (parm-regexp 'docstring-end))
- (docstring-prefix (parm-regexp 'docstring-prefix))
- (option-prefix (parm-regexp 'option-prefix))
- (signature-start (parm-regexp 'signature-start))
- (augmented-options
- (lambda (line i-p options)
- (let ((int-doc (and (lang-parm lang 'std-int-doc?)
- (let ((d (find-std-int-doc line i-p)))
- (and d (split-prefixed d "internal: "))))))
- (if int-doc
- (append (reverse int-doc) options)
- options)))))
-
- (let lp ((line (read-line i-p)) (state 'neutral) (doc-strings '())
- (options '()) (entries '()) (lno 0))
- (cond
- ((eof-object? line)
- (close-input-port i-p)
- (reverse entries))
-
- ;; State 'neutral: we're currently not within a docstring or
- ;; option section
- ((eq? state 'neutral)
- (let ((m (regexp-exec docstring-start line)))
- (if m
- (lp (read-line i-p) 'doc-string
- (list (match:substring m 1)) '() entries (+ lno 1))
- (lp (read-line i-p) state '() '() entries (+ lno 1)))))
-
- ;; State 'doc-string: we have started reading a docstring and
- ;; are waiting for more, for options or for a define.
- ((eq? state 'doc-string)
- (let ((m0 (regexp-exec docstring-prefix line))
- (m1 (regexp-exec option-prefix line))
- (m2 (regexp-exec signature-start line))
- (m3 (regexp-exec docstring-end line)))
- (cond
- (m0
- (lp (read-line i-p) 'doc-string
- (cons (match:substring m0 1) doc-strings) '() entries
- (+ lno 1)))
- (m1
- (lp (read-line i-p) 'options
- doc-strings (cons (match:substring m1 1) options) entries
- (+ lno 1)))
- (m2
- (let ((options (augmented-options line i-p options))) ; ttn-mod
- (lp (read-line i-p) 'neutral '() '()
- (cons (parse-entry doc-strings options line input-file lno)
- entries)
- (+ lno 1))))
- (m3
- (lp (read-line i-p) 'neutral '() '()
- (cons (parse-entry doc-strings options #f input-file lno)
- entries)
- (+ lno 1)))
- (else
- (lp (read-line i-p) 'neutral '() '() entries (+ lno 1))))))
-
- ;; State 'options: We're waiting for more options or for a
- ;; define.
- ((eq? state 'options)
- (let ((m1 (regexp-exec option-prefix line))
- (m2 (regexp-exec signature-start line))
- (m3 (regexp-exec docstring-end line)))
- (cond
- (m1
- (lp (read-line i-p) 'options
- doc-strings (cons (match:substring m1 1) options) entries
- (+ lno 1)))
- (m2
- (let ((options (augmented-options line i-p options))) ; ttn-mod
- (lp (read-line i-p) 'neutral '() '()
- (cons (parse-entry doc-strings options line input-file lno)
- entries)
- (+ lno 1))))
- (m3
- (lp (read-line i-p) 'neutral '() '()
- (cons (parse-entry doc-strings options #f input-file lno)
- entries)
- (+ lno 1)))
- (else
- (lp (read-line i-p) 'neutral '() '() entries (+ lno 1))))))))))
-
-(define (make-entry symbol signature docstrings options filename line)
- (vector 'entry symbol signature docstrings options filename line))
-(define (entry-symbol e)
- (vector-ref e 1))
-(define (entry-signature e)
- (vector-ref e 2))
-(define (entry-docstrings e)
- (vector-ref e 3))
-(define (entry-options e)
- (vector-ref e 4))
-(define (entry-filename e)
- (vector-ref e 5))
-(define (entry-line e)
- "This docstring will not be snarfed, unfortunately..."
- (vector-ref e 6))
-
-;; Create a docstring entry from the docstring line list
-;; @var{doc-strings}, the option line list @var{options} and the
-;; define line @var{def-line}
-(define (parse-entry docstrings options def-line filename line-no)
-; (write-line docstrings)
- (cond
- (def-line
- (make-entry (get-symbol def-line)
- (make-prototype def-line) (reverse docstrings)
- (reverse options) filename
- (+ (- line-no (length docstrings) (length options)) 1)))
- ((> (length docstrings) 0)
- (make-entry (string->symbol (car (reverse docstrings)))
- (car (reverse docstrings))
- (cdr (reverse docstrings))
- (reverse options) filename
- (+ (- line-no (length docstrings) (length options)) 1)))
- (else
- (make-entry 'foo "" (reverse docstrings) (reverse options) filename
- (+ (- line-no (length docstrings) (length options)) 1)))))
-
-;; Create a string which is a procedure prototype. The necessary
-;; information for constructing the prototype is taken from the line
-;; @var{def-line}, which is a line starting with @code{(define...}.
-(define (make-prototype def-line)
- (call-with-input-string
- def-line
- (lambda (s-p)
- (let* ((paren (read-char s-p))
- (keyword (read s-p))
- (tmp (read s-p)))
- (cond
- ((pair? tmp)
- (join-symbols tmp))
- ((symbol? tmp)
- (symbol->string tmp))
- (else
- ""))))))
-
-(define (get-symbol def-line)
- (call-with-input-string
- def-line
- (lambda (s-p)
- (let* ((paren (read-char s-p))
- (keyword (read s-p))
- (tmp (read s-p)))
- (cond
- ((pair? tmp)
- (car tmp))
- ((symbol? tmp)
- tmp)
- (else
- 'foo))))))
-
-;; Append the symbols in the string list @var{s}, separated with a
-;; space character.
-(define (join-symbols s)
- (cond ((null? s)
- "")
- ((symbol? s)
- (string-append ". " (symbol->string s)))
- ((null? (cdr s))
- (symbol->string (car s)))
- (else
- (string-append (symbol->string (car s)) " " (join-symbols (cdr s))))))
-
-;; Write @var{entries} to @var{output-file} using @var{writer}.
-;; @var{writer} is a proc that takes one entry.
-;; If @var{output-file} is #f, write to stdout.
-;;-ttn-mod: new proc
-(define (write-output entries output-file writer)
- (with-output-to-port (cond (output-file (open-output-file output-file))
- (else (current-output-port)))
- (lambda () (for-each writer entries))))
-
-;; Write an @var{entry} using texinfo format.
-;;-ttn-mod: renamed from `texinfo-output', distilled
-(define (format-texinfo entry)
- (display "\n\f")
- (display (entry-symbol entry))
- (newline)
- (display "@c snarfed from ")
- (display (entry-filename entry))
- (display ":")
- (display (entry-line entry))
- (newline)
- (display "@deffn procedure ")
- (display (entry-signature entry))
- (newline)
- (for-each (lambda (s) (write-line s))
- (entry-docstrings entry))
- (for-each (lambda (s) (display "@c ") (write-line s))
- (entry-options entry))
- (write-line "@end deffn"))
-
-;; Write an @var{entry} using plain format.
-;;-ttn-mod: renamed from `texinfo-output', distilled
-(define (format-plain entry)
- (display "Procedure: ")
- (display (entry-signature entry))
- (newline)
- (for-each (lambda (s) (write-line s))
- (entry-docstrings entry))
- (for-each (lambda (s) (display ";; ") (write-line s))
- (entry-options entry))
- (display "Snarfed from ")
- (display (entry-filename entry))
- (display ":")
- (display (entry-line entry))
- (newline)
- (write-line "\f"))
-
-;;; doc-snarf ends here
diff --git a/scripts/frisk b/scripts/frisk
deleted file mode 100755
index 108fc4a11..000000000
--- a/scripts/frisk
+++ /dev/null
@@ -1,292 +0,0 @@
-#!/bin/sh
-# aside from this initial boilerplate, this is actually -*- scheme -*- code
-main='(module-ref (resolve-module '\''(scripts frisk)) '\'main')'
-exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@"
-!#
-;;; frisk --- Grok the module interfaces of a body of files
-
-;; Copyright (C) 2002 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, Inc., 59 Temple Place, Suite 330,
-;; Boston, MA 02111-1307 USA
-
-;;; Author: Thien-Thi Nguyen <ttn@gnu.org>
-
-;;; Commentary:
-
-;; Usage: frisk [options] file ...
-;;
-;; Analyze FILE... module interfaces in aggregate (as a "body"),
-;; and display a summary. Modules that are `define-module'd are
-;; considered "internal" (and those not, "external"). When module X
-;; uses module Y, X is said to be "(a) downstream of" Y, and Y is
-;; "(an) upstream of" X.
-;;
-;; Normally, the summary displays external modules and their internal
-;; downstreams, as this is the usual question asked by a body. There
-;; are several options that modify this output.
-;;
-;; -u, --upstream show upstream edges
-;; -d, --downstream show downstream edges (default)
-;; -i, --internal show internal modules
-;; -x, --external show external modules (default)
-;;
-;; If given both `upstream' and `downstream' options ("frisk -ud"), the
-;; output is formatted: "C MODULE --- UP-LS --- DOWN-LS", where C is
-;; either `i' or `x', and each element of UP-LS and DOWN-LS is (TYPE
-;; MODULE-NAME ...).
-;;
-;; In all other cases, the "C MODULE" occupies its own line, and
-;; subsequent lines list the up- or downstream edges, respectively,
-;; indented by some non-zero amount of whitespace.
-;;
-;; Top-level `use-modules' (or `load' or 'primitive-load') forms in a
-;; file that do not follow a `define-module' result an edge where the
-;; downstream is the "default module", normally `(guile-user)'. This
-;; can be set to another value by using:
-;;
-;; -m, --default-module MOD set MOD as the default module
-
-;; Usage from a Scheme Program: (use-modules (scripts frisk))
-;;
-;; Module export list:
-;; (frisk . args)
-;; (make-frisker . options) => (lambda (files) ...) [see below]
-;; (mod-up-ls module) => upstream edges
-;; (mod-down-ls module) => downstream edges
-;; (mod-int? module) => is the module internal?
-;; (edge-type edge) => symbol: {regular,autoload,computed}
-;; (edge-up edge) => upstream module
-;; (edge-down edge) => downstream module
-;;
-;; OPTIONS is an alist. Recognized keys are:
-;; default-module
-;;
-;; `make-frisker' returns a procedure that takes a list of files, the
-;; FRISKER. FRISKER returns a closure, REPORT, that takes one of the
-;; keys:
-;; modules -- entire list of modules
-;; internal -- list of internal modules
-;; external -- list of external modules
-;; i-up -- list of modules upstream of internal modules
-;; x-up -- list of modules upstream of external modules
-;; i-down -- list of modules downstream of internal modules
-;; x-down -- list of modules downstream of external modules
-;; edges -- list of edges
-;; Note that `x-up' should always be null, since by (lack of!)
-;; definition, we only know external modules by reference.
-;;
-;; The module and edge objects managed by REPORT can be examined in
-;; detail by using the other (self-explanatory) procedures. Be careful
-;; not to confuse a freshly consed list of symbols, like `(a b c)' with
-;; the module `(a b c)'. If you want to find the module by that name,
-;; try: (cond ((member '(a b c) (REPORT 'modules)) => car)).
-
-;; TODO: Make "frisk -ud" output less ugly.
-;; Consider default module as internal; add option to invert.
-;; Support `edge-misc' data.
-
-;;; Code:
-
-(define-module (scripts frisk)
- :autoload (ice-9 getopt-long) (getopt-long)
- :use-module ((srfi srfi-1) :select (filter remove))
- :export (frisk
- make-frisker
- mod-up-ls mod-down-ls mod-int?
- edge-type edge-up edge-down))
-
-(define *default-module* '(guile-user))
-
-(define (grok-proc default-module note-use!)
- (lambda (filename)
- (let* ((p (open-file filename "r"))
- (next (lambda () (read p)))
- (ferret (lambda (use) ;;; handle "((foo bar) :select ...)"
- (let ((maybe (car use)))
- (if (list? maybe)
- maybe
- use))))
- (curmod #f))
- (let loop ((form (next)))
- (cond ((eof-object? form))
- ((not (list? form)) (loop (next)))
- (else (case (car form)
- ((define-module)
- (let ((module (cadr form)))
- (set! curmod module)
- (note-use! 'def module #f)
- (let loop ((ls form))
- (or (null? ls)
- (case (car ls)
- ((:use-module)
- (note-use! 'regular module (ferret (cadr ls)))
- (loop (cddr ls)))
- ((:autoload)
- (note-use! 'autoload module (cadr ls))
- (loop (cdddr ls)))
- (else (loop (cdr ls))))))))
- ((use-modules)
- (for-each (lambda (use)
- (note-use! 'regular
- (or curmod default-module)
- (ferret use)))
- (cdr form)))
- ((load primitive-load)
- (note-use! 'computed
- (or curmod default-module)
- (let ((file (cadr form)))
- (if (string? file)
- file
- (format #f "[computed in ~A]"
- filename))))))
- (loop (next))))))))
-
-(define up-ls (make-object-property)) ; list
-(define dn-ls (make-object-property)) ; list
-(define int? (make-object-property)) ; defined via `define-module'
-
-(define mod-up-ls up-ls)
-(define mod-down-ls dn-ls)
-(define mod-int? int?)
-
-(define (i-or-x module)
- (if (int? module) 'i 'x))
-
-(define edge-type (make-object-property)) ; symbol
-
-(define (make-edge type up down)
- (let ((new (cons up down)))
- (set! (edge-type new) type)
- new))
-
-(define edge-up car)
-(define edge-down cdr)
-
-(define (up-ls+! m new) (set! (up-ls m) (cons new (up-ls m))))
-(define (dn-ls+! m new) (set! (dn-ls m) (cons new (dn-ls m))))
-
-(define (make-body alist)
- (lambda (key)
- (assq-ref alist key)))
-
-(define (scan default-module files)
- (let* ((modules (list))
- (edges (list))
- (intern (lambda (module)
- (cond ((member module modules) => car)
- (else (set! (up-ls module) (list))
- (set! (dn-ls module) (list))
- (set! modules (cons module modules))
- module))))
- (grok (grok-proc default-module
- (lambda (type d u)
- (let ((d (intern d)))
- (if (eq? type 'def)
- (set! (int? d) #t)
- (let* ((u (intern u))
- (edge (make-edge type u d)))
- (set! edges (cons edge edges))
- (up-ls+! d edge)
- (dn-ls+! u edge))))))))
- (for-each grok files)
- (make-body
- `((modules . ,modules)
- (internal . ,(filter int? modules))
- (external . ,(remove int? modules))
- (i-up . ,(filter int? (map edge-down edges)))
- (x-up . ,(remove int? (map edge-down edges)))
- (i-down . ,(filter int? (map edge-up edges)))
- (x-down . ,(remove int? (map edge-up edges)))
- (edges . ,edges)))))
-
-(define (make-frisker . options)
- (let ((default-module (or (assq-ref options 'default-module)
- *default-module*)))
- (lambda (files)
- (scan default-module files))))
-
-(define (dump-updown modules)
- (for-each (lambda (m)
- (format #t "~A ~A --- ~A --- ~A\n"
- (i-or-x m) m
- (map (lambda (edge)
- (cons (edge-type edge)
- (edge-up edge)))
- (up-ls m))
- (map (lambda (edge)
- (cons (edge-type edge)
- (edge-down edge)))
- (dn-ls m))))
- modules))
-
-(define (dump-up modules)
- (for-each (lambda (m)
- (format #t "~A ~A\n" (i-or-x m) m)
- (for-each (lambda (edge)
- (format #t "\t\t\t ~A\t~A\n"
- (edge-type edge) (edge-up edge)))
- (up-ls m)))
- modules))
-
-(define (dump-down modules)
- (for-each (lambda (m)
- (format #t "~A ~A\n" (i-or-x m) m)
- (for-each (lambda (edge)
- (format #t "\t\t\t ~A\t~A\n"
- (edge-type edge) (edge-down edge)))
- (dn-ls m)))
- modules))
-
-(define (frisk . args)
- (let* ((parsed-opts (getopt-long
- (cons "frisk" args) ;;; kludge
- '((upstream (single-char #\u))
- (downstream (single-char #\d))
- (internal (single-char #\i))
- (external (single-char #\x))
- (default-module
- (single-char #\m)
- (value #t)))))
- (=u (option-ref parsed-opts 'upstream #f))
- (=d (option-ref parsed-opts 'downstream #f))
- (=i (option-ref parsed-opts 'internal #f))
- (=x (option-ref parsed-opts 'external #f))
- (files (option-ref parsed-opts '() (list)))
- (report ((make-frisker
- `(default-module
- . ,(option-ref parsed-opts 'default-module
- *default-module*)))
- files))
- (modules (report 'modules))
- (internal (report 'internal))
- (external (report 'external))
- (edges (report 'edges)))
- (format #t "~A ~A, ~A ~A (~A ~A, ~A ~A), ~A ~A\n\n"
- (length files) "files"
- (length modules) "modules"
- (length internal) "internal"
- (length external) "external"
- (length edges) "edges")
- ((cond ((and =u =d) dump-updown)
- (=u dump-up)
- (else dump-down))
- (cond ((and =i =x) modules)
- (=i internal)
- (else external)))))
-
-(define main frisk)
-
-;;; frisk ends here
diff --git a/scripts/generate-autoload b/scripts/generate-autoload
deleted file mode 100755
index 942822ead..000000000
--- a/scripts/generate-autoload
+++ /dev/null
@@ -1,146 +0,0 @@
-#!/bin/sh
-# aside from this initial boilerplate, this is actually -*- scheme -*- code
-main='(module-ref (resolve-module '\''(scripts generate-autoload)) '\'main')'
-exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@"
-!#
-;;; generate-autoload --- Display define-module form with autoload info
-
-;; Copyright (C) 2001 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, Inc., 59 Temple Place, Suite 330,
-;; Boston, MA 02111-1307 USA
-
-;;; Author: Thien-Thi Nguyen
-
-;;; Commentary:
-
-;; Usage: generate-autoload [OPTIONS] FILE1 FILE2 ...
-;;
-;; The autoload form is displayed to standard output:
-;;
-;; (define-module (guile-user)
-;; :autoload (ZAR FOO) (FOO-1 FOO-2 ...)
-;; :
-;; :
-;; :autoload (ZAR BAR) (BAR-1 BAR-2 ...))
-;;
-;; For each file, a symbol triggers an autoload if it is found in one
-;; of these situations:
-;; - in the `:export' clause of a `define-module' form
-;; - in a top-level `export' or `export-syntax' form
-;; - in a `define-public' form
-;; - in a `defmacro-public' form
-;;
-;; The module name is inferred from the `define-module' form. If either the
-;; module name or the exports list cannot be determined, no autoload entry is
-;; generated for that file.
-;;
-;; Options:
-;; --target MODULE-NAME -- Use MODULE-NAME instead of `(guile-user)'.
-;; Note that some shells may require you to
-;; quote the argument to handle parentheses
-;; and spaces.
-;;
-;; Usage examples from Scheme code as a module:
-;; (use-modules (scripts generate-autoload))
-;; (generate-autoload "generate-autoload")
-;; (generate-autoload "--target" "(my module)" "generate-autoload")
-;; (apply generate-autoload "--target" "(my module)" '("foo" "bar" "baz"))
-
-;;; Code:
-
-(define-module (scripts generate-autoload)
- :export (generate-autoload))
-
-(define (autoload-info file)
- (let ((p (open-input-file file)))
- (let loop ((form (read p)) (module-name #f) (exports '()))
- (if (eof-object? form)
- (and module-name
- (not (null? exports))
- (list module-name exports)) ; ret
- (cond ((and (list? form)
- (< 1 (length form))
- (eq? 'define-module (car form)))
- (loop (read p)
- (cadr form)
- (cond ((member ':export form)
- => (lambda (val)
- (append (cadr val) exports)))
- (else exports))))
- ((and (list? form)
- (< 1 (length form))
- (memq (car form) '(export export-syntax)))
- (loop (read p)
- module-name
- (append (cdr form) exports)))
- ((and (list? form)
- (< 2 (length form))
- (eq? 'define-public (car form))
- (list? (cadr form))
- (symbol? (caadr form)))
- (loop (read p)
- module-name
- (cons (caadr form) exports)))
- ((and (list? form)
- (< 2 (length form))
- (eq? 'define-public (car form))
- (symbol? (cadr form)))
- (loop (read p)
- module-name
- (cons (cadr form) exports)))
- ((and (list? form)
- (< 3 (length form))
- (eq? 'defmacro-public (car form))
- (symbol? (cadr form)))
- (loop (read p)
- module-name
- (cons (cadr form) exports)))
- (else (loop (read p) module-name exports)))))))
-
-(define (generate-autoload . args)
- (let* ((module-count 0)
- (syms-count 0)
- (target-override (cond ((member "--target" args) => cadr)
- (else #f)))
- (files (if target-override (cddr args) (cdr args))))
- (display ";;; do not edit --- generated ")
- (display (strftime "%Y-%m-%d %H:%M:%S" (localtime (current-time))))
- (newline)
- (display "(define-module ")
- (display (or target-override "(guile-user)"))
- (for-each (lambda (file)
- (cond ((autoload-info file)
- => (lambda (info)
- (and info
- (apply (lambda (module-name exports)
- (set! module-count (1+ module-count))
- (set! syms-count (+ (length exports)
- syms-count))
- (for-each display
- (list "\n :autoload "
- module-name " "
- exports)))
- info))))))
- files)
- (display ")")
- (newline)
- (for-each display (list " ;;; "
- syms-count " symbols in "
- module-count " modules\n"))))
-
-(define main generate-autoload)
-
-;;; generate-autoload ends here
diff --git a/scripts/lint b/scripts/lint
deleted file mode 100755
index a43cfc065..000000000
--- a/scripts/lint
+++ /dev/null
@@ -1,319 +0,0 @@
-#!/bin/sh
-# aside from this initial boilerplate, this is actually -*- scheme -*- code
-main='(module-ref (resolve-module '\''(scripts lint)) '\'main')'
-exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@"
-!#
-;;; lint --- Preemptive checks for coding errors in Guile Scheme code
-
-;; Copyright (C) 2002 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, Inc., 59 Temple Place, Suite 330,
-;; Boston, MA 02111-1307 USA
-
-;;; Author: Neil Jerram
-
-;;; Commentary:
-
-;; Usage: lint FILE1 FILE2 ...
-;;
-;; Perform various preemptive checks for coding errors in Guile Scheme
-;; code.
-;;
-;; Right now, there is only one check available, for unresolved free
-;; variables. The intention is that future lint-like checks will be
-;; implemented by adding to this script file.
-;;
-;; Unresolved free variables
-;; -------------------------
-;;
-;; Free variables are those whose definitions come from outside the
-;; module under investigation. In Guile, these definitions are
-;; imported from other modules using `#:use-module' forms.
-;;
-;; This tool scans the specified files for unresolved free variables -
-;; i.e. variables for which you may have forgotten the appropriate
-;; `#:use-module', or for which the module that is supposed to export
-;; them forgot to.
-;;
-;; It isn't guaranteed that the scan will find absolutely all such
-;; errors. Quoted (and quasiquoted) expressions are skipped, since
-;; they are most commonly used to describe constant data, not code, so
-;; code that is explicitly evaluated using `eval' will not be checked.
-;; For example, the `unresolved-var' in `(eval 'unresolved-var
-;; (current-module))' would be missed.
-;;
-;; False positives are also possible. Firstly, the tool doesn't
-;; understand all possible forms of implicit quoting; in particular,
-;; it doesn't detect and expand uses of macros. Secondly, it picks up
-;; explicit compatibility code like `(if (defined? 'x) (define y x))'.
-;; Thirdly, there are occasional oddities like `next-method'.
-;; However, the number of false positives for realistic code is
-;; hopefully small enough that they can be individually considered and
-;; ignored.
-;;
-;; Example
-;; -------
-;;
-;; Note: most of the unresolved variables found in this example are
-;; false positives, as you would hope. => scope for improvement.
-;;
-;; $ guile-tools lint `guile-tools`
-;; No unresolved free variables in PROGRAM
-;; No unresolved free variables in autofrisk
-;; No unresolved free variables in display-commentary
-;; Unresolved free variables in doc-snarf:
-;; doc-snarf-version
-;; No unresolved free variables in frisk
-;; No unresolved free variables in generate-autoload
-;; No unresolved free variables in lint
-;; No unresolved free variables in punify
-;; No unresolved free variables in read-scheme-source
-;; Unresolved free variables in snarf-check-and-output-texi:
-;; name
-;; pos
-;; line
-;; x
-;; rest
-;; ...
-;; do-argpos
-;; do-command
-;; do-args
-;; type
-;; num
-;; file
-;; do-arglist
-;; req
-;; opt
-;; var
-;; command
-;; do-directive
-;; s
-;; ?
-;; No unresolved free variables in use2dot
-
-;;; Code:
-
-(define-module (scripts lint)
- #:use-module (ice-9 common-list)
- #:use-module (ice-9 format)
- #:export (lint))
-
-(define (lint filename)
- (let ((module-name (scan-file-for-module-name filename))
- (free-vars (uniq (scan-file-for-free-variables filename))))
- (let ((module (resolve-module module-name))
- (all-resolved? #t))
- (let loop ((free-vars free-vars))
- (or (null? free-vars)
- (begin
- (catch #t
- (lambda ()
- (eval (car free-vars) module))
- (lambda args
- (if all-resolved?
- (format #t
- "Unresolved free variables in ~A:\n"
- filename))
- (write-char #\tab)
- (write (car free-vars))
- (newline)
- (set! all-resolved? #f)))
- (loop (cdr free-vars)))))
- (if all-resolved?
- (format #t
- "No unresolved free variables in ~A\n"
- filename)))))
-
-(define (scan-file-for-module-name filename)
- (with-input-from-file filename
- (lambda ()
- (let loop ((x (read)))
- (cond ((eof-object? x) #f)
- ((and (pair? x)
- (eq? (car x) 'define-module))
- (cadr x))
- (else (loop (read))))))))
-
-(define (scan-file-for-free-variables filename)
- (with-input-from-file filename
- (lambda ()
- (let loop ((x (read)) (fvlists '()))
- (if (eof-object? x)
- (apply append fvlists)
- (loop (read) (cons (detect-free-variables x '()) fvlists)))))))
-
-; guile> (detect-free-variables '(let ((a 1)) a) '())
-; ()
-; guile> (detect-free-variables '(let ((a 1)) b) '())
-; (b)
-; guile> (detect-free-variables '(let ((a 1) (b a)) b) '())
-; (a)
-; guile> (detect-free-variables '(let* ((a 1) (b a)) b) '())
-; ()
-; guile> (detect-free-variables '(define a 1) '())
-; ()
-; guile> (detect-free-variables '(define a b) '())
-; (b)
-; guile> (detect-free-variables '(define (a b c) b) '())
-; ()
-; guile> (detect-free-variables '(define (a b c) e) '())
-; (e)
-
-(define (detect-free-variables x locals)
- ;; Given an expression @var{x} and a list @var{locals} of local
- ;; variables (symbols) that are in scope for @var{x}, return a list
- ;; of free variable symbols.
- (cond ((symbol? x)
- (if (memq x locals) '() (list x)))
-
- ((pair? x)
- (case (car x)
- ((define-module define-generic quote quasiquote)
- ;; No code of interest in these expressions.
- '())
-
- ((let letrec)
- ;; Check for named let. If there is a name, transform the
- ;; expression so that it looks like an unnamed let with
- ;; the name as one of the bindings.
- (if (symbol? (cadr x))
- (set-cdr! x (cons (cons (list (cadr x) #f) (caddr x))
- (cdddr x))))
- ;; Unnamed let processing.
- (let ((letrec? (eq? (car x) 'letrec))
- (locals-for-let-body (append locals (map car (cadr x)))))
- (append (apply append
- (map (lambda (binding)
- (detect-free-variables (cadr binding)
- (if letrec?
- locals-for-let-body
- locals)))
- (cadr x)))
- (apply append
- (map (lambda (bodyform)
- (detect-free-variables bodyform
- locals-for-let-body))
- (cddr x))))))
-
- ((let* and-let*)
- ;; Handle bindings recursively.
- (if (null? (cadr x))
- (apply append
- (map (lambda (bodyform)
- (detect-free-variables bodyform locals))
- (cddr x)))
- (append (detect-free-variables (cadr (caadr x)) locals)
- (detect-free-variables `(let* ,(cdadr x) ,@(cddr x))
- (cons (caaadr x) locals)))))
-
- ((define define-public define-macro)
- (if (pair? (cadr x))
- (begin
- (set! locals (cons (caadr x) locals))
- (detect-free-variables `(lambda ,(cdadr x) ,@(cddr x))
- locals))
- (begin
- (set! locals (cons (cadr x) locals))
- (detect-free-variables (caddr x) locals))))
-
- ((lambda lambda*)
- (let ((locals-for-lambda-body (let loop ((locals locals)
- (args (cadr x)))
- (cond ((null? args) locals)
- ((pair? args)
- (loop (cons (car args) locals)
- (cdr args)))
- (else
- (cons args locals))))))
- (apply append
- (map (lambda (bodyform)
- (detect-free-variables bodyform
- locals-for-lambda-body))
- (cddr x)))))
-
- ((receive)
- (let ((locals-for-receive-body (append locals (cadr x))))
- (apply append
- (detect-free-variables (caddr x) locals)
- (map (lambda (bodyform)
- (detect-free-variables bodyform
- locals-for-receive-body))
- (cdddr x)))))
-
- ((define-method define*)
- (let ((locals-for-method-body (let loop ((locals locals)
- (args (cdadr x)))
- (cond ((null? args) locals)
- ((pair? args)
- (loop (cons (if (pair? (car args))
- (caar args)
- (car args))
- locals)
- (cdr args)))
- (else
- (cons args locals))))))
- (apply append
- (map (lambda (bodyform)
- (detect-free-variables bodyform
- locals-for-method-body))
- (cddr x)))))
-
- ((define-class)
- ;; Avoid picking up slot names at the start of slot
- ;; definitions.
- (apply append
- (map (lambda (slot/option)
- (detect-free-variables-noncar (if (pair? slot/option)
- (cdr slot/option)
- slot/option)
- locals))
- (cdddr x))))
-
- ((case)
- (apply append
- (detect-free-variables (cadr x) locals)
- (map (lambda (case)
- (detect-free-variables (cdr case) locals))
- (cddr x))))
-
- ((unquote unquote-splicing else =>)
- (detect-free-variables-noncar (cdr x) locals))
-
- (else (append (detect-free-variables (car x) locals)
- (detect-free-variables-noncar (cdr x) locals)))))
-
- (else '())))
-
-(define (detect-free-variables-noncar x locals)
- ;; Given an expression @var{x} and a list @var{locals} of local
- ;; variables (symbols) that are in scope for @var{x}, return a list
- ;; of free variable symbols.
- (cond ((symbol? x)
- (if (memq x locals) '() (list x)))
-
- ((pair? x)
- (case (car x)
- ((=>)
- (detect-free-variables-noncar (cdr x) locals))
-
- (else (append (detect-free-variables (car x) locals)
- (detect-free-variables-noncar (cdr x) locals)))))
-
- (else '())))
-
-(define (main . files)
- (for-each lint files))
-
-;;; lint ends here
diff --git a/scripts/punify b/scripts/punify
deleted file mode 100755
index eae8d51a7..000000000
--- a/scripts/punify
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/bin/sh
-# aside from this initial boilerplate, this is actually -*- scheme -*- code
-main='(module-ref (resolve-module '\''(scripts punify)) '\'main')'
-exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@"
-!#
-;;; punify --- Display Scheme code w/o unnecessary comments / whitespace
-
-;; Copyright (C) 2001 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, Inc., 59 Temple Place, Suite 330,
-;; Boston, MA 02111-1307 USA
-
-;;; Author: Thien-Thi Nguyen
-
-;;; Commentary:
-
-;; Usage: punify FILE1 FILE2 ...
-;;
-;; Each file's forms are read and written to stdout.
-;; The effect is to remove comments and much non-essential whitespace.
-;; This is useful when installing Scheme source to space-limited media.
-;;
-;; Example:
-;; $ wc ./punify ; ./punify ./punify | wc
-;; 89 384 3031 ./punify
-;; 0 42 920
-;;
-;; TODO: Read from stdin.
-;; Handle vectors.
-;; Identifier punification.
-
-;;; Code:
-
-(define-module (scripts punify)
- :export (punify))
-
-(define (write-punily form)
- (cond ((and (list? form) (not (null? form)))
- (let ((first (car form)))
- (display "(")
- (write-punily first)
- (let loop ((ls (cdr form)) (last-was-list? (list? first)))
- (if (null? ls)
- (display ")")
- (let* ((new-first (car ls))
- (this-is-list? (list? new-first)))
- (and (not last-was-list?)
- (not this-is-list?)
- (display " "))
- (write-punily new-first)
- (loop (cdr ls) this-is-list?))))))
- ((and (symbol? form)
- (let ((ls (string->list (symbol->string form))))
- (and (char=? (car ls) #\:)
- (not (memq #\space ls))
- (list->string (cdr ls)))))
- => (lambda (symbol-name-after-colon)
- (display #\:)
- (display symbol-name-after-colon)))
- (else (write form))))
-
-(define (punify-one file)
- (with-input-from-file file
- (lambda ()
- (let ((toke (lambda () (read (current-input-port)))))
- (let loop ((form (toke)))
- (or (eof-object? form)
- (begin
- (write-punily form)
- (loop (toke)))))))))
-
-(define (punify . args)
- (for-each punify-one args))
-
-(define main punify)
-
-;;; punify ends here
diff --git a/scripts/read-rfc822 b/scripts/read-rfc822
deleted file mode 100755
index 660f0feb9..000000000
--- a/scripts/read-rfc822
+++ /dev/null
@@ -1,133 +0,0 @@
-#!/bin/sh
-# aside from this initial boilerplate, this is actually -*- scheme -*- code
-main='(module-ref (resolve-module '\''(scripts read-rfc822)) '\'main')'
-exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@"
-!#
-;;; read-rfc822 --- Validate RFC822 file by displaying it to stdout
-
-;; Copyright (C) 2002 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, Inc., 59 Temple Place, Suite 330,
-;; Boston, MA 02111-1307 USA
-
-;;; Author: Thien-Thi Nguyen <ttn@gnu.org>
-
-;;; Commentary:
-
-;; Usage: read-rfc822 FILE
-;;
-;; Read FILE, assumed to be in RFC822 format, and display it to stdout.
-;; This is not very interesting, admittedly.
-;;
-;; For Scheme programming, this module exports two procs:
-;; (read-rfc822 . args) ; only first arg used
-;; (read-rfc822-silently port)
-;;
-;; Parse FILE (a string) or PORT, respectively, and return a query proc that
-;; takes a symbol COMP, and returns the message component COMP. Supported
-;; values for COMP (and the associated query return values) are:
-;; from -- #f (reserved for future mbox support)
-;; headers -- alist of (HEADER-SYMBOL . "VALUE-STRING") pairs, in order
-;; body -- rest of the mail message, a string
-;; body-lines -- rest of the mail message, as a list of lines
-;; Any other query results in a "bad component" error.
-;;
-;; TODO: Add "-m" option (mbox support).
-
-;;; Code:
-
-(define-module (scripts read-rfc822)
- :use-module (ice-9 regex)
- :use-module (ice-9 rdelim)
- :autoload (srfi srfi-13) (string-join)
- :export (read-rfc822 read-rfc822-silently))
-
-(define from-line-rx (make-regexp "^From "))
-(define header-name-rx (make-regexp "^([^:]+):[ \t]*"))
-(define header-cont-rx (make-regexp "^[ \t]+"))
-
-(define option #f) ; for future "-m"
-
-(define (drain-message port)
- (let loop ((line (read-line port)) (acc '()))
- (cond ((eof-object? line)
- (reverse acc))
- ((and option (regexp-exec from-line-rx line))
- (for-each (lambda (c)
- (unread-char c port))
- (cons #\newline
- (reverse (string->list line))))
- (reverse acc))
- (else
- (loop (read-line port) (cons line acc))))))
-
-(define (parse-message port)
- (let* ((from (and option
- (match:suffix (regexp-exec from-line-rx
- (read-line port)))))
- (body-lines #f)
- (body #f)
- (headers '())
- (add-header! (lambda (reversed-hlines)
- (let* ((hlines (reverse reversed-hlines))
- (first (car hlines))
- (m (regexp-exec header-name-rx first))
- (name (string->symbol (match:substring m 1)))
- (data (string-join
- (cons (substring first (match:end m))
- (cdr hlines))
- " ")))
- (set! headers (acons name data headers))))))
- ;; "From " is only one line
- (let loop ((line (read-line port)) (current-header #f))
- (cond ((string-null? line)
- (and current-header (add-header! current-header))
- (set! body-lines (drain-message port)))
- ((regexp-exec header-cont-rx line)
- => (lambda (m)
- (loop (cdr lines)
- (cons (match:suffix m) current-header))))
- (else
- (and current-header (add-header! current-header))
- (loop (read-line port) (list line)))))
- (set! headers (reverse headers))
- (lambda (component)
- (case component
- ((from) from)
- ((body-lines) body-lines)
- ((headers) headers)
- ((body) (or body
- (begin (set! body (string-join body-lines "\n" 'suffix))
- body)))
- (else (error "bad component:" component))))))
-
-(define (read-rfc822-silently port)
- (parse-message port))
-
-(define (display-rfc822 parse)
- (cond ((parse 'from) => (lambda (from) (format #t "From ~A\n" from))))
- (for-each (lambda (header)
- (format #t "~A: ~A\n" (car header) (cdr header)))
- (parse 'headers))
- (format #t "\n~A" (parse 'body)))
-
-(define (read-rfc822 . args)
- (let ((parse (read-rfc822-silently (open-file (car args) OPEN_READ))))
- (display-rfc822 parse))
- #t)
-
-(define main read-rfc822)
-
-;;; read-rfc822 ends here
diff --git a/scripts/read-scheme-source b/scripts/read-scheme-source
deleted file mode 100755
index 31d851bd2..000000000
--- a/scripts/read-scheme-source
+++ /dev/null
@@ -1,284 +0,0 @@
-#!/bin/sh
-# aside from this initial boilerplate, this is actually -*- scheme -*- code
-main='(module-ref (resolve-module '\''(scripts read-scheme-source)) '\'main')'
-exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@"
-!#
-;;; read-scheme-source --- Read a file, recognizing scheme forms and comments
-
-;; Copyright (C) 2001 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, Inc., 59 Temple Place, Suite 330,
-;; Boston, MA 02111-1307 USA
-
-;;; Author: Thien-Thi Nguyen
-
-;;; Commentary:
-
-;; Usage: read-scheme-source FILE1 FILE2 ...
-;;
-;; This program parses each FILE and writes to stdout sexps that describe the
-;; top-level structures of the file: scheme forms, single-line comments, and
-;; hash-bang comments. You can further process these (to associate comments
-;; w/ scheme forms as a kind of documentation, for example).
-;;
-;; The output sexps have one of these forms:
-;;
-;; (quote (filename FILENAME))
-;;
-;; (quote (comment :leading-semicolons N
-;; :text LINE))
-;;
-;; (quote (whitespace :text LINE))
-;;
-;; (quote (hash-bang-comment :line LINUM
-;; :line-count N
-;; :text-list (LINE1 LINE2 ...)))
-;;
-;; (quote (following-form-properties :line LINUM
-;; :line-count N)
-;; :type TYPE
-;; :signature SIGNATURE
-;; :std-int-doc DOCSTRING))
-;;
-;; SEXP
-;;
-;; The first four are straightforward (both FILENAME and LINE are strings sans
-;; newline, while LINUM and N are integers). The last two always go together,
-;; in that order. SEXP is scheme code processed only by `read' and then
-;; `write'.
-;;
-;; The :type field may be omitted if the form is not recognized. Otherwise,
-;; TYPE may be one of: procedure, alias, define-module, variable.
-;;
-;; The :signature field may be omitted if the form is not a procedure.
-;; Otherwise, SIGNATURE is a list showing the procedure's signature.
-;;
-;; If the type is `procedure' and the form has a standard internal docstring
-;; (first body form a string), that is extracted in full -- including any
-;; embedded newlines -- and recorded by field :std-int-doc.
-;;
-;;
-;; Usage from a program: The output list of sexps can be retrieved by scheme
-;; programs w/o having to capture stdout, like so:
-;;
-;; (use-modules (scripts read-scheme-source))
-;; (define source-forms (read-scheme-source-silently "FILE1" "FILE2" ...))
-;;
-;; There are also two convenience procs exported for use by Scheme programs:
-;;
-;; (clump FORMS) --- filter FORMS combining contiguous comment forms that
-;; have the same number of leading semicolons.
-;;
-;; (quoted? SYM FORM) --- see if FORM looks like: "(quote (SYM ...))", parse
-;; the ":tags", and return alist of (TAG . VAL) elems.
-;;
-;; TODO: Add option "--clump-comments", maybe w/ different clumping styles.
-;; Make `annotate!' extensible.
-
-;;; Code:
-
-(define-module (scripts read-scheme-source)
- :use-module (ice-9 rdelim)
- :export (read-scheme-source
- read-scheme-source-silently
- quoted?
- clump))
-
-;; Try to figure out what FORM is and its various attributes.
-;; Call proc NOTE! with key (a symbol) and value.
-;;
-(define (annotate! form note!)
- (cond ((and (list? form)
- (< 2 (length form))
- (eq? 'define (car form))
- (pair? (cadr form))
- (symbol? (caadr form)))
- (note! ':type 'procedure)
- (note! ':signature (cadr form))
- (and (< 3 (length form))
- (string? (caddr form))
- (note! ':std-int-doc (caddr form))))
- ((and (list? form)
- (< 2 (length form))
- (eq? 'define (car form))
- (symbol? (cadr form))
- (list? (caddr form))
- (< 3 (length (caddr form)))
- (eq? 'lambda (car (caddr form)))
- (string? (caddr (caddr form))))
- (note! ':type 'procedure)
- (note! ':signature (cons (cadr form) (cadr (caddr form))))
- (note! ':std-int-doc (caddr (caddr form))))
- ((and (list? form)
- (= 3 (length form))
- (eq? 'define (car form))
- (symbol? (cadr form))
- (symbol? (caddr form)))
- (note! ':type 'alias))
- ((and (list? form)
- (eq? 'define-module (car form)))
- (note! ':type 'define-module))
- ;; Add other types here.
- (else (note! ':type 'variable))))
-
-;; Process FILE, calling NB! on parsed top-level elements.
-;; Recognized: #!-!# and regular comments in addition to normal forms.
-;;
-(define (process file nb!)
- (nb! `'(filename ,file))
- (let ((hash-bang-rx (make-regexp "^#!"))
- (bang-hash-rx (make-regexp "^!#"))
- (all-comment-rx (make-regexp "^[ \t]*(;+)"))
- (all-whitespace-rx (make-regexp "^[ \t]*$"))
- (p (open-input-file file)))
- (let loop ((n (1+ (port-line p))) (line (read-line p)))
- (or (not n)
- (eof-object? line)
- (begin
- (cond ((regexp-exec hash-bang-rx line)
- (let loop ((line (read-line p))
- (text (list line)))
- (if (or (eof-object? line)
- (regexp-exec bang-hash-rx line))
- (nb! `'(hash-bang-comment
- :line ,n
- :line-count ,(1+ (length text))
- :text-list ,(reverse
- (cons line text))))
- (loop (read-line p)
- (cons line text)))))
- ((regexp-exec all-whitespace-rx line)
- (nb! `'(whitespace :text ,line)))
- ((regexp-exec all-comment-rx line)
- => (lambda (m)
- (nb! `'(comment
- :leading-semicolons
- ,(let ((m1 (vector-ref m 1)))
- (- (cdr m1) (car m1)))
- :text ,line))))
- (else
- (unread-string line p)
- (let* ((form (read p))
- (count (- (port-line p) n))
- (props (let* ((props '())
- (prop+ (lambda args
- (set! props
- (append props args)))))
- (annotate! form prop+)
- props)))
- (or (= count 1) ; ugh
- (begin
- (read-line p)
- (set! count (1+ count))))
- (nb! `'(following-form-properties
- :line ,n
- :line-count ,count
- ,@props))
- (nb! form))))
- (loop (1+ (port-line p)) (read-line p)))))))
-
-;;; entry points
-
-(define (read-scheme-source-silently . files)
- "See commentary in module (scripts read-scheme-source)."
- (let* ((res '()))
- (for-each (lambda (file)
- (process file (lambda (e) (set! res (cons e res)))))
- files)
- (reverse res)))
-
-(define (read-scheme-source . files)
- "See commentary in module (scripts read-scheme-source)."
- (for-each (lambda (file)
- (process file (lambda (e) (write e) (newline))))
- files))
-
-;; Recognize: (quote (SYM :TAG1 VAL1 :TAG2 VAL2 ...))
-;; and return alist: ((TAG1 . VAL1) (TAG2 . VAL2) ...)
-;; where the tags are symbols.
-;;
-(define (quoted? sym form)
- (and (list? form)
- (= 2 (length form))
- (eq? 'quote (car form))
- (let ((inside (cadr form)))
- (and (list? inside)
- (< 0 (length inside))
- (eq? sym (car inside))
- (let loop ((ls (cdr inside)) (alist '()))
- (if (null? ls)
- alist ; retval
- (let ((first (car ls)))
- (or (symbol? first)
- (error "bad list!"))
- (loop (cddr ls)
- (acons (string->symbol
- (substring (symbol->string first) 1))
- (cadr ls)
- alist)))))))))
-
-;; Filter FORMS, combining contiguous comment forms that have the same number
-;; of leading semicolons. Do not include in them whitespace lines.
-;; Whitespace lines outside of such comment groupings are ignored, as are
-;; hash-bang comments. All other forms are passed through unchanged.
-;;
-(define (clump forms)
- (let loop ((forms forms) (acc '()) (pass-this-one-through? #f))
- (if (null? forms)
- (reverse acc) ; retval
- (let ((form (car forms)))
- (cond (pass-this-one-through?
- (loop (cdr forms) (cons form acc) #f))
- ((quoted? 'following-form-properties form)
- (loop (cdr forms) (cons form acc) #t))
- ((quoted? 'whitespace form) ;;; ignore
- (loop (cdr forms) acc #f))
- ((quoted? 'hash-bang-comment form) ;;; ignore for now
- (loop (cdr forms) acc #f))
- ((quoted? 'comment form)
- => (lambda (alist)
- (let cloop ((inner-forms (cdr forms))
- (level (assq-ref alist 'leading-semicolons))
- (text (list (assq-ref alist 'text))))
- (let ((up (lambda ()
- (loop inner-forms
- (cons (cons level (reverse text))
- acc)
- #f))))
- (if (null? inner-forms)
- (up)
- (let ((inner-form (car inner-forms)))
- (cond ((quoted? 'comment inner-form)
- => (lambda (inner-alist)
- (let ((new-level
- (assq-ref
- inner-alist
- 'leading-semicolons)))
- (if (= new-level level)
- (cloop (cdr inner-forms)
- level
- (cons (assq-ref
- inner-alist
- 'text)
- text))
- (up)))))
- (else (up)))))))))
- (else (loop (cdr forms) (cons form acc) #f)))))))
-
-;;; script entry point
-
-(define main read-scheme-source)
-
-;;; read-scheme-source ends here
diff --git a/scripts/read-text-outline b/scripts/read-text-outline
deleted file mode 100755
index 1a88f205e..000000000
--- a/scripts/read-text-outline
+++ /dev/null
@@ -1,255 +0,0 @@
-#!/bin/sh
-# aside from this initial boilerplate, this is actually -*- scheme -*- code
-main='(module-ref (resolve-module '\''(scripts read-text-outline)) '\'main')'
-exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@"
-!#
-;;; read-text-outline --- Read a text outline and display it as a sexp
-
-;; Copyright (C) 2002 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, Inc., 59 Temple Place, Suite 330,
-;; Boston, MA 02111-1307 USA
-
-;;; Author: Thien-Thi Nguyen <ttn@gnu.org>
-
-;;; Commentary:
-
-;; Usage: read-text-outline OUTLINE
-;;
-;; Scan OUTLINE file and display a list of trees, the structure of
-;; each reflecting the "levels" in OUTLINE. The recognized outline
-;; format (used to indicate outline headings) is zero or more pairs of
-;; leading spaces followed by "-". Something like:
-;;
-;; - a 0
-;; - b 1
-;; - c 2
-;; - d 1
-;; - e 0
-;; - f 1
-;; - g 2
-;; - h 1
-;;
-;; In this example the levels are shown to the right. The output for
-;; such a file would be the single line:
-;;
-;; (("a" ("b" "c") "d") ("e" ("f" "g") "h"))
-;;
-;; Basically, anything at the beginning of a list is a parent, and the
-;; remaining elements of that list are its children.
-;;
-;;
-;; Usage from a Scheme program: These two procs are exported:
-;;
-;; (read-text-outline . args) ; only first arg is used
-;; (read-text-outline-silently port)
-;; (make-text-outline-reader re specs)
-;;
-;; `make-text-outline-reader' returns a proc that reads from PORT and
-;; returns a list of trees (similar to `read-text-outline-silently').
-;;
-;; RE is a regular expression (string) that is used to identify a header
-;; line of the outline (as opposed to a whitespace line or intervening
-;; text). RE must begin w/ a sub-expression to match the "level prefix"
-;; of the line. You can use `level-submatch-number' in SPECS (explained
-;; below) to specify a number other than 1, the default.
-;;
-;; Normally, the level of the line is taken directly as the length of
-;; its level prefix. This often results in adjacent levels not mapping
-;; to adjacent numbers, which confuses the tree-building portion of the
-;; program, which expects top-level to be 0, first sub-level to be 1,
-;; etc. You can use `level-substring-divisor' or `compute-level' in
-;; SPECS to specify a constant scaling factor or specify a completely
-;; alternative procedure, respectively.
-;;
-;; SPECS is an alist which may contain the following key/value pairs:
-;;
-;; - level-submatch-number NUMBER
-;; - level-substring-divisor NUMBER
-;; - compute-level PROC
-;; - body-submatch-number NUMBER
-;; - extra-fields ((FIELD-1 . SUBMATCH-1) (FIELD-2 . SUBMATCH-2) ...)
-;;
-;; The PROC value associated with key `compute-level' should take a
-;; Scheme match structure (as returned by `regexp-exec') and return a
-;; number, the normalized level for that line. If this is specified,
-;; it takes precedence over other level-computation methods.
-;;
-;; Use `body-submatch-number' if RE specifies the whole body, or if you
-;; want to make use of the extra fields parsing. The `extra-fields'
-;; value is a sub-alist, whose keys name additional fields that are to
-;; be recognized. These fields along with `level' are set as object
-;; properties of the final string ("body") that is consed into the tree.
-;; If a field name ends in "?" the field value is set to be #t if there
-;; is a match and the result is not an empty string, and #f otherwise.
-;;
-;;
-;; Bugs and caveats:
-;;
-;; (1) Only the first file specified on the command line is scanned.
-;; (2) TAB characters at the beginnings of lines are not recognized.
-;; (3) Outlines that "skip" levels signal an error. In other words,
-;; this will fail:
-;;
-;; - a 0
-;; - b 1
-;; - c 3 <-- skipped 2 -- error!
-;; - d 1
-;;
-;;
-;; TODO: Determine what's the right thing to do for skips.
-;; Handle TABs.
-;; Make line format customizable via longopts.
-
-;;; Code:
-
-(define-module (scripts read-text-outline)
- :export (read-text-outline
- read-text-outline-silently
- make-text-outline-reader)
- :use-module (ice-9 regex)
- :autoload (ice-9 rdelim) (read-line)
- :autoload (ice-9 getopt-long) (getopt-long))
-
-(define (?? symbol)
- (let ((name (symbol->string symbol)))
- (string=? "?" (substring name (1- (string-length name))))))
-
-(define (msub n)
- (lambda (m)
- (match:substring m n)))
-
-(define (??-predicates pair)
- (cons (car pair)
- (if (?? (car pair))
- (lambda (m)
- (not (string=? "" (match:substring m (cdr pair)))))
- (msub (cdr pair)))))
-
-(define (make-line-parser re specs)
- (let* ((rx (let ((fc (substring re 0 1)))
- (make-regexp (if (string=? "^" fc)
- re
- (string-append "^" re)))))
- (check (lambda (key)
- (assq-ref specs key)))
- (level-substring (msub (or (check 'level-submatch-number) 1)))
- (extract-level (cond ((check 'compute-level)
- => (lambda (proc)
- (lambda (m)
- (proc m))))
- ((check 'level-substring-divisor)
- => (lambda (n)
- (lambda (m)
- (/ (string-length (level-substring m))
- n))))
- (else
- (lambda (m)
- (string-length (level-substring m))))))
- (extract-body (cond ((check 'body-submatch-number)
- => msub)
- (else
- (lambda (m) (match:suffix m)))))
- (misc-props! (cond ((check 'extra-fields)
- => (lambda (alist)
- (let ((new (map ??-predicates alist)))
- (lambda (obj m)
- (for-each
- (lambda (pair)
- (set-object-property!
- obj (car pair)
- ((cdr pair) m)))
- new)))))
- (else
- (lambda (obj m) #t)))))
- ;; retval
- (lambda (line)
- (cond ((regexp-exec rx line)
- => (lambda (m)
- (let ((level (extract-level m))
- (body (extract-body m)))
- (set-object-property! body 'level level)
- (misc-props! body m)
- body)))
- (else #f)))))
-
-(define (make-text-outline-reader re specs)
- (let ((parse-line (make-line-parser re specs)))
- ;; retval
- (lambda (port)
- (let* ((all '(start))
- (pchain (list))) ; parents chain
- (let loop ((line (read-line port))
- (prev-level -1) ; how this relates to the first input
- ; level determines whether or not we
- ; start in "sibling" or "child" mode.
- ; in the end, `start' is ignored and
- ; it's much easier to ignore parents
- ; than siblings (sometimes). this is
- ; not to encourage ignorance, however.
- (tp all)) ; tail pointer
- (or (eof-object? line)
- (cond ((parse-line line)
- => (lambda (w)
- (let* ((words (list w))
- (level (object-property w 'level))
- (diff (- level prev-level)))
- (cond
-
- ;; sibling
- ((zero? diff)
- ;; just extend the chain
- (set-cdr! tp words))
-
- ;; child
- ((positive? diff)
- (or (= 1 diff)
- (error "unhandled diff not 1:" diff line))
- ;; parent may be contacted by uncle later (kids
- ;; these days!) so save its level
- (set-object-property! tp 'level prev-level)
- (set! pchain (cons tp pchain))
- ;; "push down" car into hierarchy
- (set-car! tp (cons (car tp) words)))
-
- ;; uncle
- ((negative? diff)
- ;; prune back to where levels match
- (do ((p pchain (cdr p)))
- ((= level (object-property (car p) 'level))
- (set! pchain p)))
- ;; resume at this level
- (set-cdr! (car pchain) words)
- (set! pchain (cdr pchain))))
-
- (loop (read-line port) level words))))
- (else (loop (read-line port) prev-level tp)))))
- (set! all (car all))
- (if (eq? 'start all)
- '() ; wasteland
- (cdr all))))))
-
-(define read-text-outline-silently
- (make-text-outline-reader "(([ ][ ])*)- *"
- '((level-substring-divisor . 2))))
-
-(define (read-text-outline . args)
- (write (read-text-outline-silently (open-file (car args) "r")))
- (newline)
- #t) ; exit val
-
-(define main read-text-outline)
-
-;;; read-text-outline ends here
diff --git a/scripts/scan-api b/scripts/scan-api
deleted file mode 100755
index 29837c8a2..000000000
--- a/scripts/scan-api
+++ /dev/null
@@ -1,225 +0,0 @@
-#!/bin/sh
-# aside from this initial boilerplate, this is actually -*- scheme -*- code
-main='(module-ref (resolve-module '\''(scripts scan-api)) '\'main')'
-exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@"
-!#
-;;; scan-api --- Scan and group interpreter and libguile interface elements
-
-;; Copyright (C) 2002 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, Inc., 59 Temple Place, Suite 330,
-;; Boston, MA 02111-1307 USA
-
-;;; Author: Thien-Thi Nguyen <ttn@gnu.org>
-
-;;; Commentary:
-
-;; Usage: scan-api GUILE SOFILE [GROUPINGS ...]
-;;
-;; Invoke GUILE, an executable guile interpreter, and use nm(1) on SOFILE, a
-;; shared-object library, to determine available interface elements, and
-;; display them to stdout as an alist:
-;;
-;; ((meta ...) (interface ...))
-;;
-;; The meta fields are `GUILE_LOAD_PATH', `LTDL_LIBRARY_PATH', `guile'
-;; `libguileinterface', `sofile' and `groups'. The interface elements are in
-;; turn sub-alists w/ keys `groups' and `scan-data'. Interface elements
-;; initially belong in one of two groups `Scheme' or `C' (but not both --
-;; signal error if that happens).
-;;
-;; Optional GROUPINGS ... are files each containing a single "grouping
-;; definition" alist with each entry of the form:
-;;
-;; (NAME (description "DESCRIPTION") (members SYM...))
-;;
-;; All of the SYM... should be proper subsets of the interface. In addition
-;; to `description' and `members' forms, the entry may optionally include:
-;;
-;; (grok USE-MODULES (lambda (x) CODE))
-;;
-;; where CODE implements a group-membership predicate to be applied to `x', a
-;; symbol. [When evaluated, CODE can assume (use-modules MODULE) has been
-;; executed where MODULE is an element of USE-MODULES, a list. [NOT YET
-;; IMPLEMENTED!]]
-;;
-;; Currently, there are two convenience predicates that operate on `x':
-;; (in-group? x GROUP)
-;; (name-prefix? x PREFIX)
-;;
-;; TODO: Allow for concurrent Scheme/C membership.
-;; Completely separate reporting.
-
-;;; Code:
-
-(define-module (scripts scan-api)
- :use-module (ice-9 popen)
- :use-module (ice-9 rdelim)
- :use-module (ice-9 regex)
- :export (scan-api))
-
-(define put set-object-property!)
-(define get object-property)
-
-(define (add-props object . args)
- (let loop ((args args))
- (if (null? args)
- object ; retval
- (let ((key (car args))
- (value (cadr args)))
- (put object key value)
- (loop (cddr args))))))
-
-(define (scan re command match)
- (let ((rx (make-regexp re))
- (port (open-pipe command OPEN_READ)))
- (let loop ((line (read-line port)))
- (or (eof-object? line)
- (begin
- (cond ((regexp-exec rx line) => match))
- (loop (read-line port)))))))
-
-(define (scan-Scheme! ht guile)
- (scan "^.guile.+: ([^ \t]+)([ \t]+(.+))*$"
- (format #f "~A -c '~S ~S'"
- guile
- '(use-modules (ice-9 session))
- '(apropos "."))
- (lambda (m)
- (let ((x (string->symbol (match:substring m 1))))
- (put x 'Scheme (or (match:substring m 3)
- ""))
- (hashq-set! ht x #t)))))
-
-(define (scan-C! ht sofile)
- (scan "^[0-9a-fA-F]+ ([B-TV-Z]) (.+)$"
- (format #f "nm ~A" sofile)
- (lambda (m)
- (let ((x (string->symbol (match:substring m 2))))
- (put x 'C (string->symbol (match:substring m 1)))
- (and (hashq-get-handle ht x)
- (error "both Scheme and C:" x))
- (hashq-set! ht x #t)))))
-
-(define THIS-MODULE (current-module))
-
-(define (in-group? x group)
- (memq group (get x 'groups)))
-
-(define (name-prefix? x prefix)
- (string-match (string-append "^" prefix) (symbol->string x)))
-
-(define (add-group-name! x name)
- (put x 'groups (cons name (get x 'groups))))
-
-(define (make-grok-proc name form)
- (let* ((predicate? (eval form THIS-MODULE))
- (p (lambda (x)
- (and (predicate? x)
- (add-group-name! x name)))))
- (put p 'name name)
- p))
-
-(define (make-members-proc name members)
- (let ((p (lambda (x)
- (and (memq x members)
- (add-group-name! x name)))))
- (put p 'name name)
- p))
-
-(define (make-grouper files) ; \/^^^o/ . o
- (let ((hook (make-hook 1))) ; /\____\
- (for-each
- (lambda (file)
- (for-each
- (lambda (gdef)
- (let ((name (car gdef))
- (members (assq-ref gdef 'members))
- (grok (assq-ref gdef 'grok)))
- (or members grok
- (error "bad grouping, must have `members' or `grok'"))
- (add-hook! hook
- (if grok
- (add-props (make-grok-proc name (cadr grok))
- 'description
- (assq-ref gdef 'description))
- (make-members-proc name members))
- #t))) ; append
- (read (open-file file OPEN_READ))))
- files)
- hook))
-
-(define (scan-api . args)
- (let ((guile (list-ref args 0))
- (sofile (list-ref args 1))
- (grouper (false-if-exception (make-grouper (cddr args))))
- (ht (make-hash-table 3331)))
- (scan-Scheme! ht guile)
- (scan-C! ht sofile)
- (let ((all (sort (hash-fold (lambda (key value prior-result)
- (add-props
- key
- 'string (symbol->string key)
- 'scan-data (or (get key 'Scheme)
- (get key 'C))
- 'groups (if (get key 'Scheme)
- '(Scheme)
- '(C)))
- (and grouper (run-hook grouper key))
- (cons key prior-result))
- '()
- ht)
- (lambda (a b)
- (string<? (get a 'string)
- (get b 'string))))))
- (format #t ";;; generated by scan-api -- do not edit!\n\n")
- (format #t "(\n")
- (format #t "(meta\n")
- (format #t " (GUILE_LOAD_PATH . ~S)\n"
- (or (getenv "GUILE_LOAD_PATH") ""))
- (format #t " (LTDL_LIBRARY_PATH . ~S)\n"
- (or (getenv "LTDL_LIBRARY_PATH") ""))
- (format #t " (guile . ~S)\n" guile)
- (format #t " (libguileinterface . ~S)\n"
- (let ((i #f))
- (scan "(.+)"
- (format #f "~A -c '(display ~A)'"
- guile
- '(assq-ref %guile-build-info
- 'libguileinterface))
- (lambda (m) (set! i (match:substring m 1))))
- i))
- (format #t " (sofile . ~S)\n" sofile)
- (format #t " ~A\n"
- (cons 'groups (append (if grouper
- (map (lambda (p) (get p 'name))
- (hook->list grouper))
- '())
- '(Scheme C))))
- (format #t ") ;; end of meta\n")
- (format #t "(interface\n")
- (for-each (lambda (x)
- (format #t "(~A ~A (scan-data ~S))\n"
- x
- (cons 'groups (get x 'groups))
- (get x 'scan-data)))
- all)
- (format #t ") ;; end of interface\n")
- (format #t ") ;; eof\n")))
- #t)
-
-(define main scan-api)
-
-;;; scan-api ends here
diff --git a/scripts/snarf-check-and-output-texi b/scripts/snarf-check-and-output-texi
deleted file mode 100755
index d669cab86..000000000
--- a/scripts/snarf-check-and-output-texi
+++ /dev/null
@@ -1,313 +0,0 @@
-#!/bin/sh
-# aside from this initial boilerplate, this is actually -*- scheme -*- code
-main="(module-ref (resolve-module '(scripts snarf-check-and-output-texi)) 'main)"
-exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@"
-!#
-;;; snarf-check-and-output-texi --- called by the doc snarfer.
-
-;; Copyright (C) 2001 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, Inc., 59 Temple Place, Suite 330,
-;; Boston, MA 02111-1307 USA
-
-;;; Author: Michael Livshin
-
-;;; Code:
-
-(define-module (scripts snarf-check-and-output-texi)
- :use-module (ice-9 streams)
- :use-module (ice-9 match)
- :export (snarf-check-and-output-texi))
-
-;;; why aren't these in some module?
-
-(define-macro (when cond . body)
- `(if ,cond (begin ,@body)))
-
-(define-macro (unless cond . body)
- `(if (not ,cond) (begin ,@body)))
-
-(define *manual-flag* #f)
-
-(define (snarf-check-and-output-texi . flags)
- (if (member "--manual" flags)
- (set! *manual-flag* #t))
- (process-stream (current-input-port)))
-
-(define (process-stream port)
- (let loop ((input (stream-map (match-lambda
- (('id . s)
- (cons 'id (string->symbol s)))
- (('int_dec . s)
- (cons 'int (string->number s)))
- (('int_oct . s)
- (cons 'int (string->number s 8)))
- (('int_hex . s)
- (cons 'int (string->number s 16)))
- ((and x (? symbol?))
- (cons x x))
- ((and x (? string?))
- (cons 'string x))
- (x x))
- (make-stream (lambda (s)
- (let loop ((s s))
- (cond
- ((stream-null? s) #t)
- ((eq? 'eol (stream-car s))
- (loop (stream-cdr s)))
- (else (cons (stream-car s) (stream-cdr s))))))
- (port->stream port read)))))
-
- (unless (stream-null? input)
- (let ((token (stream-car input)))
- (if (eq? (car token) 'snarf_cookie)
- (dispatch-top-cookie (stream-cdr input)
- loop)
- (loop (stream-cdr input)))))))
-
-(define (dispatch-top-cookie input cont)
-
- (when (stream-null? input)
- (error 'syntax "premature end of file"))
-
- (let ((token (stream-car input)))
- (cond
- ((eq? (car token) 'brace_open)
- (consume-multiline (stream-cdr input)
- cont))
- (else
- (consume-upto-cookie process-singleline
- input
- cont)))))
-
-(define (consume-upto-cookie process input cont)
- (let loop ((acc '()) (input input))
-
- (when (stream-null? input)
- (error 'syntax "premature end of file in directive context"))
-
- (let ((token (stream-car input)))
- (cond
- ((eq? (car token) 'snarf_cookie)
- (process (reverse! acc))
- (cont (stream-cdr input)))
-
- (else (loop (cons token acc) (stream-cdr input)))))))
-
-(define (consume-multiline input cont)
- (begin-multiline)
-
- (let loop ((input input))
-
- (when (stream-null? input)
- (error 'syntax "premature end of file in multiline context"))
-
- (let ((token (stream-car input)))
- (cond
- ((eq? (car token) 'brace_close)
- (end-multiline)
- (cont (stream-cdr input)))
-
- (else (consume-upto-cookie process-multiline-directive
- input
- loop))))))
-
-(define *file* #f)
-(define *line* #f)
-(define *c-function-name* #f)
-(define *function-name* #f)
-(define *snarf-type* #f)
-(define *args* #f)
-(define *sig* #f)
-(define *docstring* #f)
-
-(define (begin-multiline)
- (set! *file* #f)
- (set! *line* #f)
- (set! *c-function-name* #f)
- (set! *function-name* #f)
- (set! *snarf-type* #f)
- (set! *args* #f)
- (set! *sig* #f)
- (set! *docstring* #f))
-
-(define *primitive-deffnx-signature* "@deffnx {Scheme Procedure} ")
-(define *primitive-deffnx-sig-length* (string-length *primitive-deffnx-signature*))
-
-(define (end-multiline)
- (let* ((req (car *sig*))
- (opt (cadr *sig*))
- (var (caddr *sig*))
- (all (+ req opt var)))
- (if (and (not (eqv? *snarf-type* 'register))
- (not (= (length *args*) all)))
- (error (format #f "~A:~A: ~A's C implementation takes ~A args (should take ~A)"
- *file* *line* name (length *args*) all)))
- (let ((nice-sig
- (if (eq? *snarf-type* 'register)
- *function-name*
- (with-output-to-string
- (lambda ()
- (format #t "~A" *function-name*)
- (let loop-req ((args *args*) (r 0))
- (if (< r req)
- (begin
- (format #t " ~A" (car args))
- (loop-req (cdr args) (+ 1 r)))
- (let loop-opt ((o 0) (args args) (tail '()))
- (if (< o opt)
- (begin
- (format #t " [~A" (car args))
- (loop-opt (+ 1 o) (cdr args) (cons #\] tail)))
- (begin
- (if (> var 0)
- (format #t " . ~A"
- (car args)))
- (let loop-tail ((tail tail))
- (if (not (null? tail))
- (begin
- (format #t "~A" (car tail))
- (loop-tail (cdr tail))))))))))))))
- (scm-deffnx
- (if (and *manual-flag* (eq? *snarf-type* 'primitive))
- (with-output-to-string
- (lambda ()
- (format #t "@deffnx {C Function} ~A (" *c-function-name*)
- (unless (null? *args*)
- (format #t "~A" (car *args*))
- (let loop ((args (cdr *args*)))
- (unless (null? args)
- (format #t ", ~A" (car args))
- (loop (cdr args)))))
- (format #t ")\n")))
- #f)))
- (format #t "\n ~A\n" *function-name*)
- (format #t "@c snarfed from ~A:~A\n" *file* *line*)
- (format #t "@deffn {Scheme Procedure} ~A\n" nice-sig)
- (let loop ((strings *docstring*) (scm-deffnx scm-deffnx))
- (cond ((null? strings))
- ((or (not scm-deffnx)
- (and (>= (string-length (car strings))
- *primitive-deffnx-sig-length*)
- (string=? (substring (car strings)
- 0 *primitive-deffnx-sig-length*)
- *primitive-deffnx-signature*)))
- (display (car strings))
- (loop (cdr strings) scm-deffnx))
- (else (display scm-deffnx)
- (loop strings #f))))
- (display "\n")
- (display "@end deffn\n"))))
-
-(define (texi-quote s)
- (let rec ((i 0))
- (if (= i (string-length s))
- ""
- (string-append (let ((ss (substring s i (+ i 1))))
- (if (string=? ss "@")
- "@@"
- ss))
- (rec (+ i 1))))))
-
-(define (process-multiline-directive l)
-
- (define do-args
- (match-lambda
-
- (('(paren_close . paren_close))
- '())
-
- (('(comma . comma) rest ...)
- (do-args rest))
-
- (('(id . SCM) ('id . name) rest ...)
- (cons name (do-args rest)))
-
- (x (error (format #f "invalid argument syntax: ~A" (map cdr x))))))
-
- (define do-arglist
- (match-lambda
-
- (('(paren_open . paren_open) '(id . void) '(paren_close . paren_close))
- '())
-
- (('(paren_open . paren_open) rest ...)
- (do-args rest))
-
- (x (error (format #f "invalid arglist syntax: ~A" (map cdr x))))))
-
- (define do-command
- (match-lambda
-
- (('cname ('id . name))
- (set! *c-function-name* (texi-quote (symbol->string name))))
-
- (('fname ('string . name))
- (set! *function-name* (texi-quote name)))
-
- (('type ('id . type))
- (set! *snarf-type* type))
-
- (('type ('int . num))
- (set! *snarf-type* num))
-
- (('location ('string . file) ('int . line))
- (set! *file* file)
- (set! *line* line))
-
- (('arglist rest ...)
- (set! *args* (do-arglist rest)))
-
- (('argsig ('int . req) ('int . opt) ('int . var))
- (set! *sig* (list req opt var)))
-
- (x (error (format #f "unknown doc attribute: ~A" x)))))
-
- (define do-directive
- (match-lambda
-
- ((('id . command) rest ...)
- (do-command (cons command rest)))
-
- ((('string . string) ...)
- (set! *docstring* string))
-
- (x (error (format #f "unknown doc attribute syntax: ~A" x)))))
-
- (do-directive l))
-
-(define (process-singleline l)
-
- (define do-argpos
- (match-lambda
- ((('id . name) ('int . pos) ('int . line))
- (let ((idx (list-index *args* name)))
- (when idx
- (unless (= (+ idx 1) pos)
- (display (format #f "~A:~A: wrong position for argument ~A: ~A (should be ~A)\n"
- *file* line name pos (+ idx 1))
- (current-error-port))))))
- (x #f)))
-
- (define do-command
- (match-lambda
- (('(id . argpos) rest ...)
- (do-argpos rest))
- (x (error (format #f "unknown check: ~A" x)))))
-
- (when *function-name*
- (do-command l)))
-
-(define main snarf-check-and-output-texi)
diff --git a/scripts/snarf-guile-m4-docs b/scripts/snarf-guile-m4-docs
deleted file mode 100755
index 45d258c61..000000000
--- a/scripts/snarf-guile-m4-docs
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/bin/sh
-# aside from this initial boilerplate, this is actually -*- scheme -*- code
-main='(module-ref (resolve-module '\''(scripts snarf-guile-m4-docs)) '\'main')'
-exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@"
-!#
-;;; snarf-guile-m4-docs --- Parse guile.m4 comments for texi documentation
-
-;; Copyright (C) 2002 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, Inc., 59 Temple Place, Suite 330,
-;; Boston, MA 02111-1307 USA
-
-;;; Author: Thien-Thi Nguyen <ttn@gnu.org>
-
-;;; Commentary:
-
-;; Usage: snarf-guile-m4-docs FILE
-;;
-;; Grep FILE for comments preceding macro definitions, massage
-;; them into valid texi, and display to stdout. For each comment,
-;; lines preceding "^# Usage:" are discarded.
-;;
-;; TODO: Generalize.
-
-;;; Code:
-
-(define-module (scripts snarf-guile-m4-docs)
- :use-module (ice-9 rdelim)
- :export (snarf-guile-m4-docs))
-
-(define (display-texi lines)
- (display "@deffn {Autoconf Macro}")
- (for-each (lambda (line)
- (display (cond ((and (>= (string-length line) 2)
- (string=? "# " (substring line 0 2)))
- (substring line 2))
- ((string=? "#" (substring line 0 1))
- (substring line 1))
- (else line)))
- (newline))
- lines)
- (display "@end deffn")
- (newline) (newline))
-
-(define (prefix? line sub)
- (false-if-exception
- (string=? sub (substring line 0 (string-length sub)))))
-
-(define (massage-usage line)
- (let loop ((line (string->list line)) (acc '()))
- (if (null? line)
- (list (list->string (reverse acc)))
- (loop (cdr line)
- (cons (case (car line)
- ((#\( #\) #\,) #\space)
- (else (car line)))
- acc)))))
-
-(define (snarf-guile-m4-docs . args)
- (let* ((p (open-file (car args) "r"))
- (next (lambda () (read-line p))))
- (let loop ((line (next)) (acc #f))
- (or (eof-object? line)
- (cond ((prefix? line "# Usage:")
- (loop (next) (massage-usage (substring line 8))))
- ((prefix? line "AC_DEFUN")
- (display-texi (reverse acc))
- (loop (next) #f))
- ((and acc (prefix? line "#"))
- (loop (next) (cons line acc)))
- (else
- (loop (next) #f)))))))
-
-(define main snarf-guile-m4-docs)
-
-;;; snarf-guile-m4-docs ends here
diff --git a/scripts/summarize-guile-TODO b/scripts/summarize-guile-TODO
deleted file mode 100755
index fb659c836..000000000
--- a/scripts/summarize-guile-TODO
+++ /dev/null
@@ -1,214 +0,0 @@
-#!/bin/sh
-# aside from this initial boilerplate, this is actually -*- scheme -*- code
-main='(module-ref (resolve-module '\''(scripts summarize-guile-TODO)) '\'main')'
-exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@"
-!#
-;;; summarize-guile-TODO --- Display Guile TODO list in various ways
-
-;; Copyright (C) 2002 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, Inc., 59 Temple Place, Suite 330,
-;; Boston, MA 02111-1307 USA
-
-;;; Author: Thien-Thi Nguyen <ttn@gnu.org>
-
-;;; Commentary:
-
-;; Usage: summarize-guile-TODO TODOFILE
-;;
-;; The TODOFILE is typically Guile's (see workbook/tasks/README)
-;; presumed to serve as our signal to ourselves (lest we want real
-;; bosses hassling us) wrt to the overt message "items to do" as well as
-;; the messages that can be inferred from its structure.
-;;
-;; This program reads TODOFILE and displays interpretations on its
-;; structure, including registered markers and ownership, in various
-;; ways.
-;;
-;; A primary interest in any task is its parent task. The output
-;; summarization by default lists every item and its parent chain.
-;; Top-level parents are not items. You can use these command-line
-;; options to modify the selection and display (selection criteria
-;; are ANDed together):
-;;
-;; -i, --involved USER -- select USER-involved items
-;; -p, --personal USER -- select USER-responsible items
-;; -t, --todo -- select unfinished items (status "-")
-;; -d, --done -- select finished items (status "+")
-;; -r, --review -- select review items (marker "R")
-;;
-;; -w, --who -- also show who is associated w/ the item
-;; -n, --no-parent -- do not show parent chain
-;;
-;;
-;; Usage from a Scheme program:
-;; (summarize-guile-TODO . args) ; uses first arg only
-;;
-;;
-;; Bugs: (1) Markers are scanned in sequence: D R X N%. This means "XD"
-;; and the like are completely dropped. However, such strings
-;; are unlikely to be used if the markers are chosen to be
-;; somewhat exclusive, which is currently the case for D R X.
-;; N% used w/ these needs to be something like: "D25%" (this
-;; means discussion accounts for 1/4 of the task).
-;;
-;; TODO: Implement more various ways. (Patches welcome.)
-;; Add support for ORing criteria.
-
-;;; Code:
-(debug-enable 'debug 'backtrace)
-
-(define-module (scripts summarize-guile-TODO)
- :use-module (scripts read-text-outline)
- :use-module (ice-9 getopt-long)
- :autoload (srfi srfi-13) (string-tokenize) ; string library
- :autoload (ice-9 common-list) (remove-if-not)
- :export (summarize-guile-TODO))
-
-(define put set-object-property!)
-(define get object-property)
-
-(define (as-leaf x)
- (cond ((get x 'who)
- => (lambda (who)
- (put x 'who
- (map string->symbol
- (string-tokenize who #\:))))))
- (cond ((get x 'pct-done)
- => (lambda (pct-done)
- (put x 'pct-done (string->number pct-done)))))
- x)
-
-(define (hang-by-the-leaves trees)
- (let ((leaves '()))
- (letrec ((hang (lambda (tree parent)
- (if (list? tree)
- (begin
- (put (car tree) 'parent parent)
- (for-each (lambda (child)
- (hang child (car tree)))
- (cdr tree)))
- (begin
- (put tree 'parent parent)
- (set! leaves (cons (as-leaf tree) leaves)))))))
- (for-each (lambda (tree)
- (hang tree #f))
- trees))
- leaves))
-
-(define (read-TODO file)
- (hang-by-the-leaves
- ((make-text-outline-reader
- "(([ ][ ])*)([-+])(D*)(R*)(X*)(([0-9]+)%)* *([^[]*)(\\[(.*)\\])*"
- '((level-substring-divisor . 2)
- (body-submatch-number . 9)
- (extra-fields . ((status . 3)
- (design? . 4)
- (review? . 5)
- (extblock? . 6)
- (pct-done . 8)
- (who . 11)))))
- (open-file file "r"))))
-
-(define (select-items p items)
- (let ((sub '()))
- (cond ((option-ref p 'involved #f)
- => (lambda (u)
- (let ((u (string->symbol u)))
- (set! sub (cons
- (lambda (x)
- (and (get x 'who)
- (memq u (get x 'who))))
- sub))))))
- (cond ((option-ref p 'personal #f)
- => (lambda (u)
- (let ((u (string->symbol u)))
- (set! sub (cons
- (lambda (x)
- (cond ((get x 'who)
- => (lambda (ls)
- (eq? (car (reverse ls))
- u)))
- (else #f)))
- sub))))))
- (for-each (lambda (pair)
- (cond ((option-ref p (car pair) #f)
- (set! sub (cons (cdr pair) sub)))))
- `((todo . ,(lambda (x) (string=? (get x 'status) "-")))
- (done . ,(lambda (x) (string=? (get x 'status) "+")))
- (review . ,(lambda (x) (get x 'review?)))))
- (let loop ((sub (reverse sub)) (items items))
- (if (null? sub)
- (reverse items)
- (loop (cdr sub) (remove-if-not (car sub) items))))))
-
-(define (make-display-item show-who? show-parent?)
- (let ((show-who
- (if show-who?
- (lambda (item)
- (cond ((get item 'who)
- => (lambda (who) (format #f " ~A" who)))
- (else "")))
- (lambda (item) "")))
- (show-parents
- (if show-parent?
- (lambda (item)
- (let loop ((parent (get item 'parent)) (indent 2))
- (and parent
- (begin
- (format #t "under : ~A~A\n"
- (make-string indent #\space)
- parent)
- (loop (get parent 'parent) (+ 2 indent))))))
- (lambda (item) #t))))
- (lambda (item)
- (format #t "status: ~A~A~A~A~A~A\nitem : ~A\n"
- (get item 'status)
- (if (get item 'design?) "D" "")
- (if (get item 'review?) "R" "")
- (if (get item 'extblock?) "X" "")
- (cond ((get item 'pct-done)
- => (lambda (pct-done)
- (format #f " ~A%" pct-done)))
- (else ""))
- (show-who item)
- item)
- (show-parents item))))
-
-(define (display-items p items)
- (let ((display-item (make-display-item (option-ref p 'who #f)
- (not (option-ref p 'no-parent #f))
- )))
- (for-each display-item items)))
-
-(define (summarize-guile-TODO . args)
- (let ((p (getopt-long (cons "summarize-guile-TODO" args)
- '((who (single-char #\w))
- (no-parent (single-char #\n))
- (involved (single-char #\i)
- (value #t))
- (personal (single-char #\p)
- (value #t))
- (todo (single-char #\t))
- (done (single-char #\d))
- (review (single-char #\r))
- ;; Add options here.
- ))))
- (display-items p (select-items p (read-TODO (car (option-ref p '() #f))))))
- #t) ; exit val
-
-(define main summarize-guile-TODO)
-
-;;; summarize-guile-TODO ends here
diff --git a/scripts/use2dot b/scripts/use2dot
deleted file mode 100755
index dff341744..000000000
--- a/scripts/use2dot
+++ /dev/null
@@ -1,113 +0,0 @@
-#!/bin/sh
-# aside from this initial boilerplate, this is actually -*- scheme -*- code
-main='(module-ref (resolve-module '\''(scripts use2dot)) '\'main')'
-exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@"
-!#
-;;; use2dot --- Display module dependencies as a DOT specification
-
-;; Copyright (C) 2001 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, Inc., 59 Temple Place, Suite 330,
-;; Boston, MA 02111-1307 USA
-
-;;; Author: Thien-Thi Nguyen
-
-;;; Commentary:
-
-;; Usage: use2dot [OPTIONS] [FILE ...]
-;; Display to stdout a DOT specification that describes module dependencies
-;; in FILEs.
-;;
-;; A top-level `use-modules' form or a `:use-module' `define-module'-component
-;; results in a "solid" style edge.
-;;
-;; An `:autoload' `define-module'-component results in a "dotted" style edge
-;; with label "N" indicating that N names are responsible for triggering the
-;; autoload. [The "N" label is not implemented.]
-;;
-;; A top-level `load' or `primitive-load' form results in a a "bold" style
-;; edge to a node named with either the file name if the `load' argument is a
-;; string, or "[computed in FILE]" otherwise.
-;;
-;; Options:
-;; -m, --default-module MOD -- Set MOD as the default module (for top-level
-;; `use-modules' forms that do not follow some
-;; `define-module' form in a file). MOD should be
-;; be a list or `#f', in which case such top-level
-;; `use-modules' forms are effectively ignored.
-;; Default value: `(guile-user)'.
-
-;;; Code:
-
-(define-module (scripts use2dot)
- :autoload (ice-9 getopt-long) (getopt-long)
- :use-module ((srfi srfi-13) :select (string-join))
- :use-module ((scripts frisk)
- :select (make-frisker edge-type edge-up edge-down))
- :export (use2dot))
-
-(define *default-module* '(guile-user))
-
-(define (q s) ; quote
- (format #f "~S" s))
-
-(define (vv pairs) ; => ("var=val" ...)
- (map (lambda (pair)
- (format #f "~A=~A" (car pair) (cdr pair)))
- pairs))
-
-(define (>>header)
- (format #t "digraph use2dot {\n")
- (for-each (lambda (s) (format #t " ~A;\n" s))
- (vv `((label . ,(q "Guile Module Dependencies"))
- ;;(rankdir . LR)
- ;;(size . ,(q "7.5,10"))
- (ratio . fill)
- ;;(nodesep . ,(q "0.05"))
- ))))
-
-(define (>>body edges)
- (for-each
- (lambda (edge)
- (format #t " \"~A\" -> \"~A\"" (edge-down edge) (edge-up edge))
- (cond ((case (edge-type edge)
- ((autoload) '((style . dotted) (fontsize . 5)))
- ((computed) '((style . bold)))
- (else #f))
- => (lambda (etc)
- (format #t " [~A]" (string-join (vv etc) ",")))))
- (format #t ";\n"))
- edges))
-
-(define (>>footer)
- (format #t "}"))
-
-(define (>> edges)
- (>>header)
- (>>body edges)
- (>>footer))
-
-(define (use2dot . args)
- (let* ((parsed-args (getopt-long (cons "use2dot" args) ;;; kludge
- '((default-module
- (single-char #\m) (value #t)))))
- (=m (option-ref parsed-args 'default-module *default-module*))
- (scan (make-frisker `(default-module . ,=m)))
- (files (option-ref parsed-args '() '())))
- (>> (reverse ((scan files) 'edges)))))
-
-(define main use2dot)
-
-;;; use2dot ends here
diff --git a/srfi/.cvsignore b/srfi/.cvsignore
deleted file mode 100644
index 30ce6d616..000000000
--- a/srfi/.cvsignore
+++ /dev/null
@@ -1,13 +0,0 @@
-*.c.clean.c
-*.la
-*.lo
-*.x
-.deps
-.libs
-Makefile
-Makefile.in
-aclocal.m4
-config.log
-config.status
-configure
-libtool
diff --git a/srfi/ChangeLog b/srfi/ChangeLog
deleted file mode 100644
index ae124be8d..000000000
--- a/srfi/ChangeLog
+++ /dev/null
@@ -1,736 +0,0 @@
-2002-05-06 Marius Vollmer <mvo@zagadka.ping.de>
-
- * srfi-13.c (scm_string_tokenize): Instead of using "isgraphic" as
- the subtitute for char-set:graphic when then token-set hsa been
- defaulted, grab the real char-set:graphic from (srfi srfi-14).
-
- * srfi-14.h (SCM_CHARSET_GET): Cast IDX to unsigned char so that
- it works for 8-bit characters. Thanks to Matthias Koeppe! No,
- make that "Köppe".
-
-2002-04-24 Marius Vollmer <mvo@zagadka.ping.de>
-
- * srfi-13.c (s_scm_string_tokenize): Only take character sets as
- the second arg. Collect characters belonging to this set into
- tokens (as specified by the SRFI), instead of splitting at these
- characters. Default to an equivalent of char-set:graphic instead
- of everything-but-whitespace. Thanks to Matthias Koeppe!
-
-2002-04-10 Rob Browning <rlb@defaultvalue.org>
-
- * .cvsignore: add *.c.clean.c.
-
-2002-03-27 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * srfi-1.scm, srfi-13.scm, srfi-17.scm, srfi-4.scm, srfi-9.scm,
- srfi-10.scm, srfi-14.scm, srfi-19.scm, srfi-6.scm, srfi-11.scm,
- srfi-16.scm, srfi-2.scm, srfi-8.scm: Update copyright.
- Point to manual in commentary; nfc.
-
-2002-03-24 Marius Vollmer <mvo@zagadka.ping.de>
-
- * Makefile.am (.c.x): Pass "-o $@" to guile-snarf.
-
-2002-03-13 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * srfi-13.c, srfi-14.c, srfi-4.c:
- Retire inclusion guard macro SCM_MAGIC_SNARFER.
-
- * Makefile.am (snarfcppopts): New var.
- (.c.x): Use $(snarfcppopts). Rework guile-snarf usage.
-
-2002-03-11 Marius Vollmer <mvo@zagadka.ping.de>
-
- * srfi-13.c (string_titlecase_x): Treat characters as unsigned so
- that 8-bit chars work. Thanks to David Pirotte!
-
-2002-02-24 Rob Browning <rlb@defaultvalue.org>
-
- * Makefile.am (libguile_srfi_srfi_4_la_LDFLAGS): use
- @LIBGUILE_SRFI_SRFI_4_INTERFACE@.
- (libguile_srfi_srfi_13_14_la_LDFLAGS): use
- @LIBGUILE_SRFI_SRFI_13_14_INTERFACE@.
-
-2002-02-23 Neil Jerram <neil@ossau.uklinux.net>
-
- * srfi-19.scm (priv:month-assoc): Correct numbers so that they
- match the expectations of priv:year-day.
-
-2002-02-22 Neil Jerram <neil@ossau.uklinux.net>
-
- * srfi-19.scm (priv:year-day): Index into priv:month-assoc using
- month number, not day number. (Thanks to Sébastien de Menten de
- Horne for reporting the problem.)
-
-2002-02-11 Marius Vollmer <marius.vollmer@uni-dortmund.de>
-
- * srfi-14.c, srfi-4.c: Use scm_gc_malloc/scm_malloc and
- scm_gc_free/free instead of scm_must_malloc and scm_must_free, as
- appropriate.
-
-2002-01-21 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * srfi-1.scm (count1, take-while): Rewrite to be tail-recursive.
- Thanks to Panagiotis Vossos.
-
-2002-01-20 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * srfi-1.scm (map1): Rewrite to be tail-recursive.
- Thanks to Panagiotis Vossos for the bug report.
-
-2001-12-16 Marius Vollmer <mvo@zagadka.ping.de>
-
- * srfi-11.scm (let-values): Use `gensym' instead of `gentemp'.
-
-2001-11-30 Neil Jerram <neil@ossau.uklinux.net>
-
- * Makefile.am (ETAGS_ARGS): Added.
-
-2001-11-12 Marius Vollmer <mvo@zagadka.ping.de>
-
- * srfi-4.c: Use HAVE_LONG_LONG instead of HAVE_LONG_LONGS and test
- it with `#ifdef' instead of `#if'.
-
-2001-11-07 Neil Jerram <neil@ossau.uklinux.net>
-
- * srfi-13.c (scm_string_unfold, scm_string_unfold_right),
- srfi-14.c (scm_char_set_unfold, scm_char_set_unfold_x): Remove
- superfluous whitespace at end of docstring lines.
-
-2001-11-06 Thien-Thi Nguyen <ttn@glug.org>
-
- * srfi-19.scm (time-monotonic->time-monotonic): Spurious;
- remove from exports.
-
-2001-11-04 Stefan Jahn <stefan@lkcc.org>
-
- * srfi-13.h, srfi-14.h, srfi-4.h: Follow-up patch. Renamed
- __FOO__ macros into FOO.
-
-2001-11-03 Marius Vollmer <mvo@zagadka.ping.de>
-
- * Makefile.am (libguile_srfi_srfi_4_la_LIBADD,
- libguile_srfi_srfi_13_14_la_LIBADD): Refer to build directory, not
- the source directory, for libguile.la. Thanks to Ken Raeburn.
-
-2001-11-02 Marius Vollmer <mvo@zagadka.ping.de>
-
- Support for native Win32. Thanks to Stefan Jahn!
-
- * Makefile.am: Put `-no-undefined' into LDFLAGS to support linkers
- which do not allow unresolved symbols inside shared libraries.
-
- * srfi-13.h, srfi-14.h: Defined SCM_SRFI1314_API. Prefixed each
- exported symbol with SCM_SRFI1314_API.
-
- * srfi-4.h: Defined SCM_SRFI4_API. Prefixed each exported
- symbol with SCM_SRFI4_API.
-
-2001-10-21 Mikael Djurfeldt <mdj@linnaeus>
-
- * srfi-2.scm, srfi-4.scm, srfi-8.scm, srfi-9.scm, srfi-10.scm,
- srfi-11.scm, srfi-14.scm, srfi-16.scm: Move module the system
- directives `export', `export-syntax', `re-export' and
- `re-export-syntax' into the `define-module' form. This is the
- recommended way of exporting bindings.
-
-2001-09-22 Mikael Djurfeldt <mdj@linnaeus>
-
- * srfi-19.scm (priv:split-real): Inserted missing call to
- inexact->exact.
-
-2001-09-21 Rob Browning <rlb@defaultvalue.org>
-
- * srfi-14.h (SCM_CHARSET_GET): need 1L, not just 1 in "<<".
-
- * srfi-14.c (SCM_CHARSET_SET): need 1L, not just 1 in "<<".
- (scm_char_set_hash): val needs to be long, not just unsigned.
- (scm_char_set): need 1L, not just 1 in "<<".
- (scm_list_to_char_set): need 1L, not just 1 in "<<".
- (scm_list_to_char_set_x): need 1L, not just 1 in "<<".
- (scm_list_to_char_set_x): FUNC_NAME was wrong - added a _x.
- (scm_string_to_char_set): string length var needed to be
- scm_sizet, not int.
- (scm_string_to_char_set): need 1L, not just 1 in "<<".
- (scm_string_to_char_set_x): string length var needed to be
- scm_sizet, not int.
- (scm_string_to_char_set_x): need 1L, not just 1 in "<<".
- (scm_char_set_filter): need 1L, not just 1 in "<<".
- (scm_char_set_filter_x): need 1L, not just 1 in "<<".
- (scm_ucs_range_to_char_set): need 1L, not just 1 in "<<".
- (scm_ucs_range_to_char_set_x): need 1L, not just 1 in "<<".
- (scm_char_set_adjoin): need 1L, not just 1 in "<<".
- (scm_char_set_delete): need 1L, not just 1 in "<<".
- (scm_char_set_adjoin_x): need 1L, not just 1 in "<<".
- (scm_char_set_delete_x): need 1L, not just 1 in "<<".
-
-2001-09-12 Gary Houston <ghouston@arglist.com>
-
- * srfi-1.scm (filter): change "caller" to "filter" in check-arg-type.
-
-2001-08-31 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * srfi-1.scm, srfi-13.scm: Remove the defines that were needed to
- trick export from the beginning of the files.
-
-2001-08-25 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * srfi-19.scm (add-duration): Fix bug: Call `add-duration!' w/
- two args. Thanks to Alex Shinn.
-
-2001-08-25 Marius Vollmer <mvo@zagadka.ping.de>
-
- * Makefile.am (AUTOMAKE_OPTIONS): Change "foreign" to "gnu".
-
-2001-08-24 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * srfi-13.h (scm_string_map, scm_string_map_x,
- scm_string_for_each): Reverse order of first two args.
- (scm_string_for_each_index): New proc.
-
- * srfi-13.c (scm_string_for_each): Reverse order of first 2 args.
- (scm_string_for_each_index): New func.
-
- * srfi-13.scm (string-for-each-index): New exported proc.
-
- Thanks to Alex Shinn.
-
-2001-08-22 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * srfi-13.c (string-map): Swapped order of string and proc args to
- conform with the srfi. (Thanks to Alex Shinn.)
-
-2001-08-05 Gary Houston <ghouston@arglist.com>
-
- * srfi-1.scm (check-arg-type, non-negative-integer?): a couple of new
- internal definitions.
- (list-tabulate, iota): check for bad arguments that otherwise
- give weird output.
- (filter): check for proper list, to avoid infinite recursion on
- a circular list.
-
-2001-08-04 Gary Houston <ghouston@arglist.com>
-
- * srfi-1.scm (filter): replaced with a tail-recursive version.
- (remove): implement using filter, to make it tail-recursive.
-
-2001-07-31 Gary Houston <ghouston@arglist.com>
-
- * srfi-14.c (scm_char_set_diff_plus_intersection): wasn't correctly
- accounting for the (char-set-union cs2...) in the spec. i.e.,
- (char-set-diff+intersection a) -> copy-of-a, empty-set
- and the following are equivalent:
- (char-set-diff+intersection a (char-set #\a) (char-set #\b))
- (char-set-diff+intersection a (char-set #\a #\b))
-
- (scm_char_set_xor_x): disabled the side-effecting code, since it
- gives inconsistent results to scm_char_set_xor for the case
- (char-set-xor! a a a).
-
- (scm_char_set_diff_plus_intersection_x): added cs2 argument, since
- two arguments are compulsory in final spec. also similar changes
- as for scm_char_set_diff_plus_intersection.
- * srfi-14.h (scm_char_set_diff_plus_intersection_x): added cs2.
-
-2001-07-22 Gary Houston <ghouston@arglist.com>
-
- * srfi-14.c (scm_char_set_intersection, scm_char_set_xor): remove
- the compulsory cs1 arguments: all args are optional in final spec.
-
- * srfi-14.h: declarations updated.
-
-2001-07-18 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * srfi-11.scm, srfi-8.scm: Update copyright notice.
-
-2001-07-17 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * srfi-14.c: Okay. Now I got it. Really. This time it's fixed.
- Guaranteed. (Maybe)
-
- * srfi-19.scm: Define `current-time' before exporting it.
-
-2001-07-17 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * srfi-14.c: Fix for bug caused by brain-malfunctioning on my
- side. Bit sets were handled wrong because I couldn't tell bit
- counts from byte counts. Also, the bit array should be 256 / 8
- bytes long. Thank you, Gary!
-
- Removed unnecessary protoype for scm_char_set_copy.
-
-2001-07-16 Gary Houston <ghouston@arglist.com>
-
- * srfi-14.scm: export string->char-set!, not string-char-set!.
-
- * srfi-14.c (scm_char_set_ref, scm_char_set_cursor_next,
- scm_end_of_char_set_p): reject negative cursor values.
- (scm_list_to_char_set, scm_list_to_char_set_x): when reporting
- type error in list component, omit the position (was always 1).
-
-2001-07-16 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- (scm_char_set_map): Bug-fix: char-set-map was modifying the
- argument instead of the return value.
-
-2001-07-16 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * srfi-14.c: Allocate correct memory size for charsets (32 bytes),
- use this value for initializing and comparing charsets.
- (scm_char_set_hash): Use ``better'' hash algorithm which produces
- more values.
-
-2001-07-15 Gary Houston <ghouston@arglist.com>
-
- * srfi-14.c (scm_char_set_hash): recognise 0 instead of #f in the
- opt arg to give default bound, as in final spec. don't allow
- negative bounds.
- (scm_char_set_hash): bug fix: was overrunning the buffer and
- calculating based on garbage.
- (scm_char_set_eq, scm_char_set_leq): fix argument number in error
- reporting: wasn't incremented due to macro coding.
- (scm_char_set): report argument number in error reporting: was
- hard coded to 1. remove a couple of local variables.
-
-2001-07-13 Marius Vollmer <mvo@zagadka.ping.de>
-
- * srfi-2.scm (and-let*): Use `re-export-syntax' instead of
- `export-syntax'.
-
-2001-07-11 Gary Houston <ghouston@arglist.com>
-
- * srfi-14.c (s_scm_char_set_eq): bug fix: (char-set=) should
- return #t instead of giving wrong-number-of-arguments . take a
- single "rest" argument. use memcmp instead of a loop to compare
- the values.
- (s_scm_char_set_leq): similarly, (char-set<=) should return #t.
- take a single "rest" argument.
- srfi-14.h: update the declarations.
-
-2001-07-09 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * README: Cleanup.
-
-2001-07-06 Gary Houston <ghouston@arglist.com>
-
- * srfi-1.scm (iota, map, for-each, list-index, member, delete,
- delete!, assoc): roll back the previous change. instead place
- dummy definitions in a deprecated block at the beginning as in
- srfi-13.scm.
-
-2001-07-06 Rob Browning <rlb@defaultvalue.org>
-
- * srfi-19.scm (priv:locale-reader): don't need open-output-string.
-
-2001-07-03 Gary Houston <ghouston@arglist.com>
-
- * srfi-1.scm (iota, map, for-each, list-index, member, delete,
- delete!, assoc): don't export until the new bindings have been
- created. otherwise "export" thinks they are being re-exported and
- a deprecation warning is produced.
- (map-in-order): defined and exported, to support lists of unequal
- length.
-
-2001-07-03 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * srfi-1.scm (list-tabulate): Do not go into infinite loop for
- invalid arguments. Same fix for several other procedures (do not
- use zero?, use <= 0).
-
-2001-07-02 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * srfi-1.scm: Replaced calls to `map' in several procedures to
- calls to `map1'.
- (map, for-each): New procedures, extended from R5RS.
-
-2001-06-28 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * srfi-4.c: Minor cleanups.
-
- * srfi-14.c (scm_char_set_fold, scm_char_set_unfold)
- (scm_char_set_unfold_x, scm_char_set_for_each)
- (scm_char_set_map, scm_char_set_filter)
- (scm_char_set_filter_x, scm_char_set_count)
- (scm_char_set_every, scm_char_set_any): Replace calls to
- scm_apply() with the corresponding scm_call_N() functions.
-
- * srfi-14.c (scm_char_set_ref, scm_char_set_cursor_next)
- (scm_char_set_unfold, scm_char_set_unfold_x)
- (scm_char_set_map, scm_char_set_diff_plus_intersection)
- (scm_char_set_diff_plus_intersection_x): Replace deprecated macros
- SCM_LISTN with calls to scm_list_N().
-
- * srfi-13.c (scm_string_tabulate, scm_string_map)
- (scm_string_map_x, scm_string_unfold)
- (scm_string_unfold_right): Replace deprecated macros SCM_LISTN
- with calls to scm_list_N().
-
- * srfi-13.c (scm_string_any, scm_string_every),
- (scm_string_tabulate, scm_string_trim),
- (scm_string_trim_right, scm_string_trim_both),
- (scm_string_compare, scm_string_compare_ci),
- (scm_string_indexS, scm_string_index_right),
- (scm_string_skip, scm_string_skip_right, scm_string_count),
- (scm_string_map, scm_string_map_x, scm_string_fold),
- (scm_string_fold_right, scm_string_unfold),
- (scm_string_unfold_right, scm_string_for_each),
- (scm_string_filter, scm_string_delete): Replace calls to
- scm_apply() with the corresponding scm_call_N() functions.
-
-2001-06-27 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * Makefile.am: Added SRFI-4 files in various places.
-
- * srfi-4.c, srfi-4.h, srfi-4.scm: New files implementing SRFI-4.
-
-2001-06-26 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * srfi-13.c (scm_string_copyS, scm_string_take, scm_string_drop,
- scm_string_take_right, scm_string_drop_right, scm_string_trim,
- scm_string_trim_right, scm_string_trim_both, scm_string_tokenize):
- Use scm_mem2string instead of scm_makfromstr.
-
- (scm_reverse_list_to_string, string_titlecase_x): Prefer
- !SCM_<pred> over SCM_N<pred>.
-
-2001-06-25 Marius Vollmer <mvo@zagadka.ping.de>
-
- * srfi-8.scm: Use `re-export-syntax' to correctly re-export
- `receive'.
-
-2001-06-18 Matthias Koeppe <mkoeppe@mail.math.uni-magdeburg.de>
-
- The SRFI-19 implementation was completely broken. Already the
- reference implementation did not handle DST and time zones
- properly and relied on non-R5RS-isms like passing reals to
- `quotient'. For Guile, some additional fixes were needed because
- of the incomplete numeric tower implementation. See also
- srfi-19.test.
-
- * srfi-19.scm (date-zone-offset): Fixed typo in export clause.
- (add-duration): Renamed from priv:add-duration.
- (priv:time-normalize!): Handle fractional nanoseconds; remove
- duplicate definition.
- (priv:current-time-tai): Fixed typo.
- (time=?, time<=?): Fixed typos.
- (time-tai->time-utc, time-utc->time-tai,
- time-utc->time-monotonic): Use make-time-unnormalized instead of
- make-time when uninitialized time fields are used.
- (set-date-nanosecond!, set-date-second!, set-date-minute!,
- set-date-hour!, set-date-day!, set-date-month!, set-date-year!,
- set-date-zone-offset!): Define.
- (priv:local-tz-offset): Take an extra argument in order to handle
- DST effects.
- (time-utc->date, time-tai->date, time-monotonic->date): Handle the
- changed signature of priv:local-tz-offset. Don't pass non-integer
- arguments to quotient (non-R5RS, not supported by Guile).
- (date->time-utc): Ensure that seconds in a date structure are
- always exact integers. Handle DST properly.
- (current-date, julian-day->date, modified-julian-day->date):
- Handle the changed signature of priv:local-tz-offset.
- (julian-day->time-utc): Reverted earlier inexact->exact hack;
- make-time now handles inexact arguments.
- (priv:locale-print-time-zone): At least print the numerical time
- zone.
- (priv:integer-reader): Fixed named let iteration.
- (priv:read-directives): Use set-date-month! instead of
- priv:set-date-month! etc.
- (string->date): Handle DST properly.
-
-2001-06-14 Marius Vollmer <mvo@zagadka.ping.de>
-
- * srfi-13.scm: Prevent `export' from re-exporting core bindings.
-
-2001-06-07 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * srfi-14.c (charset_print): Mark unused parameters with
- SCM_UNUSED.
-
-2001-06-07 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * srfi-1.scm (fold, fold-pair): Fixed a buggy call to apply.
- (delete-duplicates): Now the first occurrence of an element is
- retained, as required.
- (member, assoc): Fixed wrong order of equality predicate
- application.
-
-2001-06-06 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * README: Update.
-
- * srfi-1.scm: New file.
-
-2001-06-04 Marius Vollmer <mvo@zagadka.ping.de>
-
- Added exception notice to all files.
-
-2001-05-31 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * srfi-14.scm, srfi-13.scm: Use `load-extension' for loading the
- shared library.
-
-2001-05-31 Michael Livshin <mlivshin@bigfoot.com>
-
- * Makefile.am (MKDEP): copied from libguile/Makefile.am, just in
- case.
- (CLEANFILES): added *.x (and removed from DISTCLEANFILES)
-
-2001-05-28 Michael Livshin <mlivshin@bigfoot.com>
-
- * srfi-19.scm: removed a stray open parenthesis. (thanks to
- Matthias Köppe for the report).
-
-2001-05-23 Rob Browning <rlb@cs.utexas.edu>
-
- * srfi-19.scm (:optional): renamed to optional to avoid reader
- keywords conflict. Time passes... Removed :optional altogether
- and just handle optional args directly. Thanks to Matthias Koeppe
- for the report of this and the two bits below.
- (priv:decode-julian-day-number): add inexact->exact for truncate
- result.
- (time-utc->date): add inexact->exact and floor so quotient will
- work.
-
-2001-05-22 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * README: Update, document available SRFIs.
-
-2001-05-21 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * srfi-19.scm, srfi-17.scm, srfi-16.scm, srfi-14.scm, srfi-13.scm,
- srfi-11.scm, srfi-10.scm, srfi-9.scm, srfi-8.scm, srfi-6.scm,
- srfi-2.scm: Use `cond-expand-provide' for providing features to
- `cond-expand'.
-
-2001-05-20 Marius Vollmer <mvo@zagadka.ping.de>
-
- * srfi-14.c (scm_c_init_srfi_14): Added "int" to declaration of
- `initialized'.
-
-2001-05-19 Marius Vollmer <mvo@zagadka.ping.de>
-
- Avoid using module operations from C.
-
- * srfi-13.c (scm_init_srfi_13_14): Removed.
- * srfi-14.h, srfi-14.c (scm_c_init_srfi_14): New. Contains
- initializations needed by C clients of srfi-14.
- (scm_init_srfi_13, scm_init_srfi_14): Call it.
- * srfi-13.scm: Call "scm_init_srfi_13" instead of
- "scm_init_srfi_13_14".
- * srfi-14.scm: Call "scm_init_srfi_14" instead of
- "scm_init_srfi_13_14".
-
-2001-05-16 Rob Browning <rlb@cs.utexas.edu>
-
- * srfi-19.scm (priv:integer-reader-exact): minor cleanups.
-
-2001-05-14 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * Makefile.am (srfi_DATA): Added srfi-16.scm.
-
- * srfi-16.scm: New file.
-
-2001-05-10 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * srfi-13.c (scm_string_delete): Logic was inversed for charset.
- Fixed.
-
-2001-05-08 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * srfi-13.c (scm_string_copyS): Fixed nasty bug.
-
-2001-05-05 Rob Browning <rlb@cs.utexas.edu>
-
- * Makefile.am (srfi_DATA): added srfi-19.scm.
-
- * srfi-19.scm: New file - time/date SRFI. Thanks to Will
- Fitzgerald.
-
-2001-05-02 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * srfi-14.c, srfi-13.c: Added @bullet to various @itemize lists.
-
- * srfi-10.scm: Typo fix.
-
-2001-05-02 Rob Browning <rlb@cs.utexas.edu>
-
- * srfi-11.scm (let-values): fix (a b c . d) case. Thanks Martin.
-
-2001-05-02 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * Makefile.am (srfi_DATA): Added srfi-10.scm and srfi-17.scm.
-
- * srfi-10.scm: New file.
-
- * srfi-17.scm: New file, contributed by Matthias Koeppe. Thanks a
- lot!
- Added `Commentary:' tag.
-
- * srfi-9.scm: Added `Commentary:' tag.
-
-2001-04-27 Rob Browning <rlb@cs.utexas.edu>
-
- * srfi-13.h
- (scm_reverse_string_concatenate): renamed to
- scm_string_concatentate_reverse.
- (scm_reverse_string_concatenate_shared): renamed to
- scm_string_concatenate_reverse_shared.
-
-2001-04-27 Gary Houston <ghouston@arglist.com>
-
- * srfi-13.c (scm_init_srfi_13), srfi-14.c (scm_init_srfi_14):
- add "srfi/" to lines including .x files so they can be found
- when build_dir != src_dir.
-
-2001-04-27 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * Makefile.am (srfi_DATA): Added srfi-9.scm.
-
- * srfi-9.scm: New file. Exports `define-record-type'.
-
-2001-04-26 Rob Browning <rlb@cs.utexas.edu>
-
- * Makefile.am (srfi_DATA): added srfi-6.scm.
- (srfi_DATA): added srfi-11.scm.
- (srfi_DATA): added srfi-8.scm.
- (srfi_DATA): added srfi-2.scm.
-
- * srfi-11.scm: new file - exports let-values and let*-values.
-
- * srfi-6.scm: new file - guile already has srfi-6 procedures
- loaded by default, so this is a dummy file right now.
-
- * srfi-8.scm: new file - exports receive.
-
- * srfi-2.scm: new file - just use/export (ice-9 and-let-star)
-
-2001-04-26 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- Changed two procedure names to match final SRFI document. Thanks
- to Rob Browning for spotting this.
-
- * srfi-13.scm (string-concatenate-reverse),
- (string-concatenate-reverse/shared): Rename from
- reverse-string-concatenate[/shared].
-
- * srfi-13.c (scm_string_concatenate_reverse_shared): Renamed from
- scm_reverse_string_concatenate_shared.
- (scm_string_concatenate_reverse): Renamed from
- scm_reverse_string_concatenate.
-
-2001-04-25 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * configure.in, autogen.sh: Removed.
-
- * srfi-13.c (scm_string_replace): Take sizeof (char) into account
- when using memmove().
-
- * srfi-14.h: Added prototypes for all exported procedures..
-
- * srfi-13.c: Include srfi-13.h
-
- * srfi-13.h: New file containing the prototypes.
-
- * Makefile.am: Removed guile-srfi.texi and info_TEXINFOS variable.
- (libguile_srfi_srfi_13_14_la_SOURCES): Added srfi-14.h, so it gets
- distributed.
- (libguile_srfi_srfi_13_14_la_SOURCES): Added srfi-13.h.
-
-2001-04-24 Neil Jerram <neil@ossau.uklinux.net>
-
- * Makefile.am: Fixed "srf-14.x" typo.
-
-2001-04-24 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * guile-srfi.texi: Removed, because merged with the GRM.
-
- * guile-srfi.texi: The docs are now up to date with the
- implementation and have new introductory material.
-
-2001-04-23 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- Integrated the guile-srfi package into the Guile distribution.
-
- * srfi-13.c: All procedures so specified in the SRFI now accept
- character set arguments.
-
- * Makefile.am: Snarfed some variables from the guile-readline
- directory.
-
- * srfi-14.c, srfi-14.h: Add prefix SCM_ to exported macros.
-
- * srfi-13.scm, srfi-14.scm, srfi-13.c, srfi-14.c, srfi-14.h,
- configure.in, Makefile.am: Added FSF copyright and Guile license
- information.
-
- * srfi-13.c, srfi-14.c: Include srfi-14.h.
- (scm_init_srfi_13_14): Initialize the complete module, if not
- already done so.
-
- * srfi-14.h: New file.
-
- * srfi-13.scm, srfi-14.scm: Load new combined library.
-
- * Makefile.am: Build only one library,
- `libguile-srfi-srfi-13-14.la'
-
-2001-04-04 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * guile-srfi.texi: Integrated the SRFI-14 documentation.
-
- * srfi-14.c, srfi-14.scm: Made the procedures and variables
- compliant to the final SRFI document.
-
- * Renamed the package to guile-srfi.
-
-2001-04-03 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * NEWS: New section for 0.0.3.
-
- * configure.in, README, guile-srfi-13.texi: Bumped version number
- to 0.0.3.
-
- * Released version 0.0.2.
-
- * Makefile.am: Added rules for builing the SRFI-14 library.
-
- * srfi-14.c, srfi-14.scm: New files, implementing SRFI-14
- (character set library).
-
-2001-03-27 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * README: Updated procedure and incompatibility list.
-
- * srfi-13.c (string_upcase_x, scm_string_upcase_xS),
- (scm_string_upcase, string_downcase_x, scm_string_downcase_xS),
- (scm_string_downcaseS, string_titlecase_x),
- (scm_string_titlecase_x, scm_string_titlecase),
- (scm_string_fill_xS, scm_string_copyS, scm_string_to_listS): New
- procedures.
-
- * srfi-13.scm: Export new case mapping procedures.
-
- * guile-srfi-13.texi (What cannot be done): Removed case mapping
- procedures from incompatibility list.
- (Case Mapping): New section for case mapping procedures.
-
-2001-03-26 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * NEWS: New section for 0.0.2
-
- * configure.in, README, guile-srfi-13.texi: Bumbed version number
- to 0.0.2
-
- * Released version 0.0.1.
-
- * README: Made procedure list up-to-date.
-
- * guile-srfi-13.texi: Fixed typos, completed reference and added
- introductory blurb.
-
- * srfi-13.c, srfi-13.scm: Filled in the last missing pieces.
-
-2001-03-22 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * Started guile-srfi-13 package. Files are copied from the
- guile-gdbm and slightly modified.
diff --git a/srfi/Makefile.am b/srfi/Makefile.am
deleted file mode 100644
index b46d2acbb..000000000
--- a/srfi/Makefile.am
+++ /dev/null
@@ -1,75 +0,0 @@
-## Process this file with Automake to create Makefile.in
-##
-## Copyright (C) 2001 Free Software Foundation, Inc.
-##
-## This file is part of GUILE.
-##
-## GUILE 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.
-##
-## GUILE 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 GUILE; see the file COPYING. If not, write
-## to the Free Software Foundation, Inc., 59 Temple Place, Suite
-## 330, Boston, MA 02111-1307 USA
-
-AUTOMAKE_OPTIONS = gnu
-
-## Prevent automake from adding extra -I options
-DEFS = @DEFS@ @EXTRA_DEFS@
-## Check for headers in $(srcdir)/.., so that #include
-## <libguile/MUMBLE.h> will find MUMBLE.h in this dir when we're
-## building.
-INCLUDES = -I.. -I$(srcdir)/..
-
-
-lib_LTLIBRARIES = libguile-srfi-srfi-13-14.la libguile-srfi-srfi-4.la
-
-BUILT_SOURCES = srfi-13.x srfi-14.x srfi-4.x
-
-libguile_srfi_srfi_4_la_SOURCES = srfi-4.x srfi-4.c srfi-4.h
-libguile_srfi_srfi_4_la_LIBADD = ../libguile/libguile.la
-libguile_srfi_srfi_4_la_LDFLAGS = -export-dynamic \
- -version-info @LIBGUILE_SRFI_SRFI_4_INTERFACE@
-
-libguile_srfi_srfi_13_14_la_SOURCES = srfi-13.x srfi-13.c srfi-14.x srfi-14.c\
- srfi-13.h srfi-14.h
-libguile_srfi_srfi_13_14_la_LIBADD = ../libguile/libguile.la
-libguile_srfi_srfi_13_14_la_LDFLAGS = -export-dynamic \
- -version-info @LIBGUILE_SRFI_SRFI_13_14_INTERFACE@
-
-srfidir = $(datadir)/guile/$(VERSION)/srfi
-srfi_DATA = srfi-1.scm \
- srfi-2.scm \
- srfi-4.scm \
- srfi-6.scm \
- srfi-8.scm \
- srfi-9.scm \
- srfi-10.scm \
- srfi-11.scm \
- srfi-13.scm \
- srfi-14.scm \
- srfi-16.scm \
- srfi-17.scm \
- srfi-19.scm
-
-EXTRA_DIST = $(srfi_DATA)
-ETAGS_ARGS = $(srfi_DATA)
-
-GUILE_SNARF = ../libguile/guile-snarf
-
-MKDEP = gcc -M -MG $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-
-snarfcppopts = $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-
-SUFFIXES = .x
-.c.x:
- $(GUILE_SNARF) -o $@ $< $(snarfcppopts)
-
-CLEANFILES = *.x
diff --git a/srfi/README b/srfi/README
deleted file mode 100644
index c9d47ee54..000000000
--- a/srfi/README
+++ /dev/null
@@ -1,76 +0,0 @@
-This directory includes most of Guile's SRFI support. -*- text -*-
-
-For more details about what SRFI means, and what the various numbers
-stand for, please refer to the SRFI homepage at
-
- http://srfi.schemers.org
-
-SRFI-0: cond-expand
-
- Supported by default, no module needs to get used.
-
-SRFI-1: List Library
-
- A full toolbox of list processing procedures. (use-modules (srfi
- srfi-1)) will make them available for use.
-
-SRFI-2: and-let*
-
- (use-modules (srfi srfi-2)) to make and-let* available.
-
-SRFI-6: open-input-string, open-output-string and get-output-string
-
- (use-modules (srfi srfi-6)) to make these available. (Currently,
- these procedures are available without using the module, but the
- procedures might be factored out of the core library in the
- future.)
-
-SRFI-8: receive
-
- (use-modules (srfi srfi-8)) to make receive available.
-
-SRFI-9: define-record-type
-
- A mechanism for defining record types. (use-modules (srfi srfi-9))
- makes this syntactic form available.
-
-SRFI-10: #,()
-
- The hash-comma reader extension. (use-modules (srfi srfi-10))
- activates the extension.
-
-SRFI-11: let-values and let-values*
-
- Syntactic extensions for handling multiple values. (use-modules
- (srfi srfi-11)) makes these syntactic forms available.
-
-SRFI-13: string library
-
- A lot of (more or less) useful string processing procedures.
- (use-modules (srfi srfi-13)) loads the procedures.
-
-SRFI-14: character-set library
-
- Character-set library. (use-modules (srfi srfi-14)) loads the
- procedures and standard variables.
-
-SRFI-16: case-lambda
-
- Syntactic form which permits writing functions acting different
- according to the number of arguments passed. (use-modules (srfi
- srfi-16)) makes this syntactic form available.
-
-SRFI-17: Generalized set!
-
- Guile supports generalized set! by default, but this module makes it
- fully compliant to the SRFI. (use-modules (srfi srfi-17)) loads the
- procedures.
-
-SRFI-19: Time Data Types and Procedures
-
- A lot of data types and procedures for dealing with times and
- dates. (use-modules (srfi srfi-19)) loads the procedures.
-
-SRFI-23: Error reporting mechanism
-
- Guile fully supports this SRFI. No need to load any module.
diff --git a/srfi/srfi-1.scm b/srfi/srfi-1.scm
deleted file mode 100644
index a06e8462e..000000000
--- a/srfi/srfi-1.scm
+++ /dev/null
@@ -1,1056 +0,0 @@
-;;; srfi-1.scm --- List Library
-
-;; Copyright (C) 2001, 2002 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, 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 GUILE.
-;;
-;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;; code from other Free Software Foundation releases into a copy of
-;; GUILE, 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 GUILE, it is your choice
-;; whether to permit this exception to apply to your modifications.
-;; If you do not wish that, delete this exception notice.
-
-;;; Author: Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-;;; Date: 2001-06-06
-
-;;; Commentary:
-
-;; This is an implementation of SRFI-1 (List Library).
-;;
-;; All procedures defined in SRFI-1, which are not already defined in
-;; the Guile core library, are exported. The procedures in this
-;; implementation work, but they have not been tuned for speed or
-;; memory usage.
-;;
-;; This module is fully documented in the Guile Reference Manual.
-
-;;; Code:
-
-(define-module (srfi srfi-1)
- :use-module (ice-9 session)
- :use-module (ice-9 receive))
-
-(export
-;;; Constructors
- ;; cons <= in the core
- ;; list <= in the core
- xcons
- ;; cons* <= in the core
- ;; make-list <= in the core
- list-tabulate
- ;; list-copy <= in the core
- circular-list
- iota ; Extended.
-
-;;; Predicates
- proper-list?
- circular-list?
- dotted-list?
- ;; pair? <= in the core
- ;; null? <= in the core
- null-list?
- not-pair?
- list=
-
-;;; Selectors
- ;; car <= in the core
- ;; cdr <= in the core
- ;; caar <= in the core
- ;; cadr <= in the core
- ;; cdar <= in the core
- ;; cddr <= in the core
- ;; caaar <= in the core
- ;; caadr <= in the core
- ;; cadar <= in the core
- ;; caddr <= in the core
- ;; cdaar <= in the core
- ;; cdadr <= in the core
- ;; cddar <= in the core
- ;; cdddr <= in the core
- ;; caaaar <= in the core
- ;; caaadr <= in the core
- ;; caadar <= in the core
- ;; caaddr <= in the core
- ;; cadaar <= in the core
- ;; cadadr <= in the core
- ;; caddar <= in the core
- ;; cadddr <= in the core
- ;; cdaaar <= in the core
- ;; cdaadr <= in the core
- ;; cdadar <= in the core
- ;; cdaddr <= in the core
- ;; cddaar <= in the core
- ;; cddadr <= in the core
- ;; cdddar <= in the core
- ;; cddddr <= in the core
- ;; list-ref <= in the core
- first
- second
- third
- fourth
- fifth
- sixth
- seventh
- eighth
- ninth
- tenth
- car+cdr
- take
- drop
- take-right
- drop-right
- take!
- drop-right!
- split-at
- split-at!
- last
- ;; last-pair <= in the core
-
-;;; Miscelleneous: length, append, concatenate, reverse, zip & count
- ;; length <= in the core
- length+
- ;; append <= in the core
- ;; append! <= in the core
- concatenate
- concatenate!
- ;; reverse <= in the core
- ;; reverse! <= in the core
- append-reverse
- append-reverse!
- zip
- unzip1
- unzip2
- unzip3
- unzip4
- unzip5
- count
-
-;;; Fold, unfold & map
- fold
- fold-right
- pair-fold
- pair-fold-right
- reduce
- reduce-right
- unfold
- unfold-right
- map ; Extended.
- for-each ; Extended.
- append-map
- append-map!
- map!
- map-in-order ; Extended.
- pair-for-each
- filter-map
-
-;;; Filtering & partitioning
- filter
- partition
- remove
- filter!
- partition!
- remove!
-
-;;; Searching
- find
- find-tail
- take-while
- take-while!
- drop-while
- span
- span!
- break
- break!
- any
- every
- list-index ; Extended.
- member ; Extended.
- ;; memq <= in the core
- ;; memv <= in the core
-
-;;; Deletion
- delete ; Extended.
- delete! ; Extended.
- delete-duplicates
- delete-duplicates!
-
-;;; Association lists
- assoc ; Extended.
- ;; assq <= in the core
- ;; assv <= in the core
- alist-cons
- alist-copy
- alist-delete
- alist-delete!
-
-;;; Set operations on lists
- lset<=
- lset=
- lset-adjoin
- lset-union
- lset-intersection
- lset-difference
- lset-xor
- lset-diff+intersection
- lset-union!
- lset-intersection!
- lset-difference!
- lset-xor!
- lset-diff+intersection!
-
-;;; Primitive side-effects
- ;; set-car! <= in the core
- ;; set-cdr! <= in the core
- )
-
-(cond-expand-provide (current-module) '(srfi-1))
-
-;;; Constructors
-
-(define (xcons d a)
- (cons a d))
-
-;; internal helper, similar to (scsh utilities) check-arg.
-(define (check-arg-type pred arg caller)
- (if (pred arg)
- arg
- (scm-error 'wrong-type-arg caller
- "Wrong type argument: ~S" (list arg) '())))
-
-;; the srfi spec doesn't seem to forbid inexact integers.
-(define (non-negative-integer? x) (and (integer? x) (>= x 0)))
-
-(define (list-tabulate n init-proc)
- (check-arg-type non-negative-integer? n "list-tabulate")
- (let lp ((n n) (acc '()))
- (if (<= n 0)
- acc
- (lp (- n 1) (cons (init-proc (- n 1)) acc)))))
-
-(define (circular-list elt1 . rest)
- (let ((start (cons elt1 '())))
- (let lp ((r rest) (p start))
- (if (null? r)
- (begin
- (set-cdr! p start)
- start)
- (begin
- (set-cdr! p (cons (car r) '()))
- (lp (cdr r) (cdr p)))))))
-
-(define (iota count . rest)
- (check-arg-type non-negative-integer? count "iota")
- (let ((start (if (pair? rest) (car rest) 0))
- (step (if (and (pair? rest) (pair? (cdr rest))) (cadr rest) 1)))
- (let lp ((n 0) (acc '()))
- (if (= n count)
- (reverse! acc)
- (lp (+ n 1) (cons (+ start (* n step)) acc))))))
-
-;;; Predicates
-
-(define (proper-list? x)
- (list? x))
-
-(define (circular-list? x)
- (if (not-pair? x)
- #f
- (let lp ((hare (cdr x)) (tortoise x))
- (if (not-pair? hare)
- #f
- (let ((hare (cdr hare)))
- (if (not-pair? hare)
- #f
- (if (eq? hare tortoise)
- #t
- (lp (cdr hare) (cdr tortoise)))))))))
-
-(define (dotted-list? x)
- (cond
- ((null? x) #f)
- ((not-pair? x) #t)
- (else
- (let lp ((hare (cdr x)) (tortoise x))
- (cond
- ((null? hare) #f)
- ((not-pair? hare) #t)
- (else
- (let ((hare (cdr hare)))
- (cond
- ((null? hare) #f)
- ((not-pair? hare) #t)
- ((eq? hare tortoise) #f)
- (else
- (lp (cdr hare) (cdr tortoise)))))))))))
-
-(define (null-list? x)
- (cond
- ((proper-list? x)
- (null? x))
- ((circular-list? x)
- #f)
- (else
- (error "not a proper list in null-list?"))))
-
-(define (not-pair? x)
- (not (pair? x)))
-
-(define (list= elt= . rest)
- (define (lists-equal a b)
- (let lp ((a a) (b b))
- (cond ((null? a)
- (null? b))
- ((null? b)
- #f)
- (else
- (and (elt= (car a) (car b))
- (lp (cdr a) (cdr b)))))))
- (or (null? rest)
- (let ((first (car rest)))
- (let lp ((lists rest))
- (or (null? lists)
- (and (lists-equal first (car lists))
- (lp (cdr lists))))))))
-
-;;; Selectors
-
-(define first car)
-(define second cadr)
-(define third caddr)
-(define fourth cadddr)
-(define (fifth x) (car (cddddr x)))
-(define (sixth x) (cadr (cddddr x)))
-(define (seventh x) (caddr (cddddr x)))
-(define (eighth x) (cadddr (cddddr x)))
-(define (ninth x) (car (cddddr (cddddr x))))
-(define (tenth x) (cadr (cddddr (cddddr x))))
-
-(define (car+cdr x) (values (car x) (cdr x)))
-
-(define (take x i)
- (let lp ((n i) (l x) (acc '()))
- (if (<= n 0)
- (reverse! acc)
- (lp (- n 1) (cdr l) (cons (car l) acc)))))
-(define (drop x i)
- (let lp ((n i) (l x))
- (if (<= n 0)
- l
- (lp (- n 1) (cdr l)))))
-(define (take-right flist i)
- (let lp ((n i) (l flist))
- (if (<= n 0)
- (let lp0 ((s flist) (l l))
- (if (null? l)
- s
- (lp0 (cdr s) (cdr l))))
- (lp (- n 1) (cdr l)))))
-
-(define (drop-right flist i)
- (let lp ((n i) (l flist))
- (if (<= n 0)
- (let lp0 ((s flist) (l l) (acc '()))
- (if (null? l)
- (reverse! acc)
- (lp0 (cdr s) (cdr l) (cons (car s) acc))))
- (lp (- n 1) (cdr l)))))
-
-(define (take! x i)
- (if (<= i 0)
- '()
- (let lp ((n (- i 1)) (l x))
- (if (<= n 0)
- (begin
- (set-cdr! l '())
- x)
- (lp (- n 1) (cdr l))))))
-
-(define (drop-right! flist i)
- (if (<= i 0)
- flist
- (let lp ((n (+ i 1)) (l flist))
- (if (<= n 0)
- (let lp0 ((s flist) (l l))
- (if (null? l)
- (begin
- (set-cdr! s '())
- flist)
- (lp0 (cdr s) (cdr l))))
- (if (null? l)
- '()
- (lp (- n 1) (cdr l)))))))
-
-(define (split-at x i)
- (let lp ((l x) (n i) (acc '()))
- (if (<= n 0)
- (values (reverse! acc) l)
- (lp (cdr l) (- n 1) (cons (car l) acc)))))
-
-(define (split-at! x i)
- (if (<= i 0)
- (values '() x)
- (let lp ((l x) (n (- i 1)))
- (if (<= n 0)
- (let ((tmp (cdr l)))
- (set-cdr! l '())
- (values x tmp))
- (lp (cdr l) (- n 1))))))
-
-(define (last pair)
- (car (last-pair pair)))
-
-;;; Miscelleneous: length, append, concatenate, reverse, zip & count
-
-(define (length+ clist)
- (if (null? clist)
- 0
- (let lp ((hare (cdr clist)) (tortoise clist) (l 1))
- (if (null? hare)
- l
- (let ((hare (cdr hare)))
- (if (null? hare)
- (+ l 1)
- (if (eq? hare tortoise)
- #f
- (lp (cdr hare) (cdr tortoise) (+ l 2)))))))))
-
-(define (concatenate l-o-l)
- (let lp ((l l-o-l) (acc '()))
- (if (null? l)
- (reverse! acc)
- (let lp0 ((ll (car l)) (acc acc))
- (if (null? ll)
- (lp (cdr l) acc)
- (lp0 (cdr ll) (cons (car ll) acc)))))))
-
-(define (concatenate! l-o-l)
- (let lp0 ((l-o-l l-o-l))
- (cond
- ((null? l-o-l)
- '())
- ((null? (car l-o-l))
- (lp0 (cdr l-o-l)))
- (else
- (let ((result (car l-o-l)) (tail (last-pair (car l-o-l))))
- (let lp ((l (cdr l-o-l)) (ntail tail))
- (if (null? l)
- result
- (begin
- (set-cdr! ntail (car l))
- (lp (cdr l) (last-pair ntail))))))))))
-
-
-(define (append-reverse rev-head tail)
- (let lp ((l rev-head) (acc tail))
- (if (null? l)
- acc
- (lp (cdr l) (cons (car l) acc)))))
-
-(define (append-reverse! rev-head tail)
- (append-reverse rev-head tail)) ; XXX:optimize
-
-(define (zip clist1 . rest)
- (let lp ((l (cons clist1 rest)) (acc '()))
- (if (any null? l)
- (reverse! acc)
- (lp (map1 cdr l) (cons (map1 car l) acc)))))
-
-
-(define (unzip1 l)
- (map1 first l))
-(define (unzip2 l)
- (values (map1 first l) (map1 second l)))
-(define (unzip3 l)
- (values (map1 first l) (map1 second l) (map1 third l)))
-(define (unzip4 l)
- (values (map1 first l) (map1 second l) (map1 third l) (map1 fourth l)))
-(define (unzip5 l)
- (values (map1 first l) (map1 second l) (map1 third l) (map1 fourth l)
- (map1 fifth l)))
-
-(define (count pred clist1 . rest)
- (if (null? rest)
- (count1 pred clist1)
- (let lp ((lists (cons clist1 rest)))
- (cond ((any1 null? lists)
- 0)
- (else
- (if (apply pred (map1 car lists))
- (+ 1 (lp (map1 cdr lists)))
- (lp (map1 cdr lists))))))))
-
-(define (count1 pred clist)
- (let lp ((result 0) (rest clist))
- (if (null? rest)
- result
- (if (pred (car rest))
- (lp (+ 1 result) (cdr rest))
- (lp result (cdr rest))))))
-
-;;; Fold, unfold & map
-
-(define (fold kons knil list1 . rest)
- (if (null? rest)
- (let f ((knil knil) (list1 list1))
- (if (null? list1)
- knil
- (f (kons (car list1) knil) (cdr list1))))
- (let f ((knil knil) (lists (cons list1 rest)))
- (if (any null? lists)
- knil
- (let ((cars (map1 car lists))
- (cdrs (map1 cdr lists)))
- (f (apply kons (append! cars (list knil))) cdrs))))))
-
-(define (fold-right kons knil clist1 . rest)
- (if (null? rest)
- (let f ((list1 clist1))
- (if (null? list1)
- knil
- (kons (car list1) (f (cdr list1)))))
- (let f ((lists (cons clist1 rest)))
- (if (any null? lists)
- knil
- (apply kons (append! (map1 car lists) (list (f (map1 cdr lists)))))))))
-
-(define (pair-fold kons knil clist1 . rest)
- (if (null? rest)
- (let f ((knil knil) (list1 clist1))
- (if (null? list1)
- knil
- (let ((tail (cdr list1)))
- (f (kons list1 knil) tail))))
- (let f ((knil knil) (lists (cons clist1 rest)))
- (if (any null? lists)
- knil
- (let ((tails (map1 cdr lists)))
- (f (apply kons (append! lists (list knil))) tails))))))
-
-
-(define (pair-fold-right kons knil clist1 . rest)
- (if (null? rest)
- (let f ((list1 clist1))
- (if (null? list1)
- knil
- (kons list1 (f (cdr list1)))))
- (let f ((lists (cons clist1 rest)))
- (if (any null? lists)
- knil
- (apply kons (append! lists (list (f (map1 cdr lists)))))))))
-
-(define (unfold p f g seed . rest)
- (let ((tail-gen (if (pair? rest)
- (if (pair? (cdr rest))
- (scm-error 'wrong-number-of-args
- "unfold" "too many arguments" '() '())
- (car rest))
- (lambda (x) '()))))
- (let uf ((seed seed))
- (if (p seed)
- (tail-gen seed)
- (cons (f seed)
- (uf (g seed)))))))
-
-(define (unfold-right p f g seed . rest)
- (let ((tail (if (pair? rest)
- (if (pair? (cdr rest))
- (scm-error 'wrong-number-of-args
- "unfold-right" "too many arguments" '()
- '())
- (car rest))
- '())))
- (let uf ((seed seed) (lis tail))
- (if (p seed)
- lis
- (uf (g seed) (cons (f seed) lis))))))
-
-(define (reduce f ridentity lst)
- (fold f ridentity lst))
-
-(define (reduce-right f ridentity lst)
- (fold-right f ridentity lst))
-
-
-;; Internal helper procedure. Map `f' over the single list `ls'.
-;;
-(define (map1 f ls)
- (if (null? ls)
- ls
- (let ((ret (list (f (car ls)))))
- (let lp ((ls (cdr ls)) (p ret)) ; tail pointer
- (if (null? ls)
- ret
- (begin
- (set-cdr! p (list (f (car ls))))
- (lp (cdr ls) (cdr p))))))))
-
-;; This `map' is extended from the standard `map'. It allows argument
-;; lists of different length, so that the shortest list determines the
-;; number of elements processed.
-;;
-(define (map f list1 . rest)
- (if (null? rest)
- (map1 f list1)
- (let lp ((l (cons list1 rest)))
- (if (any1 null? l)
- '()
- (cons (apply f (map1 car l)) (lp (map1 cdr l)))))))
-
-;; extended to lists of unequal length.
-(define map-in-order map)
-
-;; This `for-each' is extended from the standard `for-each'. It
-;; allows argument lists of different length, so that the shortest
-;; list determines the number of elements processed.
-;;
-(define (for-each f list1 . rest)
- (if (null? rest)
- (let lp ((l list1))
- (if (null? l)
- (if #f #f) ; Return unspecified value.
- (begin
- (f (car l))
- (lp (cdr l)))))
- (let lp ((l (cons list1 rest)))
- (if (any1 null? l)
- (if #f #f)
- (begin
- (apply f (map1 car l))
- (lp (map1 cdr l)))))))
-
-
-(define (append-map f clist1 . rest)
- (if (null? rest)
- (let lp ((l clist1))
- (if (null? l)
- '()
- (append (f (car l)) (lp (cdr l)))))
- (let lp ((l (cons clist1 rest)))
- (if (any1 null? l)
- '()
- (append (apply f (map1 car l)) (lp (map1 cdr l)))))))
-
-
-(define (append-map! f clist1 . rest)
- (if (null? rest)
- (let lp ((l clist1))
- (if (null? l)
- '()
- (append! (f (car l)) (lp (cdr l)))))
- (let lp ((l (cons clist1 rest)))
- (if (any1 null? l)
- '()
- (append! (apply f (map1 car l)) (lp (map1 cdr l)))))))
-
-(define (map! f list1 . rest)
- (if (null? rest)
- (let lp ((l list1))
- (if (null? l)
- '()
- (begin
- (set-car! l (f (car l)))
- (set-cdr! l (lp (cdr l)))
- l)))
- (let lp ((l (cons list1 rest)) (res list1))
- (if (any1 null? l)
- '()
- (begin
- (set-car! res (apply f (map1 car l)))
- (set-cdr! res (lp (map1 cdr l) (cdr res)))
- res)))))
-
-(define (pair-for-each f clist1 . rest)
- (if (null? rest)
- (let lp ((l clist1))
- (if (null? l)
- (if #f #f)
- (begin
- (f l)
- (lp (cdr l)))))
- (let lp ((l (cons clist1 rest)))
- (if (any1 null? l)
- (if #f #f)
- (begin
- (apply f l)
- (lp (map1 cdr l)))))))
-
-(define (filter-map f clist1 . rest)
- (if (null? rest)
- (let lp ((l clist1))
- (if (null? l)
- '()
- (let ((res (f (car l))))
- (if res
- (cons res (lp (cdr l)))
- (lp (cdr l))))))
- (let lp ((l (cons clist1 rest)))
- (if (any1 null? l)
- '()
- (let ((res (apply f (map1 car l))))
- (if res
- (cons res (lp (map1 cdr l)))
- (lp (map1 cdr l))))))))
-
-;;; Filtering & partitioning
-
-(define (filter pred list)
- (check-arg-type list? list "filter") ; reject circular lists.
- (letrec ((filiter (lambda (pred rest result)
- (if (null? rest)
- (reverse! result)
- (filiter pred (cdr rest)
- (cond ((pred (car rest))
- (cons (car rest) result))
- (else
- result)))))))
- (filiter pred list '())))
-
-(define (partition pred list)
- (if (null? list)
- (values '() '())
- (if (pred (car list))
- (receive (in out) (partition pred (cdr list))
- (values (cons (car list) in) out))
- (receive (in out) (partition pred (cdr list))
- (values in (cons (car list) out))))))
-
-(define (remove pred list)
- (filter (lambda (x) (not (pred x))) list))
-
-(define (filter! pred list)
- (filter pred list)) ; XXX:optimize
-
-(define (partition! pred list)
- (partition pred list)) ; XXX:optimize
-
-(define (remove! pred list)
- (remove pred list)) ; XXX:optimize
-
-;;; Searching
-
-(define (find pred clist)
- (if (null? clist)
- #f
- (if (pred (car clist))
- (car clist)
- (find pred (cdr clist)))))
-
-(define (find-tail pred clist)
- (if (null? clist)
- #f
- (if (pred (car clist))
- clist
- (find-tail pred (cdr clist)))))
-
-(define (take-while pred ls)
- (cond ((null? ls) '())
- ((not (pred (car ls))) '())
- (else
- (let ((result (list (car ls))))
- (let lp ((ls (cdr ls)) (p result))
- (cond ((null? ls) result)
- ((not (pred (car ls))) result)
- (else
- (set-cdr! p (list (car ls)))
- (lp (cdr ls) (cdr p)))))))))
-
-(define (take-while! pred clist)
- (take-while pred clist)) ; XXX:optimize
-
-(define (drop-while pred clist)
- (if (null? clist)
- '()
- (if (pred (car clist))
- (drop-while pred (cdr clist))
- clist)))
-
-(define (span pred clist)
- (if (null? clist)
- (values '() '())
- (if (pred (car clist))
- (receive (first last) (span pred (cdr clist))
- (values (cons (car clist) first) last))
- (values '() clist))))
-
-(define (span! pred list)
- (span pred list)) ; XXX:optimize
-
-(define (break pred clist)
- (if (null? clist)
- (values '() '())
- (if (pred (car clist))
- (values '() clist)
- (receive (first last) (break pred (cdr clist))
- (values (cons (car clist) first) last)))))
-
-(define (break! pred list)
- (break pred list)) ; XXX:optimize
-
-(define (any pred ls . lists)
- (if (null? lists)
- (any1 pred ls)
- (let lp ((lists (cons ls lists)))
- (cond ((any1 null? lists)
- #f)
- ((any1 null? (map1 cdr lists))
- (apply pred (map1 car lists)))
- (else
- (or (apply pred (map1 car lists)) (lp (map1 cdr lists))))))))
-
-(define (any1 pred ls)
- (let lp ((ls ls))
- (cond ((null? ls)
- #f)
- ((null? (cdr ls))
- (pred (car ls)))
- (else
- (or (pred (car ls)) (lp (cdr ls)))))))
-
-(define (every pred ls . lists)
- (if (null? lists)
- (every1 pred ls)
- (let lp ((lists (cons ls lists)))
- (cond ((any1 null? lists)
- #t)
- ((any1 null? (map1 cdr lists))
- (apply pred (map1 car lists)))
- (else
- (and (apply pred (map1 car lists)) (lp (map1 cdr lists))))))))
-
-(define (every1 pred ls)
- (let lp ((ls ls))
- (cond ((null? ls)
- #t)
- ((null? (cdr ls))
- (pred (car ls)))
- (else
- (and (pred (car ls)) (lp (cdr ls)))))))
-
-(define (list-index pred clist1 . rest)
- (if (null? rest)
- (let lp ((l clist1) (i 0))
- (if (null? l)
- #f
- (if (pred (car l))
- i
- (lp (cdr l) (+ i 1)))))
- (let lp ((lists (cons clist1 rest)) (i 0))
- (cond ((any1 null? lists)
- #f)
- ((apply pred (map1 car lists)) i)
- (else
- (lp (map1 cdr lists) (+ i 1)))))))
-
-(define (member x list . rest)
- (let ((l= (if (pair? rest) (car rest) equal?)))
- (let lp ((l list))
- (if (null? l)
- #f
- (if (l= x (car l))
- l
- (lp (cdr l)))))))
-
-;;; Deletion
-
-(define (delete x list . rest)
- (let ((l= (if (pair? rest) (car rest) equal?)))
- (let lp ((l list))
- (if (null? l)
- '()
- (if (l= (car l) x)
- (lp (cdr l))
- (cons (car l) (lp (cdr l))))))))
-
-(define (delete! x list . rest)
- (let ((l= (if (pair? rest) (car rest) equal?)))
- (delete x list l=))) ; XXX:optimize
-
-(define (delete-duplicates list . rest)
- (let ((l= (if (pair? rest) (car rest) equal?)))
- (let lp0 ((l1 list))
- (if (null? l1)
- '()
- (if (let lp1 ((l2 (cdr l1)))
- (if (null? l2)
- #f
- (if (l= (car l1) (car l2))
- #t
- (lp1 (cdr l2)))))
- (lp0 (cdr l1))
- (cons (car l1) (lp0 (cdr l1))))))))
-
-(define (delete-duplicates list . rest)
- (let ((l= (if (pair? rest) (car rest) equal?)))
- (let lp ((list list))
- (if (null? list)
- '()
- (cons (car list) (lp (delete (car list) (cdr list) l=)))))))
-
-(define (delete-duplicates! list . rest)
- (let ((l= (if (pair? rest) (car rest) equal?)))
- (delete-duplicates list l=))) ; XXX:optimize
-
-;;; Association lists
-
-(define (assoc key alist . rest)
- (let ((k= (if (pair? rest) (car rest) equal?)))
- (let lp ((a alist))
- (if (null? a)
- #f
- (if (k= key (caar a))
- (car a)
- (lp (cdr a)))))))
-
-(define (alist-cons key datum alist)
- (acons key datum alist))
-
-(define (alist-copy alist)
- (let lp ((a alist))
- (if (null? a)
- '()
- (acons (caar a) (cdar a) (lp (cdr a))))))
-
-(define (alist-delete key alist . rest)
- (let ((k= (if (pair? rest) (car rest) equal?)))
- (let lp ((a alist))
- (if (null? a)
- '()
- (if (k= (caar a) key)
- (lp (cdr a))
- (cons (car a) (lp (cdr a))))))))
-
-(define (alist-delete! key alist . rest)
- (let ((k= (if (pair? rest) (car rest) equal?)))
- (alist-delete key alist k=))) ; XXX:optimize
-
-;;; Set operations on lists
-
-(define (lset<= = . rest)
- (if (null? rest)
- #t
- (let lp ((f (car rest)) (r (cdr rest)))
- (or (null? r)
- (and (every (lambda (el) (member el (car r) =)) f)
- (lp (car r) (cdr r)))))))
-
-(define (lset= = list1 . rest)
- (if (null? rest)
- #t
- (let lp ((f list1) (r rest))
- (or (null? r)
- (and (every (lambda (el) (member el (car r) =)) f)
- (every (lambda (el) (member el f =)) (car r))
- (lp (car r) (cdr r)))))))
-
-(define (lset-adjoin = list . rest)
- (let lp ((l rest) (acc list))
- (if (null? l)
- acc
- (if (member (car l) acc)
- (lp (cdr l) acc)
- (lp (cdr l) (cons (car l) acc))))))
-
-(define (lset-union = . rest)
- (let lp0 ((l rest) (acc '()))
- (if (null? l)
- (reverse! acc)
- (let lp1 ((ll (car l)) (acc acc))
- (if (null? ll)
- (lp0 (cdr l) acc)
- (if (member (car ll) acc =)
- (lp1 (cdr ll) acc)
- (lp1 (cdr ll) (cons (car ll) acc))))))))
-
-(define (lset-intersection = list1 . rest)
- (let lp ((l list1) (acc '()))
- (if (null? l)
- (reverse! acc)
- (if (every (lambda (ll) (member (car l) ll =)) rest)
- (lp (cdr l) (cons (car l) acc))
- (lp (cdr l) acc)))))
-
-(define (lset-difference = list1 . rest)
- (if (null? rest)
- list1
- (let lp ((l list1) (acc '()))
- (if (null? l)
- (reverse! acc)
- (if (any (lambda (ll) (member (car l) ll =)) rest)
- (lp (cdr l) acc)
- (lp (cdr l) (cons (car l) acc)))))))
-
-;(define (fold kons knil list1 . rest)
-
-(define (lset-xor = . rest)
- (fold (lambda (lst res)
- (let lp ((l lst) (acc '()))
- (if (null? l)
- (let lp0 ((r res) (acc acc))
- (if (null? r)
- (reverse! acc)
- (if (member (car r) lst =)
- (lp0 (cdr r) acc)
- (lp0 (cdr r) (cons (car r) acc)))))
- (if (member (car l) res =)
- (lp (cdr l) acc)
- (lp (cdr l) (cons (car l) acc))))))
- '()
- rest))
-
-(define (lset-diff+intersection = list1 . rest)
- (let lp ((l list1) (accd '()) (acci '()))
- (if (null? l)
- (values (reverse! accd) (reverse! acci))
- (let ((appears (every (lambda (ll) (member (car l) ll =)) rest)))
- (if appears
- (lp (cdr l) accd (cons (car l) acci))
- (lp (cdr l) (cons (car l) accd) acci))))))
-
-
-(define (lset-union! = . rest)
- (apply lset-union = rest)) ; XXX:optimize
-
-(define (lset-intersection! = list1 . rest)
- (apply lset-intersection = list1 rest)) ; XXX:optimize
-
-(define (lset-difference! = list1 . rest)
- (apply lset-difference = list1 rest)) ; XXX:optimize
-
-(define (lset-xor! = . rest)
- (apply lset-xor = rest)) ; XXX:optimize
-
-(define (lset-diff+intersection! = list1 . rest)
- (apply lset-diff+intersection = list1 rest)) ; XXX:optimize
-
-;;; srfi-1.scm ends here
diff --git a/srfi/srfi-10.scm b/srfi/srfi-10.scm
deleted file mode 100644
index 481732051..000000000
--- a/srfi/srfi-10.scm
+++ /dev/null
@@ -1,114 +0,0 @@
-;;; srfi-10.scm --- Hash-Comma Reader Extension
-
-;; Copyright (C) 2001, 2002 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, 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 GUILE.
-;;
-;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;; code from other Free Software Foundation releases into a copy of
-;; GUILE, 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 GUILE, it is your choice
-;; whether to permit this exception to apply to your modifications.
-;; If you do not wish that, delete this exception notice.
-
-;;; Commentary:
-
-;; This module implements the syntax extension #,(), also called
-;; hash-comma, which is defined in SRFI-10.
-;;
-;; The support for SRFI-10 consists of the procedure
-;; `define-reader-ctor' for defining new reader constructors and the
-;; read syntax form
-;;
-;; #,(<ctor> <datum> ...)
-;;
-;; where <ctor> must be a symbol for which a read constructor was
-;; defined previously.
-;;
-;; Example:
-;;
-;; (define-reader-ctor 'file open-input-file)
-;; (define f '#,(file "/etc/passwd"))
-;; (read-line f)
-;; =>
-;; "root:x:0:0:root:/root:/bin/bash"
-;;
-;; Please note the quote before the #,(file ...) expression. This is
-;; necessary because ports are not self-evaluating in Guile.
-;;
-;; This module is fully documented in the Guile Reference Manual.
-
-;;; Code:
-
-(define-module (srfi srfi-10)
- :use-module (ice-9 rdelim)
- :export (define-reader-ctor))
-
-(cond-expand-provide (current-module) '(srfi-10))
-
-;; This hash table stores the association between comma-hash tags and
-;; the corresponding constructor procedures.
-;;
-(define reader-ctors (make-hash-table 31))
-
-;; This procedure installs the procedure @var{proc} as the constructor
-;; for the comma-hash tag @var{symbol}.
-;;
-(define (define-reader-ctor symbol proc)
- (hashq-set! reader-ctors symbol proc)
- (if #f #f)) ; Return unspecified value.
-
-;; Retrieve the constructor procedure for the tag @var{symbol} or
-;; throw an error if no such tag is defined.
-;;
-(define (lookup symbol)
- (let ((p (hashq-ref reader-ctors symbol #f)))
- (if (procedure? p)
- p
- (error "unknown hash-comma tag " symbol))))
-
-;; This is the actual reader extension.
-;;
-(define (hash-comma char port)
- (let* ((obj (read port)))
- (if (and (list? obj) (positive? (length obj)) (symbol? (car obj)))
- (let ((p (lookup (car obj))))
- (let ((res (apply p (cdr obj))))
- res))
- (error "syntax error in hash-comma expression"))))
-
-;; Install the hash extension.
-;;
-(read-hash-extend #\, hash-comma)
-
-;;; srfi-10.scm ends here
diff --git a/srfi/srfi-11.scm b/srfi/srfi-11.scm
deleted file mode 100644
index cabd8e6f3..000000000
--- a/srfi/srfi-11.scm
+++ /dev/null
@@ -1,281 +0,0 @@
-;;; srfi-11.scm --- let-values and let*-values
-
-;; Copyright (C) 2000, 2001, 2002 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, 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 GUILE.
-;;
-;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;; code from other Free Software Foundation releases into a copy of
-;; GUILE, 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 GUILE, it is your choice
-;; whether to permit this exception to apply to your modifications.
-;; If you do not wish that, delete this exception notice.
-
-;;; Commentary:
-
-;; This module exports two syntax forms: let-values and let*-values.
-;;
-;; Sample usage:
-;;
-;; (let-values (((x y . z) (foo a b))
-;; ((p q) (bar c)))
-;; (baz x y z p q))
-;;
-;; This binds `x' and `y' to the first to values returned by `foo',
-;; `z' to the rest of the values from `foo', and `p' and `q' to the
-;; values returned by `bar'. All of these are available to `baz'.
-;;
-;; let*-values : let-values :: let* : let
-;;
-;; This module is fully documented in the Guile Reference Manual.
-
-;;; Code:
-
-(define-module (srfi srfi-11)
- :use-module (ice-9 syncase)
- :export-syntax (let-values let*-values))
-
-(cond-expand-provide (current-module) '(srfi-11))
-
-;;;;;;;;;;;;;;
-;; let-values
-;;
-;; Current approach is to translate
-;;
-;; (let-values (((x y . z) (foo a b))
-;; ((p q) (bar c)))
-;; (baz x y z p q))
-;;
-;; into
-;;
-;; (call-with-values (lambda () (foo a b))
-;; (lambda (<tmp-x> <tmp-y> . <tmp-z>)
-;; (call-with-values (lambda () (bar c))
-;; (lambda (<tmp-p> <tmp-q>)
-;; (let ((x <tmp-x>)
-;; (y <tmp-y>)
-;; (z <tmp-z>)
-;; (p <tmp-p>)
-;; (q <tmp-q>))
-;; (baz x y z p q))))))
-
-;; I originally wrote this as a define-macro, but then I found out
-;; that guile's gensym/gentemp was broken, so I tried rewriting it as
-;; a syntax-rules statement.
-;;
-;; Since syntax-rules didn't seem powerful enough to implement
-;; let-values in one definition without exposing illegal syntax (or
-;; perhaps my brain's just not powerful enough :>). I tried writing
-;; it using a private helper, but that didn't work because the
-;; let-values expands outside the scope of this module. I wonder why
-;; syntax-rules wasn't designed to allow "private" patterns or
-;; similar...
-;;
-;; So in the end, I dumped the syntax-rules implementation, reproduced
-;; here for posterity, and went with the define-macro one below --
-;; gensym/gentemp's got to be fixed anyhow...
-;
-; (define-syntax let-values-helper
-; (syntax-rules ()
-; ;; Take the vars from one let binding (i.e. the (x y z) from ((x y
-; ;; z) (values 1 2 3)) and turn it in to the corresponding (lambda
-; ;; (<tmp-x> <tmp-y> <tmp-z>) ...) from above, keeping track of the
-; ;; temps you create so you can use them later...
-; ;;
-; ;; I really don't fully understand why the (var-1 var-1) trick
-; ;; works below, but basically, when all those (x x) bindings show
-; ;; up in the final "let", syntax-rules forces a renaming.
-
-; ((_ "consumer" () lambda-tmps final-let-bindings lv-bindings
-; body ...)
-; (lambda lambda-tmps
-; (let-values-helper "cwv" lv-bindings final-let-bindings body ...)))
-
-; ((_ "consumer" (var-1 var-2 ...) (lambda-tmp ...) final-let-bindings lv-bindings
-; body ...)
-; (let-values-helper "consumer"
-; (var-2 ...)
-; (lambda-tmp ... var-1)
-; ((var-1 var-1) . final-let-bindings)
-; lv-bindings
-; body ...))
-
-; ((_ "cwv" () final-let-bindings body ...)
-; (let final-let-bindings
-; body ...))
-
-; ((_ "cwv" ((vars-1 binding-1) other-bindings ...) final-let-bindings
-; body ...)
-; (call-with-values (lambda () binding-1)
-; (let-values-helper "consumer"
-; vars-1
-; ()
-; final-let-bindings
-; (other-bindings ...)
-; body ...)))))
-;
-; (define-syntax let-values
-; (syntax-rules ()
-; ((let-values () body ...)
-; (begin body ...))
-; ((let-values (binding ...) body ...)
-; (let-values-helper "cwv" (binding ...) () body ...))))
-;
-;
-; (define-syntax let-values
-; (letrec-syntax ((build-consumer
-; ;; Take the vars from one let binding (i.e. the (x
-; ;; y z) from ((x y z) (values 1 2 3)) and turn it
-; ;; in to the corresponding (lambda (<tmp-x> <tmp-y>
-; ;; <tmp-z>) ...) from above.
-; (syntax-rules ()
-; ((_ () new-tmps tmp-vars () body ...)
-; (lambda new-tmps
-; body ...))
-; ((_ () new-tmps tmp-vars vars body ...)
-; (lambda new-tmps
-; (lv-builder vars tmp-vars body ...)))
-; ((_ (var-1 var-2 ...) new-tmps tmp-vars vars body ...)
-; (build-consumer (var-2 ...)
-; (tmp-1 . new-tmps)
-; ((var-1 tmp-1) . tmp-vars)
-; bindings
-; body ...))))
-; (lv-builder
-; (syntax-rules ()
-; ((_ () tmp-vars body ...)
-; (let tmp-vars
-; body ...))
-; ((_ ((vars-1 binding-1) (vars-2 binding-2) ...)
-; tmp-vars
-; body ...)
-; (call-with-values (lambda () binding-1)
-; (build-consumer vars-1
-; ()
-; tmp-vars
-; ((vars-2 binding-2) ...)
-; body ...))))))
-;
-; (syntax-rules ()
-; ((_ () body ...)
-; (begin body ...))
-; ((_ ((vars binding) ...) body ...)
-; (lv-builder ((vars binding) ...) () body ...)))))
-
-;; FIXME: This is currently somewhat unsafe (b/c gentemp/gensym is
-;; broken -- right now (as of 1.4.1, it doesn't generate unique
-;; symbols)
-(define-macro (let-values vars . body)
-
- (define (map-1-dot proc elts)
- ;; map over one optionally dotted (a b c . d) list, producing an
- ;; optionally dotted result.
- (cond
- ((null? elts) '())
- ((pair? elts) (cons (proc (car elts)) (map-1-dot proc (cdr elts))))
- (else (proc elts))))
-
- (define (undot-list lst)
- ;; produce a non-dotted list from a possibly dotted list.
- (cond
- ((null? lst) '())
- ((pair? lst) (cons (car lst) (undot-list (cdr lst))))
- (else (list lst))))
-
- (define (let-values-helper vars body prev-let-vars)
- (let* ((var-binding (car vars))
- (new-tmps (map-1-dot (lambda (sym) (gensym))
- (car var-binding)))
- (let-vars (map (lambda (sym tmp) (list sym tmp))
- (undot-list (car var-binding))
- (undot-list new-tmps))))
-
- (if (null? (cdr vars))
- `(call-with-values (lambda () ,(cadr var-binding))
- (lambda ,new-tmps
- (let ,(apply append let-vars prev-let-vars)
- ,@body)))
- `(call-with-values (lambda () ,(cadr var-binding))
- (lambda ,new-tmps
- ,(let-values-helper (cdr vars) body
- (cons let-vars prev-let-vars)))))))
-
- (if (null? vars)
- `(begin ,@body)
- (let-values-helper vars body '())))
-
-;;;;;;;;;;;;;;
-;; let*-values
-;;
-;; Current approach is to translate
-;;
-;; (let*-values (((x y z) (foo a b))
-;; ((p q) (bar c)))
-;; (baz x y z p q))
-;;
-;; into
-;;
-;; (call-with-values (lambda () (foo a b))
-;; (lambda (x y z)
-;; (call-with-values (lambda (bar c))
-;; (lambda (p q)
-;; (baz x y z p q)))))
-
-(define-syntax let*-values
- (syntax-rules ()
- ((let*-values () body ...)
- (begin body ...))
- ((let*-values ((vars-1 binding-1) (vars-2 binding-2) ...) body ...)
- (call-with-values (lambda () binding-1)
- (lambda vars-1
- (let*-values ((vars-2 binding-2) ...)
- body ...))))))
-
-; Alternate define-macro implementation...
-;
-; (define-macro (let*-values vars . body)
-; (define (let-values-helper vars body)
-; (let ((var-binding (car vars)))
-; (if (null? (cdr vars))
-; `(call-with-values (lambda () ,(cadr var-binding))
-; (lambda ,(car var-binding)
-; ,@body))
-; `(call-with-values (lambda () ,(cadr var-binding))
-; (lambda ,(car var-binding)
-; ,(let-values-helper (cdr vars) body))))))
-
-; (if (null? vars)
-; `(begin ,@body)
-; (let-values-helper vars body)))
-
-;;; srfi-11.scm ends here
diff --git a/srfi/srfi-13.c b/srfi/srfi-13.c
deleted file mode 100644
index 8b9f4933c..000000000
--- a/srfi/srfi-13.c
+++ /dev/null
@@ -1,3009 +0,0 @@
-/* srfi-13.c --- SRFI-13 procedures for Guile
- *
- * Copyright (C) 2001 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, 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 GUILE.
- *
- * The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy code from
- * other Free Software Foundation releases into a copy of GUILE, 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 GUILE, it is your choice
- * whether to permit this exception to apply to your modifications.
- * If you do not wish that, delete this exception notice. */
-
-
-#include <string.h>
-#include <ctype.h>
-
-#include <libguile.h>
-
-#include "srfi-13.h"
-#include "srfi-14.h"
-
-SCM_DEFINE (scm_string_any, "string-any", 2, 2, 0,
- (SCM pred, SCM s, SCM start, SCM end),
- "Check if the predicate @var{pred} is true for any character in\n"
- "the string @var{s}, proceeding from left (index @var{start}) to\n"
- "right (index @var{end}). If @code{string-any} returns true,\n"
- "the returned true value is the one produced by the first\n"
- "successful application of @var{pred}.")
-#define FUNC_NAME s_scm_string_any
-{
- char * cstr;
- int cstart, cend;
- SCM res;
-
- SCM_VALIDATE_PROC (1, pred);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s, cstr,
- 3, start, cstart,
- 4, end, cend);
- cstr += cstart;
- while (cstart < cend)
- {
- res = scm_call_1 (pred, SCM_MAKE_CHAR (*cstr));
- if (!SCM_FALSEP (res))
- return res;
- cstr++;
- cstart++;
- }
- return SCM_BOOL_F;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_every, "string-every", 2, 2, 0,
- (SCM pred, SCM s, SCM start, SCM end),
- "Check if the predicate @var{pred} is true for every character\n"
- "in the string @var{s}, proceeding from left (index @var{start})\n"
- "to right (index @var{end}). If @code{string-every} returns\n"
- "true, the returned true value is the one produced by the final\n"
- "application of @var{pred} to the last character of @var{s}.")
-#define FUNC_NAME s_scm_string_every
-{
- char * cstr;
- int cstart, cend;
- SCM res;
-
- SCM_VALIDATE_PROC (1, pred);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s, cstr,
- 3, start, cstart,
- 4, end, cend);
- res = SCM_BOOL_F;
- cstr += cstart;
- while (cstart < cend)
- {
- res = scm_call_1 (pred, SCM_MAKE_CHAR (*cstr));
- if (SCM_FALSEP (res))
- return res;
- cstr++;
- cstart++;
- }
- return res;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_tabulate, "string-tabulate", 2, 0, 0,
- (SCM proc, SCM len),
- "@var{proc} is an integer->char procedure. Construct a string\n"
- "of size @var{len} by applying @var{proc} to each index to\n"
- "produce the corresponding string element. The order in which\n"
- "@var{proc} is applied to the indices is not specified.")
-#define FUNC_NAME s_scm_string_tabulate
-{
- int clen, i;
- SCM res;
- SCM ch;
- char * p;
-
- SCM_VALIDATE_PROC (1, proc);
- SCM_VALIDATE_INUM_COPY (2, len, clen);
- SCM_ASSERT_RANGE (2, len, clen >= 0);
-
- res = scm_allocate_string (clen);
- p = SCM_STRING_CHARS (res);
- i = 0;
- while (i < clen)
- {
- ch = scm_call_1 (proc, SCM_MAKINUM (i));
- if (!SCM_CHARP (ch))
- SCM_MISC_ERROR ("procedure ~S returned non-char", scm_list_1 (proc));
- *p++ = SCM_CHAR (ch);
- i++;
- }
- return res;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_to_listS, "string->list", 1, 2, 0,
- (SCM str, SCM start, SCM end),
- "Convert the string @var{str} into a list of characters.")
-#define FUNC_NAME s_scm_string_to_listS
-{
- char * cstr;
- int cstart, cend;
- SCM result = SCM_EOL;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
- 2, start, cstart,
- 3, end, cend);
- while (cstart < cend)
- {
- cend--;
- result = scm_cons (SCM_MAKE_CHAR (cstr[cend]), result);
- }
- return result;
-}
-#undef FUNC_NAME
-
-SCM_DEFINE (scm_reverse_list_to_string, "reverse-list->string", 1, 0, 0,
- (SCM chrs),
- "An efficient implementation of @code{(compose string->list\n"
- "reverse)}:\n"
- "\n"
- "@smalllisp\n"
- "(reverse-list->string '(#\a #\B #\c)) @result{} \"cBa\"\n"
- "@end smalllisp")
-#define FUNC_NAME s_scm_reverse_list_to_string
-{
- SCM result;
- long i = scm_ilength (chrs);
-
- if (i < 0)
- SCM_WRONG_TYPE_ARG (1, chrs);
- result = scm_allocate_string (i);
-
- {
- unsigned char *data = SCM_STRING_UCHARS (result) + i;
-
- while (!SCM_NULLP (chrs))
- {
- SCM elt = SCM_CAR (chrs);
-
- SCM_VALIDATE_CHAR (SCM_ARGn, elt);
- data--;
- *data = SCM_CHAR (elt);
- chrs = SCM_CDR (chrs);
- }
- }
- return result;
-}
-#undef FUNC_NAME
-
-
-SCM_SYMBOL (scm_sym_infix, "infix");
-SCM_SYMBOL (scm_sym_strict_infix, "strict-infix");
-SCM_SYMBOL (scm_sym_suffix, "suffix");
-SCM_SYMBOL (scm_sym_prefix, "prefix");
-
-SCM_DEFINE (scm_string_join, "string-join", 1, 2, 0,
- (SCM ls, SCM delimiter, SCM grammar),
- "Append the string in the string list @var{ls}, using the string\n"
- "@var{delim} as a delimiter between the elements of @var{ls}.\n"
- "@var{grammar} is a symbol which specifies how the delimiter is\n"
- "placed between the strings, and defaults to the symbol\n"
- "@code{infix}.\n"
- "\n"
- "@table @code\n"
- "@item infix\n"
- "Insert the separator between list elements. An empty string\n"
- "will produce an empty list.\n"
- "@item string-infix\n"
- "Like @code{infix}, but will raise an error if given the empty\n"
- "list.\n"
- "@item suffix\n"
- "Insert the separator after every list element.\n"
- "@item prefix\n"
- "Insert the separator before each list element.\n"
- "@end table")
-#define FUNC_NAME s_scm_string_join
-{
-#define GRAM_INFIX 0
-#define GRAM_STRICT_INFIX 1
-#define GRAM_SUFFIX 2
-#define GRAM_PREFIX 3
- SCM tmp;
- SCM result;
- int gram = GRAM_INFIX;
- int del_len = 0, extra_len = 0;
- int len = 0;
- char * p;
- long strings = scm_ilength (ls);
-
- /* Validate the string list. */
- if (strings < 0)
- SCM_WRONG_TYPE_ARG (1, ls);
-
- /* Validate the delimiter and record its length. */
- if (SCM_UNBNDP (delimiter))
- {
- delimiter = scm_makfrom0str (" ");
- del_len = 1;
- }
- else
- {
- SCM_VALIDATE_STRING (2, delimiter);
- del_len = SCM_STRING_LENGTH (delimiter);
- }
-
- /* Validate the grammar symbol and remember the grammar. */
- if (SCM_UNBNDP (grammar))
- gram = GRAM_INFIX;
- else if (SCM_EQ_P (grammar, scm_sym_infix))
- gram = GRAM_INFIX;
- else if (SCM_EQ_P (grammar, scm_sym_strict_infix))
- gram = GRAM_STRICT_INFIX;
- else if (SCM_EQ_P (grammar, scm_sym_suffix))
- gram = GRAM_SUFFIX;
- else if (SCM_EQ_P (grammar, scm_sym_prefix))
- gram = GRAM_PREFIX;
- else
- SCM_WRONG_TYPE_ARG (3, grammar);
-
- /* Check grammar constraints and calculate the space required for
- the delimiter(s). */
- switch (gram)
- {
- case GRAM_INFIX:
- if (!SCM_NULLP (ls))
- extra_len = (strings > 0) ? ((strings - 1) * del_len) : 0;
- break;
- case GRAM_STRICT_INFIX:
- if (strings == 0)
- SCM_MISC_ERROR ("strict-infix grammar requires non-empty list",
- SCM_EOL);
- extra_len = (strings - 1) * del_len;
- break;
- default:
- extra_len = strings * del_len;
- break;
- }
-
- tmp = ls;
- while (SCM_CONSP (tmp))
- {
- SCM elt = SCM_CAR (tmp);
- SCM_VALIDATE_STRING (1, elt);
- len += SCM_STRING_LENGTH (elt);
- tmp = SCM_CDR (tmp);
- }
-
- result = scm_allocate_string (len + extra_len);
- p = SCM_STRING_CHARS (result);
-
- tmp = ls;
- switch (gram)
- {
- case GRAM_INFIX:
- case GRAM_STRICT_INFIX:
- while (!SCM_NULLP (tmp))
- {
- SCM elt = SCM_CAR (tmp);
- memmove (p, SCM_STRING_CHARS (elt),
- SCM_STRING_LENGTH (elt) * sizeof (char));
- p += SCM_STRING_LENGTH (elt);
- if (!SCM_NULLP (SCM_CDR (tmp)) && del_len > 0)
- {
- memmove (p, SCM_STRING_CHARS (delimiter),
- SCM_STRING_LENGTH (delimiter) * sizeof (char));
- p += del_len;
- }
- tmp = SCM_CDR (tmp);
- }
- break;
- case GRAM_SUFFIX:
- while (!SCM_NULLP (tmp))
- {
- SCM elt = SCM_CAR (tmp);
- memmove (p, SCM_STRING_CHARS (elt),
- SCM_STRING_LENGTH (elt) * sizeof (char));
- p += SCM_STRING_LENGTH (elt);
- if (del_len > 0)
- {
- memmove (p, SCM_STRING_CHARS (delimiter),
- SCM_STRING_LENGTH (delimiter) * sizeof (char));
- p += del_len;
- }
- tmp = SCM_CDR (tmp);
- }
- break;
- case GRAM_PREFIX:
- while (!SCM_NULLP (tmp))
- {
- SCM elt = SCM_CAR (tmp);
- if (del_len > 0)
- {
- memmove (p, SCM_STRING_CHARS (delimiter),
- SCM_STRING_LENGTH (delimiter) * sizeof (char));
- p += del_len;
- }
- memmove (p, SCM_STRING_CHARS (elt),
- SCM_STRING_LENGTH (elt) * sizeof (char));
- p += SCM_STRING_LENGTH (elt);
- tmp = SCM_CDR (tmp);
- }
- break;
- }
- return result;
-#undef GRAM_INFIX
-#undef GRAM_STRICT_INFIX
-#undef GRAM_SUFFIX
-#undef GRAM_PREFIX
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_copyS, "string-copy", 1, 2, 0,
- (SCM str, SCM start, SCM end),
- "Return a freshly allocated copy of the string @var{str}. If\n"
- "given, @var{start} and @var{end} delimit the portion of\n"
- "@var{str} which is copied.")
-#define FUNC_NAME s_scm_string_copyS
-{
- char * cstr;
- int cstart, cend;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
- 2, start, cstart,
- 3, end, cend);
- return scm_mem2string (cstr + cstart, cend - cstart);
-
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_substring_shared, "substring/shared", 2, 1, 0,
- (SCM str, SCM start, SCM end),
- "Like @code{substring}, but the result may share memory with the\n"
- "argument @var{str}.")
-#define FUNC_NAME s_scm_substring_shared
-{
- SCM_VALIDATE_STRING (1, str);
- SCM_VALIDATE_INUM (2, start);
- if (SCM_UNBNDP (end))
- end = SCM_MAKINUM (SCM_STRING_LENGTH (str));
- else
- SCM_VALIDATE_INUM (3, end);
- if (SCM_INUM (start) == 0 &&
- SCM_INUM (end) == SCM_STRING_LENGTH (str))
- return str;
- return scm_substring (str, start, end);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_copy_x, "string-copy!", 3, 2, 0,
- (SCM target, SCM tstart, SCM s, SCM start, SCM end),
- "Copy the sequence of characters from index range [@var{start},\n"
- "@var{end}) in string @var{s} to string @var{target}, beginning\n"
- "at index @var{tstart}. The characters are copied left-to-right\n"
- "or right-to-left as needed -- the copy is guaranteed to work,\n"
- "even if @var{target} and @var{s} are the same string. It is an\n"
- "error if the copy operation runs off the end of the target\n"
- "string.")
-#define FUNC_NAME s_scm_string_copy_x
-{
- char * cstr, * ctarget;
- int cstart, cend, ctstart, dummy;
- int len;
- SCM sdummy = SCM_UNDEFINED;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, target, ctarget,
- 2, tstart, ctstart,
- 2, sdummy, dummy);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (3, s, cstr,
- 4, start, cstart,
- 5, end, cend);
- len = cend - cstart;
- SCM_ASSERT_RANGE (3, s, len <= SCM_STRING_LENGTH (target) - ctstart);
-
- memmove (SCM_STRING_CHARS (target) + ctstart,
- SCM_STRING_CHARS (s) + cstart,
- len * sizeof (char));
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_take, "string-take", 2, 0, 0,
- (SCM s, SCM n),
- "Return the @var{n} first characters of @var{s}.")
-#define FUNC_NAME s_scm_string_take
-{
- char * cstr;
- int cn;
-
- SCM_VALIDATE_STRING_COPY (1, s, cstr);
- SCM_VALIDATE_INUM_COPY (2, n, cn);
- SCM_ASSERT_RANGE (2, n, cn >= 0 && cn <= SCM_STRING_LENGTH (s));
-
- return scm_mem2string (cstr, cn);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_drop, "string-drop", 2, 0, 0,
- (SCM s, SCM n),
- "Return all but the first @var{n} characters of @var{s}.")
-#define FUNC_NAME s_scm_string_drop
-{
- char * cstr;
- int cn;
-
- SCM_VALIDATE_STRING_COPY (1, s, cstr);
- SCM_VALIDATE_INUM_COPY (2, n, cn);
- SCM_ASSERT_RANGE (2, n, cn >= 0 && cn <= SCM_STRING_LENGTH (s));
-
- return scm_mem2string (cstr + cn, SCM_STRING_LENGTH (s) - cn);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_take_right, "string-take-right", 2, 0, 0,
- (SCM s, SCM n),
- "Return the @var{n} last characters of @var{s}.")
-#define FUNC_NAME s_scm_string_take_right
-{
- char * cstr;
- int cn;
-
- SCM_VALIDATE_STRING_COPY (1, s, cstr);
- SCM_VALIDATE_INUM_COPY (2, n, cn);
- SCM_ASSERT_RANGE (2, n, cn >= 0 && cn <= SCM_STRING_LENGTH (s));
-
- return scm_mem2string (cstr + SCM_STRING_LENGTH (s) - cn, cn);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_drop_right, "string-drop-right", 2, 0, 0,
- (SCM s, SCM n),
- "Return all but the last @var{n} characters of @var{s}.")
-#define FUNC_NAME s_scm_string_drop_right
-{
- char * cstr;
- int cn;
-
- SCM_VALIDATE_STRING_COPY (1, s, cstr);
- SCM_VALIDATE_INUM_COPY (2, n, cn);
- SCM_ASSERT_RANGE (2, n, cn >= 0 && cn <= SCM_STRING_LENGTH (s));
-
- return scm_mem2string (cstr, SCM_STRING_LENGTH (s) - cn);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_pad, "string-pad", 2, 3, 0,
- (SCM s, SCM len, SCM chr, SCM start, SCM end),
- "Take that characters from @var{start} to @var{end} from the\n"
- "string @var{s} and return a new string, right-padded by the\n"
- "character @var{chr} to length @var{len}. If the resulting\n"
- "string is longer than @var{len}, it is truncated on the right.")
-#define FUNC_NAME s_scm_string_pad
-{
- char cchr;
- char * cstr;
- int cstart, cend, clen;
- SCM result;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 4, start, cstart,
- 5, end, cend);
- SCM_VALIDATE_INUM_COPY (2, len, clen);
- if (SCM_UNBNDP (chr))
- cchr = ' ';
- else
- {
- SCM_VALIDATE_CHAR (3, chr);
- cchr = SCM_CHAR (chr);
- }
- result = scm_allocate_string (clen);
- if (clen < (cend - cstart))
- memmove (SCM_STRING_CHARS (result),
- cstr + cend - clen,
- clen * sizeof (char));
- else
- {
- memset (SCM_STRING_CHARS (result), cchr,
- (clen - (cend - cstart)) * sizeof (char));
- memmove (SCM_STRING_CHARS (result) + (clen - (cend - cstart)),
- cstr + cstart,
- (cend - cstart) * sizeof (char));
- }
- return result;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_pad_right, "string-pad-right", 2, 3, 0,
- (SCM s, SCM len, SCM chr, SCM start, SCM end),
- "Take that characters from @var{start} to @var{end} from the\n"
- "string @var{s} and return a new string, left-padded by the\n"
- "character @var{chr} to length @var{len}. If the resulting\n"
- "string is longer than @var{len}, it is truncated on the left.")
-#define FUNC_NAME s_scm_string_pad_right
-{
- char cchr;
- char * cstr;
- int cstart, cend, clen;
- SCM result;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 4, start, cstart,
- 5, end, cend);
- SCM_VALIDATE_INUM_COPY (2, len, clen);
- if (SCM_UNBNDP (chr))
- cchr = ' ';
- else
- {
- SCM_VALIDATE_CHAR (3, chr);
- cchr = SCM_CHAR (chr);
- }
- result = scm_allocate_string (clen);
- if (clen < (cend - cstart))
- memmove (SCM_STRING_CHARS (result), cstr + cstart, clen * sizeof (char));
- else
- {
- memset (SCM_STRING_CHARS (result) + (cend - cstart),
- cchr, (clen - (cend - cstart)) * sizeof (char));
- memmove (SCM_STRING_CHARS (result), cstr + cstart,
- (cend - cstart) * sizeof (char));
- }
- return result;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_trim, "string-trim", 1, 3, 0,
- (SCM s, SCM char_pred, SCM start, SCM end),
- "Trim @var{s} by skipping over all characters on the left\n"
- "that satisfy the parameter @var{char_pred}:\n"
- "\n"
- "@itemize @bullet\n"
- "@item\n"
- "if it is the character @var{ch}, characters equal to\n"
- "@var{ch} are trimmed,\n"
- "\n"
- "@item\n"
- "if it is a procedure @var{pred} characters that\n"
- "satisfy @var{pred} are trimmed,\n"
- "\n"
- "@item\n"
- "if it is a character set, characters in that set are trimmed.\n"
- "@end itemize\n"
- "\n"
- "If called without a @var{char_pred} argument, all whitespace is\n"
- "trimmed.")
-#define FUNC_NAME s_scm_string_trim
-{
- char * cstr;
- int cstart, cend;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 3, start, cstart,
- 4, end, cend);
- if (SCM_UNBNDP (char_pred))
- {
- while (cstart < cend)
- {
- if (!isspace(cstr[cstart]))
- break;
- cstart++;
- }
- }
- else if (SCM_CHARP (char_pred))
- {
- char chr = SCM_CHAR (char_pred);
- while (cstart < cend)
- {
- if (chr != cstr[cstart])
- break;
- cstart++;
- }
- }
- else if (SCM_CHARSETP (char_pred))
- {
- while (cstart < cend)
- {
- if (!SCM_CHARSET_GET (char_pred, cstr[cstart]))
- break;
- cstart++;
- }
- }
- else
- {
- SCM_VALIDATE_PROC (2, char_pred);
- while (cstart < cend)
- {
- SCM res;
-
- res = scm_call_1 (char_pred, SCM_MAKE_CHAR (cstr[cstart]));
- if (SCM_FALSEP (res))
- break;
- cstart++;
- }
- }
- return scm_mem2string (cstr + cstart, cend - cstart);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_trim_right, "string-trim-right", 1, 3, 0,
- (SCM s, SCM char_pred, SCM start, SCM end),
- "Trim @var{s} by skipping over all characters on the rightt\n"
- "that satisfy the parameter @var{char_pred}:\n"
- "\n"
- "@itemize @bullet\n"
- "@item\n"
- "if it is the character @var{ch}, characters equal to @var{ch}\n"
- "are trimmed,\n"
- "\n"
- "@item\n"
- "if it is a procedure @var{pred} characters that satisfy\n"
- "@var{pred} are trimmed,\n"
- "\n"
- "@item\n"
- "if it is a character sets, all characters in that set are\n"
- "trimmed.\n"
- "@end itemize\n"
- "\n"
- "If called without a @var{char_pred} argument, all whitespace is\n"
- "trimmed.")
-#define FUNC_NAME s_scm_string_trim_right
-{
- char * cstr;
- int cstart, cend;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 3, start, cstart,
- 4, end, cend);
- if (SCM_UNBNDP (char_pred))
- {
- while (cstart < cend)
- {
- if (!isspace(cstr[cend - 1]))
- break;
- cend--;
- }
- }
- else if (SCM_CHARP (char_pred))
- {
- char chr = SCM_CHAR (char_pred);
- while (cstart < cend)
- {
- if (chr != cstr[cend - 1])
- break;
- cend--;
- }
- }
- else if (SCM_CHARSETP (char_pred))
- {
- while (cstart < cend)
- {
- if (!SCM_CHARSET_GET (char_pred, cstr[cend - 1]))
- break;
- cend--;
- }
- }
- else
- {
- SCM_VALIDATE_PROC (2, char_pred);
- while (cstart < cend)
- {
- SCM res;
-
- res = scm_call_1 (char_pred, SCM_MAKE_CHAR (cstr[cend - 1]));
- if (SCM_FALSEP (res))
- break;
- cend--;
- }
- }
- return scm_mem2string (cstr + cstart, cend - cstart);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_trim_both, "string-trim-both", 1, 3, 0,
- (SCM s, SCM char_pred, SCM start, SCM end),
- "Trim @var{s} by skipping over all characters on both sides of\n"
- "the string that satisfy the parameter @var{char_pred}:\n"
- "\n"
- "@itemize @bullet\n"
- "@item\n"
- "if it is the character @var{ch}, characters equal to @var{ch}\n"
- "are trimmed,\n"
- "\n"
- "@item\n"
- "if it is a procedure @var{pred} characters that satisfy\n"
- "@var{pred} are trimmed,\n"
- "\n"
- "@item\n"
- "if it is a character set, the characters in the set are\n"
- "trimmed.\n"
- "@end itemize\n"
- "\n"
- "If called without a @var{char_pred} argument, all whitespace is\n"
- "trimmed.")
-#define FUNC_NAME s_scm_string_trim_both
-{
- char * cstr;
- int cstart, cend;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 3, start, cstart,
- 4, end, cend);
- if (SCM_UNBNDP (char_pred))
- {
- while (cstart < cend)
- {
- if (!isspace(cstr[cstart]))
- break;
- cstart++;
- }
- while (cstart < cend)
- {
- if (!isspace(cstr[cend - 1]))
- break;
- cend--;
- }
- }
- else if (SCM_CHARP (char_pred))
- {
- char chr = SCM_CHAR (char_pred);
- while (cstart < cend)
- {
- if (chr != cstr[cstart])
- break;
- cstart++;
- }
- while (cstart < cend)
- {
- if (chr != cstr[cend - 1])
- break;
- cend--;
- }
- }
- else if (SCM_CHARSETP (char_pred))
- {
- while (cstart < cend)
- {
- if (!SCM_CHARSET_GET (char_pred, cstr[cstart]))
- break;
- cstart++;
- }
- while (cstart < cend)
- {
- if (!SCM_CHARSET_GET (char_pred, cstr[cend - 1]))
- break;
- cend--;
- }
- }
- else
- {
- SCM_VALIDATE_PROC (2, char_pred);
- while (cstart < cend)
- {
- SCM res;
-
- res = scm_call_1 (char_pred, SCM_MAKE_CHAR (cstr[cstart]));
- if (SCM_FALSEP (res))
- break;
- cstart++;
- }
- while (cstart < cend)
- {
- SCM res;
-
- res = scm_call_1 (char_pred, SCM_MAKE_CHAR (cstr[cend - 1]));
- if (SCM_FALSEP (res))
- break;
- cend--;
- }
- }
- return scm_mem2string (cstr + cstart, cend - cstart);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_fill_xS, "string-fill!", 2, 2, 0,
- (SCM str, SCM chr, SCM start, SCM end),
- "Stores @var{chr} in every element of the given @var{str} and\n"
- "returns an unspecified value.")
-#define FUNC_NAME s_scm_string_fill_xS
-{
- char * cstr;
- int cstart, cend;
- int c;
- long k;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
- 3, start, cstart,
- 4, end, cend);
- SCM_VALIDATE_CHAR_COPY (2, chr, c);
- for (k = cstart; k < cend; k++)
- cstr[k] = c;
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_compare, "string-compare", 5, 4, 0,
- (SCM s1, SCM s2, SCM proc_lt, SCM proc_eq, SCM proc_gt, SCM start1, SCM end1, SCM start2, SCM end2),
- "Apply @var{proc_lt}, @var{proc_eq}, @var{proc_gt} to the\n"
- "mismatch index, depending upon whether @var{s1} is less than,\n"
- "equal to, or greater than @var{s2}. The mismatch index is the\n"
- "largest index @var{i} such that for every 0 <= @var{j} <\n"
- "@var{i}, @var{s1}[@var{j}] = @var{s2}[@var{j}] -- that is,\n"
- "@var{i} is the first position that does not match.")
-#define FUNC_NAME s_scm_string_compare
-{
- char * cstr1, * cstr2;
- int cstart1, cend1, cstart2, cend2;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 6, start1, cstart1,
- 7, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 8, start2, cstart2,
- 9, end2, cend2);
- SCM_VALIDATE_PROC (3, proc_lt);
- SCM_VALIDATE_PROC (4, proc_eq);
- SCM_VALIDATE_PROC (5, proc_gt);
-
- while (cstart1 < cend1 && cstart2 < cend2)
- {
- if (cstr1[cstart1] < cstr2[cstart2])
- return scm_call_1 (proc_lt, SCM_MAKINUM (cstart1));
- else if (cstr1[cstart1] > cstr2[cstart2])
- return scm_call_1 (proc_gt, SCM_MAKINUM (cstart1));
- cstart1++;
- cstart2++;
- }
- if (cstart1 < cend1)
- return scm_call_1 (proc_gt, SCM_MAKINUM (cstart1));
- else if (cstart2 < cend2)
- return scm_call_1 (proc_lt, SCM_MAKINUM (cstart1));
- else
- return scm_call_1 (proc_eq, SCM_MAKINUM (cstart1));
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_compare_ci, "string-compare-ci", 5, 4, 0,
- (SCM s1, SCM s2, SCM proc_lt, SCM proc_eq, SCM proc_gt, SCM start1, SCM end1, SCM start2, SCM end2),
- "Apply @var{proc_lt}, @var{proc_eq}, @var{proc_gt} to the\n"
- "mismatch index, depending upon whether @var{s1} is less than,\n"
- "equal to, or greater than @var{s2}. The mismatch index is the\n"
- "largest index @var{i} such that for every 0 <= @var{j} <\n"
- "@var{i}, @var{s1}[@var{j}] = @var{s2}[@var{j}] -- that is,\n"
- "@var{i} is the first position that does not match. The\n"
- "character comparison is done case-insensitively.")
-#define FUNC_NAME s_scm_string_compare_ci
-{
- char * cstr1, * cstr2;
- int cstart1, cend1, cstart2, cend2;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 6, start1, cstart1,
- 7, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 8, start2, cstart2,
- 9, end2, cend2);
- SCM_VALIDATE_PROC (3, proc_lt);
- SCM_VALIDATE_PROC (4, proc_eq);
- SCM_VALIDATE_PROC (5, proc_gt);
-
- while (cstart1 < cend1 && cstart2 < cend2)
- {
- if (scm_downcase (cstr1[cstart1]) < scm_downcase (cstr2[cstart2]))
- return scm_call_1 (proc_lt, SCM_MAKINUM (cstart1));
- else if (scm_downcase (cstr1[cstart1]) > scm_downcase (cstr2[cstart2]))
- return scm_call_1 (proc_gt, SCM_MAKINUM (cstart1));
- cstart1++;
- cstart2++;
- }
- if (cstart1 < cend1)
- return scm_call_1 (proc_gt, SCM_MAKINUM (cstart1));
- else if (cstart2 < cend2)
- return scm_call_1 (proc_lt, SCM_MAKINUM (cstart1));
- else
- return scm_call_1 (proc_eq, SCM_MAKINUM (cstart1));
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_eq, "string=", 2, 4, 0,
- (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2),
- "Return @code{#f} if @var{s1} and @var{s2} are not equal, a true\n"
- "value otherwise.")
-#define FUNC_NAME s_scm_string_eq
-{
- char * cstr1, * cstr2;
- int cstart1, cend1, cstart2, cend2;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
-
- while (cstart1 < cend1 && cstart2 < cend2)
- {
- if (cstr1[cstart1] < cstr2[cstart2])
- return SCM_BOOL_F;
- else if (cstr1[cstart1] > cstr2[cstart2])
- return SCM_BOOL_F;
- cstart1++;
- cstart2++;
- }
- if (cstart1 < cend1)
- return SCM_BOOL_F;
- else if (cstart2 < cend2)
- return SCM_BOOL_F;
- else
- return SCM_MAKINUM (cstart1);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_neq, "string<>", 2, 4, 0,
- (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2),
- "Return @code{#f} if @var{s1} and @var{s2} are equal, a true\n"
- "value otherwise.")
-#define FUNC_NAME s_scm_string_neq
-{
- char * cstr1, * cstr2;
- int cstart1, cend1, cstart2, cend2;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
-
- while (cstart1 < cend1 && cstart2 < cend2)
- {
- if (cstr1[cstart1] < cstr2[cstart2])
- return SCM_MAKINUM (cstart1);
- else if (cstr1[cstart1] > cstr2[cstart2])
- return SCM_MAKINUM (cstart1);
- cstart1++;
- cstart2++;
- }
- if (cstart1 < cend1)
- return SCM_MAKINUM (cstart1);
- else if (cstart2 < cend2)
- return SCM_MAKINUM (cstart1);
- else
- return SCM_BOOL_F;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_lt, "string<", 2, 4, 0,
- (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2),
- "Return @code{#f} if @var{s1} is greater or equal to @var{s2}, a\n"
- "true value otherwise.")
-#define FUNC_NAME s_scm_string_lt
-{
- char * cstr1, * cstr2;
- int cstart1, cend1, cstart2, cend2;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
-
- while (cstart1 < cend1 && cstart2 < cend2)
- {
- if (cstr1[cstart1] < cstr2[cstart2])
- return SCM_MAKINUM (cstart1);
- else if (cstr1[cstart1] > cstr2[cstart2])
- return SCM_BOOL_F;
- cstart1++;
- cstart2++;
- }
- if (cstart1 < cend1)
- return SCM_BOOL_F;
- else if (cstart2 < cend2)
- return SCM_MAKINUM (cstart1);
- else
- return SCM_BOOL_F;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_gt, "string>", 2, 4, 0,
- (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2),
- "Return @code{#f} if @var{s1} is less or equal to @var{s2}, a\n"
- "true value otherwise.")
-#define FUNC_NAME s_scm_string_gt
-{
- char * cstr1, * cstr2;
- int cstart1, cend1, cstart2, cend2;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
-
- while (cstart1 < cend1 && cstart2 < cend2)
- {
- if (cstr1[cstart1] < cstr2[cstart2])
- return SCM_BOOL_F;
- else if (cstr1[cstart1] > cstr2[cstart2])
- return SCM_MAKINUM (cstart1);
- cstart1++;
- cstart2++;
- }
- if (cstart1 < cend1)
- return SCM_MAKINUM (cstart1);
- else if (cstart2 < cend2)
- return SCM_BOOL_F;
- else
- return SCM_BOOL_F;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_le, "string<=", 2, 4, 0,
- (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2),
- "Return @code{#f} if @var{s1} is greater to @var{s2}, a true\n"
- "value otherwise.")
-#define FUNC_NAME s_scm_string_le
-{
- char * cstr1, * cstr2;
- int cstart1, cend1, cstart2, cend2;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
-
- while (cstart1 < cend1 && cstart2 < cend2)
- {
- if (cstr1[cstart1] < cstr2[cstart2])
- return SCM_MAKINUM (cstart1);
- else if (cstr1[cstart1] > cstr2[cstart2])
- return SCM_BOOL_F;
- cstart1++;
- cstart2++;
- }
- if (cstart1 < cend1)
- return SCM_BOOL_F;
- else if (cstart2 < cend2)
- return SCM_MAKINUM (cstart1);
- else
- return SCM_MAKINUM (cstart1);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_ge, "string>=", 2, 4, 0,
- (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2),
- "Return @code{#f} if @var{s1} is less to @var{s2}, a true value\n"
- "otherwise.")
-#define FUNC_NAME s_scm_string_ge
-{
- char * cstr1, * cstr2;
- int cstart1, cend1, cstart2, cend2;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
-
- while (cstart1 < cend1 && cstart2 < cend2)
- {
- if (cstr1[cstart1] < cstr2[cstart2])
- return SCM_BOOL_F;
- else if (cstr1[cstart1] > cstr2[cstart2])
- return SCM_MAKINUM (cstart1);
- cstart1++;
- cstart2++;
- }
- if (cstart1 < cend1)
- return SCM_MAKINUM (cstart1);
- else if (cstart2 < cend2)
- return SCM_BOOL_F;
- else
- return SCM_MAKINUM (cstart1);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_ci_eq, "string-ci=", 2, 4, 0,
- (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2),
- "Return @code{#f} if @var{s1} and @var{s2} are not equal, a true\n"
- "value otherwise. The character comparison is done\n"
- "case-insensitively.")
-#define FUNC_NAME s_scm_string_ci_eq
-{
- char * cstr1, * cstr2;
- int cstart1, cend1, cstart2, cend2;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
-
- while (cstart1 < cend1 && cstart2 < cend2)
- {
- if (scm_downcase (cstr1[cstart1]) < scm_downcase (cstr2[cstart2]))
- return SCM_BOOL_F;
- else if (scm_downcase (cstr1[cstart1]) > scm_downcase (cstr2[cstart2]))
- return SCM_BOOL_F;
- cstart1++;
- cstart2++;
- }
- if (cstart1 < cend1)
- return SCM_BOOL_F;
- else if (cstart2 < cend2)
- return SCM_BOOL_F;
- else
- return SCM_MAKINUM (cstart1);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_ci_neq, "string-ci<>", 2, 4, 0,
- (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2),
- "Return @code{#f} if @var{s1} and @var{s2} are equal, a true\n"
- "value otherwise. The character comparison is done\n"
- "case-insensitively.")
-#define FUNC_NAME s_scm_string_ci_neq
-{
- char * cstr1, * cstr2;
- int cstart1, cend1, cstart2, cend2;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
-
- while (cstart1 < cend1 && cstart2 < cend2)
- {
- if (scm_downcase (cstr1[cstart1]) < scm_downcase (cstr2[cstart2]))
- return SCM_MAKINUM (cstart1);
- else if (scm_downcase (cstr1[cstart1]) > scm_downcase (cstr2[cstart2]))
- return SCM_MAKINUM (cstart1);
- cstart1++;
- cstart2++;
- }
- if (cstart1 < cend1)
- return SCM_MAKINUM (cstart1);
- else if (cstart2 < cend2)
- return SCM_MAKINUM (cstart1);
- else
- return SCM_BOOL_F;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_ci_lt, "string-ci<", 2, 4, 0,
- (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2),
- "Return @code{#f} if @var{s1} is greater or equal to @var{s2}, a\n"
- "true value otherwise. The character comparison is done\n"
- "case-insensitively.")
-#define FUNC_NAME s_scm_string_ci_lt
-{
- char * cstr1, * cstr2;
- int cstart1, cend1, cstart2, cend2;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
-
- while (cstart1 < cend1 && cstart2 < cend2)
- {
- if (scm_downcase (cstr1[cstart1]) < scm_downcase (cstr2[cstart2]))
- return SCM_MAKINUM (cstart1);
- else if (scm_downcase (cstr1[cstart1]) > scm_downcase (cstr2[cstart2]))
- return SCM_BOOL_F;
- cstart1++;
- cstart2++;
- }
- if (cstart1 < cend1)
- return SCM_BOOL_F;
- else if (cstart2 < cend2)
- return SCM_MAKINUM (cstart1);
- else
- return SCM_BOOL_F;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_ci_gt, "string-ci>", 2, 4, 0,
- (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2),
- "Return @code{#f} if @var{s1} is less or equal to @var{s2}, a\n"
- "true value otherwise. The character comparison is done\n"
- "case-insensitively.")
-#define FUNC_NAME s_scm_string_ci_gt
-{
- char * cstr1, * cstr2;
- int cstart1, cend1, cstart2, cend2;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
-
- while (cstart1 < cend1 && cstart2 < cend2)
- {
- if (scm_downcase (cstr1[cstart1]) < scm_downcase (cstr2[cstart2]))
- return SCM_BOOL_F;
- else if (scm_downcase (cstr1[cstart1]) > scm_downcase (cstr2[cstart2]))
- return SCM_MAKINUM (cstart1);
- cstart1++;
- cstart2++;
- }
- if (cstart1 < cend1)
- return SCM_MAKINUM (cstart1);
- else if (cstart2 < cend2)
- return SCM_BOOL_F;
- else
- return SCM_BOOL_F;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_ci_le, "string-ci<=", 2, 4, 0,
- (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2),
- "Return @code{#f} if @var{s1} is greater to @var{s2}, a true\n"
- "value otherwise. The character comparison is done\n"
- "case-insensitively.")
-#define FUNC_NAME s_scm_string_ci_le
-{
- char * cstr1, * cstr2;
- int cstart1, cend1, cstart2, cend2;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
-
- while (cstart1 < cend1 && cstart2 < cend2)
- {
- if (scm_downcase (cstr1[cstart1]) < scm_downcase (cstr2[cstart2]))
- return SCM_MAKINUM (cstart1);
- else if (scm_downcase (cstr1[cstart1]) > scm_downcase (cstr2[cstart2]))
- return SCM_BOOL_F;
- cstart1++;
- cstart2++;
- }
- if (cstart1 < cend1)
- return SCM_BOOL_F;
- else if (cstart2 < cend2)
- return SCM_MAKINUM (cstart1);
- else
- return SCM_MAKINUM (cstart1);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_ci_ge, "string-ci>=", 2, 4, 0,
- (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2),
- "Return @code{#f} if @var{s1} is less to @var{s2}, a true value\n"
- "otherwise. The character comparison is done\n"
- "case-insensitively.")
-#define FUNC_NAME s_scm_string_ci_ge
-{
- char * cstr1, * cstr2;
- int cstart1, cend1, cstart2, cend2;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
-
- while (cstart1 < cend1 && cstart2 < cend2)
- {
- if (scm_downcase (cstr1[cstart1]) < scm_downcase (cstr2[cstart2]))
- return SCM_BOOL_F;
- else if (scm_downcase (cstr1[cstart1]) > scm_downcase (cstr2[cstart2]))
- return SCM_MAKINUM (cstart1);
- cstart1++;
- cstart2++;
- }
- if (cstart1 < cend1)
- return SCM_MAKINUM (cstart1);
- else if (cstart2 < cend2)
- return SCM_BOOL_F;
- else
- return SCM_MAKINUM (cstart1);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_prefix_length, "string-prefix-length", 2, 4, 0,
- (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2),
- "Return the length of the longest common prefix of the two\n"
- "strings.")
-#define FUNC_NAME s_scm_string_prefix_length
-{
- char * cstr1, * cstr2;
- int cstart1, cend1, cstart2, cend2;
- int len = 0;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
- while (cstart1 < cend1 && cstart2 < cend2)
- {
- if (cstr1[cstart1] != cstr2[cstart2])
- return SCM_MAKINUM (len);
- len++;
- cstart1++;
- cstart2++;
- }
- return SCM_MAKINUM (len);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_prefix_length_ci, "string-prefix-length-ci", 2, 4, 0,
- (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2),
- "Return the length of the longest common prefix of the two\n"
- "strings, ignoring character case.")
-#define FUNC_NAME s_scm_string_prefix_length_ci
-{
- char * cstr1, * cstr2;
- int cstart1, cend1, cstart2, cend2;
- int len = 0;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
- while (cstart1 < cend1 && cstart2 < cend2)
- {
- if (scm_downcase (cstr1[cstart1]) != scm_downcase (cstr2[cstart2]))
- return SCM_MAKINUM (len);
- len++;
- cstart1++;
- cstart2++;
- }
- return SCM_MAKINUM (len);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_suffix_length, "string-suffix-length", 2, 4, 0,
- (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2),
- "Return the length of the longest common suffix of the two\n"
- "strings.")
-#define FUNC_NAME s_scm_string_suffix_length
-{
- char * cstr1, * cstr2;
- int cstart1, cend1, cstart2, cend2;
- int len = 0;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
- while (cstart1 < cend1 && cstart2 < cend2)
- {
- cend1--;
- cend2--;
- if (cstr1[cend1] != cstr2[cend2])
- return SCM_MAKINUM (len);
- len++;
- }
- return SCM_MAKINUM (len);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_suffix_length_ci, "string-suffix-length-ci", 2, 4, 0,
- (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2),
- "Return the length of the longest common suffix of the two\n"
- "strings, ignoring character case.")
-#define FUNC_NAME s_scm_string_suffix_length_ci
-{
- char * cstr1, * cstr2;
- int cstart1, cend1, cstart2, cend2;
- int len = 0;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
- while (cstart1 < cend1 && cstart2 < cend2)
- {
- cend1--;
- cend2--;
- if (scm_downcase (cstr1[cend1]) != scm_downcase (cstr2[cend2]))
- return SCM_MAKINUM (len);
- len++;
- }
- return SCM_MAKINUM (len);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_prefix_p, "string-prefix?", 2, 4, 0,
- (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2),
- "Is @var{s1} a prefix of @var{s2}?")
-#define FUNC_NAME s_scm_string_prefix_p
-{
- char * cstr1, * cstr2;
- int cstart1, cend1, cstart2, cend2;
- int len = 0, len1;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
- len1 = cend1 - cstart1;
- while (cstart1 < cend1 && cstart2 < cend2)
- {
- if (cstr1[cstart1] != cstr2[cstart2])
- return SCM_BOOL (len == len1);
- len++;
- cstart1++;
- cstart2++;
- }
- return SCM_BOOL (len == len1);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_prefix_ci_p, "string-prefix-ci?", 2, 4, 0,
- (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2),
- "Is @var{s1} a prefix of @var{s2}, ignoring character case?")
-#define FUNC_NAME s_scm_string_prefix_ci_p
-{
- char * cstr1, * cstr2;
- int cstart1, cend1, cstart2, cend2;
- int len = 0, len1;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
- len1 = cend1 - cstart1;
- while (cstart1 < cend1 && cstart2 < cend2)
- {
- if (scm_downcase (cstr1[cstart1]) != scm_downcase (cstr2[cstart2]))
- return SCM_BOOL (len == len1);
- len++;
- cstart1++;
- cstart2++;
- }
- return SCM_BOOL (len == len1);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_suffix_p, "string-suffix?", 2, 4, 0,
- (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2),
- "Is @var{s1} a suffix of @var{s2}?")
-#define FUNC_NAME s_scm_string_suffix_p
-{
- char * cstr1, * cstr2;
- int cstart1, cend1, cstart2, cend2;
- int len = 0, len1;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
- len1 = cend1 - cstart1;
- while (cstart1 < cend1 && cstart2 < cend2)
- {
- cend1--;
- cend2--;
- if (cstr1[cend1] != cstr2[cend2])
- return SCM_BOOL (len == len1);
- len++;
- }
- return SCM_BOOL (len == len1);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_suffix_ci_p, "string-suffix-ci?", 2, 4, 0,
- (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2),
- "Is @var{s1} a suffix of @var{s2}, ignoring character case?")
-#define FUNC_NAME s_scm_string_suffix_ci_p
-{
- char * cstr1, * cstr2;
- int cstart1, cend1, cstart2, cend2;
- int len = 0, len1;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
- len1 = cend1 - cstart1;
- while (cstart1 < cend1 && cstart2 < cend2)
- {
- cend1--;
- cend2--;
- if (scm_downcase (cstr1[cend1]) != scm_downcase (cstr2[cend2]))
- return SCM_BOOL (len == len1);
- len++;
- }
- return SCM_BOOL (len == len1);
-}
-#undef FUNC_NAME
-
-
-/* FIXME::martin: The `S' is to avoid a name clash with the procedure
- in the core, which does not accept a predicate. */
-SCM_DEFINE (scm_string_indexS, "string-index", 2, 2, 0,
- (SCM s, SCM char_pred, SCM start, SCM end),
- "Search through the string @var{s} from left to right, returning\n"
- "the index of the first occurence of a character which\n"
- "\n"
- "@itemize @bullet\n"
- "@item\n"
- "equals @var{char_pred}, if it is character,\n"
- "\n"
- "@item\n"
- "satisifies the predicate @var{char_pred}, if it is a procedure,\n"
- "\n"
- "@item\n"
- "is in the set @var{char_pred}, if it is a character set.\n"
- "@end itemize")
-#define FUNC_NAME s_scm_string_indexS
-{
- char * cstr;
- int cstart, cend;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 3, start, cstart,
- 4, end, cend);
- if (SCM_CHARP (char_pred))
- {
- char cchr = SCM_CHAR (char_pred);
- while (cstart < cend)
- {
- if (cchr == cstr[cstart])
- return SCM_MAKINUM (cstart);
- cstart++;
- }
- }
- else if (SCM_CHARSETP (char_pred))
- {
- while (cstart < cend)
- {
- if (SCM_CHARSET_GET (char_pred, cstr[cstart]))
- return SCM_MAKINUM (cstart);
- cstart++;
- }
- }
- else
- {
- SCM_VALIDATE_PROC (2, char_pred);
- while (cstart < cend)
- {
- SCM res;
- res = scm_call_1 (char_pred, SCM_MAKE_CHAR (cstr[cstart]));
- if (!SCM_FALSEP (res))
- return SCM_MAKINUM (cstart);
- cstart++;
- }
- }
- return SCM_BOOL_F;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_index_right, "string-index-right", 2, 2, 0,
- (SCM s, SCM char_pred, SCM start, SCM end),
- "Search through the string @var{s} from right to left, returning\n"
- "the index of the last occurence of a character which\n"
- "\n"
- "@itemize @bullet\n"
- "@item\n"
- "equals @var{char_pred}, if it is character,\n"
- "\n"
- "@item\n"
- "satisifies the predicate @var{char_pred}, if it is a procedure,\n"
- "\n"
- "@item\n"
- "is in the set if @var{char_pred} is a character set.\n"
- "@end itemize")
-#define FUNC_NAME s_scm_string_index_right
-{
- char * cstr;
- int cstart, cend;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 3, start, cstart,
- 4, end, cend);
- if (SCM_CHARP (char_pred))
- {
- char cchr = SCM_CHAR (char_pred);
- while (cstart < cend)
- {
- cend--;
- if (cchr == cstr[cend])
- return SCM_MAKINUM (cend);
- }
- }
- else if (SCM_CHARSETP (char_pred))
- {
- while (cstart < cend)
- {
- cend--;
- if (SCM_CHARSET_GET (char_pred, cstr[cend]))
- return SCM_MAKINUM (cend);
- }
- }
- else
- {
- SCM_VALIDATE_PROC (2, char_pred);
- while (cstart < cend)
- {
- SCM res;
- cend--;
- res = scm_call_1 (char_pred, SCM_MAKE_CHAR (cstr[cend]));
- if (!SCM_FALSEP (res))
- return SCM_MAKINUM (cend);
- }
- }
- return SCM_BOOL_F;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_skip, "string-skip", 2, 2, 0,
- (SCM s, SCM char_pred, SCM start, SCM end),
- "Search through the string @var{s} from left to right, returning\n"
- "the index of the first occurence of a character which\n"
- "\n"
- "@itemize @bullet\n"
- "@item\n"
- "does not equal @var{char_pred}, if it is character,\n"
- "\n"
- "@item\n"
- "does not satisify the predicate @var{char_pred}, if it is a\n"
- "procedure,\n"
- "\n"
- "@item\n"
- "is not in the set if @var{char_pred} is a character set.\n"
- "@end itemize")
-#define FUNC_NAME s_scm_string_skip
-{
- char * cstr;
- int cstart, cend;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 3, start, cstart,
- 4, end, cend);
- if (SCM_CHARP (char_pred))
- {
- char cchr = SCM_CHAR (char_pred);
- while (cstart < cend)
- {
- if (cchr != cstr[cstart])
- return SCM_MAKINUM (cstart);
- cstart++;
- }
- }
- else if (SCM_CHARSETP (char_pred))
- {
- while (cstart < cend)
- {
- if (!SCM_CHARSET_GET (char_pred, cstr[cstart]))
- return SCM_MAKINUM (cstart);
- cstart++;
- }
- }
- else
- {
- SCM_VALIDATE_PROC (2, char_pred);
- while (cstart < cend)
- {
- SCM res;
- res = scm_call_1 (char_pred, SCM_MAKE_CHAR (cstr[cstart]));
- if (SCM_FALSEP (res))
- return SCM_MAKINUM (cstart);
- cstart++;
- }
- }
- return SCM_BOOL_F;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_skip_right, "string-skip-right", 2, 2, 0,
- (SCM s, SCM char_pred, SCM start, SCM end),
- "Search through the string @var{s} from right to left, returning\n"
- "the index of the last occurence of a character which\n"
- "\n"
- "@itemize @bullet\n"
- "@item\n"
- "does not equal @var{char_pred}, if it is character,\n"
- "\n"
- "@item\n"
- "does not satisifie the predicate @var{char_pred}, if it is a\n"
- "procedure,\n"
- "\n"
- "@item\n"
- "is not in the set if @var{char_pred} is a character set.\n"
- "@end itemize")
-#define FUNC_NAME s_scm_string_skip_right
-{
- char * cstr;
- int cstart, cend;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 3, start, cstart,
- 4, end, cend);
- if (SCM_CHARP (char_pred))
- {
- char cchr = SCM_CHAR (char_pred);
- while (cstart < cend)
- {
- cend--;
- if (cchr != cstr[cend])
- return SCM_MAKINUM (cend);
- }
- }
- else if (SCM_CHARSETP (char_pred))
- {
- while (cstart < cend)
- {
- cend--;
- if (!SCM_CHARSET_GET (char_pred, cstr[cend]))
- return SCM_MAKINUM (cend);
- }
- }
- else
- {
- SCM_VALIDATE_PROC (2, char_pred);
- while (cstart < cend)
- {
- SCM res;
- cend--;
- res = scm_call_1 (char_pred, SCM_MAKE_CHAR (cstr[cend]));
- if (SCM_FALSEP (res))
- return SCM_MAKINUM (cend);
- }
- }
- return SCM_BOOL_F;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_count, "string-count", 2, 2, 0,
- (SCM s, SCM char_pred, SCM start, SCM end),
- "Return the count of the number of characters in the string\n"
- "@var{s} which\n"
- "\n"
- "@itemize @bullet\n"
- "@item\n"
- "equals @var{char_pred}, if it is character,\n"
- "\n"
- "@item\n"
- "satisifies the predicate @var{char_pred}, if it is a procedure.\n"
- "\n"
- "@item\n"
- "is in the set @var{char_pred}, if it is a character set.\n"
- "@end itemize")
-#define FUNC_NAME s_scm_string_count
-{
- char * cstr;
- int cstart, cend;
- int count = 0;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 3, start, cstart,
- 4, end, cend);
- if (SCM_CHARP (char_pred))
- {
- char cchr = SCM_CHAR (char_pred);
- while (cstart < cend)
- {
- if (cchr == cstr[cstart])
- count++;
- cstart++;
- }
- }
- else if (SCM_CHARSETP (char_pred))
- {
- while (cstart < cend)
- {
- if (SCM_CHARSET_GET (char_pred, cstr[cstart]))
- count++;
- cstart++;
- }
- }
- else
- {
- SCM_VALIDATE_PROC (2, char_pred);
- while (cstart < cend)
- {
- SCM res;
- res = scm_call_1 (char_pred, SCM_MAKE_CHAR (cstr[cstart]));
- if (!SCM_FALSEP (res))
- count++;
- cstart++;
- }
- }
- return SCM_MAKINUM (count);
-}
-#undef FUNC_NAME
-
-
-/* FIXME::martin: This should definitely get implemented more
- efficiently -- maybe with Knuth-Morris-Pratt, like in the reference
- implementation. */
-SCM_DEFINE (scm_string_contains, "string-contains", 2, 4, 0,
- (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2),
- "Does string @var{s1} contain string @var{s2}? Return the index\n"
- "in @var{s1} where @var{s2} occurs as a substring, or false.\n"
- "The optional start/end indices restrict the operation to the\n"
- "indicated substrings.")
-#define FUNC_NAME s_scm_string_contains
-{
- char * cs1, * cs2;
- int cstart1, cend1, cstart2, cend2;
- int len2, i, j;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cs1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cs2,
- 5, start2, cstart2,
- 6, end2, cend2);
- len2 = cend2 - cstart2;
- while (cstart1 <= cend1 - len2)
- {
- i = cstart1;
- j = cstart2;
- while (i < cend1 && j < cend2 && cs1[i] == cs2[j])
- {
- i++;
- j++;
- }
- if (j == cend2)
- return SCM_MAKINUM (cstart1);
- cstart1++;
- }
- return SCM_BOOL_F;
-}
-#undef FUNC_NAME
-
-
-/* FIXME::martin: This should definitely get implemented more
- efficiently -- maybe with Knuth-Morris-Pratt, like in the reference
- implementation. */
-SCM_DEFINE (scm_string_contains_ci, "string-contains-ci", 2, 4, 0,
- (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2),
- "Does string @var{s1} contain string @var{s2}? Return the index\n"
- "in @var{s1} where @var{s2} occurs as a substring, or false.\n"
- "The optional start/end indices restrict the operation to the\n"
- "indicated substrings. Character comparison is done\n"
- "case-insensitively.")
-#define FUNC_NAME s_scm_string_contains_ci
-{
- char * cs1, * cs2;
- int cstart1, cend1, cstart2, cend2;
- int len2, i, j;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cs1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cs2,
- 5, start2, cstart2,
- 6, end2, cend2);
- len2 = cend2 - cstart2;
- while (cstart1 <= cend1 - len2)
- {
- i = cstart1;
- j = cstart2;
- while (i < cend1 && j < cend2 &&
- scm_downcase (cs1[i]) == scm_downcase (cs2[j]))
- {
- i++;
- j++;
- }
- if (j == cend2)
- return SCM_MAKINUM (cstart1);
- cstart1++;
- }
- return SCM_BOOL_F;
-}
-#undef FUNC_NAME
-
-
-/* Helper function for the string uppercase conversion functions.
- * No argument checking is performed. */
-static SCM
-string_upcase_x (SCM v, int start, int end)
-{
- unsigned long k;
-
- for (k = start; k < end; ++k)
- SCM_STRING_UCHARS (v) [k] = scm_upcase (SCM_STRING_UCHARS (v) [k]);
-
- return v;
-}
-
-
-/* FIXME::martin: The `S' is to avoid a name clash with the procedure
- in the core, which does not accept start/end indices */
-SCM_DEFINE (scm_string_upcase_xS, "string-upcase!", 1, 2, 0,
- (SCM str, SCM start, SCM end),
- "Destructively upcase every character in @code{str}.\n"
- "\n"
- "@lisp\n"
- "(string-upcase! y)\n"
- "@result{} \"ARRDEFG\"\n"
- "y\n"
- "@result{} \"ARRDEFG\"\n"
- "@end lisp")
-#define FUNC_NAME s_scm_string_upcase_xS
-{
- char * cstr;
- int cstart, cend;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
- 2, start, cstart,
- 3, end, cend);
- return string_upcase_x (str, cstart, cend);
-}
-#undef FUNC_NAME
-
-
-/* FIXME::martin: The `S' is to avoid a name clash with the procedure
- in the core, which does not accept start/end indices */
-SCM_DEFINE (scm_string_upcaseS, "string-upcase", 1, 2, 0,
- (SCM str, SCM start, SCM end),
- "Upcase every character in @code{str}.")
-#define FUNC_NAME s_scm_string_upcaseS
-{
- char * cstr;
- int cstart, cend;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
- 2, start, cstart,
- 3, end, cend);
- return string_upcase_x (scm_string_copy (str), cstart, cend);
-}
-#undef FUNC_NAME
-
-
-/* Helper function for the string lowercase conversion functions.
- * No argument checking is performed. */
-static SCM
-string_downcase_x (SCM v, int start, int end)
-{
- unsigned long k;
-
- for (k = start; k < end; ++k)
- SCM_STRING_UCHARS (v) [k] = scm_downcase (SCM_STRING_UCHARS (v) [k]);
-
- return v;
-}
-
-
-/* FIXME::martin: The `S' is to avoid a name clash with the procedure
- in the core, which does not accept start/end indices */
-SCM_DEFINE (scm_string_downcase_xS, "string-downcase!", 1, 2, 0,
- (SCM str, SCM start, SCM end),
- "Destructively downcase every character in @var{str}.\n"
- "\n"
- "@lisp\n"
- "y\n"
- "@result{} \"ARRDEFG\"\n"
- "(string-downcase! y)\n"
- "@result{} \"arrdefg\"\n"
- "y\n"
- "@result{} \"arrdefg\"\n"
- "@end lisp")
-#define FUNC_NAME s_scm_string_downcase_xS
-{
- char * cstr;
- int cstart, cend;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
- 2, start, cstart,
- 3, end, cend);
- return string_downcase_x (str, cstart, cend);
-}
-#undef FUNC_NAME
-
-
-/* FIXME::martin: The `S' is to avoid a name clash with the procedure
- in the core, which does not accept start/end indices */
-SCM_DEFINE (scm_string_downcaseS, "string-downcase", 1, 2, 0,
- (SCM str, SCM start, SCM end),
- "Downcase every character in @var{str}.")
-#define FUNC_NAME s_scm_string_downcaseS
-{
- char * cstr;
- int cstart, cend;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
- 2, start, cstart,
- 3, end, cend);
- return string_downcase_x (scm_string_copy (str), cstart, cend);
-}
-#undef FUNC_NAME
-
-
-/* Helper function for the string capitalization functions.
- * No argument checking is performed. */
-static SCM
-string_titlecase_x (SCM str, int start, int end)
-{
- unsigned char * sz;
- int i, in_word = 0;
-
- sz = SCM_STRING_UCHARS (str);
- for(i = start; i < end; i++)
- {
- if (!SCM_FALSEP (scm_char_alphabetic_p (SCM_MAKE_CHAR (sz[i]))))
- {
- if (!in_word)
- {
- sz[i] = scm_upcase(sz[i]);
- in_word = 1;
- }
- else
- {
- sz[i] = scm_downcase(sz[i]);
- }
- }
- else
- in_word = 0;
- }
- return str;
-}
-
-
-SCM_DEFINE (scm_string_titlecase_x, "string-titlecase!", 1, 2, 0,
- (SCM str, SCM start, SCM end),
- "Destructively titlecase every first character in a word in\n"
- "@var{str}.")
-#define FUNC_NAME s_scm_string_titlecase_x
-{
- char * cstr;
- int cstart, cend;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
- 2, start, cstart,
- 3, end, cend);
- return string_titlecase_x (str, cstart, cend);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_titlecase, "string-titlecase", 1, 2, 0,
- (SCM str, SCM start, SCM end),
- "Titlecase every first character in a word in @var{str}.")
-#define FUNC_NAME s_scm_string_titlecase
-{
- char * cstr;
- int cstart, cend;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
- 2, start, cstart,
- 3, end, cend);
- return string_titlecase_x (scm_string_copy (str), cstart, cend);
-}
-#undef FUNC_NAME
-
-
-/* Reverse the portion of @var{str} between str[cstart] (including)
- and str[cend] excluding. */
-static void
-string_reverse_x (char * str, int cstart, int cend)
-{
- char tmp;
-
- cend--;
- while (cstart < cend)
- {
- tmp = str[cstart];
- str[cstart] = str[cend];
- str[cend] = tmp;
- cstart++;
- cend--;
- }
-}
-
-
-SCM_DEFINE (scm_string_reverse, "string-reverse", 1, 2, 0,
- (SCM str, SCM start, SCM end),
- "Reverse the string @var{str}. The optional arguments\n"
- "@var{start} and @var{end} delimit the region of @var{str} to\n"
- "operate on.")
-#define FUNC_NAME s_scm_string_reverse
-{
- char * cstr;
- int cstart;
- int cend;
- SCM result;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
- 2, start, cstart,
- 3, end, cend);
- result = scm_string_copy (str);
- string_reverse_x (SCM_STRING_CHARS (result), cstart, cend);
- return result;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_reverse_x, "string-reverse!", 1, 2, 0,
- (SCM str, SCM start, SCM end),
- "Reverse the string @var{str} in-place. The optional arguments\n"
- "@var{start} and @var{end} delimit the region of @var{str} to\n"
- "operate on. The return value is unspecified.")
-#define FUNC_NAME s_scm_string_reverse_x
-{
- char * cstr;
- int cstart;
- int cend;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, str, cstr,
- 2, start, cstart,
- 3, end, cend);
- string_reverse_x (SCM_STRING_CHARS (str), cstart, cend);
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_append_shared, "string-append/shared", 0, 0, 1,
- (SCM ls),
- "Like @code{string-append}, but the result may share memory\n"
- "with the argument strings.")
-#define FUNC_NAME s_scm_string_append_shared
-{
- long i;
-
- SCM_VALIDATE_REST_ARGUMENT (ls);
-
- /* Optimize the one-argument case. */
- i = scm_ilength (ls);
- if (i == 1)
- return SCM_CAR (ls);
- else
- return scm_string_append (ls);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_concatenate, "string-concatenate", 1, 0, 0,
- (SCM ls),
- "Append the elements of @var{ls} (which must be strings)\n"
- "together into a single string. Guaranteed to return a freshly\n"
- "allocated string.")
-#define FUNC_NAME s_scm_string_concatenate
-{
- long strings = scm_ilength (ls);
- SCM tmp, result;
- int len = 0;
- char * p;
-
- /* Validate the string list. */
- if (strings < 0)
- SCM_WRONG_TYPE_ARG (1, ls);
-
- /* Calculate the size of the result string. */
- tmp = ls;
- while (!SCM_NULLP (tmp))
- {
- SCM elt = SCM_CAR (tmp);
- SCM_VALIDATE_STRING (1, elt);
- len += SCM_STRING_LENGTH (elt);
- tmp = SCM_CDR (tmp);
- }
- result = scm_allocate_string (len);
-
- /* Copy the list elements into the result. */
- p = SCM_STRING_CHARS (result);
- tmp = ls;
- while (!SCM_NULLP (tmp))
- {
- SCM elt = SCM_CAR (tmp);
- memmove (p, SCM_STRING_CHARS (elt),
- SCM_STRING_LENGTH (elt) * sizeof (char));
- p += SCM_STRING_LENGTH (elt);
- tmp = SCM_CDR (tmp);
- }
- return result;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_concatenate_reverse, "string-concatenate-reverse", 1, 2, 0,
- (SCM ls, SCM final_string, SCM end),
- "Without optional arguments, this procedure is equivalent to\n"
- "\n"
- "@smalllisp\n"
- "(string-concatenate (reverse ls))\n"
- "@end smalllisp\n"
- "\n"
- "If the optional argument @var{final_string} is specified, it is\n"
- "consed onto the beginning to @var{ls} before performing the\n"
- "list-reverse and string-concatenate operations. If @var{end}\n"
- "is given, only the characters of @var{final_string} up to index\n"
- "@var{end} are used.\n"
- "\n"
- "Guaranteed to return a freshly allocated string.")
-#define FUNC_NAME s_scm_string_concatenate_reverse
-{
- long strings;
- SCM tmp, result;
- int len = 0;
- char * p;
- int cend = 0;
-
- /* Check the optional arguments and calculate the additional length
- of the result string. */
- if (!SCM_UNBNDP (final_string))
- {
- SCM_VALIDATE_STRING (2, final_string);
- if (!SCM_UNBNDP (end))
- {
- SCM_VALIDATE_INUM_COPY (3, end, cend);
- SCM_ASSERT_RANGE (3, end,
- (cend >= 0) &&
- (cend <= SCM_STRING_LENGTH (final_string)));
- }
- else
- {
- cend = SCM_STRING_LENGTH (final_string);
- }
- len += cend;
- }
- strings = scm_ilength (ls);
- /* Validate the string list. */
- if (strings < 0)
- SCM_WRONG_TYPE_ARG (1, ls);
-
- /* Calculate the length of the result string. */
- tmp = ls;
- while (!SCM_NULLP (tmp))
- {
- SCM elt = SCM_CAR (tmp);
- SCM_VALIDATE_STRING (1, elt);
- len += SCM_STRING_LENGTH (elt);
- tmp = SCM_CDR (tmp);
- }
-
- result = scm_allocate_string (len);
-
- p = SCM_STRING_CHARS (result) + len;
-
- /* Construct the result string, possibly by using the optional final
- string. */
- if (!SCM_UNBNDP (final_string))
- {
- p -= cend;
- memmove (p, SCM_STRING_CHARS (final_string), cend * sizeof (char));
- }
- tmp = ls;
- while (!SCM_NULLP (tmp))
- {
- SCM elt = SCM_CAR (tmp);
- p -= SCM_STRING_LENGTH (elt);
- memmove (p, SCM_STRING_CHARS (elt),
- SCM_STRING_LENGTH (elt) * sizeof (char));
- tmp = SCM_CDR (tmp);
- }
- return result;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_concatenate_shared, "string-concatenate/shared", 1, 0, 0,
- (SCM ls),
- "Like @code{string-concatenate}, but the result may share memory\n"
- "with the strings in the list @var{ls}.")
-#define FUNC_NAME s_scm_string_concatenate_shared
-{
- /* Optimize the one-string case. */
- long i = scm_ilength (ls);
- if (i == 1)
- {
- SCM_VALIDATE_STRING (1, SCM_CAR (ls));
- return SCM_CAR (ls);
- }
- return scm_string_concatenate (ls);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_concatenate_reverse_shared, "string-concatenate-reverse/shared", 1, 2, 0,
- (SCM ls, SCM final_string, SCM end),
- "Like @code{string-concatenate-reverse}, but the result may\n"
- "share memory with the the strings in the @var{ls} arguments.")
-#define FUNC_NAME s_scm_string_concatenate_reverse_shared
-{
- /* Just call the non-sharing version. */
- return scm_string_concatenate_reverse (ls, final_string, end);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_map, "string-map", 2, 2, 0,
- (SCM proc, SCM s, SCM start, SCM end),
- "@var{proc} is a char->char procedure, it is mapped over\n"
- "@var{s}. The order in which the procedure is applied to the\n"
- "string elements is not specified.")
-#define FUNC_NAME s_scm_string_map
-{
- char * cstr, *p;
- int cstart, cend;
- SCM result;
-
- SCM_VALIDATE_PROC (1, proc);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s, cstr,
- 3, start, cstart,
- 4, end, cend);
- result = scm_allocate_string (cend - cstart);
- p = SCM_STRING_CHARS (result);
- while (cstart < cend)
- {
- SCM ch = scm_call_1 (proc, SCM_MAKE_CHAR (cstr[cstart]));
- if (!SCM_CHARP (ch))
- SCM_MISC_ERROR ("procedure ~S returned non-char", scm_list_1 (proc));
- cstart++;
- *p++ = SCM_CHAR (ch);
- }
- return result;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_map_x, "string-map!", 2, 2, 0,
- (SCM proc, SCM s, SCM start, SCM end),
- "@var{proc} is a char->char procedure, it is mapped over\n"
- "@var{s}. The order in which the procedure is applied to the\n"
- "string elements is not specified. The string @var{s} is\n"
- "modified in-place, the return value is not specified.")
-#define FUNC_NAME s_scm_string_map_x
-{
- char * cstr, *p;
- int cstart, cend;
-
- SCM_VALIDATE_PROC (1, proc);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s, cstr,
- 3, start, cstart,
- 4, end, cend);
- p = SCM_STRING_CHARS (s) + cstart;
- while (cstart < cend)
- {
- SCM ch = scm_call_1 (proc, SCM_MAKE_CHAR (cstr[cstart]));
- if (!SCM_CHARP (ch))
- SCM_MISC_ERROR ("procedure ~S returned non-char", scm_list_1 (proc));
- cstart++;
- *p++ = SCM_CHAR (ch);
- }
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_fold, "string-fold", 3, 2, 0,
- (SCM kons, SCM knil, SCM s, SCM start, SCM end),
- "Fold @var{kons} over the characters of @var{s}, with @var{knil}\n"
- "as the terminating element, from left to right. @var{kons}\n"
- "must expect two arguments: The actual character and the last\n"
- "result of @var{kons}' application.")
-#define FUNC_NAME s_scm_string_fold
-{
- char * cstr;
- int cstart, cend;
- SCM result;
-
- SCM_VALIDATE_PROC (1, kons);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (3, s, cstr,
- 4, start, cstart,
- 5, end, cend);
- result = knil;
- while (cstart < cend)
- {
- result = scm_call_2 (kons, SCM_MAKE_CHAR (cstr[cstart]), result);
- cstart++;
- }
- return result;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_fold_right, "string-fold-right", 3, 2, 0,
- (SCM kons, SCM knil, SCM s, SCM start, SCM end),
- "Fold @var{kons} over the characters of @var{s}, with @var{knil}\n"
- "as the terminating element, from right to left. @var{kons}\n"
- "must expect two arguments: The actual character and the last\n"
- "result of @var{kons}' application.")
-#define FUNC_NAME s_scm_string_fold_right
-{
- char * cstr;
- int cstart, cend;
- SCM result;
-
- SCM_VALIDATE_PROC (1, kons);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (3, s, cstr,
- 4, start, cstart,
- 5, end, cend);
- result = knil;
- while (cstart < cend)
- {
- result = scm_call_2 (kons, SCM_MAKE_CHAR (cstr[cend - 1]), result);
- cend--;
- }
- return result;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_unfold, "string-unfold", 4, 2, 0,
- (SCM p, SCM f, SCM g, SCM seed, SCM base, SCM make_final),
- "@itemize @bullet\n"
- "@item @var{g} is used to generate a series of @emph{seed}\n"
- "values from the initial @var{seed}: @var{seed}, (@var{g}\n"
- "@var{seed}), (@var{g}^2 @var{seed}), (@var{g}^3 @var{seed}),\n"
- "@dots{}\n"
- "@item @var{p} tells us when to stop -- when it returns true\n"
- "when applied to one of these seed values.\n"
- "@item @var{f} maps each seed value to the corresponding\n"
- "character in the result string. These chars are assembled\n"
- "into the string in a left-to-right order.\n"
- "@item @var{base} is the optional initial/leftmost portion\n"
- "of the constructed string; it default to the empty\n"
- "string.\n"
- "@item @var{make_final} is applied to the terminal seed\n"
- "value (on which @var{p} returns true) to produce\n"
- "the final/rightmost portion of the constructed string.\n"
- "It defaults to @code{(lambda (x) "")}.\n"
- "@end itemize")
-#define FUNC_NAME s_scm_string_unfold
-{
- SCM res, ans;
-
- SCM_VALIDATE_PROC (1, p);
- SCM_VALIDATE_PROC (2, f);
- SCM_VALIDATE_PROC (3, g);
- if (!SCM_UNBNDP (base))
- {
- SCM_VALIDATE_STRING (5, base);
- ans = base;
- }
- else
- ans = scm_allocate_string (0);
- if (!SCM_UNBNDP (make_final))
- SCM_VALIDATE_PROC (6, make_final);
-
- res = scm_call_1 (p, seed);
- while (SCM_FALSEP (res))
- {
- SCM str;
- SCM ch = scm_call_1 (f, seed);
- if (!SCM_CHARP (ch))
- SCM_MISC_ERROR ("procedure ~S returned non-char", scm_list_1 (f));
- str = scm_allocate_string (1);
- *SCM_STRING_CHARS (str) = SCM_CHAR (ch);
-
- ans = scm_string_append (scm_list_2 (ans, str));
- seed = scm_call_1 (g, seed);
- res = scm_call_1 (p, seed);
- }
- if (!SCM_UNBNDP (make_final))
- {
- res = scm_call_1 (make_final, seed);
- return scm_string_append (scm_list_2 (ans, res));
- }
- else
- return ans;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_unfold_right, "string-unfold-right", 4, 2, 0,
- (SCM p, SCM f, SCM g, SCM seed, SCM base, SCM make_final),
- "@itemize @bullet\n"
- "@item @var{g} is used to generate a series of @emph{seed}\n"
- "values from the initial @var{seed}: @var{seed}, (@var{g}\n"
- "@var{seed}), (@var{g}^2 @var{seed}), (@var{g}^3 @var{seed}),\n"
- "@dots{}\n"
- "@item @var{p} tells us when to stop -- when it returns true\n"
- "when applied to one of these seed values.\n"
- "@item @var{f} maps each seed value to the corresponding\n"
- "character in the result string. These chars are assembled\n"
- "into the string in a right-to-left order.\n"
- "@item @var{base} is the optional initial/rightmost portion\n"
- "of the constructed string; it default to the empty\n"
- "string.\n"
- "@item @var{make_final} is applied to the terminal seed\n"
- "value (on which @var{p} returns true) to produce\n"
- "the final/leftmost portion of the constructed string.\n"
- "It defaults to @code{(lambda (x) "")}.\n"
- "@end itemize")
-#define FUNC_NAME s_scm_string_unfold_right
-{
- SCM res, ans;
-
- SCM_VALIDATE_PROC (1, p);
- SCM_VALIDATE_PROC (2, f);
- SCM_VALIDATE_PROC (3, g);
- if (!SCM_UNBNDP (base))
- {
- SCM_VALIDATE_STRING (5, base);
- ans = base;
- }
- else
- ans = scm_allocate_string (0);
- if (!SCM_UNBNDP (make_final))
- SCM_VALIDATE_PROC (6, make_final);
-
- res = scm_call_1 (p, seed);
- while (SCM_FALSEP (res))
- {
- SCM str;
- SCM ch = scm_call_1 (f, seed);
- if (!SCM_CHARP (ch))
- SCM_MISC_ERROR ("procedure ~S returned non-char", scm_list_1 (f));
- str = scm_allocate_string (1);
- *SCM_STRING_CHARS (str) = SCM_CHAR (ch);
-
- ans = scm_string_append (scm_list_2 (str, ans));
- seed = scm_call_1 (g, seed);
- res = scm_call_1 (p, seed);
- }
- if (!SCM_UNBNDP (make_final))
- {
- res = scm_call_1 (make_final, seed);
- return scm_string_append (scm_list_2 (res, ans));
- }
- else
- return ans;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_for_each, "string-for-each", 2, 2, 0,
- (SCM proc, SCM s, SCM start, SCM end),
- "@var{proc} is mapped over @var{s} in left-to-right order. The\n"
- "return value is not specified.")
-#define FUNC_NAME s_scm_string_for_each
-{
- char * cstr;
- int cstart, cend;
-
- SCM_VALIDATE_PROC (1, proc);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s, cstr,
- 3, start, cstart,
- 4, end, cend);
- while (cstart < cend)
- {
- scm_call_1 (proc, SCM_MAKE_CHAR (cstr[cstart]));
- cstart++;
- }
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
-SCM_DEFINE (scm_string_for_each_index, "string-for-each-index", 2, 2, 0,
- (SCM proc, SCM s, SCM start, SCM end),
- "@var{proc} is mapped over @var{s} in left-to-right order. The\n"
- "return value is not specified.")
-#define FUNC_NAME s_scm_string_for_each
-{
- char * cstr;
- int cstart, cend;
-
- SCM_VALIDATE_PROC (1, proc);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s, cstr,
- 3, start, cstart,
- 4, end, cend);
- while (cstart < cend)
- {
- scm_call_1 (proc, SCM_MAKINUM (cstart));
- cstart++;
- }
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
-SCM_DEFINE (scm_xsubstring, "xsubstring", 2, 3, 0,
- (SCM s, SCM from, SCM to, SCM start, SCM end),
- "This is the @emph{extended substring} procedure that implements\n"
- "replicated copying of a substring of some string.\n"
- "\n"
- "@var{s} is a string, @var{start} and @var{end} are optional\n"
- "arguments that demarcate a substring of @var{s}, defaulting to\n"
- "0 and the length of @var{s}. Replicate this substring up and\n"
- "down index space, in both the positive and negative directions.\n"
- "@code{xsubstring} returns the substring of this string\n"
- "beginning at index @var{from}, and ending at @var{to}, which\n"
- "defaults to @var{from} + (@var{end} - @var{start}).")
-#define FUNC_NAME s_scm_xsubstring
-{
- char * cs, * p;
- int cstart, cend, cfrom, cto;
- SCM result;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cs,
- 4, start, cstart,
- 5, end, cend);
- SCM_VALIDATE_INUM_COPY (2, from, cfrom);
- SCM_VALIDATE_INUM_DEF_COPY (3, to, cfrom + (cend - cstart), cto);
- if (cstart == cend && cfrom != cto)
- SCM_MISC_ERROR ("start and end indices must not be equal", SCM_EOL);
-
- result = scm_allocate_string (cto - cfrom);
-
- p = SCM_STRING_CHARS (result);
- while (cfrom < cto)
- {
- int t = ((cfrom < 0) ? -cfrom : cfrom) % (cend - cstart);
- if (cfrom < 0)
- *p = cs[(cend - cstart) - t];
- else
- *p = cs[t];
- cfrom++;
- p++;
- }
- return result;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_xcopy_x, "string-xcopy!", 4, 3, 0,
- (SCM target, SCM tstart, SCM s, SCM sfrom, SCM sto, SCM start, SCM end),
- "Exactly the same as @code{xsubstring}, but the extracted text\n"
- "is written into the string @var{target} starting at index\n"
- "@var{tstart}. The operation is not defined if @code{(eq?\n"
- "@var{target} @var{s})} or these arguments share storage -- you\n"
- "cannot copy a string on top of itself.")
-#define FUNC_NAME s_scm_string_xcopy_x
-{
- char * ctarget, * cs, * p;
- int ctstart, csfrom, csto, cstart, cend;
- SCM dummy = SCM_UNDEFINED;
- int cdummy;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, target, ctarget,
- 2, tstart, ctstart,
- 2, dummy, cdummy);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (3, s, cs,
- 6, start, cstart,
- 7, end, cend);
- SCM_VALIDATE_INUM_COPY (4, sfrom, csfrom);
- SCM_VALIDATE_INUM_DEF_COPY (5, sto, csfrom + (cend - cstart), csto);
- if (cstart == cend && csfrom != csto)
- SCM_MISC_ERROR ("start and end indices must not be equal", SCM_EOL);
- SCM_ASSERT_RANGE (1, tstart,
- ctstart + (csto - csfrom) <= SCM_STRING_LENGTH (target));
-
- p = ctarget + ctstart;
- while (csfrom < csto)
- {
- int t = ((csfrom < 0) ? -csfrom : csfrom) % (cend - cstart);
- if (csfrom < 0)
- *p = cs[(cend - cstart) - t];
- else
- *p = cs[t];
- csfrom++;
- p++;
- }
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_replace, "string-replace", 2, 4, 0,
- (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2),
- "Return the string @var{s1}, but with the characters\n"
- "@var{start1} @dots{} @var{end1} replaced by the characters\n"
- "@var{start2} @dots{} @var{end2} from @var{s2}.")
-#define FUNC_NAME s_scm_string_replace
-{
- char * cstr1, * cstr2, * p;
- int cstart1, cend1, cstart2, cend2;
- SCM result;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
- 3, start1, cstart1,
- 4, end1, cend1);
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (2, s2, cstr2,
- 5, start2, cstart2,
- 6, end2, cend2);
- result = scm_allocate_string (cstart1 + (cend2 - cstart2) +
- SCM_STRING_LENGTH (s1) - cend1);
- p = SCM_STRING_CHARS (result);
- memmove (p, cstr1, cstart1 * sizeof (char));
- memmove (p + cstart1, cstr2 + cstart2, (cend2 - cstart2) * sizeof (char));
- memmove (p + cstart1 + (cend2 - cstart2),
- cstr1 + cend1,
- (SCM_STRING_LENGTH (s1) - cend1) * sizeof (char));
- return result;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_tokenize, "string-tokenize", 1, 3, 0,
- (SCM s, SCM token_set, SCM start, SCM end),
- "Split the string @var{s} into a list of substrings, where each\n"
- "substring is a maximal non-empty contiguous sequence of\n"
- "characters from the character set @var{token_set}, which\n"
- "defaults to @code{char-set:graphic} from module (srfi srfi-14).\n"
- "If @var{start} or @var{end} indices are provided, they restrict\n"
- "@code{string-tokenize} to operating on the indicated substring\n"
- "of @var{s}.")
-#define FUNC_NAME s_scm_string_tokenize
-{
- char * cstr;
- int cstart, cend;
- SCM result = SCM_EOL;
-
- static SCM charset_graphic = SCM_BOOL_F;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 3, start, cstart,
- 4, end, cend);
-
- if (SCM_UNBNDP (token_set))
- {
- if (charset_graphic == SCM_BOOL_F)
- {
- SCM srfi_14_module = scm_c_resolve_module ("srfi srfi-14");
- SCM charset_graphic_var = scm_c_module_lookup (srfi_14_module,
- "char-set:graphic");
- charset_graphic =
- scm_permanent_object (SCM_VARIABLE_REF (charset_graphic_var));
- }
- token_set = charset_graphic;
- }
-
- if (SCM_CHARSETP (token_set))
- {
- int idx;
-
- while (cstart < cend)
- {
- while (cstart < cend)
- {
- if (SCM_CHARSET_GET (token_set, cstr[cend - 1]))
- break;
- cend--;
- }
- if (cstart >= cend)
- break;
- idx = cend;
- while (cstart < cend)
- {
- if (!SCM_CHARSET_GET (token_set, cstr[cend - 1]))
- break;
- cend--;
- }
- result = scm_cons (scm_mem2string (cstr + cend, idx - cend), result);
- }
- }
- else SCM_WRONG_TYPE_ARG (2, token_set);
- return result;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_filter, "string-filter", 2, 2, 0,
- (SCM s, SCM char_pred, SCM start, SCM end),
- "Filter the string @var{s}, retaining only those characters that\n"
- "satisfy the @var{char_pred} argument. If the argument is a\n"
- "procedure, it is applied to each character as a predicate, if\n"
- "it is a character, it is tested for equality and if it is a\n"
- "character set, it is tested for membership.")
-#define FUNC_NAME s_scm_string_filter
-{
- char * cstr;
- int cstart, cend;
- SCM result;
- int idx;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 3, start, cstart,
- 4, end, cend);
- if (SCM_CHARP (char_pred))
- {
- SCM ls = SCM_EOL;
- char chr;
-
- chr = SCM_CHAR (char_pred);
- idx = cstart;
- while (idx < cend)
- {
- if (cstr[idx] == chr)
- ls = scm_cons (SCM_MAKE_CHAR (cstr[idx]), ls);
- idx++;
- }
- result = scm_reverse_list_to_string (ls);
- }
- else if (SCM_CHARSETP (char_pred))
- {
- SCM ls = SCM_EOL;
-
- idx = cstart;
- while (idx < cend)
- {
- if (SCM_CHARSET_GET (char_pred, cstr[idx]))
- ls = scm_cons (SCM_MAKE_CHAR (cstr[idx]), ls);
- idx++;
- }
- result = scm_reverse_list_to_string (ls);
- }
- else
- {
- SCM ls = SCM_EOL;
-
- SCM_VALIDATE_PROC (2, char_pred);
- idx = cstart;
- while (idx < cend)
- {
- SCM res;
- res = scm_call_1 (char_pred, SCM_MAKE_CHAR (cstr[idx]));
- if (!SCM_FALSEP (res))
- ls = scm_cons (SCM_MAKE_CHAR (cstr[idx]), ls);
- idx++;
- }
- result = scm_reverse_list_to_string (ls);
- }
- return result;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_delete, "string-delete", 2, 2, 0,
- (SCM s, SCM char_pred, SCM start, SCM end),
- "Filter the string @var{s}, retaining only those characters that\n"
- "do not satisfy the @var{char_pred} argument. If the argument\n"
- "is a procedure, it is applied to each character as a predicate,\n"
- "if it is a character, it is tested for equality and if it is a\n"
- "character set, it is tested for membership.")
-#define FUNC_NAME s_scm_string_delete
-{
- char * cstr;
- int cstart, cend;
- SCM result;
- int idx;
-
- SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
- 3, start, cstart,
- 4, end, cend);
- if (SCM_CHARP (char_pred))
- {
- SCM ls = SCM_EOL;
- char chr;
-
- chr = SCM_CHAR (char_pred);
- idx = cstart;
- while (idx < cend)
- {
- if (cstr[idx] != chr)
- ls = scm_cons (SCM_MAKE_CHAR (cstr[idx]), ls);
- idx++;
- }
- result = scm_reverse_list_to_string (ls);
- }
- else if (SCM_CHARSETP (char_pred))
- {
- SCM ls = SCM_EOL;
-
- idx = cstart;
- while (idx < cend)
- {
- if (!SCM_CHARSET_GET (char_pred, cstr[idx]))
- ls = scm_cons (SCM_MAKE_CHAR (cstr[idx]), ls);
- idx++;
- }
- result = scm_reverse_list_to_string (ls);
- }
- else
- {
- SCM ls = SCM_EOL;
-
- SCM_VALIDATE_PROC (2, char_pred);
- idx = cstart;
- while (idx < cend)
- {
- SCM res;
- res = scm_call_1 (char_pred, SCM_MAKE_CHAR (cstr[idx]));
- if (SCM_FALSEP (res))
- ls = scm_cons (SCM_MAKE_CHAR (cstr[idx]), ls);
- idx++;
- }
- result = scm_reverse_list_to_string (ls);
- }
- return result;
-}
-#undef FUNC_NAME
-
-
-/* Initialize the SRFI-13 module. This function will be called by the
- loading Scheme module. */
-void
-scm_init_srfi_13 (void)
-{
- /* We initialize the SRFI-14 module here, because the string
- primitives need the charset smob type created by that module. */
- scm_c_init_srfi_14 ();
-
- /* Install the string primitives. */
-#include "srfi/srfi-13.x"
-}
-
-/* End of srfi-13.c. */
diff --git a/srfi/srfi-13.h b/srfi/srfi-13.h
deleted file mode 100644
index 1127cde26..000000000
--- a/srfi/srfi-13.h
+++ /dev/null
@@ -1,140 +0,0 @@
-#ifndef SCM_SRFI_13_H
-#define SCM_SRFI_13_H
-/* srfi-13.c --- SRFI-13 procedures for Guile
- *
- * Copyright (C) 2001 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, 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 GUILE.
- *
- * The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy code from
- * other Free Software Foundation releases into a copy of GUILE, 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 GUILE, it is your choice
- * whether to permit this exception to apply to your modifications.
- * If you do not wish that, delete this exception notice. */
-
-
-/* SCM_SRFI1314_API is a macro prepended to all function and data definitions
- which should be exported or imported in the resulting dynamic link
- library in the Win32 port. */
-
-#if defined (SCM_SRFI1314_IMPORT)
-# define SCM_SRFI1314_API __declspec (dllimport) extern
-#elif defined (SCM_SRFI1314_EXPORT) || defined (DLL_EXPORT)
-# define SCM_SRFI1314_API __declspec (dllexport) extern
-#else
-# define SCM_SRFI1314_API extern
-#endif
-
-SCM_SRFI1314_API void scm_init_srfi_13 (void);
-SCM_SRFI1314_API void scm_init_srfi_13_14 (void);
-
-SCM_SRFI1314_API SCM scm_string_any (SCM pred, SCM s, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_every (SCM pred, SCM s, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_tabulate (SCM proc, SCM len);
-SCM_SRFI1314_API SCM scm_string_to_listS (SCM str, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_reverse_list_to_string (SCM chrs);
-SCM_SRFI1314_API SCM scm_string_join (SCM ls, SCM delimiter, SCM grammar);
-SCM_SRFI1314_API SCM scm_string_copyS (SCM str, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_substring_shared (SCM str, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_copy_x (SCM target, SCM tstart, SCM s, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_take (SCM s, SCM n);
-SCM_SRFI1314_API SCM scm_string_drop (SCM s, SCM n);
-SCM_SRFI1314_API SCM scm_string_take_right (SCM s, SCM n);
-SCM_SRFI1314_API SCM scm_string_drop_right (SCM s, SCM n);
-SCM_SRFI1314_API SCM scm_string_pad (SCM s, SCM len, SCM chr, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_pad_right (SCM s, SCM len, SCM chr, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_trim (SCM s, SCM char_pred, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_trim_right (SCM s, SCM char_pred, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_trim_both (SCM s, SCM char_pred, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_fill_xS (SCM str, SCM chr, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_compare (SCM s1, SCM s2, SCM proc_lt, SCM proc_eq, SCM proc_gt, SCM start1, SCM end1, SCM start2, SCM end2);
-SCM_SRFI1314_API SCM scm_string_compare_ci (SCM s1, SCM s2, SCM proc_lt, SCM proc_eq, SCM proc_gt, SCM start1, SCM end1, SCM start2, SCM end2);
-SCM_SRFI1314_API SCM scm_string_eq (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2);
-SCM_SRFI1314_API SCM scm_string_neq (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2);
-SCM_SRFI1314_API SCM scm_string_lt (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2);
-SCM_SRFI1314_API SCM scm_string_gt (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2);
-SCM_SRFI1314_API SCM scm_string_le (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2);
-SCM_SRFI1314_API SCM scm_string_ge (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2);
-SCM_SRFI1314_API SCM scm_string_ci_eq (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2);
-SCM_SRFI1314_API SCM scm_string_ci_neq (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2);
-SCM_SRFI1314_API SCM scm_string_ci_lt (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2);
-SCM_SRFI1314_API SCM scm_string_ci_gt (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2);
-SCM_SRFI1314_API SCM scm_string_ci_le (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2);
-SCM_SRFI1314_API SCM scm_string_ci_ge (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2);
-SCM_SRFI1314_API SCM scm_string_prefix_length (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2);
-SCM_SRFI1314_API SCM scm_string_prefix_length_ci (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2);
-SCM_SRFI1314_API SCM scm_string_suffix_length (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2);
-SCM_SRFI1314_API SCM scm_string_suffix_length_ci (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2);
-SCM_SRFI1314_API SCM scm_string_prefix_p (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2);
-SCM_SRFI1314_API SCM scm_string_prefix_ci_p (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2);
-SCM_SRFI1314_API SCM scm_string_suffix_p (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2);
-SCM_SRFI1314_API SCM scm_string_suffix_ci_p (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2);
-SCM_SRFI1314_API SCM scm_string_indexS (SCM s, SCM char_pred, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_index_right (SCM s, SCM char_pred, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_skip (SCM s, SCM char_pred, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_skip_right (SCM s, SCM char_pred, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_count (SCM s, SCM char_pred, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_contains (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2);
-SCM_SRFI1314_API SCM scm_string_contains_ci (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2);
-SCM_SRFI1314_API SCM scm_string_upcase_xS (SCM str, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_upcaseS (SCM str, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_downcase_xS (SCM str, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_downcaseS (SCM str, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_titlecase_x (SCM str, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_titlecase (SCM str, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_reverse (SCM str, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_reverse_x (SCM str, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_append_shared (SCM ls);
-SCM_SRFI1314_API SCM scm_string_concatenate (SCM ls);
-SCM_SRFI1314_API SCM scm_string_concatenate_shared (SCM ls);
-SCM_SRFI1314_API SCM scm_string_concatenate_reverse (SCM ls, SCM final_string, SCM end);
-SCM_SRFI1314_API SCM scm_string_concatenate_reverse_shared (SCM ls, SCM final_string, SCM end);
-SCM_SRFI1314_API SCM scm_string_map (SCM proc, SCM s, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_map_x (SCM proc, SCM s, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_fold (SCM kons, SCM knil, SCM s, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_fold_right (SCM kons, SCM knil, SCM s, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_unfold (SCM p, SCM f, SCM g, SCM seed, SCM base, SCM make_final);
-SCM_SRFI1314_API SCM scm_string_unfold_right (SCM p, SCM f, SCM g, SCM seed, SCM base, SCM make_final);
-SCM_SRFI1314_API SCM scm_string_for_each (SCM proc, SCM s, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_for_each_index (SCM proc, SCM s, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_xsubstring (SCM s, SCM from, SCM to, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_xcopy_x (SCM target, SCM tstart, SCM s, SCM sfrom, SCM sto, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_replace (SCM s1, SCM s2, SCM start1, SCM end1, SCM start2, SCM end2);
-SCM_SRFI1314_API SCM scm_string_tokenize (SCM s, SCM token_char, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_filter (SCM s, SCM char_pred, SCM start, SCM end);
-SCM_SRFI1314_API SCM scm_string_delete (SCM s, SCM char_pred, SCM start, SCM end);
-
-#endif /* SCM_SRFI_13_H */
diff --git a/srfi/srfi-13.scm b/srfi/srfi-13.scm
deleted file mode 100644
index 1ca8edac3..000000000
--- a/srfi/srfi-13.scm
+++ /dev/null
@@ -1,176 +0,0 @@
-;;; srfi-13.scm --- String Library
-
-;; Copyright (C) 2001, 2002 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, 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 GUILE.
-;;
-;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;; code from other Free Software Foundation releases into a copy of
-;; GUILE, 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 GUILE, it is your choice
-;; whether to permit this exception to apply to your modifications.
-;; If you do not wish that, delete this exception notice.
-
-;;; Commentary:
-
-;; This module is fully documented in the Guile Reference Manual.
-
-;;; Code:
-
-(define-module (srfi srfi-13))
-
-(export
-;;; Predicates
- ;; string? string-null? <= in the core
- string-any string-every
-
-;;; Constructors
- ;; make-string string <= in the core
- string-tabulate
-
-;;; List/string conversion
- string->list
- ;; list->string <= in the core
- reverse-list->string
- string-join
-
-;;; Selection
- ;; string-length string-ref <= in the core
- string-copy
- substring/shared
- string-copy!
- string-take string-take-right
- string-drop string-drop-right
- string-pad string-pad-right
- string-trim string-trim-right
- string-trim-both
-
-;;; Modification
- ;; string-set! <= in the core
- string-fill!
-
-;;; Comparison
- string-compare string-compare-ci
- string= string<>
- string< string>
- string<= string>=
- string-ci= string-ci<>
- string-ci< string-ci>
- string-ci<= string-ci>=
- string-hash string-hash-ci
-
-;;; Prefixes/Suffixes
- string-prefix-length
- string-prefix-length-ci
- string-suffix-length
- string-suffix-length-ci
- string-prefix?
- string-prefix-ci?
- string-suffix?
- string-suffix-ci?
-
-;;; Searching
- string-index string-index-right
- string-skip string-skip-right
- string-count
- string-contains string-contains-ci
-
-;;; Alphabetic case mapping
-
- string-upcase string-upcase!
- string-downcase string-downcase!
- string-titlecase string-titlecase!
-
-;;; Reverse/Append
- string-reverse string-reverse!
- ;; string-append <= in the core
- string-append/shared
- string-concatenate
- string-concatenate-reverse
- string-concatenate/shared
- string-concatenate-reverse/shared
-
-;;; Fold/Unfold/Map
- string-map string-map!
- string-fold
- string-fold-right
- string-unfold
- string-unfold-right
- string-for-each
- string-for-each-index
-
-;;; Replicate/Rotate
- xsubstring string-xcopy!
-
-;;; Miscellaneous
- string-replace
- string-tokenize
-
-;;; Filtering/Deleting
- string-filter
- string-delete
- )
-
-(cond-expand-provide (current-module) '(srfi-13))
-
-(load-extension "libguile-srfi-srfi-13-14" "scm_init_srfi_13")
-
-(define string-hash
- (lambda (s . rest)
- (let ((bound (if (pair? rest)
- (or (car rest)
- 871)
- 871))
- (start (if (and (pair? rest) (pair? (cdr rest)))
- (cadr rest)
- 0))
- (end (if (and (pair? rest) (pair? (cdr rest)) (pair? (cddr rest)))
- (caddr rest)
- (string-length s))))
- (hash (substring/shared s start end) bound))))
-
-(define string-hash-ci
- (lambda (s . rest)
- (let ((bound (if (pair? rest)
- (or (car rest)
- 871)
- 871))
- (start (if (and (pair? rest) (pair? (cdr rest)))
- (cadr rest)
- 0))
- (end (if (and (pair? rest) (pair? (cdr rest)) (pair? (cddr rest)))
- (caddr rest)
- (string-length s))))
- (hash (string-upcase (substring/shared s start end)) bound))))
-
-;;; srfi-13.scm ends here
diff --git a/srfi/srfi-14.c b/srfi/srfi-14.c
deleted file mode 100644
index cb34182f2..000000000
--- a/srfi/srfi-14.c
+++ /dev/null
@@ -1,1453 +0,0 @@
-/* srfi-14.c --- SRFI-14 procedures for Guile
- *
- * Copyright (C) 2001 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, 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 GUILE.
- *
- * The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy code from
- * other Free Software Foundation releases into a copy of GUILE, 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 GUILE, it is your choice
- * whether to permit this exception to apply to your modifications.
- * If you do not wish that, delete this exception notice. */
-
-
-#include <string.h>
-
-#include <libguile.h>
-
-#include "srfi-14.h"
-
-
-#define SCM_CHARSET_SET(cs, idx) \
- (((long *) SCM_SMOB_DATA (cs))[(idx) / SCM_BITS_PER_LONG] |= \
- (1L << ((idx) % SCM_BITS_PER_LONG)))
-
-#define BYTES_PER_CHARSET (SCM_CHARSET_SIZE / 8)
-#define LONGS_PER_CHARSET (SCM_CHARSET_SIZE / SCM_BITS_PER_LONG)
-
-
-/* Smob type code for character sets. */
-int scm_tc16_charset = 0;
-
-
-/* Smob print hook for character sets. */
-static int
-charset_print (SCM charset, SCM port, scm_print_state *pstate SCM_UNUSED)
-{
- int i;
- int first = 1;
-
- scm_puts ("#<charset {", port);
- for (i = 0; i < SCM_CHARSET_SIZE; i++)
- if (SCM_CHARSET_GET (charset, i))
- {
- if (first)
- first = 0;
- else
- scm_puts (" ", port);
- scm_write (SCM_MAKE_CHAR (i), port);
- }
- scm_puts ("}>", port);
- return 1;
-}
-
-
-/* Smob free hook for character sets. */
-static size_t
-charset_free (SCM charset)
-{
- return scm_smob_free (charset);
-}
-
-
-/* Create a new, empty character set. */
-static SCM
-make_char_set (const char * func_name)
-{
- long * p;
-
- p = scm_gc_malloc (BYTES_PER_CHARSET, "character-set");
- memset (p, 0, BYTES_PER_CHARSET);
- SCM_RETURN_NEWSMOB (scm_tc16_charset, p);
-}
-
-
-SCM_DEFINE (scm_char_set_p, "char-set?", 1, 0, 0,
- (SCM obj),
- "Return @code{#t} if @var{obj} is a character set, @code{#f}\n"
- "otherwise.")
-#define FUNC_NAME s_scm_char_set_p
-{
- return SCM_BOOL (SCM_SMOB_PREDICATE (scm_tc16_charset, obj));
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_eq, "char-set=", 0, 0, 1,
- (SCM char_sets),
- "Return @code{#t} if all given character sets are equal.")
-#define FUNC_NAME s_scm_char_set_eq
-{
- int argnum = 1;
- long *cs1_data = NULL;
-
- SCM_VALIDATE_REST_ARGUMENT (char_sets);
-
- while (!SCM_NULLP (char_sets))
- {
- SCM csi = SCM_CAR (char_sets);
- long *csi_data;
-
- SCM_VALIDATE_SMOB (argnum, csi, charset);
- argnum++;
- csi_data = (long *) SCM_SMOB_DATA (csi);
- if (cs1_data == NULL)
- cs1_data = csi_data;
- else if (memcmp (cs1_data, csi_data, BYTES_PER_CHARSET) != 0)
- return SCM_BOOL_F;
- char_sets = SCM_CDR (char_sets);
- }
- return SCM_BOOL_T;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_leq, "char-set<=", 0, 0, 1,
- (SCM char_sets),
- "Return @code{#t} if every character set @var{cs}i is a subset\n"
- "of character set @var{cs}i+1.")
-#define FUNC_NAME s_scm_char_set_leq
-{
- int argnum = 1;
- long *prev_data = NULL;
-
- SCM_VALIDATE_REST_ARGUMENT (char_sets);
-
- while (!SCM_NULLP (char_sets))
- {
- SCM csi = SCM_CAR (char_sets);
- long *csi_data;
-
- SCM_VALIDATE_SMOB (argnum, csi, charset);
- argnum++;
- csi_data = (long *) SCM_SMOB_DATA (csi);
- if (prev_data)
- {
- int k;
-
- for (k = 0; k < LONGS_PER_CHARSET; k++)
- {
- if ((prev_data[k] & csi_data[k]) != prev_data[k])
- return SCM_BOOL_F;
- }
- }
- prev_data = csi_data;
- char_sets = SCM_CDR (char_sets);
- }
- return SCM_BOOL_T;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_hash, "char-set-hash", 1, 1, 0,
- (SCM cs, SCM bound),
- "Compute a hash value for the character set @var{cs}. If\n"
- "@var{bound} is given and non-zero, it restricts the\n"
- "returned value to the range 0 @dots{} @var{bound - 1}.")
-#define FUNC_NAME s_scm_char_set_hash
-{
- const int default_bnd = 871;
- int bnd;
- long * p;
- unsigned long val = 0;
- int k;
-
- SCM_VALIDATE_SMOB (1, cs, charset);
-
- if (SCM_UNBNDP (bound))
- bnd = default_bnd;
- else
- {
- SCM_VALIDATE_INUM_MIN_COPY (2, bound, 0, bnd);
- if (bnd == 0)
- bnd = default_bnd;
- }
-
- p = (long *) SCM_SMOB_DATA (cs);
- for (k = 0; k < LONGS_PER_CHARSET; k++)
- {
- if (p[k] != 0)
- val = p[k] + (val << 1);
- }
- return SCM_MAKINUM (val % bnd);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_cursor, "char-set-cursor", 1, 0, 0,
- (SCM cs),
- "Return a cursor into the character set @var{cs}.")
-#define FUNC_NAME s_scm_char_set_cursor
-{
- int idx;
-
- SCM_VALIDATE_SMOB (1, cs, charset);
- for (idx = 0; idx < SCM_CHARSET_SIZE; idx++)
- {
- if (SCM_CHARSET_GET (cs, idx))
- break;
- }
- return SCM_MAKINUM (idx);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_ref, "char-set-ref", 2, 0, 0,
- (SCM cs, SCM cursor),
- "Return the character at the current cursor position\n"
- "@var{cursor} in the character set @var{cs}. It is an error to\n"
- "pass a cursor for which @code{end-of-char-set?} returns true.")
-#define FUNC_NAME s_scm_char_set_ref
-{
- int ccursor;
-
- SCM_VALIDATE_SMOB (1, cs, charset);
- SCM_VALIDATE_INUM_MIN_COPY (2, cursor, 0, ccursor);
-
- if (ccursor >= SCM_CHARSET_SIZE || !SCM_CHARSET_GET (cs, ccursor))
- SCM_MISC_ERROR ("invalid character set cursor: ~A", scm_list_1 (cursor));
- return SCM_MAKE_CHAR (ccursor);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_cursor_next, "char-set-cursor-next", 2, 0, 0,
- (SCM cs, SCM cursor),
- "Advance the character set cursor @var{cursor} to the next\n"
- "character in the character set @var{cs}. It is an error if the\n"
- "cursor given satisfies @code{end-of-char-set?}.")
-#define FUNC_NAME s_scm_char_set_cursor_next
-{
- int ccursor;
-
- SCM_VALIDATE_SMOB (1, cs, charset);
- SCM_VALIDATE_INUM_MIN_COPY (2, cursor, 0, ccursor);
-
- if (ccursor >= SCM_CHARSET_SIZE || !SCM_CHARSET_GET (cs, ccursor))
- SCM_MISC_ERROR ("invalid character set cursor: ~A", scm_list_1 (cursor));
- for (ccursor++; ccursor < SCM_CHARSET_SIZE; ccursor++)
- {
- if (SCM_CHARSET_GET (cs, ccursor))
- break;
- }
- return SCM_MAKINUM (ccursor);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_end_of_char_set_p, "end-of-char-set?", 1, 0, 0,
- (SCM cursor),
- "Return @code{#t} if @var{cursor} has reached the end of a\n"
- "character set, @code{#f} otherwise.")
-#define FUNC_NAME s_scm_end_of_char_set_p
-{
- int ccursor;
-
- SCM_VALIDATE_INUM_MIN_COPY (1, cursor, 0, ccursor);
- return SCM_BOOL (ccursor >= SCM_CHARSET_SIZE);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_fold, "char-set-fold", 3, 0, 0,
- (SCM kons, SCM knil, SCM cs),
- "Fold the procedure @var{kons} over the character set @var{cs},\n"
- "initializing it with @var{knil}.")
-#define FUNC_NAME s_scm_char_set_fold
-{
- int k;
-
- SCM_VALIDATE_PROC (1, kons);
- SCM_VALIDATE_SMOB (3, cs, charset);
-
- for (k = 0; k < SCM_CHARSET_SIZE; k++)
- if (SCM_CHARSET_GET (cs, k))
- {
- knil = scm_call_2 (kons, SCM_MAKE_CHAR (k), knil);
- }
- return knil;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_unfold, "char-set-unfold", 4, 1, 0,
- (SCM p, SCM f, SCM g, SCM seed, SCM base_cs),
- "This is a fundamental constructor for character sets.\n"
- "@itemize @bullet\n"
- "@item @var{g} is used to generate a series of ``seed'' values\n"
- "from the initial seed: @var{seed}, (@var{g} @var{seed}),\n"
- "(@var{g}^2 @var{seed}), (@var{g}^3 @var{seed}), @dots{}\n"
- "@item @var{p} tells us when to stop -- when it returns true\n"
- "when applied to one of the seed values.\n"
- "@item @var{f} maps each seed value to a character. These\n"
- "characters are added to the base character set @var{base_cs} to\n"
- "form the result; @var{base_cs} defaults to the empty set.\n"
- "@end itemize")
-#define FUNC_NAME s_scm_char_set_unfold
-{
- SCM result, tmp;
-
- SCM_VALIDATE_PROC (1, p);
- SCM_VALIDATE_PROC (2, f);
- SCM_VALIDATE_PROC (3, g);
- if (!SCM_UNBNDP (base_cs))
- {
- SCM_VALIDATE_SMOB (5, base_cs, charset);
- result = scm_char_set_copy (base_cs);
- }
- else
- result = make_char_set (FUNC_NAME);
-
- tmp = scm_call_1 (p, seed);
- while (SCM_FALSEP (tmp))
- {
- SCM ch = scm_call_1 (f, seed);
- if (!SCM_CHARP (ch))
- SCM_MISC_ERROR ("procedure ~S returned non-char", scm_list_1 (f));
- SCM_CHARSET_SET (result, SCM_CHAR (ch));
-
- seed = scm_call_1 (g, seed);
- tmp = scm_call_1 (p, seed);
- }
- return result;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_unfold_x, "char-set-unfold!", 5, 0, 0,
- (SCM p, SCM f, SCM g, SCM seed, SCM base_cs),
- "This is a fundamental constructor for character sets.\n"
- "@itemize @bullet\n"
- "@item @var{g} is used to generate a series of ``seed'' values\n"
- "from the initial seed: @var{seed}, (@var{g} @var{seed}),\n"
- "(@var{g}^2 @var{seed}), (@var{g}^3 @var{seed}), @dots{}\n"
- "@item @var{p} tells us when to stop -- when it returns true\n"
- "when applied to one of the seed values.\n"
- "@item @var{f} maps each seed value to a character. These\n"
- "characters are added to the base character set @var{base_cs} to\n"
- "form the result; @var{base_cs} defaults to the empty set.\n"
- "@end itemize")
-#define FUNC_NAME s_scm_char_set_unfold_x
-{
- SCM tmp;
-
- SCM_VALIDATE_PROC (1, p);
- SCM_VALIDATE_PROC (2, f);
- SCM_VALIDATE_PROC (3, g);
- SCM_VALIDATE_SMOB (5, base_cs, charset);
-
- tmp = scm_call_1 (p, seed);
- while (SCM_FALSEP (tmp))
- {
- SCM ch = scm_call_1 (f, seed);
- if (!SCM_CHARP (ch))
- SCM_MISC_ERROR ("procedure ~S returned non-char", scm_list_1 (f));
- SCM_CHARSET_SET (base_cs, SCM_CHAR (ch));
-
- seed = scm_call_1 (g, seed);
- tmp = scm_call_1 (p, seed);
- }
- return base_cs;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_for_each, "char-set-for-each", 2, 0, 0,
- (SCM proc, SCM cs),
- "Apply @var{proc} to every character in the character set\n"
- "@var{cs}. The return value is not specified.")
-#define FUNC_NAME s_scm_char_set_for_each
-{
- int k;
-
- SCM_VALIDATE_PROC (1, proc);
- SCM_VALIDATE_SMOB (2, cs, charset);
-
- for (k = 0; k < SCM_CHARSET_SIZE; k++)
- if (SCM_CHARSET_GET (cs, k))
- scm_call_1 (proc, SCM_MAKE_CHAR (k));
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_map, "char-set-map", 2, 0, 0,
- (SCM proc, SCM cs),
- "Map the procedure @var{proc} over every character in @var{cs}.\n"
- "@var{proc} must be a character -> character procedure.")
-#define FUNC_NAME s_scm_char_set_map
-{
- SCM result;
- int k;
-
- SCM_VALIDATE_PROC (1, proc);
- SCM_VALIDATE_SMOB (2, cs, charset);
-
- result = make_char_set (FUNC_NAME);
- for (k = 0; k < SCM_CHARSET_SIZE; k++)
- if (SCM_CHARSET_GET (cs, k))
- {
- SCM ch = scm_call_1 (proc, SCM_MAKE_CHAR (k));
- if (!SCM_CHARP (ch))
- SCM_MISC_ERROR ("procedure ~S returned non-char", scm_list_1 (proc));
- SCM_CHARSET_SET (result, SCM_CHAR (ch));
- }
- return result;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_copy, "char-set-copy", 1, 0, 0,
- (SCM cs),
- "Return a newly allocated character set containing all\n"
- "characters in @var{cs}.")
-#define FUNC_NAME s_scm_char_set_copy
-{
- SCM ret;
- long * p1, * p2;
- int k;
-
- SCM_VALIDATE_SMOB (1, cs, charset);
- ret = make_char_set (FUNC_NAME);
- p1 = (long *) SCM_SMOB_DATA (cs);
- p2 = (long *) SCM_SMOB_DATA (ret);
- for (k = 0; k < LONGS_PER_CHARSET; k++)
- p2[k] = p1[k];
- return ret;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set, "char-set", 0, 0, 1,
- (SCM rest),
- "Return a character set containing all given characters.")
-#define FUNC_NAME s_scm_char_set
-{
- SCM cs;
- long * p;
- int argnum = 1;
-
- SCM_VALIDATE_REST_ARGUMENT (rest);
- cs = make_char_set (FUNC_NAME);
- p = (long *) SCM_SMOB_DATA (cs);
- while (!SCM_NULLP (rest))
- {
- int c;
-
- SCM_VALIDATE_CHAR_COPY (argnum, SCM_CAR (rest), c);
- argnum++;
- rest = SCM_CDR (rest);
- p[c / SCM_BITS_PER_LONG] |= 1L << (c % SCM_BITS_PER_LONG);
- }
- return cs;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_list_to_char_set, "list->char-set", 1, 1, 0,
- (SCM list, SCM base_cs),
- "Convert the character list @var{list} to a character set. If\n"
- "the character set @var{base_cs} is given, the character in this\n"
- "set are also included in the result.")
-#define FUNC_NAME s_scm_list_to_char_set
-{
- SCM cs;
- long * p;
-
- SCM_VALIDATE_LIST (1, list);
- if (SCM_UNBNDP (base_cs))
- cs = make_char_set (FUNC_NAME);
- else
- {
- SCM_VALIDATE_SMOB (2, base_cs, charset);
- cs = scm_char_set_copy (base_cs);
- }
- p = (long *) SCM_SMOB_DATA (cs);
- while (!SCM_NULLP (list))
- {
- SCM chr = SCM_CAR (list);
- int c;
-
- SCM_VALIDATE_CHAR_COPY (0, chr, c);
- list = SCM_CDR (list);
-
- p[c / SCM_BITS_PER_LONG] |= 1L << (c % SCM_BITS_PER_LONG);
- }
- return cs;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_list_to_char_set_x, "list->char-set!", 2, 0, 0,
- (SCM list, SCM base_cs),
- "Convert the character list @var{list} to a character set. The\n"
- "characters are added to @var{base_cs} and @var{base_cs} is\n"
- "returned.")
-#define FUNC_NAME s_scm_list_to_char_set_x
-{
- long * p;
-
- SCM_VALIDATE_LIST (1, list);
- SCM_VALIDATE_SMOB (2, base_cs, charset);
- p = (long *) SCM_SMOB_DATA (base_cs);
- while (!SCM_NULLP (list))
- {
- SCM chr = SCM_CAR (list);
- int c;
-
- SCM_VALIDATE_CHAR_COPY (0, chr, c);
- list = SCM_CDR (list);
-
- p[c / SCM_BITS_PER_LONG] |= 1L << (c % SCM_BITS_PER_LONG);
- }
- return base_cs;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_to_char_set, "string->char-set", 1, 1, 0,
- (SCM str, SCM base_cs),
- "Convert the string @var{str} to a character set. If the\n"
- "character set @var{base_cs} is given, the characters in this\n"
- "set are also included in the result.")
-#define FUNC_NAME s_scm_string_to_char_set
-{
- SCM cs;
- long * p;
- char * s;
- size_t k = 0;
-
- SCM_VALIDATE_STRING (1, str);
- if (SCM_UNBNDP (base_cs))
- cs = make_char_set (FUNC_NAME);
- else
- {
- SCM_VALIDATE_SMOB (2, base_cs, charset);
- cs = scm_char_set_copy (base_cs);
- }
- p = (long *) SCM_SMOB_DATA (cs);
- s = SCM_STRING_CHARS (str);
- while (k < SCM_STRING_LENGTH (str))
- {
- int c = s[k++];
- p[c / SCM_BITS_PER_LONG] |= 1L << (c % SCM_BITS_PER_LONG);
- }
- return cs;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_string_to_char_set_x, "string->char-set!", 2, 0, 0,
- (SCM str, SCM base_cs),
- "Convert the string @var{str} to a character set. The\n"
- "characters from the string are added to @var{base_cs}, and\n"
- "@var{base_cs} is returned.")
-#define FUNC_NAME s_scm_string_to_char_set_x
-{
- long * p;
- char * s;
- size_t k = 0;
-
- SCM_VALIDATE_STRING (1, str);
- SCM_VALIDATE_SMOB (2, base_cs, charset);
- p = (long *) SCM_SMOB_DATA (base_cs);
- s = SCM_STRING_CHARS (str);
- while (k < SCM_STRING_LENGTH (str))
- {
- int c = s[k++];
- p[c / SCM_BITS_PER_LONG] |= 1L << (c % SCM_BITS_PER_LONG);
- }
- return base_cs;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_filter, "char-set-filter", 2, 1, 0,
- (SCM pred, SCM cs, SCM base_cs),
- "Return a character set containing every character from @var{cs}\n"
- "so that it satisfies @var{pred}. If provided, the characters\n"
- "from @var{base_cs} are added to the result.")
-#define FUNC_NAME s_scm_char_set_filter
-{
- SCM ret;
- int k;
- long * p;
-
- SCM_VALIDATE_PROC (1, pred);
- SCM_VALIDATE_SMOB (2, cs, charset);
- if (!SCM_UNBNDP (base_cs))
- {
- SCM_VALIDATE_SMOB (3, base_cs, charset);
- ret = scm_char_set_copy (base_cs);
- }
- else
- ret = make_char_set (FUNC_NAME);
- p = (long *) SCM_SMOB_DATA (ret);
- for (k = 0; k < SCM_CHARSET_SIZE; k++)
- {
- if (SCM_CHARSET_GET (cs, k))
- {
- SCM res = scm_call_1 (pred, SCM_MAKE_CHAR (k));
-
- if (!SCM_FALSEP (res))
- p[k / SCM_BITS_PER_LONG] |= 1L << (k % SCM_BITS_PER_LONG);
- }
- }
- return ret;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_filter_x, "char-set-filter!", 3, 0, 0,
- (SCM pred, SCM cs, SCM base_cs),
- "Return a character set containing every character from @var{cs}\n"
- "so that it satisfies @var{pred}. The characters are added to\n"
- "@var{base_cs} and @var{base_cs} is returned.")
-#define FUNC_NAME s_scm_char_set_filter_x
-{
- int k;
- long * p;
-
- SCM_VALIDATE_PROC (1, pred);
- SCM_VALIDATE_SMOB (2, cs, charset);
- SCM_VALIDATE_SMOB (3, base_cs, charset);
- p = (long *) SCM_SMOB_DATA (base_cs);
- for (k = 0; k < SCM_CHARSET_SIZE; k++)
- {
- if (SCM_CHARSET_GET (cs, k))
- {
- SCM res = scm_call_1 (pred, SCM_MAKE_CHAR (k));
-
- if (!SCM_FALSEP (res))
- p[k / SCM_BITS_PER_LONG] |= 1L << (k % SCM_BITS_PER_LONG);
- }
- }
- return base_cs;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_ucs_range_to_char_set, "ucs-range->char-set", 2, 2, 0,
- (SCM lower, SCM upper, SCM error, SCM base_cs),
- "Return a character set containing all characters whose\n"
- "character codes lie in the half-open range\n"
- "[@var{lower},@var{upper}).\n"
- "\n"
- "If @var{error} is a true value, an error is signalled if the\n"
- "specified range contains characters which are not contained in\n"
- "the implemented character range. If @var{error} is @code{#f},\n"
- "these characters are silently left out of the resultung\n"
- "character set.\n"
- "\n"
- "The characters in @var{base_cs} are added to the result, if\n"
- "given.")
-#define FUNC_NAME s_scm_ucs_range_to_char_set
-{
- SCM cs;
- int clower, cupper;
- long * p;
-
- SCM_VALIDATE_INUM_COPY (1, lower, clower);
- SCM_VALIDATE_INUM_COPY (2, upper, cupper);
- SCM_ASSERT_RANGE (1, lower, clower >= 0);
- SCM_ASSERT_RANGE (2, upper, cupper >= 0 && cupper >= clower);
- if (!SCM_UNBNDP (error))
- {
- if (!SCM_FALSEP (error))
- {
- SCM_ASSERT_RANGE (1, lower, clower <= SCM_CHARSET_SIZE);
- SCM_ASSERT_RANGE (2, upper, cupper <= SCM_CHARSET_SIZE);
- }
- }
- if (clower > SCM_CHARSET_SIZE)
- clower = SCM_CHARSET_SIZE;
- if (cupper > SCM_CHARSET_SIZE)
- cupper = SCM_CHARSET_SIZE;
- if (SCM_UNBNDP (base_cs))
- cs = make_char_set (FUNC_NAME);
- else
- {
- SCM_VALIDATE_SMOB (2, base_cs, charset);
- cs = scm_char_set_copy (base_cs);
- }
- p = (long *) SCM_SMOB_DATA (cs);
- while (clower < cupper)
- {
- p[clower / SCM_BITS_PER_LONG] |= 1L << (clower % SCM_BITS_PER_LONG);
- clower++;
- }
- return cs;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_ucs_range_to_char_set_x, "ucs-range->char-set!", 4, 0, 0,
- (SCM lower, SCM upper, SCM error, SCM base_cs),
- "Return a character set containing all characters whose\n"
- "character codes lie in the half-open range\n"
- "[@var{lower},@var{upper}).\n"
- "\n"
- "If @var{error} is a true value, an error is signalled if the\n"
- "specified range contains characters which are not contained in\n"
- "the implemented character range. If @var{error} is @code{#f},\n"
- "these characters are silently left out of the resultung\n"
- "character set.\n"
- "\n"
- "The characters are added to @var{base_cs} and @var{base_cs} is\n"
- "returned.")
-#define FUNC_NAME s_scm_ucs_range_to_char_set_x
-{
- int clower, cupper;
- long * p;
-
- SCM_VALIDATE_INUM_COPY (1, lower, clower);
- SCM_VALIDATE_INUM_COPY (2, upper, cupper);
- SCM_ASSERT_RANGE (1, lower, clower >= 0);
- SCM_ASSERT_RANGE (2, upper, cupper >= 0 && cupper >= clower);
- if (!SCM_FALSEP (error))
- {
- SCM_ASSERT_RANGE (1, lower, clower <= SCM_CHARSET_SIZE);
- SCM_ASSERT_RANGE (2, upper, cupper <= SCM_CHARSET_SIZE);
- }
- if (clower > SCM_CHARSET_SIZE)
- clower = SCM_CHARSET_SIZE;
- if (cupper > SCM_CHARSET_SIZE)
- cupper = SCM_CHARSET_SIZE;
- p = (long *) SCM_SMOB_DATA (base_cs);
- while (clower < cupper)
- {
- p[clower / SCM_BITS_PER_LONG] |= 1L << (clower % SCM_BITS_PER_LONG);
- clower++;
- }
- return base_cs;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_size, "char-set-size", 1, 0, 0,
- (SCM cs),
- "Return the number of elements in character set @var{cs}.")
-#define FUNC_NAME s_scm_char_set_size
-{
- int k, count = 0;
-
- SCM_VALIDATE_SMOB (1, cs, charset);
- for (k = 0; k < SCM_CHARSET_SIZE; k++)
- if (SCM_CHARSET_GET (cs, k))
- count++;
- return SCM_MAKINUM (count);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_count, "char-set-count", 2, 0, 0,
- (SCM pred, SCM cs),
- "Return the number of the elements int the character set\n"
- "@var{cs} which satisfy the predicate @var{pred}.")
-#define FUNC_NAME s_scm_char_set_count
-{
- int k, count = 0;
-
- SCM_VALIDATE_PROC (1, pred);
- SCM_VALIDATE_SMOB (2, cs, charset);
-
- for (k = 0; k < SCM_CHARSET_SIZE; k++)
- if (SCM_CHARSET_GET (cs, k))
- {
- SCM res = scm_call_1 (pred, SCM_MAKE_CHAR (k));
- if (!SCM_FALSEP (res))
- count++;
- }
- return SCM_MAKINUM (count);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_to_list, "char-set->list", 1, 0, 0,
- (SCM cs),
- "Return a list containing the elements of the character set\n"
- "@var{cs}.")
-#define FUNC_NAME s_scm_char_set_to_list
-{
- int k;
- SCM result = SCM_EOL;
-
- SCM_VALIDATE_SMOB (1, cs, charset);
- for (k = SCM_CHARSET_SIZE; k > 0; k--)
- if (SCM_CHARSET_GET (cs, k - 1))
- result = scm_cons (SCM_MAKE_CHAR (k - 1), result);
- return result;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_to_string, "char-set->string", 1, 0, 0,
- (SCM cs),
- "Return a string containing the elements of the character set\n"
- "@var{cs}. The order in which the characters are placed in the\n"
- "string is not defined.")
-#define FUNC_NAME s_scm_char_set_to_string
-{
- int k;
- int count = 0;
- int idx = 0;
- SCM result;
- char * p;
-
- SCM_VALIDATE_SMOB (1, cs, charset);
- for (k = 0; k < SCM_CHARSET_SIZE; k++)
- if (SCM_CHARSET_GET (cs, k))
- count++;
- result = scm_allocate_string (count);
- p = SCM_STRING_CHARS (result);
- for (k = 0; k < SCM_CHARSET_SIZE; k++)
- if (SCM_CHARSET_GET (cs, k))
- p[idx++] = k;
- return result;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_contains_p, "char-set-contains?", 2, 0, 0,
- (SCM cs, SCM ch),
- "Return @code{#t} iff the character @var{ch} is contained in the\n"
- "character set @var{cs}.")
-#define FUNC_NAME s_scm_char_set_contains_p
-{
- SCM_VALIDATE_SMOB (1, cs, charset);
- SCM_VALIDATE_CHAR (2, ch);
- return SCM_BOOL (SCM_CHARSET_GET (cs, SCM_CHAR (ch)));
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_every, "char-set-every", 2, 0, 0,
- (SCM pred, SCM cs),
- "Return a true value if every character in the character set\n"
- "@var{cs} satisfies the predicate @var{pred}.")
-#define FUNC_NAME s_scm_char_set_every
-{
- int k;
- SCM res = SCM_BOOL_T;
-
- SCM_VALIDATE_PROC (1, pred);
- SCM_VALIDATE_SMOB (2, cs, charset);
-
- for (k = 0; k < SCM_CHARSET_SIZE; k++)
- if (SCM_CHARSET_GET (cs, k))
- {
- res = scm_call_1 (pred, SCM_MAKE_CHAR (k));
- if (SCM_FALSEP (res))
- return res;
- }
- return res;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_any, "char-set-any", 2, 0, 0,
- (SCM pred, SCM cs),
- "Return a true value if any character in the character set\n"
- "@var{cs} satisfies the predicate @var{pred}.")
-#define FUNC_NAME s_scm_char_set_any
-{
- int k;
-
- SCM_VALIDATE_PROC (1, pred);
- SCM_VALIDATE_SMOB (2, cs, charset);
-
- for (k = 0; k < SCM_CHARSET_SIZE; k++)
- if (SCM_CHARSET_GET (cs, k))
- {
- SCM res = scm_call_1 (pred, SCM_MAKE_CHAR (k));
- if (!SCM_FALSEP (res))
- return res;
- }
- return SCM_BOOL_F;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_adjoin, "char-set-adjoin", 1, 0, 1,
- (SCM cs, SCM rest),
- "Add all character arguments to the first argument, which must\n"
- "be a character set.")
-#define FUNC_NAME s_scm_char_set_adjoin
-{
- long * p;
-
- SCM_VALIDATE_SMOB (1, cs, charset);
- SCM_VALIDATE_REST_ARGUMENT (rest);
- cs = scm_char_set_copy (cs);
-
- p = (long *) SCM_SMOB_DATA (cs);
- while (!SCM_NULLP (rest))
- {
- SCM chr = SCM_CAR (rest);
- int c;
-
- SCM_VALIDATE_CHAR_COPY (1, chr, c);
- rest = SCM_CDR (rest);
-
- p[c / SCM_BITS_PER_LONG] |= 1L << (c % SCM_BITS_PER_LONG);
- }
- return cs;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_delete, "char-set-delete", 1, 0, 1,
- (SCM cs, SCM rest),
- "Delete all character arguments from the first argument, which\n"
- "must be a character set.")
-#define FUNC_NAME s_scm_char_set_delete
-{
- long * p;
-
- SCM_VALIDATE_SMOB (1, cs, charset);
- SCM_VALIDATE_REST_ARGUMENT (rest);
- cs = scm_char_set_copy (cs);
-
- p = (long *) SCM_SMOB_DATA (cs);
- while (!SCM_NULLP (rest))
- {
- SCM chr = SCM_CAR (rest);
- int c;
-
- SCM_VALIDATE_CHAR_COPY (1, chr, c);
- rest = SCM_CDR (rest);
-
- p[c / SCM_BITS_PER_LONG] &= ~(1L << (c % SCM_BITS_PER_LONG));
- }
- return cs;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_adjoin_x, "char-set-adjoin!", 1, 0, 1,
- (SCM cs, SCM rest),
- "Add all character arguments to the first argument, which must\n"
- "be a character set.")
-#define FUNC_NAME s_scm_char_set_adjoin_x
-{
- long * p;
-
- SCM_VALIDATE_SMOB (1, cs, charset);
- SCM_VALIDATE_REST_ARGUMENT (rest);
-
- p = (long *) SCM_SMOB_DATA (cs);
- while (!SCM_NULLP (rest))
- {
- SCM chr = SCM_CAR (rest);
- int c;
-
- SCM_VALIDATE_CHAR_COPY (1, chr, c);
- rest = SCM_CDR (rest);
-
- p[c / SCM_BITS_PER_LONG] |= 1L << (c % SCM_BITS_PER_LONG);
- }
- return cs;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_delete_x, "char-set-delete!", 1, 0, 1,
- (SCM cs, SCM rest),
- "Delete all character arguments from the first argument, which\n"
- "must be a character set.")
-#define FUNC_NAME s_scm_char_set_delete_x
-{
- long * p;
-
- SCM_VALIDATE_SMOB (1, cs, charset);
- SCM_VALIDATE_REST_ARGUMENT (rest);
-
- p = (long *) SCM_SMOB_DATA (cs);
- while (!SCM_NULLP (rest))
- {
- SCM chr = SCM_CAR (rest);
- int c;
-
- SCM_VALIDATE_CHAR_COPY (1, chr, c);
- rest = SCM_CDR (rest);
-
- p[c / SCM_BITS_PER_LONG] &= ~(1L << (c % SCM_BITS_PER_LONG));
- }
- return cs;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_complement, "char-set-complement", 1, 0, 0,
- (SCM cs),
- "Return the complement of the character set @var{cs}.")
-#define FUNC_NAME s_scm_char_set_complement
-{
- int k;
- SCM res;
- long * p, * q;
-
- SCM_VALIDATE_SMOB (1, cs, charset);
-
- res = make_char_set (FUNC_NAME);
- p = (long *) SCM_SMOB_DATA (res);
- q = (long *) SCM_SMOB_DATA (cs);
- for (k = 0; k < LONGS_PER_CHARSET; k++)
- p[k] = ~q[k];
- return res;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_union, "char-set-union", 0, 0, 1,
- (SCM rest),
- "Return the union of all argument character sets.")
-#define FUNC_NAME s_scm_char_set_union
-{
- int c = 1;
- SCM res;
- long * p;
-
- SCM_VALIDATE_REST_ARGUMENT (rest);
-
- res = make_char_set (FUNC_NAME);
- p = (long *) SCM_SMOB_DATA (res);
- while (!SCM_NULLP (rest))
- {
- int k;
- SCM cs = SCM_CAR (rest);
- SCM_VALIDATE_SMOB (c, cs, charset);
- c++;
- rest = SCM_CDR (rest);
-
- for (k = 0; k < LONGS_PER_CHARSET; k++)
- p[k] |= ((long *) SCM_SMOB_DATA (cs))[k];
- }
- return res;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_intersection, "char-set-intersection", 0, 0, 1,
- (SCM rest),
- "Return the intersection of all argument character sets.")
-#define FUNC_NAME s_scm_char_set_intersection
-{
- SCM res;
-
- SCM_VALIDATE_REST_ARGUMENT (rest);
-
- if (SCM_NULLP (rest))
- res = make_char_set (FUNC_NAME);
- else
- {
- long *p;
- int argnum = 2;
-
- res = scm_char_set_copy (SCM_CAR (rest));
- p = (long *) SCM_SMOB_DATA (res);
- rest = SCM_CDR (rest);
-
- while (SCM_CONSP (rest))
- {
- int k;
- SCM cs = SCM_CAR (rest);
- long *cs_data;
-
- SCM_VALIDATE_SMOB (argnum, cs, charset);
- argnum++;
- cs_data = (long *) SCM_SMOB_DATA (cs);
- rest = SCM_CDR (rest);
- for (k = 0; k < LONGS_PER_CHARSET; k++)
- p[k] &= cs_data[k];
- }
- }
-
- return res;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_difference, "char-set-difference", 1, 0, 1,
- (SCM cs1, SCM rest),
- "Return the difference of all argument character sets.")
-#define FUNC_NAME s_scm_char_set_difference
-{
- int c = 2;
- SCM res;
- long * p;
-
- SCM_VALIDATE_SMOB (1, cs1, charset);
- SCM_VALIDATE_REST_ARGUMENT (rest);
-
- res = scm_char_set_copy (cs1);
- p = (long *) SCM_SMOB_DATA (res);
- while (!SCM_NULLP (rest))
- {
- int k;
- SCM cs = SCM_CAR (rest);
- SCM_VALIDATE_SMOB (c, cs, charset);
- c++;
- rest = SCM_CDR (rest);
-
- for (k = 0; k < LONGS_PER_CHARSET; k++)
- p[k] &= ~((long *) SCM_SMOB_DATA (cs))[k];
- }
- return res;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_xor, "char-set-xor", 0, 0, 1,
- (SCM rest),
- "Return the exclusive-or of all argument character sets.")
-#define FUNC_NAME s_scm_char_set_xor
-{
- SCM res;
-
- SCM_VALIDATE_REST_ARGUMENT (rest);
-
- if (SCM_NULLP (rest))
- res = make_char_set (FUNC_NAME);
- else
- {
- int argnum = 2;
- long * p;
-
- res = scm_char_set_copy (SCM_CAR (rest));
- p = (long *) SCM_SMOB_DATA (res);
- rest = SCM_CDR (rest);
-
- while (SCM_CONSP (rest))
- {
- SCM cs = SCM_CAR (rest);
- long *cs_data;
- int k;
-
- SCM_VALIDATE_SMOB (argnum, cs, charset);
- argnum++;
- cs_data = (long *) SCM_SMOB_DATA (cs);
- rest = SCM_CDR (rest);
-
- for (k = 0; k < LONGS_PER_CHARSET; k++)
- p[k] ^= cs_data[k];
- }
- }
- return res;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_diff_plus_intersection, "char-set-diff+intersection", 1, 0, 1,
- (SCM cs1, SCM rest),
- "Return the difference and the intersection of all argument\n"
- "character sets.")
-#define FUNC_NAME s_scm_char_set_diff_plus_intersection
-{
- int c = 2;
- SCM res1, res2;
- long * p, * q;
-
- SCM_VALIDATE_SMOB (1, cs1, charset);
- SCM_VALIDATE_REST_ARGUMENT (rest);
-
- res1 = scm_char_set_copy (cs1);
- res2 = make_char_set (FUNC_NAME);
- p = (long *) SCM_SMOB_DATA (res1);
- q = (long *) SCM_SMOB_DATA (res2);
- while (!SCM_NULLP (rest))
- {
- int k;
- SCM cs = SCM_CAR (rest);
- long *r;
-
- SCM_VALIDATE_SMOB (c, cs, charset);
- c++;
- r = (long *) SCM_SMOB_DATA (cs);
-
- for (k = 0; k < LONGS_PER_CHARSET; k++)
- {
- q[k] |= p[k] & r[k];
- p[k] &= ~r[k];
- }
- rest = SCM_CDR (rest);
- }
- return scm_values (scm_list_2 (res1, res2));
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_complement_x, "char-set-complement!", 1, 0, 0,
- (SCM cs),
- "Return the complement of the character set @var{cs}.")
-#define FUNC_NAME s_scm_char_set_complement_x
-{
- int k;
- long * p;
-
- SCM_VALIDATE_SMOB (1, cs, charset);
- p = (long *) SCM_SMOB_DATA (cs);
- for (k = 0; k < LONGS_PER_CHARSET; k++)
- p[k] = ~p[k];
- return cs;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_union_x, "char-set-union!", 1, 0, 1,
- (SCM cs1, SCM rest),
- "Return the union of all argument character sets.")
-#define FUNC_NAME s_scm_char_set_union_x
-{
- int c = 2;
- long * p;
-
- SCM_VALIDATE_SMOB (1, cs1, charset);
- SCM_VALIDATE_REST_ARGUMENT (rest);
-
- p = (long *) SCM_SMOB_DATA (cs1);
- while (!SCM_NULLP (rest))
- {
- int k;
- SCM cs = SCM_CAR (rest);
- SCM_VALIDATE_SMOB (c, cs, charset);
- c++;
- rest = SCM_CDR (rest);
-
- for (k = 0; k < LONGS_PER_CHARSET; k++)
- p[k] |= ((long *) SCM_SMOB_DATA (cs))[k];
- }
- return cs1;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_intersection_x, "char-set-intersection!", 1, 0, 1,
- (SCM cs1, SCM rest),
- "Return the intersection of all argument character sets.")
-#define FUNC_NAME s_scm_char_set_intersection_x
-{
- int c = 2;
- long * p;
-
- SCM_VALIDATE_SMOB (1, cs1, charset);
- SCM_VALIDATE_REST_ARGUMENT (rest);
-
- p = (long *) SCM_SMOB_DATA (cs1);
- while (!SCM_NULLP (rest))
- {
- int k;
- SCM cs = SCM_CAR (rest);
- SCM_VALIDATE_SMOB (c, cs, charset);
- c++;
- rest = SCM_CDR (rest);
-
- for (k = 0; k < LONGS_PER_CHARSET; k++)
- p[k] &= ((long *) SCM_SMOB_DATA (cs))[k];
- }
- return cs1;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_difference_x, "char-set-difference!", 1, 0, 1,
- (SCM cs1, SCM rest),
- "Return the difference of all argument character sets.")
-#define FUNC_NAME s_scm_char_set_difference_x
-{
- int c = 2;
- long * p;
-
- SCM_VALIDATE_SMOB (1, cs1, charset);
- SCM_VALIDATE_REST_ARGUMENT (rest);
-
- p = (long *) SCM_SMOB_DATA (cs1);
- while (!SCM_NULLP (rest))
- {
- int k;
- SCM cs = SCM_CAR (rest);
- SCM_VALIDATE_SMOB (c, cs, charset);
- c++;
- rest = SCM_CDR (rest);
-
- for (k = 0; k < LONGS_PER_CHARSET; k++)
- p[k] &= ~((long *) SCM_SMOB_DATA (cs))[k];
- }
- return cs1;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_xor_x, "char-set-xor!", 1, 0, 1,
- (SCM cs1, SCM rest),
- "Return the exclusive-or of all argument character sets.")
-#define FUNC_NAME s_scm_char_set_xor_x
-{
- /* a side-effecting variant should presumably give consistent results:
- (define a (char-set #\a))
- (char-set-xor a a a) -> char set #\a
- (char-set-xor! a a a) -> char set #\a
- */
- return scm_char_set_xor (scm_cons (cs1, rest));
-
-#if 0
- /* this would give (char-set-xor! a a a) -> empty char set. */
- int c = 2;
- long * p;
-
- SCM_VALIDATE_SMOB (1, cs1, charset);
- SCM_VALIDATE_REST_ARGUMENT (rest);
-
- p = (long *) SCM_SMOB_DATA (cs1);
- while (!SCM_NULLP (rest))
- {
- int k;
- SCM cs = SCM_CAR (rest);
- SCM_VALIDATE_SMOB (c, cs, charset);
- c++;
- rest = SCM_CDR (rest);
-
- for (k = 0; k < LONGS_PER_CHARSET; k++)
- p[k] ^= ((long *) SCM_SMOB_DATA (cs))[k];
- }
- return cs1;
-#endif
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_char_set_diff_plus_intersection_x, "char-set-diff+intersection!", 2, 0, 1,
- (SCM cs1, SCM cs2, SCM rest),
- "Return the difference and the intersection of all argument\n"
- "character sets.")
-#define FUNC_NAME s_scm_char_set_diff_plus_intersection_x
-{
- int c = 3;
- long * p, * q;
- int k;
-
- SCM_VALIDATE_SMOB (1, cs1, charset);
- SCM_VALIDATE_SMOB (2, cs2, charset);
- SCM_VALIDATE_REST_ARGUMENT (rest);
-
- p = (long *) SCM_SMOB_DATA (cs1);
- q = (long *) SCM_SMOB_DATA (cs2);
- if (p == q)
- {
- /* (char-set-diff+intersection! a a ...): can't share storage,
- but we know the answer without checking for further
- arguments. */
- return scm_values (scm_list_2 (make_char_set (FUNC_NAME), cs1));
- }
- for (k = 0; k < LONGS_PER_CHARSET; k++)
- {
- long t = p[k];
-
- p[k] &= ~q[k];
- q[k] = t & q[k];
- }
- while (!SCM_NULLP (rest))
- {
- SCM cs = SCM_CAR (rest);
- long *r;
-
- SCM_VALIDATE_SMOB (c, cs, charset);
- c++;
- r = (long *) SCM_SMOB_DATA (cs);
-
- for (k = 0; k < LONGS_PER_CHARSET; k++)
- {
- q[k] |= p[k] & r[k];
- p[k] &= ~r[k];
- }
- rest = SCM_CDR (rest);
- }
- return scm_values (scm_list_2 (cs1, cs2));
-}
-#undef FUNC_NAME
-
-
-/* Create the charset smob type. */
-void
-scm_c_init_srfi_14 (void)
-{
- /* Charset smob creation is protected by this variable because this
- function can be both called from the SRFI-13 and SRFI-14
- initialization functions. This is because the SRFI-13 procedures
- access the charset smob type code. */
- static int initialized = 0;
-
- if (!initialized)
- {
- scm_tc16_charset = scm_make_smob_type ("character-set",
- BYTES_PER_CHARSET);
- scm_set_smob_free (scm_tc16_charset, charset_free);
- scm_set_smob_print (scm_tc16_charset, charset_print);
- initialized = 1;
- }
-}
-
-
-/* Initialize the SRFI-14 module. This function will be called by the
- loading Scheme module. */
-void
-scm_init_srfi_14 (void)
-{
-#if 0
- fprintf(stderr, "bytes-per-charset: %d\n", BYTES_PER_CHARSET);
- fprintf(stderr, "bits-per-long: %d\n", SCM_BITS_PER_LONG);
- fprintf(stderr, "longs-per-charset: %d\n", LONGS_PER_CHARSET);
- fflush (stderr);
-#endif /* 0 */
-
- /* Do the smob type initialization. */
- scm_c_init_srfi_14 ();
-
- /* Install the charset primitives. */
-#include "srfi/srfi-14.x"
-}
-
-/* End of srfi-14.c. */
diff --git a/srfi/srfi-14.h b/srfi/srfi-14.h
deleted file mode 100644
index d6155fa63..000000000
--- a/srfi/srfi-14.h
+++ /dev/null
@@ -1,128 +0,0 @@
-#ifndef SCM_SRFI_14_H
-#define SCM_SRFI_14_H
-/* srfi-14.c --- SRFI-14 procedures for Guile
- *
- * Copyright (C) 2001 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, 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 GUILE.
- *
- * The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy code from
- * other Free Software Foundation releases into a copy of GUILE, 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 GUILE, it is your choice
- * whether to permit this exception to apply to your modifications.
- * If you do not wish that, delete this exception notice. */
-
-
-/* SCM_SRFI1314_API is a macro prepended to all function and data definitions
- which should be exported or imported in the resulting dynamic link
- library in the Win32 port. */
-
-#if defined (SCM_SRFI1314_IMPORT)
-# define SCM_SRFI1314_API __declspec (dllimport) extern
-#elif defined (SCM_SRFI1314_EXPORT) || defined (DLL_EXPORT)
-# define SCM_SRFI1314_API __declspec (dllexport) extern
-#else
-# define SCM_SRFI1314_API extern
-#endif
-
-#define SCM_CHARSET_SIZE 256
-
-/* We expect 8-bit bytes here. Should be no problem in the year
- 2001. */
-#ifndef SCM_BITS_PER_LONG
-# define SCM_BITS_PER_LONG (sizeof (long) * 8)
-#endif
-
-#define SCM_CHARSET_GET(cs, idx) (((long *) SCM_SMOB_DATA (cs))\
- [((unsigned char) (idx)) / SCM_BITS_PER_LONG] &\
- (1L << (((unsigned char) (idx)) % SCM_BITS_PER_LONG)))
-
-#define SCM_CHARSETP(x) (!SCM_IMP (x) && (SCM_TYP16 (x) == scm_tc16_charset))
-
-/* Smob type code for character sets. */
-SCM_SRFI1314_API int scm_tc16_charset;
-
-SCM_SRFI1314_API void scm_c_init_srfi_14 (void);
-SCM_SRFI1314_API void scm_init_srfi_14 (void);
-
-SCM_SRFI1314_API SCM scm_char_set_p (SCM obj);
-SCM_SRFI1314_API SCM scm_char_set_eq (SCM char_sets);
-SCM_SRFI1314_API SCM scm_char_set_leq (SCM char_sets);
-SCM_SRFI1314_API SCM scm_char_set_hash (SCM cs, SCM bound);
-SCM_SRFI1314_API SCM scm_char_set_cursor (SCM cs);
-SCM_SRFI1314_API SCM scm_char_set_ref (SCM cs, SCM cursor);
-SCM_SRFI1314_API SCM scm_char_set_cursor_next (SCM cs, SCM cursor);
-SCM_SRFI1314_API SCM scm_end_of_char_set_p (SCM cursor);
-SCM_SRFI1314_API SCM scm_char_set_fold (SCM kons, SCM knil, SCM cs);
-SCM_SRFI1314_API SCM scm_char_set_unfold (SCM p, SCM f, SCM g, SCM seed, SCM base_cs);
-SCM_SRFI1314_API SCM scm_char_set_unfold_x (SCM p, SCM f, SCM g, SCM seed, SCM base_cs);
-SCM_SRFI1314_API SCM scm_char_set_for_each (SCM proc, SCM cs);
-SCM_SRFI1314_API SCM scm_char_set_map (SCM proc, SCM cs);
-SCM_SRFI1314_API SCM scm_char_set_copy (SCM cs);
-SCM_SRFI1314_API SCM scm_char_set (SCM rest);
-SCM_SRFI1314_API SCM scm_list_to_char_set (SCM list, SCM base_cs);
-SCM_SRFI1314_API SCM scm_list_to_char_set_x (SCM list, SCM base_cs);
-SCM_SRFI1314_API SCM scm_string_to_char_set (SCM str, SCM base_cs);
-SCM_SRFI1314_API SCM scm_string_to_char_set_x (SCM str, SCM base_cs);
-SCM_SRFI1314_API SCM scm_char_set_filter (SCM pred, SCM cs, SCM base_cs);
-SCM_SRFI1314_API SCM scm_char_set_filter_x (SCM pred, SCM cs, SCM base_cs);
-SCM_SRFI1314_API SCM scm_ucs_range_to_char_set (SCM lower, SCM upper, SCM error, SCM base_cs);
-SCM_SRFI1314_API SCM scm_ucs_range_to_char_set_x (SCM lower, SCM upper, SCM error, SCM base_cs);
-SCM_SRFI1314_API SCM scm_char_set_size (SCM cs);
-SCM_SRFI1314_API SCM scm_char_set_count (SCM pred, SCM cs);
-SCM_SRFI1314_API SCM scm_char_set_to_list (SCM cs);
-SCM_SRFI1314_API SCM scm_char_set_to_string (SCM cs);
-SCM_SRFI1314_API SCM scm_char_set_contains_p (SCM cs, SCM ch);
-SCM_SRFI1314_API SCM scm_char_set_every (SCM pred, SCM cs);
-SCM_SRFI1314_API SCM scm_char_set_any (SCM pred, SCM cs);
-SCM_SRFI1314_API SCM scm_char_set_adjoin (SCM cs, SCM rest);
-SCM_SRFI1314_API SCM scm_char_set_delete (SCM cs, SCM rest);
-SCM_SRFI1314_API SCM scm_char_set_adjoin_x (SCM cs, SCM rest);
-SCM_SRFI1314_API SCM scm_char_set_delete_x (SCM cs, SCM rest);
-SCM_SRFI1314_API SCM scm_char_set_complement (SCM cs);
-SCM_SRFI1314_API SCM scm_char_set_union (SCM rest);
-SCM_SRFI1314_API SCM scm_char_set_intersection (SCM rest);
-SCM_SRFI1314_API SCM scm_char_set_difference (SCM cs1, SCM rest);
-SCM_SRFI1314_API SCM scm_char_set_xor (SCM rest);
-SCM_SRFI1314_API SCM scm_char_set_diff_plus_intersection (SCM cs1, SCM rest);
-SCM_SRFI1314_API SCM scm_char_set_complement_x (SCM cs);
-SCM_SRFI1314_API SCM scm_char_set_union_x (SCM cs1, SCM rest);
-SCM_SRFI1314_API SCM scm_char_set_intersection_x (SCM cs1, SCM rest);
-SCM_SRFI1314_API SCM scm_char_set_difference_x (SCM cs1, SCM rest);
-SCM_SRFI1314_API SCM scm_char_set_xor_x (SCM cs1, SCM rest);
-SCM_SRFI1314_API SCM scm_char_set_diff_plus_intersection_x (SCM cs1, SCM cs2, SCM rest);
-
-#endif /* SCM_SRFI_14_H */
diff --git a/srfi/srfi-14.scm b/srfi/srfi-14.scm
deleted file mode 100644
index 3faebe2b8..000000000
--- a/srfi/srfi-14.scm
+++ /dev/null
@@ -1,175 +0,0 @@
-;;; srfi-14.scm --- Character-set Library
-
-;; Copyright (C) 2001, 2002 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, 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 GUILE.
-;;
-;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;; code from other Free Software Foundation releases into a copy of
-;; GUILE, 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 GUILE, it is your choice
-;; whether to permit this exception to apply to your modifications.
-;; If you do not wish that, delete this exception notice.
-
-;;; Commentary:
-
-;; This module is fully documented in the Guile Reference Manual.
-
-;;; Code:
-
-(define-module (srfi srfi-14)
- :export (
-;;; General procedures
- char-set?
- char-set=
- char-set<=
- char-set-hash
-
-;;; Iterating over character sets
- char-set-cursor
- char-set-ref
- char-set-cursor-next
- end-of-char-set?
- char-set-fold
- char-set-unfold char-set-unfold!
- char-set-for-each
- char-set-map
-
-;;; Creating character sets
- char-set-copy
- char-set
- list->char-set list->char-set!
- string->char-set string->char-set!
- char-set-filter char-set-filter!
- ucs-range->char-set ucs-range->char-set!
- ->char-set
-
-;;; Querying character sets
- char-set-size
- char-set-count
- char-set->list
- char-set->string
- char-set-contains?
- char-set-every
- char-set-any
-
-;;; Character set algebra
- char-set-adjoin char-set-adjoin!
- char-set-delete char-set-delete!
- char-set-complement
- char-set-union
- char-set-intersection
- char-set-difference
- char-set-xor
- char-set-diff+intersection
- char-set-complement!
- char-set-union!
- char-set-intersection!
- char-set-difference!
- char-set-xor!
- char-set-diff+intersection!
-
-;;; Standard character sets
- char-set:lower-case
- char-set:upper-case
- char-set:title-case
- char-set:letter
- char-set:digit
- char-set:letter+digit
- char-set:graphic
- char-set:printing
- char-set:whitespace
- char-set:iso-control
- char-set:punctuation
- char-set:symbol
- char-set:hex-digit
- char-set:blank
- char-set:ascii
- char-set:empty
- char-set:full
- ))
-
-(cond-expand-provide (current-module) '(srfi-14))
-
-(load-extension "libguile-srfi-srfi-13-14" "scm_init_srfi_14")
-
-(define (->char-set x)
- (cond
- ((string? x) (string->char-set x))
- ((char? x) (char-set x))
- ((char-set? x) x)
- (else (error "invalid argument to `->char-set'"))))
-
-(define char-set:full (ucs-range->char-set 0 256))
-
-(define char-set:lower-case (char-set-filter char-lower-case? char-set:full))
-
-(define char-set:upper-case (char-set-filter char-upper-case? char-set:full))
-
-(define char-set:title-case (char-set))
-
-(define char-set:letter (char-set-union char-set:lower-case
- char-set:upper-case))
-
-(define char-set:digit (string->char-set "0123456789"))
-
-(define char-set:letter+digit
- (char-set-union char-set:letter char-set:digit))
-
-(define char-set:punctuation (string->char-set "!\"#%&'()*,-./:;?@[\\]_{}"))
-
-(define char-set:symbol (string->char-set "$+<=>^`|~"))
-
-(define char-set:whitespace (char-set #\space #\newline #\tab #\cr #\vt #\np))
-
-(define char-set:blank (char-set #\space #\tab))
-
-(define char-set:graphic
- (char-set-union char-set:letter+digit char-set:punctuation char-set:symbol))
-
-(define char-set:printing
- (char-set-union char-set:graphic char-set:whitespace))
-
-(define char-set:iso-control
- (char-set-adjoin
- (char-set-filter (lambda (ch) (< (char->integer ch) 31)) char-set:full)
- (integer->char 127)))
-
-(define char-set:hex-digit (string->char-set "0123456789abcdefABCDEF"))
-
-(define char-set:ascii
- (char-set-filter (lambda (ch) (< (char->integer ch) 128)) char-set:full))
-
-(define char-set:empty (char-set))
-
-;;; srfi-14.scm ends here
diff --git a/srfi/srfi-16.scm b/srfi/srfi-16.scm
deleted file mode 100644
index f283e3c1a..000000000
--- a/srfi/srfi-16.scm
+++ /dev/null
@@ -1,151 +0,0 @@
-;;; srfi-16.scm --- case-lambda
-
-;; Copyright (C) 2001, 2002 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, 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 GUILE.
-;;
-;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;; code from other Free Software Foundation releases into a copy of
-;; GUILE, 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 GUILE, it is your choice
-;; whether to permit this exception to apply to your modifications.
-;; If you do not wish that, delete this exception notice.
-
-;;; Author: Martin Grabmueller
-
-;;; Commentary:
-
-;; Implementation of SRFI-16. `case-lambda' is a syntactic form
-;; which permits writing functions acting different according to the
-;; number of arguments passed.
-;;
-;; The syntax of the `case-lambda' form is defined in the following
-;; EBNF grammar.
-;;
-;; <case-lambda>
-;; --> (case-lambda <case-lambda-clause>)
-;; <case-lambda-clause>
-;; --> (<signature> <definition-or-command>*)
-;; <signature>
-;; --> (<identifier>*)
-;; | (<identifier>* . <identifier>)
-;; | <identifier>
-;;
-;; The value returned by a `case-lambda' form is a procedure which
-;; matches the number of actual arguments against the signatures in
-;; the various clauses, in order. The first matching clause is
-;; selected, the corresponding values from the actual parameter list
-;; are bound to the variable names in the clauses and the body of the
-;; clause is evaluated.
-
-;;; Code:
-
-(define-module (srfi srfi-16)
- :export-syntax (case-lambda))
-
-(cond-expand-provide (current-module) '(srfi-16))
-
-(define-macro (case-lambda . clauses)
-
- ;; Return the length of the list @var{l}, but allow dotted list.
- ;;
- (define (alength l)
- (cond ((null? l) 0)
- ((pair? l) (+ 1 (alength (cdr l))))
- (else 0)))
-
- ;; Return @code{#t} if @var{l} is a dotted list, @code{#f} if it is
- ;; a normal list.
- ;;
- (define (dotted? l)
- (cond ((null? l) #f)
- ((pair? l) (dotted? (cdr l)))
- (else #t)))
-
- ;; Return the expression for accessing the @var{index}th element of
- ;; the list called @var{args-name}. If @var{tail?} is true, code
- ;; for accessing the list-tail is generated, otherwise for accessing
- ;; the list element itself.
- ;;
- (define (accessor args-name index tail?)
- (if tail?
- (case index
- ((0) `,args-name)
- ((1) `(cdr ,args-name))
- ((2) `(cddr ,args-name))
- ((3) `(cdddr ,args-name))
- ((4) `(cddddr ,args-name))
- (else `(list-tail ,args-name ,index)))
- (case index
- ((0) `(car ,args-name))
- ((1) `(cadr ,args-name))
- ((2) `(caddr ,args-name))
- ((3) `(cadddr ,args-name))
- (else `(list-ref ,args-name ,index)))))
-
- ;; Generate the binding lists of the variables of one case-lambda
- ;; clause. @var{vars} is the (possibly dotted) list of variables
- ;; and @var{args-name} is the generated name used for the argument
- ;; list.
- ;;
- (define (gen-temps vars args-name)
- (let lp ((v vars) (i 0))
- (cond ((null? v) '())
- ((pair? v)
- (cons `(,(car v) ,(accessor args-name i #f))
- (lp (cdr v) (+ i 1))))
- (else `((,v ,(accessor args-name i #t)))))))
-
- ;; Generate the cond clauses for each of the clauses of case-lambda,
- ;; including the parameter count check, binding of the parameters
- ;; and the code of the corresponding body.
- ;;
- (define (gen-clauses l length-name args-name)
- (cond ((null? l) (list '(else (error "too few arguments"))))
- (else
- (cons
- `((,(if (dotted? (caar l)) '>= '=)
- ,length-name ,(alength (caar l)))
- (let ,(gen-temps (caar l) args-name)
- ,@(cdar l)))
- (gen-clauses (cdr l) length-name args-name)))))
-
- (let ((args-name (gensym))
- (length-name (gensym)))
- (let ((proc
- `(lambda ,args-name
- (let ((,length-name (length ,args-name)))
- (cond ,@(gen-clauses clauses length-name args-name))))))
- proc)))
-
-;;; srfi-16.scm ends here
diff --git a/srfi/srfi-17.scm b/srfi/srfi-17.scm
deleted file mode 100644
index 4ec71c595..000000000
--- a/srfi/srfi-17.scm
+++ /dev/null
@@ -1,130 +0,0 @@
-;;; srfi-17.scm --- Generalized set!
-
-;; Copyright (C) 2001, 2002 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, 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 GUILE.
-;;
-;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;; code from other Free Software Foundation releases into a copy of
-;; GUILE, 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 GUILE, it is your choice
-;; whether to permit this exception to apply to your modifications.
-;; If you do not wish that, delete this exception notice.
-
-;;; Author: Matthias Koeppe <mkoeppe@mail.math.uni-magdeburg.de>
-
-;;; Commentary:
-
-;; This is an implementation of SRFI-17: Generalized set!
-;;
-;; It exports the Guile procedure `make-procedure-with-setter' under
-;; the SRFI name `getter-with-setter' and exports the standard
-;; procedures `car', `cdr', ..., `cdddr', `string-ref' and
-;; `vector-ref' as procedures with setters, as required by the SRFI.
-;;
-;; SRFI-17 was heavily criticized during its discussion period but it
-;; was finalized anyway. One issue was its concept of globally
-;; associating setter "properties" with (procedure) values, which is
-;; non-Schemy. For this reason, this implementation chooses not to
-;; provide a way to set the setter of a procedure. In fact, (set!
-;; (setter PROC) SETTER) signals an error. The only way to attach a
-;; setter to a procedure is to create a new object (a "procedure with
-;; setter") via the `getter-with-setter' procedure. This procedure is
-;; also specified in the SRFI. Using it avoids the described
-;; problems.
-;;
-;; This module is fully documented in the Guile Reference Manual.
-
-;;; Code:
-
-(define-module (srfi srfi-17)
- :export (getter-with-setter
- setter
- ;; redefined standard procedures
- car cdr caar cadr cdar cddr caaar caadr cadar caddr cdaar
- cdadr cddar cdddr caaaar caaadr caadar caaddr cadaar cadadr
- caddar cadddr cdaaar cdaadr cdadar cdaddr cddaar cddadr
- cdddar cddddr string-ref vector-ref))
-
-(cond-expand-provide (current-module) '(srfi-17))
-
-;;; Procedures
-
-(define getter-with-setter make-procedure-with-setter)
-
-(define setter
- (getter-with-setter
- setter
- (lambda args
- (error "Setting setters is not supported for a good reason."))))
-
-;;; Redefine R5RS procedures to appropriate procedures with setters
-
-(define (compose-setter setter location)
- (lambda (obj value)
- (setter (location obj) value)))
-
-(define car (getter-with-setter car set-car!))
-(define cdr (getter-with-setter cdr set-cdr!))
-(define caar (getter-with-setter caar (compose-setter set-car! car)))
-(define cadr (getter-with-setter cadr (compose-setter set-car! cdr)))
-(define cdar (getter-with-setter cdar (compose-setter set-cdr! car)))
-(define cddr (getter-with-setter cddr (compose-setter set-cdr! cdr)))
-(define caaar (getter-with-setter caaar (compose-setter set-car! caar)))
-(define caadr (getter-with-setter caadr (compose-setter set-car! cadr)))
-(define cadar (getter-with-setter cadar (compose-setter set-car! cdar)))
-(define caddr (getter-with-setter caddr (compose-setter set-car! cddr)))
-(define cdaar (getter-with-setter cdaar (compose-setter set-cdr! caar)))
-(define cdadr (getter-with-setter cdadr (compose-setter set-cdr! cadr)))
-(define cddar (getter-with-setter cddar (compose-setter set-cdr! cdar)))
-(define cdddr (getter-with-setter cdddr (compose-setter set-cdr! cddr)))
-(define caaaar (getter-with-setter caaaar (compose-setter set-car! caaar)))
-(define caaadr (getter-with-setter caaadr (compose-setter set-car! caadr)))
-(define caadar (getter-with-setter caadar (compose-setter set-car! cadar)))
-(define caaddr (getter-with-setter caaddr (compose-setter set-car! caddr)))
-(define cadaar (getter-with-setter cadaar (compose-setter set-car! cdaar)))
-(define cadadr (getter-with-setter cadadr (compose-setter set-car! cdadr)))
-(define caddar (getter-with-setter caddar (compose-setter set-car! cddar)))
-(define cadddr (getter-with-setter cadddr (compose-setter set-car! cdddr)))
-(define cdaaar (getter-with-setter cdaaar (compose-setter set-cdr! caaar)))
-(define cdaadr (getter-with-setter cdaadr (compose-setter set-cdr! caadr)))
-(define cdadar (getter-with-setter cdadar (compose-setter set-cdr! cadar)))
-(define cdaddr (getter-with-setter cdaddr (compose-setter set-cdr! caddr)))
-(define cddaar (getter-with-setter cddaar (compose-setter set-cdr! cdaar)))
-(define cddadr (getter-with-setter cddadr (compose-setter set-cdr! cdadr)))
-(define cdddar (getter-with-setter cdddar (compose-setter set-cdr! cddar)))
-(define cddddr (getter-with-setter cddddr (compose-setter set-cdr! cdddr)))
-(define string-ref (getter-with-setter string-ref string-set!))
-(define vector-ref (getter-with-setter vector-ref vector-set!))
-
-;;; srfi-17.scm ends here
diff --git a/srfi/srfi-19.scm b/srfi/srfi-19.scm
deleted file mode 100644
index d828b0443..000000000
--- a/srfi/srfi-19.scm
+++ /dev/null
@@ -1,1561 +0,0 @@
-;;; srfi-19.scm --- Time/Date Library
-
-;; Copyright (C) 2001, 2002 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, 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 GUILE.
-;;
-;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;; code from other Free Software Foundation releases into a copy of
-;; GUILE, 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 GUILE, it is your choice
-;; whether to permit this exception to apply to your modifications.
-;; If you do not wish that, delete this exception notice.
-
-;;; Author: Rob Browning <rlb@cs.utexas.edu>
-;;; Originally from SRFI reference implementation by Will Fitzgerald.
-
-;;; Commentary:
-
-;; This module is fully documented in the Guile Reference Manual.
-
-;;; Code:
-
-;; FIXME: I haven't checked a decent amount of this code for potential
-;; performance improvements, but I suspect that there may be some
-;; substantial ones to be realized, esp. in the later "parsing" half
-;; of the file, by rewriting the code with use of more Guile native
-;; functions that do more work in a "chunk".
-;;
-;; FIXME: mkoeppe: Time zones are treated a little simplistic in
-;; SRFI-19; they are only a numeric offset. Thus, printing time zones
-;; (PRIV:LOCALE-PRINT-TIME-ZONE) can't be implemented sensibly. The
-;; functions taking an optional TZ-OFFSET should be extended to take a
-;; symbolic time-zone (like "CET"); this string should be stored in
-;; the DATE structure.
-
-(define-module (srfi srfi-19)
- :use-module (srfi srfi-6)
- :use-module (srfi srfi-8)
- :use-module (srfi srfi-9))
-
-(begin-deprecated
- ;; Prevent `export' from re-exporting core bindings. This behaviour
- ;; of `export' is deprecated and will disappear in one of the next
- ;; releases.
- (define current-time #f))
-
-(export ;; Constants
- time-duration
- time-monotonic
- time-process
- time-tai
- time-thread
- time-utc
- ;; Current time and clock resolution
- current-date
- current-julian-day
- current-modified-julian-day
- current-time
- time-resolution
- ;; Time object and accessors
- make-time
- time?
- time-type
- time-nanosecond
- time-second
- set-time-type!
- set-time-nanosecond!
- set-time-second!
- copy-time
- ;; Time comparison procedures
- time<=?
- time<?
- time=?
- time>=?
- time>?
- ;; Time arithmetic procedures
- time-difference
- time-difference!
- add-duration
- add-duration!
- subtract-duration
- subtract-duration!
- ;; Date object and accessors
- make-date
- date?
- date-nanosecond
- date-second
- date-minute
- date-hour
- date-day
- date-month
- date-year
- date-zone-offset
- date-year-day
- date-week-day
- date-week-number
- ;; Time/Date/Julian Day/Modified Julian Day converters
- date->julian-day
- date->modified-julian-day
- date->time-monotonic
- date->time-tai
- date->time-utc
- julian-day->date
- julian-day->time-monotonic
- julian-day->time-tai
- julian-day->time-utc
- modified-julian-day->date
- modified-julian-day->time-monotonic
- modified-julian-day->time-tai
- modified-julian-day->time-utc
- time-monotonic->date
- time-monotonic->time-tai
- time-monotonic->time-tai!
- time-monotonic->time-utc
- time-monotonic->time-utc!
- time-tai->date
- time-tai->julian-day
- time-tai->modified-julian-day
- time-tai->time-monotonic
- time-tai->time-monotonic!
- time-tai->time-utc
- time-tai->time-utc!
- time-utc->date
- time-utc->julian-day
- time-utc->modified-julian-day
- time-utc->time-monotonic
- time-utc->time-monotonic!
- time-utc->time-tai
- time-utc->time-tai!
- ;; Date to string/string to date converters.
- date->string
- string->date)
-
-(cond-expand-provide (current-module) '(srfi-19))
-
-(define time-tai 'time-tai)
-(define time-utc 'time-utc)
-(define time-monotonic 'time-monotonic)
-(define time-thread 'time-thread)
-(define time-process 'time-process)
-(define time-duration 'time-duration)
-
-;; FIXME: do we want to add gc time?
-;; (define time-gc 'time-gc)
-
-;;-- LOCALE dependent constants
-
-(define priv:locale-number-separator ".")
-
-(define priv:locale-abbr-weekday-vector
- (vector "Sun" "Mon" "Tue" "Wed" "Thu" "Fri" "Sat"))
-
-(define priv:locale-long-weekday-vector
- (vector
- "Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday"))
-
-;; note empty string in 0th place.
-(define priv:locale-abbr-month-vector
- (vector ""
- "Jan"
- "Feb"
- "Mar"
- "Apr"
- "May"
- "Jun"
- "Jul"
- "Aug"
- "Sep"
- "Oct"
- "Nov"
- "Dec"))
-
-(define priv:locale-long-month-vector
- (vector ""
- "January"
- "February"
- "March"
- "April"
- "May"
- "June"
- "July"
- "August"
- "September"
- "October"
- "November"
- "December"))
-
-(define priv:locale-pm "PM")
-(define priv:locale-am "AM")
-
-;; See date->string
-(define priv:locale-date-time-format "~a ~b ~d ~H:~M:~S~z ~Y")
-(define priv:locale-short-date-format "~m/~d/~y")
-(define priv:locale-time-format "~H:~M:~S")
-(define priv:iso-8601-date-time-format "~Y-~m-~dT~H:~M:~S~z")
-
-;;-- Miscellaneous Constants.
-;;-- only the priv:tai-epoch-in-jd might need changing if
-;; a different epoch is used.
-
-(define priv:nano 1000000000) ; nanoseconds in a second
-(define priv:sid 86400) ; seconds in a day
-(define priv:sihd 43200) ; seconds in a half day
-(define priv:tai-epoch-in-jd 4881175/2) ; julian day number for 'the epoch'
-
-;; FIXME: should this be something other than misc-error?
-(define (priv:time-error caller type value)
- (if value
- (throw 'misc-error caller "TIME-ERROR type ~A: ~S" (list type value) #f)
- (throw 'misc-error caller "TIME-ERROR type ~A" (list type) #f)))
-
-;; A table of leap seconds
-;; See ftp://maia.usno.navy.mil/ser7/tai-utc.dat
-;; and update as necessary.
-;; this procedures reads the file in the abover
-;; format and creates the leap second table
-;; it also calls the almost standard, but not R5 procedures read-line
-;; & open-input-string
-;; ie (set! priv:leap-second-table (priv:read-tai-utc-date "tai-utc.dat"))
-
-(define (priv:read-tai-utc-data filename)
- (define (convert-jd jd)
- (* (- (inexact->exact jd) priv:tai-epoch-in-jd) priv:sid))
- (define (convert-sec sec)
- (inexact->exact sec))
- (let ((port (open-input-file filename))
- (table '()))
- (let loop ((line (read-line port)))
- (if (not (eq? line eof))
- (begin
- (let* ((data (read (open-input-string
- (string-append "(" line ")"))))
- (year (car data))
- (jd (cadddr (cdr data)))
- (secs (cadddr (cdddr data))))
- (if (>= year 1972)
- (set! table (cons
- (cons (convert-jd jd) (convert-sec secs))
- table)))
- (loop (read-line port))))))
- table))
-
-;; each entry is (tai seconds since epoch . # seconds to subtract for utc)
-;; note they go higher to lower, and end in 1972.
-(define priv:leap-second-table
- '((915148800 . 32)
- (867715200 . 31)
- (820454400 . 30)
- (773020800 . 29)
- (741484800 . 28)
- (709948800 . 27)
- (662688000 . 26)
- (631152000 . 25)
- (567993600 . 24)
- (489024000 . 23)
- (425865600 . 22)
- (394329600 . 21)
- (362793600 . 20)
- (315532800 . 19)
- (283996800 . 18)
- (252460800 . 17)
- (220924800 . 16)
- (189302400 . 15)
- (157766400 . 14)
- (126230400 . 13)
- (94694400 . 12)
- (78796800 . 11)
- (63072000 . 10)))
-
-(define (read-leap-second-table filename)
- (set! priv:leap-second-table (priv:read-tai-utc-data filename))
- (values))
-
-
-(define (priv:leap-second-delta utc-seconds)
- (letrec ((lsd (lambda (table)
- (cond ((>= utc-seconds (caar table))
- (cdar table))
- (else (lsd (cdr table)))))))
- (if (< utc-seconds (* (- 1972 1970) 365 priv:sid)) 0
- (lsd priv:leap-second-table))))
-
-
-;;; the TIME structure; creates the accessors, too.
-
-(define-record-type time
- (make-time-unnormalized type nanosecond second)
- time?
- (type time-type set-time-type!)
- (nanosecond time-nanosecond set-time-nanosecond!)
- (second time-second set-time-second!))
-
-(define (copy-time time)
- (make-time (time-type time) (time-nanosecond time) (time-second time)))
-
-(define (priv:split-real r)
- (if (integer? r)
- (values (inexact->exact r) 0)
- (let ((l (truncate r)))
- (values (inexact->exact l) (- r l)))))
-
-(define (priv:time-normalize! t)
- (if (>= (abs (time-nanosecond t)) 1000000000)
- (receive (int frac)
- (priv:split-real (time-nanosecond t))
- (set-time-second! t (+ (time-second t)
- (quotient int 1000000000)))
- (set-time-nanosecond! t (+ (remainder int 1000000000)
- frac))))
- (if (and (positive? (time-second t))
- (negative? (time-nanosecond t)))
- (begin
- (set-time-second! t (- (time-second t) 1))
- (set-time-nanosecond! t (+ 1000000000 (time-nanosecond t))))
- (if (and (negative? (time-second t))
- (positive? (time-nanosecond t)))
- (begin
- (set-time-second! t (+ (time-second t) 1))
- (set-time-nanosecond! t (+ 1000000000 (time-nanosecond t))))))
- t)
-
-(define (make-time type nanosecond second)
- (priv:time-normalize! (make-time-unnormalized type nanosecond second)))
-
-;; Helpers
-;; FIXME: finish this and publish it?
-(define (date->broken-down-time date)
- (let ((result (mktime 0)))
- ;; FIXME: What should we do about leap-seconds which may overflow
- ;; set-tm:sec?
- (set-tm:sec result (date-second date))
- (set-tm:min result (date-minute date))
- (set-tm:hour result (date-hour date))
- ;; FIXME: SRFI day ranges from 0-31. (not compatible with set-tm:mday).
- (set-tm:mday result (date-day date))
- (set-tm:month result (- (date-month date) 1))
- ;; FIXME: need to signal error on range violation.
- (set-tm:year result (+ 1900 (date-year date)))
- (set-tm:isdst result -1)
- (set-tm:gmtoff result (- (date-zone-offset date)))
- result))
-
-;;; current-time
-
-;;; specific time getters.
-
-(define (priv:current-time-utc)
- ;; Resolution is microseconds.
- (let ((tod (gettimeofday)))
- (make-time time-utc (* (cdr tod) 1000) (car tod))))
-
-(define (priv:current-time-tai)
- ;; Resolution is microseconds.
- (let* ((tod (gettimeofday))
- (sec (car tod))
- (usec (cdr tod)))
- (make-time time-tai
- (* usec 1000)
- (+ (car tod) (priv:leap-second-delta sec)))))
-
-;;(define (priv:current-time-ms-time time-type proc)
-;; (let ((current-ms (proc)))
-;; (make-time time-type
-;; (quotient current-ms 10000)
-;; (* (remainder current-ms 1000) 10000))))
-
-;; -- we define it to be the same as TAI.
-;; A different implemation of current-time-montonic
-;; will require rewriting all of the time-monotonic converters,
-;; of course.
-
-(define (priv:current-time-monotonic)
- ;; Resolution is microseconds.
- (priv:current-time-tai))
-
-(define (priv:current-time-thread)
- (priv:time-error 'current-time 'unsupported-clock-type 'time-thread))
-
-(define priv:ns-per-guile-tick (/ 1000000000 internal-time-units-per-second))
-
-(define (priv:current-time-process)
- (let ((run-time (get-internal-run-time)))
- (make-time
- time-process
- (quotient run-time internal-time-units-per-second)
- (* (remainder run-time internal-time-units-per-second)
- priv:ns-per-guile-tick))))
-
-(define (priv:current-time-process)
- (let ((run-time (get-internal-run-time)))
- (list
- 'time-process
- (* (remainder run-time internal-time-units-per-second)
- priv:ns-per-guile-tick)
- (quotient run-time internal-time-units-per-second))))
-
-;;(define (priv:current-time-gc)
-;; (priv:current-time-ms-time time-gc current-gc-milliseconds))
-
-(define (current-time . clock-type)
- (let ((clock-type (if (null? clock-type) time-utc (car clock-type))))
- (cond
- ((eq? clock-type time-tai) (priv:current-time-tai))
- ((eq? clock-type time-utc) (priv:current-time-utc))
- ((eq? clock-type time-monotonic) (priv:current-time-monotonic))
- ((eq? clock-type time-thread) (priv:current-time-thread))
- ((eq? clock-type time-process) (priv:current-time-process))
- ;; ((eq? clock-type time-gc) (priv:current-time-gc))
- (else (priv:time-error 'current-time 'invalid-clock-type clock-type)))))
-
-;; -- Time Resolution
-;; This is the resolution of the clock in nanoseconds.
-;; This will be implementation specific.
-
-(define (time-resolution . clock-type)
- (let ((clock-type (if (null? clock-type) time-utc (car clock-type))))
- (case clock-type
- ((time-tai) 1000)
- ((time-utc) 1000)
- ((time-monotonic) 1000)
- ((time-process) priv:ns-per-guile-tick)
- ;; ((eq? clock-type time-thread) 1000)
- ;; ((eq? clock-type time-gc) 10000)
- (else (priv:time-error 'time-resolution 'invalid-clock-type clock-type)))))
-
-;; -- Time comparisons
-
-(define (time=? t1 t2)
- ;; Arrange tests for speed and presume that t1 and t2 are actually times.
- ;; also presume it will be rare to check two times of different types.
- (and (= (time-second t1) (time-second t2))
- (= (time-nanosecond t1) (time-nanosecond t2))
- (eq? (time-type t1) (time-type t2))))
-
-(define (time>? t1 t2)
- (or (> (time-second t1) (time-second t2))
- (and (= (time-second t1) (time-second t2))
- (> (time-nanosecond t1) (time-nanosecond t2)))))
-
-(define (time<? t1 t2)
- (or (< (time-second t1) (time-second t2))
- (and (= (time-second t1) (time-second t2))
- (< (time-nanosecond t1) (time-nanosecond t2)))))
-
-(define (time>=? t1 t2)
- (or (> (time-second t1) (time-second t2))
- (and (= (time-second t1) (time-second t2))
- (>= (time-nanosecond t1) (time-nanosecond t2)))))
-
-(define (time<=? t1 t2)
- (or (< (time-second t1) (time-second t2))
- (and (= (time-second t1) (time-second t2))
- (<= (time-nanosecond t1) (time-nanosecond t2)))))
-
-;; -- Time arithmetic
-
-(define (time-difference! time1 time2)
- (let ((sec-diff (- (time-second time1) (time-second time2)))
- (nsec-diff (- (time-nanosecond time1) (time-nanosecond time2))))
- (set-time-type! time1 time-duration)
- (set-time-second! time1 sec-diff)
- (set-time-nanosecond! time1 nsec-diff)
- (priv:time-normalize! time1)))
-
-(define (time-difference time1 time2)
- (let ((result (copy-time time1)))
- (time-difference! result time2)))
-
-(define (add-duration! t duration)
- (if (not (eq? (time-type duration) time-duration))
- (priv:time-error 'add-duration 'not-duration duration)
- (let ((sec-plus (+ (time-second t) (time-second duration)))
- (nsec-plus (+ (time-nanosecond t) (time-nanosecond duration))))
- (set-time-second! t sec-plus)
- (set-time-nanosecond! t nsec-plus)
- (priv:time-normalize! t))))
-
-(define (add-duration t duration)
- (let ((result (copy-time t)))
- (add-duration! result duration)))
-
-(define (subtract-duration! t duration)
- (if (not (eq? (time-type duration) time-duration))
- (priv:time-error 'add-duration 'not-duration duration)
- (let ((sec-minus (- (time-second t) (time-second duration)))
- (nsec-minus (- (time-nanosecond t) (time-nanosecond duration))))
- (set-time-second! t sec-minus)
- (set-time-nanosecond! t nsec-minus)
- (priv:time-normalize! t))))
-
-(define (subtract-duration time1 duration)
- (let ((result (copy-time time1)))
- (subtract-duration! result duration)))
-
-;; -- Converters between types.
-
-(define (priv:time-tai->time-utc! time-in time-out caller)
- (if (not (eq? (time-type time-in) time-tai))
- (priv:time-error caller 'incompatible-time-types time-in))
- (set-time-type! time-out time-utc)
- (set-time-nanosecond! time-out (time-nanosecond time-in))
- (set-time-second! time-out (- (time-second time-in)
- (priv:leap-second-delta
- (time-second time-in))))
- time-out)
-
-(define (time-tai->time-utc time-in)
- (priv:time-tai->time-utc! time-in (make-time-unnormalized #f #f #f) 'time-tai->time-utc))
-
-
-(define (time-tai->time-utc! time-in)
- (priv:time-tai->time-utc! time-in time-in 'time-tai->time-utc!))
-
-(define (priv:time-utc->time-tai! time-in time-out caller)
- (if (not (eq? (time-type time-in) time-utc))
- (priv:time-error caller 'incompatible-time-types time-in))
- (set-time-type! time-out time-tai)
- (set-time-nanosecond! time-out (time-nanosecond time-in))
- (set-time-second! time-out (+ (time-second time-in)
- (priv:leap-second-delta
- (time-second time-in))))
- time-out)
-
-(define (time-utc->time-tai time-in)
- (priv:time-utc->time-tai! time-in (make-time-unnormalized #f #f #f) 'time-utc->time-tai))
-
-(define (time-utc->time-tai! time-in)
- (priv:time-utc->time-tai! time-in time-in 'time-utc->time-tai!))
-
-;; -- these depend on time-monotonic having the same definition as time-tai!
-(define (time-monotonic->time-utc time-in)
- (if (not (eq? (time-type time-in) time-monotonic))
- (priv:time-error caller 'incompatible-time-types time-in))
- (let ((ntime (copy-time time-in)))
- (set-time-type! ntime time-tai)
- (priv:time-tai->time-utc! ntime ntime 'time-monotonic->time-utc)))
-
-(define (time-monotonic->time-utc! time-in)
- (if (not (eq? (time-type time-in) time-monotonic))
- (priv:time-error caller 'incompatible-time-types time-in))
- (set-time-type! time-in time-tai)
- (priv:time-tai->time-utc! ntime ntime 'time-monotonic->time-utc))
-
-(define (time-monotonic->time-tai time-in)
- (if (not (eq? (time-type time-in) time-monotonic))
- (priv:time-error caller 'incompatible-time-types time-in))
- (let ((ntime (copy-time time-in)))
- (set-time-type! ntime time-tai)
- ntime))
-
-(define (time-monotonic->time-tai! time-in)
- (if (not (eq? (time-type time-in) time-monotonic))
- (priv:time-error caller 'incompatible-time-types time-in))
- (set-time-type! time-in time-tai)
- time-in)
-
-(define (time-utc->time-monotonic time-in)
- (if (not (eq? (time-type time-in) time-utc))
- (priv:time-error caller 'incompatible-time-types time-in))
- (let ((ntime (priv:time-utc->time-tai! time-in (make-time-unnormalized #f #f #f)
- 'time-utc->time-monotonic)))
- (set-time-type! ntime time-monotonic)
- ntime))
-
-(define (time-utc->time-monotonic! time-in)
- (if (not (eq? (time-type time-in) time-utc))
- (priv:time-error caller 'incompatible-time-types time-in))
- (let ((ntime (priv:time-utc->time-tai! time-in time-in
- 'time-utc->time-monotonic!)))
- (set-time-type! ntime time-monotonic)
- ntime))
-
-(define (time-tai->time-monotonic time-in)
- (if (not (eq? (time-type time-in) time-tai))
- (priv:time-error caller 'incompatible-time-types time-in))
- (let ((ntime (copy-time time-in)))
- (set-time-type! ntime time-monotonic)
- ntime))
-
-(define (time-tai->time-monotonic! time-in)
- (if (not (eq? (time-type time-in) time-tai))
- (priv:time-error caller 'incompatible-time-types time-in))
- (set-time-type! time-in time-monotonic)
- time-in)
-
-;; -- Date Structures
-
-;; FIXME: to be really safe, perhaps we should normalize the
-;; seconds/nanoseconds/minutes coming in to make-date...
-
-(define-record-type date
- (make-date nanosecond second minute
- hour day month
- year
- zone-offset)
- date?
- (nanosecond date-nanosecond set-date-nanosecond!)
- (second date-second set-date-second!)
- (minute date-minute set-date-minute!)
- (hour date-hour set-date-hour!)
- (day date-day set-date-day!)
- (month date-month set-date-month!)
- (year date-year set-date-year!)
- (zone-offset date-zone-offset set-date-zone-offset!))
-
-;; gives the julian day which starts at noon.
-(define (priv:encode-julian-day-number day month year)
- (let* ((a (quotient (- 14 month) 12))
- (y (- (+ year 4800) a (if (negative? year) -1 0)))
- (m (- (+ month (* 12 a)) 3)))
- (+ day
- (quotient (+ (* 153 m) 2) 5)
- (* 365 y)
- (quotient y 4)
- (- (quotient y 100))
- (quotient y 400)
- -32045)))
-
-;; gives the seconds/date/month/year
-(define (priv:decode-julian-day-number jdn)
- (let* ((days (inexact->exact (truncate jdn)))
- (a (+ days 32044))
- (b (quotient (+ (* 4 a) 3) 146097))
- (c (- a (quotient (* 146097 b) 4)))
- (d (quotient (+ (* 4 c) 3) 1461))
- (e (- c (quotient (* 1461 d) 4)))
- (m (quotient (+ (* 5 e) 2) 153))
- (y (+ (* 100 b) d -4800 (quotient m 10))))
- (values ; seconds date month year
- (* (- jdn days) priv:sid)
- (+ e (- (quotient (+ (* 153 m) 2) 5)) 1)
- (+ m 3 (* -12 (quotient m 10)))
- (if (>= 0 y) (- y 1) y))))
-
-;; relies on the fact that we named our time zone accessor
-;; differently from MzScheme's....
-;; This should be written to be OS specific.
-
-(define (priv:local-tz-offset utc-time)
- ;; SRFI uses seconds West, but guile (and libc) use seconds East.
- (- (tm:gmtoff (localtime (time-second utc-time)))))
-
-;; special thing -- ignores nanos
-(define (priv:time->julian-day-number seconds tz-offset)
- (+ (/ (+ seconds tz-offset priv:sihd)
- priv:sid)
- priv:tai-epoch-in-jd))
-
-(define (priv:leap-second? second)
- (and (assoc second priv:leap-second-table) #t))
-
-(define (time-utc->date time . tz-offset)
- (if (not (eq? (time-type time) time-utc))
- (priv:time-error 'time->date 'incompatible-time-types time))
- (let* ((offset (if (null? tz-offset)
- (priv:local-tz-offset time)
- (car tz-offset)))
- (leap-second? (priv:leap-second? (+ offset (time-second time))))
- (jdn (priv:time->julian-day-number (if leap-second?
- (- (time-second time) 1)
- (time-second time))
- offset)))
-
- (call-with-values (lambda () (priv:decode-julian-day-number jdn))
- (lambda (secs date month year)
- ;; secs is a real because jdn is a real in Guile;
- ;; but it is conceptionally an integer.
- (let* ((int-secs (inexact->exact (round secs)))
- (hours (quotient int-secs (* 60 60)))
- (rem (remainder int-secs (* 60 60)))
- (minutes (quotient rem 60))
- (seconds (remainder rem 60)))
- (make-date (time-nanosecond time)
- (if leap-second? (+ seconds 1) seconds)
- minutes
- hours
- date
- month
- year
- offset))))))
-
-(define (time-tai->date time . tz-offset)
- (if (not (eq? (time-type time) time-tai))
- (priv:time-error 'time->date 'incompatible-time-types time))
- (let* ((offset (if (null? tz-offset)
- (priv:local-tz-offset (time-tai->time-utc time))
- (car tz-offset)))
- (seconds (- (time-second time)
- (priv:leap-second-delta (time-second time))))
- (leap-second? (priv:leap-second? (+ offset seconds)))
- (jdn (priv:time->julian-day-number (if leap-second?
- (- seconds 1)
- seconds)
- offset)))
- (call-with-values (lambda () (priv:decode-julian-day-number jdn))
- (lambda (secs date month year)
- ;; secs is a real because jdn is a real in Guile;
- ;; but it is conceptionally an integer.
- ;; adjust for leap seconds if necessary ...
- (let* ((int-secs (inexact->exact (round secs)))
- (hours (quotient int-secs (* 60 60)))
- (rem (remainder int-secs (* 60 60)))
- (minutes (quotient rem 60))
- (seconds (remainder rem 60)))
- (make-date (time-nanosecond time)
- (if leap-second? (+ seconds 1) seconds)
- minutes
- hours
- date
- month
- year
- offset))))))
-
-;; this is the same as time-tai->date.
-(define (time-monotonic->date time . tz-offset)
- (if (not (eq? (time-type time) time-monotonic))
- (priv:time-error 'time->date 'incompatible-time-types time))
- (let* ((offset (if (null? tz-offset)
- (priv:local-tz-offset (time-monotonic->time-utc time))
- (car tz-offset)))
- (seconds (- (time-second time)
- (priv:leap-second-delta (time-second time))))
- (leap-second? (priv:leap-second? (+ offset seconds)))
- (jdn (priv:time->julian-day-number (if leap-second?
- (- seconds 1)
- seconds)
- offset)))
- (call-with-values (lambda () (priv:decode-julian-day-number jdn))
- (lambda (secs date month year)
- ;; secs is a real because jdn is a real in Guile;
- ;; but it is conceptionally an integer.
- ;; adjust for leap seconds if necessary ...
- (let* ((int-secs (inexact->exact (round secs)))
- (hours (quotient int-secs (* 60 60)))
- (rem (remainder int-secs (* 60 60)))
- (minutes (quotient rem 60))
- (seconds (remainder rem 60)))
- (make-date (time-nanosecond time)
- (if leap-second? (+ seconds 1) seconds)
- minutes
- hours
- date
- month
- year
- offset))))))
-
-(define (date->time-utc date)
- (let* ((jdays (- (priv:encode-julian-day-number (date-day date)
- (date-month date)
- (date-year date))
- priv:tai-epoch-in-jd))
- ;; jdays is an integer plus 1/2,
- (jdays-1/2 (inexact->exact (- jdays 1/2))))
- (make-time
- time-utc
- (date-nanosecond date)
- (+ (* jdays-1/2 24 60 60)
- (* (date-hour date) 60 60)
- (* (date-minute date) 60)
- (date-second date)
- (- (date-zone-offset date))))))
-
-(define (date->time-tai date)
- (time-utc->time-tai! (date->time-utc date)))
-
-(define (date->time-monotonic date)
- (time-utc->time-monotonic! (date->time-utc date)))
-
-(define (priv:leap-year? year)
- (or (= (modulo year 400) 0)
- (and (= (modulo year 4) 0) (not (= (modulo year 100) 0)))))
-
-(define (leap-year? date)
- (priv:leap-year? (date-year date)))
-
-;; Map 1-based month number M to number of days in the year before the
-;; start of month M (in a non-leap year).
-(define priv:month-assoc '((1 . 0) (2 . 31) (3 . 59) (4 . 90)
- (5 . 120) (6 . 151) (7 . 181) (8 . 212)
- (9 . 243) (10 . 273) (11 . 304) (12 . 334)))
-
-(define (priv:year-day day month year)
- (let ((days-pr (assoc month priv:month-assoc)))
- (if (not days-pr)
- (priv:error 'date-year-day 'invalid-month-specification month))
- (if (and (priv:leap-year? year) (> month 2))
- (+ day (cdr days-pr) 1)
- (+ day (cdr days-pr)))))
-
-(define (date-year-day date)
- (priv:year-day (date-day date) (date-month date) (date-year date)))
-
-;; from calendar faq
-(define (priv:week-day day month year)
- (let* ((a (quotient (- 14 month) 12))
- (y (- year a))
- (m (+ month (* 12 a) -2)))
- (modulo (+ day
- y
- (quotient y 4)
- (- (quotient y 100))
- (quotient y 400)
- (quotient (* 31 m) 12))
- 7)))
-
-(define (date-week-day date)
- (priv:week-day (date-day date) (date-month date) (date-year date)))
-
-(define (priv:days-before-first-week date day-of-week-starting-week)
- (let* ((first-day (make-date 0 0 0 0
- 1
- 1
- (date-year date)
- #f))
- (fdweek-day (date-week-day first-day)))
- (modulo (- day-of-week-starting-week fdweek-day)
- 7)))
-
-(define (date-week-number date day-of-week-starting-week)
- (quotient (- (date-year-day date)
- (priv:days-before-first-week date day-of-week-starting-week))
- 7))
-
-(define (current-date . tz-offset)
- (let ((time (current-time time-utc)))
- (time-utc->date
- time
- (if (null? tz-offset)
- (priv:local-tz-offset time)
- (car tz-offset)))))
-
-;; given a 'two digit' number, find the year within 50 years +/-
-(define (priv:natural-year n)
- (let* ((current-year (date-year (current-date)))
- (current-century (* (quotient current-year 100) 100)))
- (cond
- ((>= n 100) n)
- ((< n 0) n)
- ((<= (- (+ current-century n) current-year) 50) (+ current-century n))
- (else (+ (- current-century 100) n)))))
-
-(define (date->julian-day date)
- (let ((nanosecond (date-nanosecond date))
- (second (date-second date))
- (minute (date-minute date))
- (hour (date-hour date))
- (day (date-day date))
- (month (date-month date))
- (year (date-year date)))
- (+ (priv:encode-julian-day-number day month year)
- (- 1/2)
- (+ (/ (+ (* hour 60 60)
- (* minute 60)
- second
- (/ nanosecond priv:nano))
- priv:sid)))))
-
-(define (date->modified-julian-day date)
- (- (date->julian-day date)
- 4800001/2))
-
-(define (time-utc->julian-day time)
- (if (not (eq? (time-type time) time-utc))
- (priv:time-error 'time->date 'incompatible-time-types time))
- (+ (/ (+ (time-second time) (/ (time-nanosecond time) priv:nano))
- priv:sid)
- priv:tai-epoch-in-jd))
-
-(define (time-utc->modified-julian-day time)
- (- (time-utc->julian-day time)
- 4800001/2))
-
-(define (time-tai->julian-day time)
- (if (not (eq? (time-type time) time-tai))
- (priv:time-error 'time->date 'incompatible-time-types time))
- (+ (/ (+ (- (time-second time)
- (priv:leap-second-delta (time-second time)))
- (/ (time-nanosecond time) priv:nano))
- priv:sid)
- priv:tai-epoch-in-jd))
-
-(define (time-tai->modified-julian-day time)
- (- (time-tai->julian-day time)
- 4800001/2))
-
-;; this is the same as time-tai->julian-day
-(define (time-monotonic->julian-day time)
- (if (not (eq? (time-type time) time-monotonic))
- (priv:time-error 'time->date 'incompatible-time-types time))
- (+ (/ (+ (- (time-second time)
- (priv:leap-second-delta (time-second time)))
- (/ (time-nanosecond time) priv:nano))
- priv:sid)
- priv:tai-epoch-in-jd))
-
-(define (time-monotonic->modified-julian-day time)
- (- (time-monotonic->julian-day time)
- 4800001/2))
-
-(define (julian-day->time-utc jdn)
- (let ((secs (* priv:sid (- jdn priv:tai-epoch-in-jd))))
- (receive (seconds parts)
- (priv:split-real secs)
- (make-time time-utc
- (* parts priv:nano)
- seconds))))
-
-(define (julian-day->time-tai jdn)
- (time-utc->time-tai! (julian-day->time-utc jdn)))
-
-(define (julian-day->time-monotonic jdn)
- (time-utc->time-monotonic! (julian-day->time-utc jdn)))
-
-(define (julian-day->date jdn . tz-offset)
- (let* ((time (julian-day->time-utc jdn))
- (offset (if (null? tz-offset)
- (priv:local-tz-offset time)
- (car tz-offset))))
- (time-utc->date time offset)))
-
-(define (modified-julian-day->date jdn . tz-offset)
- (apply julian-day->date (+ jdn 4800001/2)
- tz-offset))
-
-(define (modified-julian-day->time-utc jdn)
- (julian-day->time-utc (+ jdn 4800001/2)))
-
-(define (modified-julian-day->time-tai jdn)
- (julian-day->time-tai (+ jdn 4800001/2)))
-
-(define (modified-julian-day->time-monotonic jdn)
- (julian-day->time-monotonic (+ jdn 4800001/2)))
-
-(define (current-julian-day)
- (time-utc->julian-day (current-time time-utc)))
-
-(define (current-modified-julian-day)
- (time-utc->modified-julian-day (current-time time-utc)))
-
-;; returns a string rep. of number N, of minimum LENGTH, padded with
-;; character PAD-WITH. If PAD-WITH is #f, no padding is done, and it's
-;; as if number->string was used. if string is longer than or equal
-;; in length to LENGTH, it's as if number->string was used.
-
-(define (priv:padding n pad-with length)
- (let* ((str (number->string n))
- (str-len (string-length str)))
- (if (or (>= str-len length)
- (not pad-with))
- str
- (string-append (make-string (- length str-len) pad-with) str))))
-
-(define (priv:last-n-digits i n)
- (abs (remainder i (expt 10 n))))
-
-(define (priv:locale-abbr-weekday n)
- (vector-ref priv:locale-abbr-weekday-vector n))
-
-(define (priv:locale-long-weekday n)
- (vector-ref priv:locale-long-weekday-vector n))
-
-(define (priv:locale-abbr-month n)
- (vector-ref priv:locale-abbr-month-vector n))
-
-(define (priv:locale-long-month n)
- (vector-ref priv:locale-long-month-vector n))
-
-(define (priv:vector-find needle haystack comparator)
- (let ((len (vector-length haystack)))
- (define (priv:vector-find-int index)
- (cond
- ((>= index len) #f)
- ((comparator needle (vector-ref haystack index)) index)
- (else (priv:vector-find-int (+ index 1)))))
- (priv:vector-find-int 0)))
-
-(define (priv:locale-abbr-weekday->index string)
- (priv:vector-find string priv:locale-abbr-weekday-vector string=?))
-
-(define (priv:locale-long-weekday->index string)
- (priv:vector-find string priv:locale-long-weekday-vector string=?))
-
-(define (priv:locale-abbr-month->index string)
- (priv:vector-find string priv:locale-abbr-month-vector string=?))
-
-(define (priv:locale-long-month->index string)
- (priv:vector-find string priv:locale-long-month-vector string=?))
-
-
-;; FIXME: mkoeppe: Put a symbolic time zone in the date structs.
-;; Print it here instead of the numerical offset if available.
-(define (priv:locale-print-time-zone date port)
- (priv:tz-printer (date-zone-offset date) port))
-
-;; FIXME: we should use strftime to determine this dynamically if possible.
-;; Again, locale specific.
-(define (priv:locale-am/pm hr)
- (if (> hr 11) priv:locale-pm priv:locale-am))
-
-(define (priv:tz-printer offset port)
- (cond
- ((= offset 0) (display "Z" port))
- ((negative? offset) (display "-" port))
- (else (display "+" port)))
- (if (not (= offset 0))
- (let ((hours (abs (quotient offset (* 60 60))))
- (minutes (abs (quotient (remainder offset (* 60 60)) 60))))
- (display (priv:padding hours #\0 2) port)
- (display (priv:padding minutes #\0 2) port))))
-
-;; A table of output formatting directives.
-;; the first time is the format char.
-;; the second is a procedure that takes the date, a padding character
-;; (which might be #f), and the output port.
-;;
-(define priv:directives
- (list
- (cons #\~ (lambda (date pad-with port)
- (display #\~ port)))
- (cons #\a (lambda (date pad-with port)
- (display (priv:locale-abbr-weekday (date-week-day date))
- port)))
- (cons #\A (lambda (date pad-with port)
- (display (priv:locale-long-weekday (date-week-day date))
- port)))
- (cons #\b (lambda (date pad-with port)
- (display (priv:locale-abbr-month (date-month date))
- port)))
- (cons #\B (lambda (date pad-with port)
- (display (priv:locale-long-month (date-month date))
- port)))
- (cons #\c (lambda (date pad-with port)
- (display (date->string date priv:locale-date-time-format) port)))
- (cons #\d (lambda (date pad-with port)
- (display (priv:padding (date-day date)
- #\0 2)
- port)))
- (cons #\D (lambda (date pad-with port)
- (display (date->string date "~m/~d/~y") port)))
- (cons #\e (lambda (date pad-with port)
- (display (priv:padding (date-day date)
- #\Space 2)
- port)))
- (cons #\f (lambda (date pad-with port)
- (if (> (date-nanosecond date)
- priv:nano)
- (display (priv:padding (+ (date-second date) 1)
- pad-with 2)
- port)
- (display (priv:padding (date-second date)
- pad-with 2)
- port))
- (receive (i f)
- (priv:split-real (/
- (date-nanosecond date)
- priv:nano 1.0))
- (let* ((ns (number->string f))
- (le (string-length ns)))
- (if (> le 2)
- (begin
- (display priv:locale-number-separator port)
- (display (substring ns 2 le) port)))))))
- (cons #\h (lambda (date pad-with port)
- (display (date->string date "~b") port)))
- (cons #\H (lambda (date pad-with port)
- (display (priv:padding (date-hour date)
- pad-with 2)
- port)))
- (cons #\I (lambda (date pad-with port)
- (let ((hr (date-hour date)))
- (if (> hr 12)
- (display (priv:padding (- hr 12)
- pad-with 2)
- port)
- (display (priv:padding hr
- pad-with 2)
- port)))))
- (cons #\j (lambda (date pad-with port)
- (display (priv:padding (date-year-day date)
- pad-with 3)
- port)))
- (cons #\k (lambda (date pad-with port)
- (display (priv:padding (date-hour date)
- #\Space 2)
- port)))
- (cons #\l (lambda (date pad-with port)
- (let ((hr (if (> (date-hour date) 12)
- (- (date-hour date) 12) (date-hour date))))
- (display (priv:padding hr #\Space 2)
- port))))
- (cons #\m (lambda (date pad-with port)
- (display (priv:padding (date-month date)
- pad-with 2)
- port)))
- (cons #\M (lambda (date pad-with port)
- (display (priv:padding (date-minute date)
- pad-with 2)
- port)))
- (cons #\n (lambda (date pad-with port)
- (newline port)))
- (cons #\N (lambda (date pad-with port)
- (display (priv:padding (date-nanosecond date)
- pad-with 7)
- port)))
- (cons #\p (lambda (date pad-with port)
- (display (priv:locale-am/pm (date-hour date)) port)))
- (cons #\r (lambda (date pad-with port)
- (display (date->string date "~I:~M:~S ~p") port)))
- (cons #\s (lambda (date pad-with port)
- (display (time-second (date->time-utc date)) port)))
- (cons #\S (lambda (date pad-with port)
- (if (> (date-nanosecond date)
- priv:nano)
- (display (priv:padding (+ (date-second date) 1)
- pad-with 2)
- port)
- (display (priv:padding (date-second date)
- pad-with 2)
- port))))
- (cons #\t (lambda (date pad-with port)
- (display #\Tab port)))
- (cons #\T (lambda (date pad-with port)
- (display (date->string date "~H:~M:~S") port)))
- (cons #\U (lambda (date pad-with port)
- (if (> (priv:days-before-first-week date 0) 0)
- (display (priv:padding (+ (date-week-number date 0) 1)
- #\0 2) port)
- (display (priv:padding (date-week-number date 0)
- #\0 2) port))))
- (cons #\V (lambda (date pad-with port)
- (display (priv:padding (date-week-number date 1)
- #\0 2) port)))
- (cons #\w (lambda (date pad-with port)
- (display (date-week-day date) port)))
- (cons #\x (lambda (date pad-with port)
- (display (date->string date priv:locale-short-date-format) port)))
- (cons #\X (lambda (date pad-with port)
- (display (date->string date priv:locale-time-format) port)))
- (cons #\W (lambda (date pad-with port)
- (if (> (priv:days-before-first-week date 1) 0)
- (display (priv:padding (+ (date-week-number date 1) 1)
- #\0 2) port)
- (display (priv:padding (date-week-number date 1)
- #\0 2) port))))
- (cons #\y (lambda (date pad-with port)
- (display (priv:padding (priv:last-n-digits
- (date-year date) 2)
- pad-with
- 2)
- port)))
- (cons #\Y (lambda (date pad-with port)
- (display (date-year date) port)))
- (cons #\z (lambda (date pad-with port)
- (priv:tz-printer (date-zone-offset date) port)))
- (cons #\Z (lambda (date pad-with port)
- (priv:locale-print-time-zone date port)))
- (cons #\1 (lambda (date pad-with port)
- (display (date->string date "~Y-~m-~d") port)))
- (cons #\2 (lambda (date pad-with port)
- (display (date->string date "~k:~M:~S~z") port)))
- (cons #\3 (lambda (date pad-with port)
- (display (date->string date "~k:~M:~S") port)))
- (cons #\4 (lambda (date pad-with port)
- (display (date->string date "~Y-~m-~dT~k:~M:~S~z") port)))
- (cons #\5 (lambda (date pad-with port)
- (display (date->string date "~Y-~m-~dT~k:~M:~S") port)))))
-
-
-(define (priv:get-formatter char)
- (let ((associated (assoc char priv:directives)))
- (if associated (cdr associated) #f)))
-
-(define (priv:date-printer date index format-string str-len port)
- (if (>= index str-len)
- (values)
- (let ((current-char (string-ref format-string index)))
- (if (not (char=? current-char #\~))
- (begin
- (display current-char port)
- (priv:date-printer date (+ index 1) format-string str-len port))
- (if (= (+ index 1) str-len) ; bad format string.
- (priv:time-error 'priv:date-printer 'bad-date-format-string
- format-string)
- (let ((pad-char? (string-ref format-string (+ index 1))))
- (cond
- ((char=? pad-char? #\-)
- (if (= (+ index 2) str-len) ; bad format string.
- (priv:time-error 'priv:date-printer
- 'bad-date-format-string
- format-string)
- (let ((formatter (priv:get-formatter
- (string-ref format-string
- (+ index 2)))))
- (if (not formatter)
- (priv:time-error 'priv:date-printer
- 'bad-date-format-string
- format-string)
- (begin
- (formatter date #f port)
- (priv:date-printer date
- (+ index 3)
- format-string
- str-len
- port))))))
-
- ((char=? pad-char? #\_)
- (if (= (+ index 2) str-len) ; bad format string.
- (priv:time-error 'priv:date-printer
- 'bad-date-format-string
- format-string)
- (let ((formatter (priv:get-formatter
- (string-ref format-string
- (+ index 2)))))
- (if (not formatter)
- (priv:time-error 'priv:date-printer
- 'bad-date-format-string
- format-string)
- (begin
- (formatter date #\Space port)
- (priv:date-printer date
- (+ index 3)
- format-string
- str-len
- port))))))
- (else
- (let ((formatter (priv:get-formatter
- (string-ref format-string
- (+ index 1)))))
- (if (not formatter)
- (priv:time-error 'priv:date-printer
- 'bad-date-format-string
- format-string)
- (begin
- (formatter date #\0 port)
- (priv:date-printer date
- (+ index 2)
- format-string
- str-len
- port))))))))))))
-
-
-(define (date->string date . format-string)
- (let ((str-port (open-output-string))
- (fmt-str (if (null? format-string) "~c" (car format-string))))
- (priv:date-printer date 0 fmt-str (string-length fmt-str) str-port)
- (get-output-string str-port)))
-
-(define (priv:char->int ch)
- (case ch
- ((#\0) 0)
- ((#\1) 1)
- ((#\2) 2)
- ((#\3) 3)
- ((#\4) 4)
- ((#\5) 5)
- ((#\6) 6)
- ((#\7) 7)
- ((#\8) 8)
- ((#\9) 9)
- (else (priv:time-error 'bad-date-template-string
- (list "Non-integer character" ch i)))))
-
-;; read an integer upto n characters long on port; upto -> #f is any length
-(define (priv:integer-reader upto port)
- (let loop ((accum 0) (nchars 0))
- (let ((ch (peek-char port)))
- (if (or (eof-object? ch)
- (not (char-numeric? ch))
- (and upto (>= nchars upto)))
- accum
- (loop (+ (* accum 10) (priv:char->int (read-char port)))
- (+ nchars 1))))))
-
-(define (priv:make-integer-reader upto)
- (lambda (port)
- (priv:integer-reader upto port)))
-
-;; read *exactly* n characters and convert to integer; could be padded
-(define (priv:integer-reader-exact n port)
- (let ((padding-ok #t))
- (define (accum-int port accum nchars)
- (let ((ch (peek-char port)))
- (cond
- ((>= nchars n) accum)
- ((eof-object? ch)
- (priv:time-error 'string->date 'bad-date-template-string
- "Premature ending to integer read."))
- ((char-numeric? ch)
- (set! padding-ok #f)
- (accum-int port
- (+ (* accum 10) (priv:char->int (read-char port)))
- (+ nchars 1)))
- (padding-ok
- (read-char port) ; consume padding
- (accum-int port accum (+ nchars 1)))
- (else ; padding where it shouldn't be
- (priv:time-error 'string->date 'bad-date-template-string
- "Non-numeric characters in integer read.")))))
- (accum-int port 0 0)))
-
-
-(define (priv:make-integer-exact-reader n)
- (lambda (port)
- (priv:integer-reader-exact n port)))
-
-(define (priv:zone-reader port)
- (let ((offset 0)
- (positive? #f))
- (let ((ch (read-char port)))
- (if (eof-object? ch)
- (priv:time-error 'string->date 'bad-date-template-string
- (list "Invalid time zone +/-" ch)))
- (if (or (char=? ch #\Z) (char=? ch #\z))
- 0
- (begin
- (cond
- ((char=? ch #\+) (set! positive? #t))
- ((char=? ch #\-) (set! positive? #f))
- (else
- (priv:time-error 'string->date 'bad-date-template-string
- (list "Invalid time zone +/-" ch))))
- (let ((ch (read-char port)))
- (if (eof-object? ch)
- (priv:time-error 'string->date 'bad-date-template-string
- (list "Invalid time zone number" ch)))
- (set! offset (* (priv:char->int ch)
- 10 60 60)))
- (let ((ch (read-char port)))
- (if (eof-object? ch)
- (priv:time-error 'string->date 'bad-date-template-string
- (list "Invalid time zone number" ch)))
- (set! offset (+ offset (* (priv:char->int ch)
- 60 60))))
- (let ((ch (read-char port)))
- (if (eof-object? ch)
- (priv:time-error 'string->date 'bad-date-template-string
- (list "Invalid time zone number" ch)))
- (set! offset (+ offset (* (priv:char->int ch)
- 10 60))))
- (let ((ch (read-char port)))
- (if (eof-object? ch)
- (priv:time-error 'string->date 'bad-date-template-string
- (list "Invalid time zone number" ch)))
- (set! offset (+ offset (* (priv:char->int ch)
- 60))))
- (if positive? offset (- offset)))))))
-
-;; looking at a char, read the char string, run thru indexer, return index
-(define (priv:locale-reader port indexer)
-
- (define (read-char-string result)
- (let ((ch (peek-char port)))
- (if (char-alphabetic? ch)
- (read-char-string (cons (read-char port) result))
- (list->string (reverse! result)))))
-
- (let* ((str (read-char-string '()))
- (index (indexer str)))
- (if index index (priv:time-error 'string->date
- 'bad-date-template-string
- (list "Invalid string for " indexer)))))
-
-(define (priv:make-locale-reader indexer)
- (lambda (port)
- (priv:locale-reader port indexer)))
-
-(define (priv:make-char-id-reader char)
- (lambda (port)
- (if (char=? char (read-char port))
- char
- (priv:time-error 'string->date
- 'bad-date-template-string
- "Invalid character match."))))
-
-;; A List of formatted read directives.
-;; Each entry is a list.
-;; 1. the character directive;
-;; a procedure, which takes a character as input & returns
-;; 2. #t as soon as a character on the input port is acceptable
-;; for input,
-;; 3. a port reader procedure that knows how to read the current port
-;; for a value. Its one parameter is the port.
-;; 4. a action procedure, that takes the value (from 3.) and some
-;; object (here, always the date) and (probably) side-effects it.
-;; In some cases (e.g., ~A) the action is to do nothing
-
-(define priv:read-directives
- (let ((ireader4 (priv:make-integer-reader 4))
- (ireader2 (priv:make-integer-reader 2))
- (ireaderf (priv:make-integer-reader #f))
- (eireader2 (priv:make-integer-exact-reader 2))
- (eireader4 (priv:make-integer-exact-reader 4))
- (locale-reader-abbr-weekday (priv:make-locale-reader
- priv:locale-abbr-weekday->index))
- (locale-reader-long-weekday (priv:make-locale-reader
- priv:locale-long-weekday->index))
- (locale-reader-abbr-month (priv:make-locale-reader
- priv:locale-abbr-month->index))
- (locale-reader-long-month (priv:make-locale-reader
- priv:locale-long-month->index))
- (char-fail (lambda (ch) #t))
- (do-nothing (lambda (val object) (values))))
-
- (list
- (list #\~ char-fail (priv:make-char-id-reader #\~) do-nothing)
- (list #\a char-alphabetic? locale-reader-abbr-weekday do-nothing)
- (list #\A char-alphabetic? locale-reader-long-weekday do-nothing)
- (list #\b char-alphabetic? locale-reader-abbr-month
- (lambda (val object)
- (set-date-month! object val)))
- (list #\B char-alphabetic? locale-reader-long-month
- (lambda (val object)
- (set-date-month! object val)))
- (list #\d char-numeric? ireader2 (lambda (val object)
- (set-date-day!
- object val)))
- (list #\e char-fail eireader2 (lambda (val object)
- (set-date-day! object val)))
- (list #\h char-alphabetic? locale-reader-abbr-month
- (lambda (val object)
- (set-date-month! object val)))
- (list #\H char-numeric? ireader2 (lambda (val object)
- (set-date-hour! object val)))
- (list #\k char-fail eireader2 (lambda (val object)
- (set-date-hour! object val)))
- (list #\m char-numeric? ireader2 (lambda (val object)
- (set-date-month! object val)))
- (list #\M char-numeric? ireader2 (lambda (val object)
- (set-date-minute!
- object val)))
- (list #\S char-numeric? ireader2 (lambda (val object)
- (set-date-second! object val)))
- (list #\y char-fail eireader2
- (lambda (val object)
- (set-date-year! object (priv:natural-year val))))
- (list #\Y char-numeric? ireader4 (lambda (val object)
- (set-date-year! object val)))
- (list #\z (lambda (c)
- (or (char=? c #\Z)
- (char=? c #\z)
- (char=? c #\+)
- (char=? c #\-)))
- priv:zone-reader (lambda (val object)
- (set-date-zone-offset! object val))))))
-
-(define (priv:string->date date index format-string str-len port template-string)
- (define (skip-until port skipper)
- (let ((ch (peek-char port)))
- (if (eof-object? port)
- (priv:time-error 'string->date 'bad-date-format-string template-string)
- (if (not (skipper ch))
- (begin (read-char port) (skip-until port skipper))))))
- (if (>= index str-len)
- (begin
- (values))
- (let ((current-char (string-ref format-string index)))
- (if (not (char=? current-char #\~))
- (let ((port-char (read-char port)))
- (if (or (eof-object? port-char)
- (not (char=? current-char port-char)))
- (priv:time-error 'string->date
- 'bad-date-format-string template-string))
- (priv:string->date date
- (+ index 1)
- format-string
- str-len
- port
- template-string))
- ;; otherwise, it's an escape, we hope
- (if (> (+ index 1) str-len)
- (priv:time-error 'string->date
- 'bad-date-format-string template-string)
- (let* ((format-char (string-ref format-string (+ index 1)))
- (format-info (assoc format-char priv:read-directives)))
- (if (not format-info)
- (priv:time-error 'string->date
- 'bad-date-format-string template-string)
- (begin
- (let ((skipper (cadr format-info))
- (reader (caddr format-info))
- (actor (cadddr format-info)))
- (skip-until port skipper)
- (let ((val (reader port)))
- (if (eof-object? val)
- (priv:time-error 'string->date
- 'bad-date-format-string
- template-string)
- (actor val date)))
- (priv:string->date date
- (+ index 2)
- format-string
- str-len
- port
- template-string))))))))))
-
-(define (string->date input-string template-string)
- (define (priv:date-ok? date)
- (and (date-nanosecond date)
- (date-second date)
- (date-minute date)
- (date-hour date)
- (date-day date)
- (date-month date)
- (date-year date)
- (date-zone-offset date)))
- (let ((newdate (make-date 0 0 0 0 #f #f #f #f)))
- (priv:string->date newdate
- 0
- template-string
- (string-length template-string)
- (open-input-string input-string)
- template-string)
- (if (not (date-zone-offset newdate))
- (begin
- ;; this is necessary to get DST right -- as far as we can
- ;; get it right (think of the double/missing hour in the
- ;; night when we are switching between normal time and DST).
- (set-date-zone-offset! newdate
- (priv:local-tz-offset
- (make-time time-utc 0 0)))
- (set-date-zone-offset! newdate
- (priv:local-tz-offset
- (date->time-utc newdate)))))
- (if (priv:date-ok? newdate)
- newdate
- (priv:time-error
- 'string->date
- 'bad-date-format-string
- (list "Incomplete date read. " newdate template-string)))))
-
-;;; srfi-19.scm ends here
diff --git a/srfi/srfi-2.scm b/srfi/srfi-2.scm
deleted file mode 100644
index 8fe692efc..000000000
--- a/srfi/srfi-2.scm
+++ /dev/null
@@ -1,56 +0,0 @@
-;;; srfi-2.scm --- and-let*
-
-;; Copyright (C) 2001, 2002 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, 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 GUILE.
-;;
-;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;; code from other Free Software Foundation releases into a copy of
-;; GUILE, 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 GUILE, it is your choice
-;; whether to permit this exception to apply to your modifications.
-;; If you do not wish that, delete this exception notice.
-
-;;; Commentary:
-
-;; This module is fully documented in the Guile Reference Manual.
-
-;;; Code:
-
-(define-module (srfi srfi-2)
- :use-module (ice-9 and-let-star)
- :re-export-syntax (and-let*))
-
-(cond-expand-provide (current-module) '(srfi-2))
-
-;;; srfi-2.scm ends here
diff --git a/srfi/srfi-4.c b/srfi/srfi-4.c
deleted file mode 100644
index 1643ae9fd..000000000
--- a/srfi/srfi-4.c
+++ /dev/null
@@ -1,2155 +0,0 @@
-/* srfi-4.c --- Homogeneous numeric vector datatypes.
- *
- * Copyright (C) 2001 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, 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 GUILE.
- *
- * The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy code from
- * other Free Software Foundation releases into a copy of GUILE, 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 GUILE, it is your choice
- * whether to permit this exception to apply to your modifications.
- * If you do not wish that, delete this exception notice. */
-
-#include <libguile.h>
-
-#include "srfi-4.h"
-
-
-/* For brevity and maintainability, we define our own types for the
- various integer and floating point types. */
-typedef unsigned char int_u8;
-typedef signed char int_s8;
-typedef unsigned short int_u16;
-typedef signed short int_s16;
-typedef unsigned int int_u32;
-typedef signed int int_s32;
-#ifdef HAVE_LONG_LONG
-#if SIZEOF_LONG == 8
-typedef unsigned long int_u64;
-typedef signed long int_s64;
-#else
-typedef unsigned long long int_u64;
-typedef signed long long int_s64;
-#endif /* SIZEOF_LONG */
-#endif /* HAVE_LONG_LONG */
-typedef float float_f32;
-typedef double float_f64;
-
-
-/* Smob type code for homogeneous numeric vectors. */
-int scm_tc16_uvec = 0;
-
-
-/* Accessor macros for the three components of a homogeneous numeric
- vector:
- - The type tag (one of the symbolic constants below).
- - The vector's length (counted in elements).
- - The address of the data area (holding the elements of the
- vector). */
-#define SCM_UVEC_TYPE(u) (SCM_CELL_WORD_1(u))
-#define SCM_UVEC_LENGTH(u) (SCM_CELL_WORD_2(u))
-#define SCM_UVEC_BASE(u) (SCM_CELL_OBJECT_3(u))
-
-
-/* Symbolic constants encoding the various types of homogeneous
- numeric vectors. */
-#define SCM_UVEC_U8 0
-#define SCM_UVEC_S8 1
-#define SCM_UVEC_U16 2
-#define SCM_UVEC_S16 3
-#define SCM_UVEC_U32 4
-#define SCM_UVEC_S32 5
-#define SCM_UVEC_U64 6
-#define SCM_UVEC_S64 7
-#define SCM_UVEC_F32 8
-#define SCM_UVEC_F64 9
-
-
-/* This array maps type tags to the size of the elements. */
-static int uvec_sizes[10] = {1, 1, 2, 2, 4, 4, 8, 8, 4, 8};
-
-
-/* ================================================================ */
-/* SMOB procedures. */
-/* ================================================================ */
-
-
-/* Smob print hook for homogeneous vectors. */
-static int
-uvec_print (SCM uvec, SCM port, scm_print_state *pstate SCM_UNUSED)
-{
- switch (SCM_UVEC_TYPE (uvec))
- {
- case SCM_UVEC_U8:
- {
- int_u8 * p = (int_u8 *) SCM_UVEC_BASE (uvec);
- int i = 0;
-
- scm_puts ("#u8(", port);
- if (SCM_UVEC_LENGTH (uvec) > 0)
- {
- scm_intprint (*p, 10, port);
- p++;
- i++;
- for (; i < SCM_UVEC_LENGTH (uvec); i++)
- {
- scm_puts (" ", port);
- scm_intprint (*p, 10, port);
- p++;
- }
- }
- scm_puts (")", port);
- break;
- }
-
- case SCM_UVEC_S8:
- {
- int_s8 * p = (int_s8 *) SCM_UVEC_BASE (uvec);
- int i = 0;
-
- scm_puts ("#s8(", port);
- if (SCM_UVEC_LENGTH (uvec) > 0)
- {
- scm_intprint (*p, 10, port);
- p++;
- i++;
- for (; i < SCM_UVEC_LENGTH (uvec); i++)
- {
- scm_puts (" ", port);
- scm_intprint (*p, 10, port);
- p++;
- }
- }
- scm_puts (")", port);
- break;
- }
-
- case SCM_UVEC_U16:
- {
- int_u16 * p = (int_u16 *) SCM_UVEC_BASE (uvec);
- int i = 0;
-
- scm_puts ("#u16(", port);
- if (SCM_UVEC_LENGTH (uvec) > 0)
- {
- scm_intprint (*p, 10, port);
- p++;
- i++;
- for (; i < SCM_UVEC_LENGTH (uvec); i++)
- {
- scm_puts (" ", port);
- scm_intprint (*p, 10, port);
- p++;
- }
- }
- scm_puts (")", port);
- break;
- }
-
- case SCM_UVEC_S16:
- {
- int_s16 * p = (int_s16 *) SCM_UVEC_BASE (uvec);
- int i = 0;
-
- scm_puts ("#s16(", port);
- if (SCM_UVEC_LENGTH (uvec) > 0)
- {
- scm_intprint (*p, 10, port);
- p++;
- i++;
- for (; i < SCM_UVEC_LENGTH (uvec); i++)
- {
- scm_puts (" ", port);
- scm_intprint (*p, 10, port);
- p++;
- }
- }
- scm_puts (")", port);
- break;
- }
-
- case SCM_UVEC_U32:
- {
- int_u32 * p = (int_u32 *) SCM_UVEC_BASE (uvec);
- int i = 0;
-
- scm_puts ("#u32(", port);
- if (SCM_UVEC_LENGTH (uvec) > 0)
- {
- scm_intprint (*p, 10, port);
- p++;
- i++;
- for (; i < SCM_UVEC_LENGTH (uvec); i++)
- {
- scm_puts (" ", port);
- scm_intprint (*p, 10, port);
- p++;
- }
- }
- scm_puts (")", port);
- break;
- }
-
- case SCM_UVEC_S32:
- {
- int_s32 * p = (int_s32 *) SCM_UVEC_BASE (uvec);
- int i = 0;
-
- scm_puts ("#s32(", port);
- if (SCM_UVEC_LENGTH (uvec) > 0)
- {
- scm_intprint (*p, 10, port);
- p++;
- i++;
- for (; i < SCM_UVEC_LENGTH (uvec); i++)
- {
- scm_puts (" ", port);
- scm_intprint (*p, 10, port);
- p++;
- }
- }
- scm_puts (")", port);
- break;
- }
-
-#ifdef HAVE_LONG_LONG
- case SCM_UVEC_U64:
- {
- int_u64 * p = (int_u64 *) SCM_UVEC_BASE (uvec);
- int i = 0;
-
- scm_puts ("#u64(", port);
- if (SCM_UVEC_LENGTH (uvec) > 0)
- {
- scm_intprint (*p, 10, port);
- p++;
- i++;
- for (; i < SCM_UVEC_LENGTH (uvec); i++)
- {
- scm_puts (" ", port);
- scm_intprint (*p, 10, port);
- p++;
- }
- }
- scm_puts (")", port);
- break;
- }
-
- case SCM_UVEC_S64:
- {
- int_s64 * p = (int_s64 *) SCM_UVEC_BASE (uvec);
- int i = 0;
-
- scm_puts ("#s64(", port);
- if (SCM_UVEC_LENGTH (uvec) > 0)
- {
- scm_intprint (*p, 10, port);
- p++;
- i++;
- for (; i < SCM_UVEC_LENGTH (uvec); i++)
- {
- scm_puts (" ", port);
- scm_intprint (*p, 10, port);
- p++;
- }
- }
- scm_puts (")", port);
- break;
- }
-#endif
-
- case SCM_UVEC_F32:
- {
- float_f32 * p = (float_f32 *) SCM_UVEC_BASE (uvec);
- int i = 0;
-
- scm_puts ("#f32(", port);
- if (SCM_UVEC_LENGTH (uvec) > 0)
- {
- scm_iprin1 (scm_make_real (*p), port, pstate);
- p++;
- i++;
- for (; i < SCM_UVEC_LENGTH (uvec); i++)
- {
- scm_puts (" ", port);
- scm_iprin1 (scm_make_real (*p), port, pstate);
- p++;
- }
- }
- scm_puts (")", port);
- break;
- }
-
- case SCM_UVEC_F64:
- {
- float_f64 * p = (float_f64 *) SCM_UVEC_BASE (uvec);
- int i = 0;
-
- scm_puts ("#f64(", port);
- if (SCM_UVEC_LENGTH (uvec) > 0)
- {
- scm_iprin1 (scm_make_real (*p), port, pstate);
- p++;
- i++;
- for (; i < SCM_UVEC_LENGTH (uvec); i++)
- {
- scm_puts (" ", port);
- scm_iprin1 (scm_make_real (*p), port, pstate);
- p++;
- }
- }
- scm_puts (")", port);
- break;
- }
-
- default:
- abort (); /* Sanity check. */
- }
- return 1;
-}
-
-
-/* Smob free hook for homogeneous numeric vectors. */
-static size_t
-uvec_free (SCM uvec)
-{
- scm_gc_free (SCM_UVEC_BASE (uvec),
- SCM_UVEC_LENGTH (uvec) * uvec_sizes[SCM_UVEC_TYPE (uvec)],
- "uvec");
- return 0;
-}
-
-
-/* ================================================================ */
-/* Utility procedures. */
-/* ================================================================ */
-
-
-/* Create a new, uninitialized homogeneous numeric vector of type TYPE
- with space for LEN elements. */
-static SCM
-make_uvec (const char * func_name, int type, int len)
-{
- void * p;
-
- p = scm_gc_malloc (len * uvec_sizes[type], "uvec");
- SCM_RETURN_NEWSMOB3 (scm_tc16_uvec, type, len, p);
-}
-
-
-/* ================================================================ */
-/* U8 procedures. */
-/* ================================================================ */
-
-
-SCM_DEFINE (scm_u8vector_p, "u8vector?", 1, 0, 0,
- (SCM obj),
- "Return @code{#t} if @var{obj} is a vector of type u8,\n"
- "@code{#f} otherwise.")
-#define FUNC_NAME s_scm_u8vector_p
-{
- return SCM_BOOL (SCM_SMOB_PREDICATE (scm_tc16_uvec, obj) &&
- SCM_UVEC_TYPE (obj) == SCM_UVEC_U8);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_make_u8vector, "make-u8vector", 1, 1, 0,
- (SCM n, SCM fill),
- "Create a newly allocated homogeneous numeric vector which can\n"
- "hold @var{len} elements. If @var{fill} is given, it is used to\n"
- "initialize the elements, otherwise the contents of the vector\n"
- "is unspecified.")
-#define FUNC_NAME s_scm_make_u8vector
-{
- SCM uvec;
- int_u8 * p;
- int_u8 f;
- int count;
-
- SCM_VALIDATE_INUM (1, n);
- count = SCM_INUM (n);
- uvec = make_uvec (FUNC_NAME, SCM_UVEC_U8, count);
- if (SCM_UNBNDP (fill))
- f = 0;
- else
- {
- unsigned int s = scm_num2uint (fill, 2, FUNC_NAME);
- f = s;
- if ((unsigned int) f != s)
- scm_out_of_range_pos (FUNC_NAME, fill, SCM_MAKINUM (2));
- }
- p = (int_u8 *) SCM_UVEC_BASE (uvec);
- while (count-- > 0)
- *p++ = f;
- return uvec;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_u8vector, "u8vector", 0, 0, 1,
- (SCM l),
- "Create a newly allocated homogeneous numeric vector containing\n"
- "all argument values.")
-#define FUNC_NAME s_scm_u8vector
-{
- SCM_VALIDATE_REST_ARGUMENT (l);
- return scm_list_to_u8vector (l);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_u8vector_length, "u8vector-length", 1, 0, 0,
- (SCM uvec),
- "Return the number of elements in the homogeneous numeric vector\n"
- "@var{uvec}.")
-#define FUNC_NAME s_scm_u8vector_length
-{
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_U8)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
- return scm_int2num (SCM_UVEC_LENGTH (uvec));
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_u8vector_ref, "u8vector-ref", 2, 0, 0,
- (SCM uvec, SCM index),
- "Return the element at @var{index} in the homogeneous numeric\n"
- "vector @var{uvec}.")
-#define FUNC_NAME s_scm_u8vector_ref
-{
- int idx;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_U8)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = scm_num2int (index, 2, FUNC_NAME);
- if (idx < 0 || idx >= SCM_UVEC_LENGTH (uvec))
- scm_out_of_range_pos (FUNC_NAME, index, SCM_MAKINUM (2));
-
- return scm_short2num (((int_u8 *) SCM_UVEC_BASE (uvec))[idx]);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_u8vector_set_x, "u8vector-set!", 3, 0, 0,
- (SCM uvec, SCM index, SCM value),
- "Set the element at @var{index} in the homogeneous numeric\n"
- "vector @var{uvec} to @var{value}. The return value is not\n"
- "specified.")
-#define FUNC_NAME s_scm_u8vector_ref
-{
- int idx;
- int_u8 f;
- unsigned int s;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_U8)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = scm_num2int (index, 2, FUNC_NAME);
- if (idx < 0 || idx >= SCM_UVEC_LENGTH (uvec))
- scm_out_of_range_pos (FUNC_NAME, index, SCM_MAKINUM (2));
-
- s = scm_num2uint (value, 3, FUNC_NAME);
- f = s;
- if ((unsigned int) f != s)
- scm_out_of_range_pos (FUNC_NAME, value, SCM_MAKINUM (3));
-
- ((int_u8 *) SCM_UVEC_BASE (uvec))[idx] = f;
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_u8vector_to_list, "u8vector->list", 1, 0, 0,
- (SCM uvec),
- "Convert the homogeneous numeric vector @var{uvec} to a list.")
-#define FUNC_NAME s_scm_u8vector_to_list
-{
- int idx;
- int_u8 * p;
- SCM res = SCM_EOL;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_U8)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = SCM_UVEC_LENGTH (uvec);
- p = (int_u8 *) SCM_UVEC_BASE (uvec) + idx;
- while (idx-- > 0)
- {
- p--;
- res = scm_cons (SCM_MAKINUM (*p), res);
- }
- return res;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_list_to_u8vector, "list->u8vector", 1, 0, 0,
- (SCM l),
- "Convert the list @var{l}, which must only contain unsigned\n"
- "8-bit values, to a numeric homogeneous vector.")
-#define FUNC_NAME s_scm_list_to_u8vector
-{
- SCM uvec;
- SCM tmp;
- int_u8 * p;
- int n;
- int arg_pos = 1;
-
- SCM_VALIDATE_LIST_COPYLEN (1, l, n);
-
- uvec = make_uvec (FUNC_NAME, SCM_UVEC_U8, n);
- p = (int_u8 *) SCM_UVEC_BASE (uvec);
- tmp = l;
- while (SCM_CONSP (tmp))
- {
- int_u8 f;
- unsigned int s = scm_num2uint (SCM_CAR (tmp), 2, FUNC_NAME);
- f = s;
- if ((unsigned int) f != s)
- scm_out_of_range (FUNC_NAME, SCM_CAR (tmp));
- *p++ = f;
- tmp = SCM_CDR (tmp);
- arg_pos++;
- }
- scm_remember_upto_here_1 (l);
- return uvec;
-}
-#undef FUNC_NAME
-
-
-/* ================================================================ */
-/* S8 procedures. */
-/* ================================================================ */
-
-
-SCM_DEFINE (scm_s8vector_p, "s8vector?", 1, 0, 0,
- (SCM obj),
- "Return @code{#t} if @var{obj} is a vector of type s8,\n"
- "@code{#f} otherwise.")
-#define FUNC_NAME s_scm_s8vector_p
-{
- return SCM_BOOL (SCM_SMOB_PREDICATE (scm_tc16_uvec, obj) &&
- SCM_UVEC_TYPE (obj) == SCM_UVEC_S8);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_make_s8vector, "make-s8vector", 1, 1, 0,
- (SCM n, SCM fill),
- "Create a newly allocated homogeneous numeric vector which can\n"
- "hold @var{len} elements. If @var{fill} is given, it is used to\n"
- "initialize the elements, otherwise the contents of the vector\n"
- "is unspecified.")
-#define FUNC_NAME s_scm_make_s8vector
-{
- SCM uvec;
- int_s8 * p;
- int_s8 f;
- int count;
-
- SCM_VALIDATE_INUM (1, n);
- count = SCM_INUM (n);
- uvec = make_uvec (FUNC_NAME, SCM_UVEC_S8, count);
- if (SCM_UNBNDP (fill))
- f = 0;
- else
- {
- signed int s = scm_num2int (fill, 2, FUNC_NAME);
- f = s;
- if ((signed int) f != s)
- scm_out_of_range_pos (FUNC_NAME, fill, SCM_MAKINUM (2));
- }
- p = (int_s8 *) SCM_UVEC_BASE (uvec);
- while (count-- > 0)
- *p++ = f;
- return uvec;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_s8vector, "s8vector", 0, 0, 1,
- (SCM l),
- "Create a newly allocated homogeneous numeric vector containing\n"
- "all argument values.")
-#define FUNC_NAME s_scm_s8vector
-{
- SCM_VALIDATE_REST_ARGUMENT (l);
- return scm_list_to_s8vector (l);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_s8vector_length, "s8vector-length", 1, 0, 0,
- (SCM uvec),
- "Return the number of elements in the homogeneous numeric vector\n"
- "@var{uvec}.")
-#define FUNC_NAME s_scm_s8vector_length
-{
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_S8)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
- return scm_int2num (SCM_UVEC_LENGTH (uvec));
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_s8vector_ref, "s8vector-ref", 2, 0, 0,
- (SCM uvec, SCM index),
- "Return the element at @var{index} in the homogeneous numeric\n"
- "vector @var{uvec}.")
-#define FUNC_NAME s_scm_s8vector_ref
-{
- int idx;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_S8)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = scm_num2int (index, 2, FUNC_NAME);
- if (idx < 0 || idx >= SCM_UVEC_LENGTH (uvec))
- scm_out_of_range_pos (FUNC_NAME, index, SCM_MAKINUM (2));
-
- return scm_short2num (((int_s8 *) SCM_UVEC_BASE (uvec))[idx]);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_s8vector_set_x, "s8vector-set!", 3, 0, 0,
- (SCM uvec, SCM index, SCM value),
- "Set the element at @var{index} in the homogeneous numeric\n"
- "vector @var{uvec} to @var{value}. The return value is not\n"
- "specified.")
-#define FUNC_NAME s_scm_s8vector_ref
-{
- int idx;
- int_s8 f;
- signed int s;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_S8)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = scm_num2int (index, 2, FUNC_NAME);
- if (idx < 0 || idx >= SCM_UVEC_LENGTH (uvec))
- scm_out_of_range_pos (FUNC_NAME, index, SCM_MAKINUM (2));
-
- s = scm_num2int (value, 3, FUNC_NAME);
- f = s;
- if ((signed int) f != s)
- scm_out_of_range_pos (FUNC_NAME, value, SCM_MAKINUM (3));
-
- ((int_s8 *) SCM_UVEC_BASE (uvec))[idx] = f;
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_s8vector_to_list, "s8vector->list", 1, 0, 0,
- (SCM uvec),
- "Convert the homogeneous numeric vector @var{uvec} to a list.")
-#define FUNC_NAME s_scm_s8vector_to_list
-{
- int idx;
- int_s8 * p;
- SCM res = SCM_EOL;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_S8)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = SCM_UVEC_LENGTH (uvec);
- p = (int_s8 *) SCM_UVEC_BASE (uvec) + idx;
- while (idx-- > 0)
- {
- p--;
- res = scm_cons (SCM_MAKINUM (*p), res);
- }
- return res;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_list_to_s8vector, "list->s8vector", 1, 0, 0,
- (SCM l),
- "Convert the list @var{l}, which must only contain signed\n"
- "8-bit values, to a numeric homogeneous vector.")
-#define FUNC_NAME s_scm_list_to_s8vector
-{
- SCM uvec;
- SCM tmp;
- int_s8 * p;
- int n;
- int arg_pos = 1;
-
- SCM_VALIDATE_LIST_COPYLEN (1, l, n);
-
- uvec = make_uvec (FUNC_NAME, SCM_UVEC_S8, n);
- p = (int_s8 *) SCM_UVEC_BASE (uvec);
- tmp = l;
- while (SCM_CONSP (tmp))
- {
- int_s8 f;
- signed int s;
-
- s = scm_num2int (SCM_CAR (tmp), 2, FUNC_NAME);
- f = s;
- if ((signed int) f != s)
- scm_out_of_range (FUNC_NAME, SCM_CAR (tmp));
- *p++ = f;
- tmp = SCM_CDR (tmp);
- arg_pos++;
- }
- scm_remember_upto_here_1 (l);
- return uvec;
-}
-#undef FUNC_NAME
-
-
-/* ================================================================ */
-/* U16 procedures. */
-/* ================================================================ */
-
-
-SCM_DEFINE (scm_u16vector_p, "u16vector?", 1, 0, 0,
- (SCM obj),
- "Return @code{#t} if @var{obj} is a vector of type u16,\n"
- "@code{#f} otherwise.")
-#define FUNC_NAME s_scm_u16vector_p
-{
- return SCM_BOOL (SCM_SMOB_PREDICATE (scm_tc16_uvec, obj) &&
- SCM_UVEC_TYPE (obj) == SCM_UVEC_U16);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_make_u16vector, "make-u16vector", 1, 1, 0,
- (SCM n, SCM fill),
- "Create a newly allocated homogeneous numeric vector which can\n"
- "hold @var{len} elements. If @var{fill} is given, it is used to\n"
- "initialize the elements, otherwise the contents of the vector\n"
- "is unspecified.")
-#define FUNC_NAME s_scm_make_u16vector
-{
- SCM uvec;
- int_u16 * p;
- int_u16 f;
- int count;
-
- SCM_VALIDATE_INUM (1, n);
- count = SCM_INUM (n);
- uvec = make_uvec (FUNC_NAME, SCM_UVEC_U16, count);
- if (SCM_UNBNDP (fill))
- f = 0;
- else
- f = scm_num2ushort (fill, 2, FUNC_NAME);
- p = (int_u16 *) SCM_UVEC_BASE (uvec);
- while (count-- > 0)
- *p++ = f;
- return uvec;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_u16vector, "u16vector", 0, 0, 1,
- (SCM l),
- "Create a newly allocated homogeneous numeric vector containing\n"
- "all argument values.")
-#define FUNC_NAME s_scm_u16vector
-{
- SCM_VALIDATE_REST_ARGUMENT (l);
- return scm_list_to_u16vector (l);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_u16vector_length, "u16vector-length", 1, 0, 0,
- (SCM uvec),
- "Return the number of elements in the homogeneous numeric vector\n"
- "@var{uvec}.")
-#define FUNC_NAME s_scm_u16vector_length
-{
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_U16)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
- return scm_int2num (SCM_UVEC_LENGTH (uvec));
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_u16vector_ref, "u16vector-ref", 2, 0, 0,
- (SCM uvec, SCM index),
- "Return the element at @var{index} in the homogeneous numeric\n"
- "vector @var{uvec}.")
-#define FUNC_NAME s_scm_u16vector_ref
-{
- int idx;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_U16)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = scm_num2int (index, 2, FUNC_NAME);
- if (idx < 0 || idx >= SCM_UVEC_LENGTH (uvec))
- scm_out_of_range_pos (FUNC_NAME, index, SCM_MAKINUM (2));
-
- return scm_ushort2num (((int_u16 *) SCM_UVEC_BASE (uvec))[idx]);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_u16vector_set_x, "u16vector-set!", 3, 0, 0,
- (SCM uvec, SCM index, SCM value),
- "Set the element at @var{index} in the homogeneous numeric\n"
- "vector @var{uvec} to @var{value}. The return value is not\n"
- "specified.")
-#define FUNC_NAME s_scm_u16vector_ref
-{
- int idx;
- int_u16 f;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_U16)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = scm_num2int (index, 2, FUNC_NAME);
- if (idx < 0 || idx >= SCM_UVEC_LENGTH (uvec))
- scm_out_of_range_pos (FUNC_NAME, index, SCM_MAKINUM (2));
-
- f = scm_num2ushort (value, 3, FUNC_NAME);
-
- ((int_u16 *) SCM_UVEC_BASE (uvec))[idx] = f;
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_u16vector_to_list, "u16vector->list", 1, 0, 0,
- (SCM uvec),
- "Convert the homogeneous numeric vector @var{uvec} to a list.")
-#define FUNC_NAME s_scm_u16vector_to_list
-{
- int idx;
- int_u16 * p;
- SCM res = SCM_EOL;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_U16)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = SCM_UVEC_LENGTH (uvec);
- p = (int_u16 *) SCM_UVEC_BASE (uvec) + idx;
- while (idx-- > 0)
- {
- p--;
- res = scm_cons (SCM_MAKINUM (*p), res);
- }
- return res;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_list_to_u16vector, "list->u16vector", 1, 0, 0,
- (SCM l),
- "Convert the list @var{l}, which must only contain unsigned\n"
- "16-bit values, to a numeric homogeneous vector.")
-#define FUNC_NAME s_scm_list_to_u16vector
-{
- SCM uvec;
- int_u16 * p;
- int n;
- int arg_pos = 1;
-
- SCM_VALIDATE_LIST_COPYLEN (1, l, n);
-
- uvec = make_uvec (FUNC_NAME, SCM_UVEC_U16, n);
- p = (int_u16 *) SCM_UVEC_BASE (uvec);
- while (SCM_CONSP (l))
- {
- int_u16 f = scm_num2ushort (SCM_CAR (l), 2, FUNC_NAME);
- *p++ = f;
- l = SCM_CDR (l);
- arg_pos++;
- }
- return uvec;
-}
-#undef FUNC_NAME
-
-
-/* ================================================================ */
-/* S16 procedures. */
-/* ================================================================ */
-
-
-SCM_DEFINE (scm_s16vector_p, "s16vector?", 1, 0, 0,
- (SCM obj),
- "Return @code{#t} if @var{obj} is a vector of type s16,\n"
- "@code{#f} otherwise.")
-#define FUNC_NAME s_scm_s16vector_p
-{
- return SCM_BOOL (SCM_SMOB_PREDICATE (scm_tc16_uvec, obj) &&
- SCM_UVEC_TYPE (obj) == SCM_UVEC_S16);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_make_s16vector, "make-s16vector", 1, 1, 0,
- (SCM n, SCM fill),
- "Create a newly allocated homogeneous numeric vector which can\n"
- "hold @var{len} elements. If @var{fill} is given, it is used to\n"
- "initialize the elements, otherwise the contents of the vector\n"
- "is unspecified.")
-#define FUNC_NAME s_scm_make_s16vector
-{
- SCM uvec;
- int_s16 * p;
- int_s16 f;
- int count;
-
- SCM_VALIDATE_INUM (1, n);
- count = SCM_INUM (n);
- uvec = make_uvec (FUNC_NAME, SCM_UVEC_S16, count);
- if (SCM_UNBNDP (fill))
- f = 0;
- else
- f = scm_num2short (fill, 2, FUNC_NAME);
- p = (int_s16 *) SCM_UVEC_BASE (uvec);
- while (count-- > 0)
- *p++ = f;
- return uvec;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_s16vector, "s16vector", 0, 0, 1,
- (SCM l),
- "Create a newly allocated homogeneous numeric vector containing\n"
- "all argument values.")
-#define FUNC_NAME s_scm_s16vector
-{
- SCM_VALIDATE_REST_ARGUMENT (l);
- return scm_list_to_s16vector (l);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_s16vector_length, "s16vector-length", 1, 0, 0,
- (SCM uvec),
- "Return the number of elements in the homogeneous numeric vector\n"
- "@var{uvec}.")
-#define FUNC_NAME s_scm_s16vector_length
-{
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_S16)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
- return scm_int2num (SCM_UVEC_LENGTH (uvec));
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_s16vector_ref, "s16vector-ref", 2, 0, 0,
- (SCM uvec, SCM index),
- "Return the element at @var{index} in the homogeneous numeric\n"
- "vector @var{uvec}.")
-#define FUNC_NAME s_scm_s16vector_ref
-{
- int idx;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_S16)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = scm_num2int (index, 2, FUNC_NAME);
- if (idx < 0 || idx >= SCM_UVEC_LENGTH (uvec))
- scm_out_of_range_pos (FUNC_NAME, index, SCM_MAKINUM (2));
-
- return scm_short2num (((int_s16 *) SCM_UVEC_BASE (uvec))[idx]);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_s16vector_set_x, "s16vector-set!", 3, 0, 0,
- (SCM uvec, SCM index, SCM value),
- "Set the element at @var{index} in the homogeneous numeric\n"
- "vector @var{uvec} to @var{value}. The return value is not\n"
- "specified.")
-#define FUNC_NAME s_scm_s16vector_ref
-{
- int idx;
- int_s16 f;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_S16)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = scm_num2int (index, 2, FUNC_NAME);
- if (idx < 0 || idx >= SCM_UVEC_LENGTH (uvec))
- scm_out_of_range_pos (FUNC_NAME, index, SCM_MAKINUM (2));
-
- f = scm_num2short (value, 3, FUNC_NAME);
-
- ((int_s16 *) SCM_UVEC_BASE (uvec))[idx] = f;
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_s16vector_to_list, "s16vector->list", 1, 0, 0,
- (SCM uvec),
- "Convert the homogeneous numeric vector @var{uvec} to a list.")
-#define FUNC_NAME s_scm_s16vector_to_list
-{
- int idx;
- int_s16 * p;
- SCM res = SCM_EOL;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_S16)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = SCM_UVEC_LENGTH (uvec);
- p = (int_s16 *) SCM_UVEC_BASE (uvec) + idx;
- while (idx-- > 0)
- {
- p--;
- res = scm_cons (SCM_MAKINUM (*p), res);
- }
- return res;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_list_to_s16vector, "list->s16vector", 1, 0, 0,
- (SCM l),
- "Convert the list @var{l}, which must only contain signed\n"
- "16-bit values, to a numeric homogeneous vector.")
-#define FUNC_NAME s_scm_list_to_s16vector
-{
- SCM uvec;
- SCM tmp;
- int_s16 * p;
- int n;
- int arg_pos = 1;
-
- SCM_VALIDATE_LIST_COPYLEN (1, l, n);
-
- uvec = make_uvec (FUNC_NAME, SCM_UVEC_S16, n);
- p = (int_s16 *) SCM_UVEC_BASE (uvec);
- tmp = l;
- while (SCM_CONSP (tmp))
- {
- int_s16 f = scm_num2short (SCM_CAR (tmp), 2, FUNC_NAME);
- *p++ = f;
- tmp = SCM_CDR (tmp);
- arg_pos++;
- }
- scm_remember_upto_here_1 (l);
- return uvec;
-}
-#undef FUNC_NAME
-
-
-/* ================================================================ */
-/* U32 procedures. */
-/* ================================================================ */
-
-
-SCM_DEFINE (scm_u32vector_p, "u32vector?", 1, 0, 0,
- (SCM obj),
- "Return @code{#t} if @var{obj} is a vector of type u32,\n"
- "@code{#f} otherwise.")
-#define FUNC_NAME s_scm_u32vector_p
-{
- return SCM_BOOL (SCM_SMOB_PREDICATE (scm_tc16_uvec, obj) &&
- SCM_UVEC_TYPE (obj) == SCM_UVEC_U32);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_make_u32vector, "make-u32vector", 1, 1, 0,
- (SCM n, SCM fill),
- "Create a newly allocated homogeneous numeric vector which can\n"
- "hold @var{len} elements. If @var{fill} is given, it is used to\n"
- "initialize the elements, otherwise the contents of the vector\n"
- "is unspecified.")
-#define FUNC_NAME s_scm_make_u32vector
-{
- SCM uvec;
- int_u32 * p;
- int_u32 f;
- int count;
-
- SCM_VALIDATE_INUM (1, n);
- count = SCM_INUM (n);
- uvec = make_uvec (FUNC_NAME, SCM_UVEC_U32, count);
- if (SCM_UNBNDP (fill))
- f = 0;
- else
- f = scm_num2uint (fill, 2, FUNC_NAME);
- p = (int_u32 *) SCM_UVEC_BASE (uvec);
- while (count-- > 0)
- *p++ = f;
- return uvec;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_u32vector, "u32vector", 0, 0, 1,
- (SCM l),
- "Create a newly allocated homogeneous numeric vector containing\n"
- "all argument values.")
-#define FUNC_NAME s_scm_u32vector
-{
- SCM_VALIDATE_REST_ARGUMENT (l);
- return scm_list_to_u32vector (l);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_u32vector_length, "u32vector-length", 1, 0, 0,
- (SCM uvec),
- "Return the number of elements in the homogeneous numeric vector\n"
- "@var{uvec}.")
-#define FUNC_NAME s_scm_u32vector_length
-{
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_U32)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
- return scm_int2num (SCM_UVEC_LENGTH (uvec));
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_u32vector_ref, "u32vector-ref", 2, 0, 0,
- (SCM uvec, SCM index),
- "Return the element at @var{index} in the homogeneous numeric\n"
- "vector @var{uvec}.")
-#define FUNC_NAME s_scm_u32vector_ref
-{
- int idx;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_U32)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = scm_num2int (index, 2, FUNC_NAME);
- if (idx < 0 || idx >= SCM_UVEC_LENGTH (uvec))
- scm_out_of_range_pos (FUNC_NAME, index, SCM_MAKINUM (2));
-
- return scm_uint2num (((int_u32 *) SCM_UVEC_BASE (uvec))[idx]);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_u32vector_set_x, "u32vector-set!", 3, 0, 0,
- (SCM uvec, SCM index, SCM value),
- "Set the element at @var{index} in the homogeneous numeric\n"
- "vector @var{uvec} to @var{value}. The return value is not\n"
- "specified.")
-#define FUNC_NAME s_scm_u32vector_ref
-{
- int idx;
- int_u32 f;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_U32)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = scm_num2int (index, 2, FUNC_NAME);
- if (idx < 0 || idx >= SCM_UVEC_LENGTH (uvec))
- scm_out_of_range_pos (FUNC_NAME, index, SCM_MAKINUM (2));
-
- f = scm_num2uint (value, 3, FUNC_NAME);
-
- ((int_u32 *) SCM_UVEC_BASE (uvec))[idx] = f;
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_u32vector_to_list, "u32vector->list", 1, 0, 0,
- (SCM uvec),
- "Convert the homogeneous numeric vector @var{uvec} to a list.")
-#define FUNC_NAME s_scm_u32vector_to_list
-{
- int idx;
- int_u32 * p;
- SCM res = SCM_EOL;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_U32)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = SCM_UVEC_LENGTH (uvec);
- p = (int_u32 *) SCM_UVEC_BASE (uvec) + idx;
- while (idx-- > 0)
- {
- p--;
- res = scm_cons (scm_uint2num (*p), res);
- }
- return res;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_list_to_u32vector, "list->u32vector", 1, 0, 0,
- (SCM l),
- "Convert the list @var{l}, which must only contain unsigned\n"
- "32-bit values, to a numeric homogeneous vector.")
-#define FUNC_NAME s_scm_list_to_u32vector
-{
- SCM uvec;
- int_u32 * p;
- int n;
- int arg_pos = 1;
-
- SCM_VALIDATE_LIST_COPYLEN (1, l, n);
-
- uvec = make_uvec (FUNC_NAME, SCM_UVEC_U32, n);
- p = (int_u32 *) SCM_UVEC_BASE (uvec);
- while (SCM_CONSP (l))
- {
- int_u32 f;
- f = scm_num2uint (SCM_CAR (l), 2, FUNC_NAME);
- *p++ = f;
- l = SCM_CDR (l);
- arg_pos++;
- }
- return uvec;
-}
-#undef FUNC_NAME
-
-
-/* ================================================================ */
-/* S32 procedures. */
-/* ================================================================ */
-
-
-SCM_DEFINE (scm_s32vector_p, "s32vector?", 1, 0, 0,
- (SCM obj),
- "Return @code{#t} if @var{obj} is a vector of type s32,\n"
- "@code{#f} otherwise.")
-#define FUNC_NAME s_scm_s32vector_p
-{
- return SCM_BOOL (SCM_SMOB_PREDICATE (scm_tc16_uvec, obj) &&
- SCM_UVEC_TYPE (obj) == SCM_UVEC_S32);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_make_s32vector, "make-s32vector", 1, 1, 0,
- (SCM n, SCM fill),
- "Create a newly allocated homogeneous numeric vector which can\n"
- "hold @var{len} elements. If @var{fill} is given, it is used to\n"
- "initialize the elements, otherwise the contents of the vector\n"
- "is unspecified.")
-#define FUNC_NAME s_scm_make_s32vector
-{
- SCM uvec;
- int_s32 * p;
- int_s32 f;
- int count;
-
- SCM_VALIDATE_INUM (1, n);
- count = SCM_INUM (n);
- uvec = make_uvec (FUNC_NAME, SCM_UVEC_S32, count);
- if (SCM_UNBNDP (fill))
- f = 0;
- else
- f = scm_num2int (fill, 2, FUNC_NAME);
- p = (int_s32 *) SCM_UVEC_BASE (uvec);
- while (count-- > 0)
- *p++ = f;
- return uvec;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_s32vector, "s32vector", 0, 0, 1,
- (SCM l),
- "Create a newly allocated homogeneous numeric vector containing\n"
- "all argument values.")
-#define FUNC_NAME s_scm_s32vector
-{
- SCM_VALIDATE_REST_ARGUMENT (l);
- return scm_list_to_s32vector (l);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_s32vector_length, "s32vector-length", 1, 0, 0,
- (SCM uvec),
- "Return the number of elements in the homogeneous numeric vector\n"
- "@var{uvec}.")
-#define FUNC_NAME s_scm_s32vector_length
-{
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_S32)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
- return scm_int2num (SCM_UVEC_LENGTH (uvec));
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_s32vector_ref, "s32vector-ref", 2, 0, 0,
- (SCM uvec, SCM index),
- "Return the element at @var{index} in the homogeneous numeric\n"
- "vector @var{uvec}.")
-#define FUNC_NAME s_scm_s32vector_ref
-{
- int idx;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_S32)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = scm_num2int (index, 2, FUNC_NAME);
- if (idx < 0 || idx >= SCM_UVEC_LENGTH (uvec))
- scm_out_of_range_pos (FUNC_NAME, index, SCM_MAKINUM (2));
-
- return scm_int2num (((int_s32 *) SCM_UVEC_BASE (uvec))[idx]);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_s32vector_set_x, "s32vector-set!", 3, 0, 0,
- (SCM uvec, SCM index, SCM value),
- "Set the element at @var{index} in the homogeneous numeric\n"
- "vector @var{uvec} to @var{value}. The return value is not\n"
- "specified.")
-#define FUNC_NAME s_scm_s32vector_ref
-{
- int idx;
- int_s32 f;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_S32)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = scm_num2int (index, 2, FUNC_NAME);
- if (idx < 0 || idx >= SCM_UVEC_LENGTH (uvec))
- scm_out_of_range_pos (FUNC_NAME, index, SCM_MAKINUM (2));
-
- f = scm_num2int (value, 3, FUNC_NAME);
-
- ((int_s32 *) SCM_UVEC_BASE (uvec))[idx] = f;
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_s32vector_to_list, "s32vector->list", 1, 0, 0,
- (SCM uvec),
- "Convert the homogeneous numeric vector @var{uvec} to a list.")
-#define FUNC_NAME s_scm_s32vector_to_list
-{
- int idx;
- int_s32 * p;
- SCM res = SCM_EOL;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_S32)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = SCM_UVEC_LENGTH (uvec);
- p = (int_s32 *) SCM_UVEC_BASE (uvec) + idx;
- while (idx-- > 0)
- {
- p--;
- res = scm_cons (scm_int2num (*p), res);
- }
- return res;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_list_to_s32vector, "list->s32vector", 1, 0, 0,
- (SCM l),
- "Convert the list @var{l}, which must only contain signed\n"
- "32-bit values, to a numeric homogeneous vector.")
-#define FUNC_NAME s_scm_list_to_s32vector
-{
- SCM uvec;
- int_s32 * p;
- int n;
- int arg_pos = 1;
-
- SCM_VALIDATE_LIST_COPYLEN (1, l, n);
-
- uvec = make_uvec (FUNC_NAME, SCM_UVEC_S32, n);
- p = (int_s32 *) SCM_UVEC_BASE (uvec);
- while (SCM_CONSP (l))
- {
- int_s32 f;
- f = scm_num2int (SCM_CAR (l), 2, FUNC_NAME);
- *p++ = f;
- l = SCM_CDR (l);
- arg_pos++;
- }
- return uvec;
-}
-#undef FUNC_NAME
-
-
-#ifdef HAVE_LONG_LONG
-
-/* ================================================================ */
-/* U64 procedures. */
-/* ================================================================ */
-
-
-SCM_DEFINE (scm_u64vector_p, "u64vector?", 1, 0, 0,
- (SCM obj),
- "Return @code{#t} if @var{obj} is a vector of type u64,\n"
- "@code{#f} otherwise.")
-#define FUNC_NAME s_scm_u64vector_p
-{
- return SCM_BOOL (SCM_SMOB_PREDICATE (scm_tc16_uvec, obj) &&
- SCM_UVEC_TYPE (obj) == SCM_UVEC_U64);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_make_u64vector, "make-u64vector", 1, 1, 0,
- (SCM n, SCM fill),
- "Create a newly allocated homogeneous numeric vector which can\n"
- "hold @var{len} elements. If @var{fill} is given, it is used to\n"
- "initialize the elements, otherwise the contents of the vector\n"
- "is unspecified.")
-#define FUNC_NAME s_scm_make_u64vector
-{
- SCM uvec;
- int_u64 * p;
- int_u64 f;
- int count;
-
- SCM_VALIDATE_INUM (1, n);
- count = SCM_INUM (n);
- uvec = make_uvec (FUNC_NAME, SCM_UVEC_U64, count);
- if (SCM_UNBNDP (fill))
- f = 0;
- else
- f = scm_num2ulong_long (fill, 2, FUNC_NAME);
- p = (int_u64 *) SCM_UVEC_BASE (uvec);
- while (count-- > 0)
- *p++ = f;
- return uvec;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_u64vector, "u64vector", 0, 0, 1,
- (SCM l),
- "Create a newly allocated homogeneous numeric vector containing\n"
- "all argument values.")
-#define FUNC_NAME s_scm_u64vector
-{
- SCM_VALIDATE_REST_ARGUMENT (l);
- return scm_list_to_u64vector (l);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_u64vector_length, "u64vector-length", 1, 0, 0,
- (SCM uvec),
- "Return the number of elements in the homogeneous numeric vector\n"
- "@var{uvec}.")
-#define FUNC_NAME s_scm_u64vector_length
-{
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_U64)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
- return scm_int2num (SCM_UVEC_LENGTH (uvec));
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_u64vector_ref, "u64vector-ref", 2, 0, 0,
- (SCM uvec, SCM index),
- "Return the element at @var{index} in the homogeneous numeric\n"
- "vector @var{uvec}.")
-#define FUNC_NAME s_scm_u64vector_ref
-{
- int idx;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_U64)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = scm_num2int (index, 2, FUNC_NAME);
- if (idx < 0 || idx >= SCM_UVEC_LENGTH (uvec))
- scm_out_of_range_pos (FUNC_NAME, index, SCM_MAKINUM (2));
-
- return scm_ulong_long2num (((int_u64 *) SCM_UVEC_BASE (uvec))[idx]);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_u64vector_set_x, "u64vector-set!", 3, 0, 0,
- (SCM uvec, SCM index, SCM value),
- "Set the element at @var{index} in the homogeneous numeric\n"
- "vector @var{uvec} to @var{value}. The return value is not\n"
- "specified.")
-#define FUNC_NAME s_scm_u64vector_ref
-{
- int idx;
- int_u64 f;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_U64)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = scm_num2int (index, 2, FUNC_NAME);
- if (idx < 0 || idx >= SCM_UVEC_LENGTH (uvec))
- scm_out_of_range_pos (FUNC_NAME, index, SCM_MAKINUM (2));
-
- f = scm_num2ulong_long (value, 3, FUNC_NAME);
-
- ((int_u64 *) SCM_UVEC_BASE (uvec))[idx] = f;
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_u64vector_to_list, "u64vector->list", 1, 0, 0,
- (SCM uvec),
- "Convert the homogeneous numeric vector @var{uvec} to a list.")
-#define FUNC_NAME s_scm_u64vector_to_list
-{
- int idx;
- int_u64 * p;
- SCM res = SCM_EOL;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_U64)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = SCM_UVEC_LENGTH (uvec);
- p = (int_u64 *) SCM_UVEC_BASE (uvec) + idx;
- while (idx-- > 0)
- {
- p--;
- res = scm_cons (scm_long_long2num (*p), res);
- }
- return res;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_list_to_u64vector, "list->u64vector", 1, 0, 0,
- (SCM l),
- "Convert the list @var{l}, which must only contain unsigned\n"
- "64-bit values, to a numeric homogeneous vector.")
-#define FUNC_NAME s_scm_list_to_u64vector
-{
- SCM uvec;
- int_u64 * p;
- int n;
- int arg_pos = 1;
-
- SCM_VALIDATE_LIST_COPYLEN (1, l, n);
-
- uvec = make_uvec (FUNC_NAME, SCM_UVEC_U64, n);
- p = (int_u64 *) SCM_UVEC_BASE (uvec);
- while (SCM_CONSP (l))
- {
- int_u64 f;
- f = scm_num2ulong_long (SCM_CAR (l), 2, FUNC_NAME);
- *p++ = f;
- l = SCM_CDR (l);
- arg_pos++;
- }
- return uvec;
-}
-#undef FUNC_NAME
-
-
-/* ================================================================ */
-/* S64 procedures. */
-/* ================================================================ */
-
-
-SCM_DEFINE (scm_s64vector_p, "s64vector?", 1, 0, 0,
- (SCM obj),
- "Return @code{#t} if @var{obj} is a vector of type s64,\n"
- "@code{#f} otherwise.")
-#define FUNC_NAME s_scm_s64vector_p
-{
- return SCM_BOOL (SCM_SMOB_PREDICATE (scm_tc16_uvec, obj) &&
- SCM_UVEC_TYPE (obj) == SCM_UVEC_S64);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_make_s64vector, "make-s64vector", 1, 1, 0,
- (SCM n, SCM fill),
- "Create a newly allocated homogeneous numeric vector which can\n"
- "hold @var{len} elements. If @var{fill} is given, it is used to\n"
- "initialize the elements, otherwise the contents of the vector\n"
- "is unspecified.")
-#define FUNC_NAME s_scm_make_s64vector
-{
- SCM uvec;
- int_s64 * p;
- int_s64 f;
- int count;
-
- SCM_VALIDATE_INUM (1, n);
- count = SCM_INUM (n);
- uvec = make_uvec (FUNC_NAME, SCM_UVEC_S64, count);
- if (SCM_UNBNDP (fill))
- f = 0;
- else
- f = scm_num2long_long (fill, 2, FUNC_NAME);
- p = (int_s64 *) SCM_UVEC_BASE (uvec);
- while (count-- > 0)
- *p++ = f;
- return uvec;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_s64vector, "s64vector", 0, 0, 1,
- (SCM l),
- "Create a newly allocated homogeneous numeric vector containing\n"
- "all argument values.")
-#define FUNC_NAME s_scm_s64vector
-{
- SCM_VALIDATE_REST_ARGUMENT (l);
- return scm_list_to_s64vector (l);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_s64vector_length, "s64vector-length", 1, 0, 0,
- (SCM uvec),
- "Return the number of elements in the homogeneous numeric vector\n"
- "@var{uvec}.")
-#define FUNC_NAME s_scm_s64vector_length
-{
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_S64)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
- return scm_int2num (SCM_UVEC_LENGTH (uvec));
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_s64vector_ref, "s64vector-ref", 2, 0, 0,
- (SCM uvec, SCM index),
- "Return the element at @var{index} in the homogeneous numeric\n"
- "vector @var{uvec}.")
-#define FUNC_NAME s_scm_s64vector_ref
-{
- int idx;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_S64)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = scm_num2int (index, 2, FUNC_NAME);
- if (idx < 0 || idx >= SCM_UVEC_LENGTH (uvec))
- scm_out_of_range_pos (FUNC_NAME, index, SCM_MAKINUM (2));
-
- return scm_long_long2num (((int_s64 *) SCM_UVEC_BASE (uvec))[idx]);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_s64vector_set_x, "s64vector-set!", 3, 0, 0,
- (SCM uvec, SCM index, SCM value),
- "Set the element at @var{index} in the homogeneous numeric\n"
- "vector @var{uvec} to @var{value}. The return value is not\n"
- "specified.")
-#define FUNC_NAME s_scm_s64vector_ref
-{
- int idx;
- int_s64 f;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_S64)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = scm_num2int (index, 2, FUNC_NAME);
- if (idx < 0 || idx >= SCM_UVEC_LENGTH (uvec))
- scm_out_of_range_pos (FUNC_NAME, index, SCM_MAKINUM (2));
-
- f = scm_num2long_long (value, 3, FUNC_NAME);
-
- ((int_s64 *) SCM_UVEC_BASE (uvec))[idx] = f;
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_s64vector_to_list, "s64vector->list", 1, 0, 0,
- (SCM uvec),
- "Convert the homogeneous numeric vector @var{uvec} to a list.")
-#define FUNC_NAME s_scm_s64vector_to_list
-{
- int idx;
- int_s64 * p;
- SCM res = SCM_EOL;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_S64)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = SCM_UVEC_LENGTH (uvec);
- p = (int_s64 *) SCM_UVEC_BASE (uvec) + idx;
- while (idx-- > 0)
- {
- p--;
- res = scm_cons (scm_long_long2num (*p), res);
- }
- return res;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_list_to_s64vector, "list->s64vector", 1, 0, 0,
- (SCM l),
- "Convert the list @var{l}, which must only contain signed\n"
- "64-bit values, to a numeric homogeneous vector.")
-#define FUNC_NAME s_scm_list_to_s64vector
-{
- SCM uvec;
- int_s64 * p;
- int n;
- int arg_pos = 1;
-
- SCM_VALIDATE_LIST_COPYLEN (1, l, n);
-
- uvec = make_uvec (FUNC_NAME, SCM_UVEC_S64, n);
- p = (int_s64 *) SCM_UVEC_BASE (uvec);
- while (SCM_CONSP (l))
- {
- int_s64 f;
- f = scm_num2long_long (SCM_CAR (l), 2, FUNC_NAME);
- *p++ = f;
- l = SCM_CDR (l);
- arg_pos++;
- }
- return uvec;
-}
-#undef FUNC_NAME
-
-#endif /* HAVE_LONG_LONG */
-
-
-/* ================================================================ */
-/* F32 procedures. */
-/* ================================================================ */
-
-
-SCM_DEFINE (scm_f32vector_p, "f32vector?", 1, 0, 0,
- (SCM obj),
- "Return @code{#t} if @var{obj} is a vector of type f32,\n"
- "@code{#f} otherwise.")
-#define FUNC_NAME s_scm_f32vector_p
-{
- return SCM_BOOL (SCM_SMOB_PREDICATE (scm_tc16_uvec, obj) &&
- SCM_UVEC_TYPE (obj) == SCM_UVEC_F32);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_make_f32vector, "make-f32vector", 1, 1, 0,
- (SCM n, SCM fill),
- "Create a newly allocated homogeneous numeric vector which can\n"
- "hold @var{len} elements. If @var{fill} is given, it is used to\n"
- "initialize the elements, otherwise the contents of the vector\n"
- "is unspecified.")
-#define FUNC_NAME s_scm_make_f32vector
-{
- SCM uvec;
- float_f32 * p;
- float_f32 f;
- int count;
-
- SCM_VALIDATE_INUM (1, n);
- count = SCM_INUM (n);
- uvec = make_uvec (FUNC_NAME, SCM_UVEC_F32, count);
- if (SCM_UNBNDP (fill))
- f = 0;
- else
- {
- double d = scm_num2dbl (fill, FUNC_NAME);
- f = d;
-#if 0
- /* This test somehow fails for even the simplest inexact
- numbers, like 3.1. Must find out how to check properly. */
- if (f != d)
- scm_out_of_range_pos (FUNC_NAME, fill, SCM_MAKINUM (2));
-#endif /* 0 */
- }
- p = (float_f32 *) SCM_UVEC_BASE (uvec);
- while (count-- > 0)
- *p++ = f;
- return uvec;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_f32vector, "f32vector", 0, 0, 1,
- (SCM l),
- "Create a newly allocated homogeneous numeric vector containing\n"
- "all argument values.")
-#define FUNC_NAME s_scm_f32vector
-{
- SCM_VALIDATE_REST_ARGUMENT (l);
- return scm_list_to_f32vector (l);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_f32vector_length, "f32vector-length", 1, 0, 0,
- (SCM uvec),
- "Return the number of elements in the homogeneous numeric vector\n"
- "@var{uvec}.")
-#define FUNC_NAME s_scm_f32vector_length
-{
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_F32)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
- return scm_int2num (SCM_UVEC_LENGTH (uvec));
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_f32vector_ref, "f32vector-ref", 2, 0, 0,
- (SCM uvec, SCM index),
- "Return the element at @var{index} in the homogeneous numeric\n"
- "vector @var{uvec}.")
-#define FUNC_NAME s_scm_f32vector_ref
-{
- int idx;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_F32)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = scm_num2int (index, 2, FUNC_NAME);
- if (idx < 0 || idx >= SCM_UVEC_LENGTH (uvec))
- scm_out_of_range_pos (FUNC_NAME, index, SCM_MAKINUM (2));
-
- return scm_make_real (((float_f32 *) SCM_UVEC_BASE (uvec))[idx]);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_f32vector_set_x, "f32vector-set!", 3, 0, 0,
- (SCM uvec, SCM index, SCM value),
- "Set the element at @var{index} in the homogeneous numeric\n"
- "vector @var{uvec} to @var{value}. The return value is not\n"
- "specified.")
-#define FUNC_NAME s_scm_f32vector_ref
-{
- int idx;
- float_f32 f;
- double d;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_F32)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = scm_num2int (index, 2, FUNC_NAME);
- if (idx < 0 || idx >= SCM_UVEC_LENGTH (uvec))
- scm_out_of_range_pos (FUNC_NAME, index, SCM_MAKINUM (2));
-
- d = scm_num2dbl (value, FUNC_NAME);
- f = d;
-#if 0
- /* This test somehow fails for even the simplest inexact
- numbers, like 3.1. Must find out how to check properly. */
- if (f != d)
- scm_out_of_range_pos (FUNC_NAME, value, SCM_MAKINUM (3));
-#endif /* 0 */
-
- ((float_f32 *) SCM_UVEC_BASE (uvec))[idx] = f;
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_f32vector_to_list, "f32vector->list", 1, 0, 0,
- (SCM uvec),
- "Convert the homogeneous numeric vector @var{uvec} to a list.")
-#define FUNC_NAME s_scm_f32vector_to_list
-{
- int idx;
- float_f32 * p;
- SCM res = SCM_EOL;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_F32)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = SCM_UVEC_LENGTH (uvec);
- p = (float_f32 *) SCM_UVEC_BASE (uvec) + idx;
- while (idx-- > 0)
- {
- p--;
- res = scm_cons (scm_make_real (*p), res);
- }
- return res;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_list_to_f32vector, "list->f32vector", 1, 0, 0,
- (SCM l),
- "Convert the list @var{l}, which must only contain unsigned\n"
- "8-bit values, to a numeric homogeneous vector.")
-#define FUNC_NAME s_scm_list_to_f32vector
-{
- SCM uvec;
- float_f32 * p;
- int n;
- int arg_pos = 1;
-
- SCM_VALIDATE_LIST_COPYLEN (1, l, n);
-
- uvec = make_uvec (FUNC_NAME, SCM_UVEC_F32, n);
- p = (float_f32 *) SCM_UVEC_BASE (uvec);
- while (SCM_CONSP (l))
- {
- float_f32 f;
- double d;
- d = scm_num2dbl (SCM_CAR (l), FUNC_NAME);
- f = d;
-#if 0
- /* This test somehow fails for even the simplest inexact
- numbers, like 3.1. Must find out how to check properly. */
- if (d != f)
- scm_out_of_range_pos (FUNC_NAME, l, SCM_MAKINUM (1));
-#endif /* 0 */
- *p++ = f;
- l = SCM_CDR (l);
- arg_pos++;
- }
- return uvec;
-}
-#undef FUNC_NAME
-
-
-/* ================================================================ */
-/* F64 procedures. */
-/* ================================================================ */
-
-
-SCM_DEFINE (scm_f64vector_p, "f64vector?", 1, 0, 0,
- (SCM obj),
- "Return @code{#t} if @var{obj} is a vector of type f64,\n"
- "@code{#f} otherwise.")
-#define FUNC_NAME s_scm_f64vector_p
-{
- return SCM_BOOL (SCM_SMOB_PREDICATE (scm_tc16_uvec, obj) &&
- SCM_UVEC_TYPE (obj) == SCM_UVEC_F64);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_make_f64vector, "make-f64vector", 1, 1, 0,
- (SCM n, SCM fill),
- "Create a newly allocated homogeneous numeric vector which can\n"
- "hold @var{len} elements. If @var{fill} is given, it is used to\n"
- "initialize the elements, otherwise the contents of the vector\n"
- "is unspecified.")
-#define FUNC_NAME s_scm_make_f64vector
-{
- SCM uvec;
- float_f64 * p;
- float_f64 f;
- int count;
-
- SCM_VALIDATE_INUM (1, n);
- count = SCM_INUM (n);
- uvec = make_uvec (FUNC_NAME, SCM_UVEC_F64, count);
- if (SCM_UNBNDP (fill))
- f = 0;
- else
- f = scm_num2dbl (fill, FUNC_NAME);
- p = (float_f64 *) SCM_UVEC_BASE (uvec);
- while (count-- > 0)
- *p++ = f;
- return uvec;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_f64vector, "f64vector", 0, 0, 1,
- (SCM l),
- "Create a newly allocated homogeneous numeric vector containing\n"
- "all argument values.")
-#define FUNC_NAME s_scm_f64vector
-{
- SCM_VALIDATE_REST_ARGUMENT (l);
- return scm_list_to_f64vector (l);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_f64vector_length, "f64vector-length", 1, 0, 0,
- (SCM uvec),
- "Return the number of elements in the homogeneous numeric vector\n"
- "@var{uvec}.")
-#define FUNC_NAME s_scm_f64vector_length
-{
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_F64)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
- return scm_int2num (SCM_UVEC_LENGTH (uvec));
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_f64vector_ref, "f64vector-ref", 2, 0, 0,
- (SCM uvec, SCM index),
- "Return the element at @var{index} in the homogeneous numeric\n"
- "vector @var{uvec}.")
-#define FUNC_NAME s_scm_f64vector_ref
-{
- int idx;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_F64)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = scm_num2int (index, 2, FUNC_NAME);
- if (idx < 0 || idx >= SCM_UVEC_LENGTH (uvec))
- scm_out_of_range_pos (FUNC_NAME, index, SCM_MAKINUM (2));
-
- return scm_make_real (((float_f64 *) SCM_UVEC_BASE (uvec))[idx]);
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_f64vector_set_x, "f64vector-set!", 3, 0, 0,
- (SCM uvec, SCM index, SCM value),
- "Set the element at @var{index} in the homogeneous numeric\n"
- "vector @var{uvec} to @var{value}. The return value is not\n"
- "specified.")
-#define FUNC_NAME s_scm_f64vector_ref
-{
- int idx;
- float_f64 f;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_F64)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = scm_num2int (index, 2, FUNC_NAME);
- if (idx < 0 || idx >= SCM_UVEC_LENGTH (uvec))
- scm_out_of_range_pos (FUNC_NAME, index, SCM_MAKINUM (2));
-
- f = scm_num2dbl (value, FUNC_NAME);
-
- ((float_f64 *) SCM_UVEC_BASE (uvec))[idx] = f;
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_f64vector_to_list, "f64vector->list", 1, 0, 0,
- (SCM uvec),
- "Convert the homogeneous numeric vector @var{uvec} to a list.")
-#define FUNC_NAME s_scm_f64vector_to_list
-{
- int idx;
- float_f64 * p;
- SCM res = SCM_EOL;
-
- SCM_VALIDATE_SMOB (1, uvec, uvec);
- if (SCM_UVEC_TYPE (uvec) != SCM_UVEC_F64)
- scm_wrong_type_arg (FUNC_NAME, 1, uvec);
-
- idx = SCM_UVEC_LENGTH (uvec);
- p = (float_f64 *) SCM_UVEC_BASE (uvec) + idx;
- while (idx-- > 0)
- {
- p--;
- res = scm_cons (scm_make_real (*p), res);
- }
- return res;
-}
-#undef FUNC_NAME
-
-
-SCM_DEFINE (scm_list_to_f64vector, "list->f64vector", 1, 0, 0,
- (SCM l),
- "Convert the list @var{l}, which must only contain signed\n"
- "8-bit values, to a numeric homogeneous vector.")
-#define FUNC_NAME s_scm_list_to_f64vector
-{
- SCM uvec;
- float_f64 * p;
- int n;
- int arg_pos = 1;
-
- SCM_VALIDATE_LIST_COPYLEN (1, l, n);
-
- uvec = make_uvec (FUNC_NAME, SCM_UVEC_F64, n);
- p = (float_f64 *) SCM_UVEC_BASE (uvec);
- while (SCM_CONSP (l))
- {
- float_f64 f = scm_num2dbl (SCM_CAR (l), FUNC_NAME);
- *p++ = f;
- l = SCM_CDR (l);
- arg_pos++;
- }
- return uvec;
-}
-#undef FUNC_NAME
-
-
-/* Create the smob type for homogeneous numeric vectors and install
- the primitives. */
-void
-scm_init_srfi_4 (void)
-{
- scm_tc16_uvec = scm_make_smob_type ("uvec", 0);
- scm_set_smob_free (scm_tc16_uvec, uvec_free);
- scm_set_smob_print (scm_tc16_uvec, uvec_print);
-#include "srfi/srfi-4.x"
-}
-
-/* End of srfi-4.c. */
diff --git a/srfi/srfi-4.h b/srfi/srfi-4.h
deleted file mode 100644
index 0a522991e..000000000
--- a/srfi/srfi-4.h
+++ /dev/null
@@ -1,153 +0,0 @@
-#ifndef SCM_SRFI_4_H
-#define SCM_SRFI_4_H
-/* srfi-4.c --- Homogeneous numeric vector datatypes.
- *
- * Copyright (C) 2001 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, 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 GUILE.
- *
- * The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy code from
- * other Free Software Foundation releases into a copy of GUILE, 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 GUILE, it is your choice
- * whether to permit this exception to apply to your modifications.
- * If you do not wish that, delete this exception notice. */
-
-
-/* SCM_SRFI4_API is a macro prepended to all function and data definitions
- which should be exported or imported in the resulting dynamic link
- library in the Win32 port. */
-
-#if defined (SCM_SRFI4_IMPORT)
-# define SCM_SRFI4_API __declspec (dllimport) extern
-#elif defined (SCM_SRFI4_EXPORT) || defined (DLL_EXPORT)
-# define SCM_SRFI4_API __declspec (dllexport) extern
-#else
-# define SCM_SRFI4_API extern
-#endif
-
-SCM_SRFI4_API SCM scm_u8vector_p (SCM obj);
-SCM_SRFI4_API SCM scm_make_u8vector (SCM n, SCM fill);
-SCM_SRFI4_API SCM scm_u8vector (SCM l);
-SCM_SRFI4_API SCM scm_u8vector_length (SCM uvec);
-SCM_SRFI4_API SCM scm_u8vector_ref (SCM uvec, SCM index);
-SCM_SRFI4_API SCM scm_u8vector_set_x (SCM uvec, SCM index, SCM value);
-SCM_SRFI4_API SCM scm_u8vector_to_list (SCM uvec);
-SCM_SRFI4_API SCM scm_list_to_u8vector (SCM l);
-
-SCM_SRFI4_API SCM scm_s8vector_p (SCM obj);
-SCM_SRFI4_API SCM scm_make_s8vector (SCM n, SCM fill);
-SCM_SRFI4_API SCM scm_s8vector (SCM l);
-SCM_SRFI4_API SCM scm_s8vector_length (SCM uvec);
-SCM_SRFI4_API SCM scm_s8vector_ref (SCM uvec, SCM index);
-SCM_SRFI4_API SCM scm_s8vector_set_x (SCM uvec, SCM index, SCM value);
-SCM_SRFI4_API SCM scm_s8vector_to_list (SCM uvec);
-SCM_SRFI4_API SCM scm_list_to_s8vector (SCM l);
-
-SCM_SRFI4_API SCM scm_u16vector_p (SCM obj);
-SCM_SRFI4_API SCM scm_make_u16vector (SCM n, SCM fill);
-SCM_SRFI4_API SCM scm_u16vector (SCM l);
-SCM_SRFI4_API SCM scm_u16vector_length (SCM uvec);
-SCM_SRFI4_API SCM scm_u16vector_ref (SCM uvec, SCM index);
-SCM_SRFI4_API SCM scm_u16vector_set_x (SCM uvec, SCM index, SCM value);
-SCM_SRFI4_API SCM scm_u16vector_to_list (SCM uvec);
-SCM_SRFI4_API SCM scm_list_to_u16vector (SCM l);
-
-SCM_SRFI4_API SCM scm_s16vector_p (SCM obj);
-SCM_SRFI4_API SCM scm_make_s16vector (SCM n, SCM fill);
-SCM_SRFI4_API SCM scm_s16vector (SCM l);
-SCM_SRFI4_API SCM scm_s16vector_length (SCM uvec);
-SCM_SRFI4_API SCM scm_s16vector_ref (SCM uvec, SCM index);
-SCM_SRFI4_API SCM scm_s16vector_set_x (SCM uvec, SCM index, SCM value);
-SCM_SRFI4_API SCM scm_s16vector_to_list (SCM uvec);
-SCM_SRFI4_API SCM scm_list_to_s16vector (SCM l);
-
-SCM_SRFI4_API SCM scm_u32vector_p (SCM obj);
-SCM_SRFI4_API SCM scm_make_u32vector (SCM n, SCM fill);
-SCM_SRFI4_API SCM scm_u32vector (SCM l);
-SCM_SRFI4_API SCM scm_u32vector_length (SCM uvec);
-SCM_SRFI4_API SCM scm_u32vector_ref (SCM uvec, SCM index);
-SCM_SRFI4_API SCM scm_u32vector_set_x (SCM uvec, SCM index, SCM value);
-SCM_SRFI4_API SCM scm_u32vector_to_list (SCM uvec);
-SCM_SRFI4_API SCM scm_list_to_u32vector (SCM l);
-
-SCM_SRFI4_API SCM scm_s32vector_p (SCM obj);
-SCM_SRFI4_API SCM scm_make_s32vector (SCM n, SCM fill);
-SCM_SRFI4_API SCM scm_s32vector (SCM l);
-SCM_SRFI4_API SCM scm_s32vector_length (SCM uvec);
-SCM_SRFI4_API SCM scm_s32vector_ref (SCM uvec, SCM index);
-SCM_SRFI4_API SCM scm_s32vector_set_x (SCM uvec, SCM index, SCM value);
-SCM_SRFI4_API SCM scm_s32vector_to_list (SCM uvec);
-SCM_SRFI4_API SCM scm_list_to_s32vector (SCM l);
-
-SCM_SRFI4_API SCM scm_u64vector_p (SCM obj);
-SCM_SRFI4_API SCM scm_make_u64vector (SCM n, SCM fill);
-SCM_SRFI4_API SCM scm_u64vector (SCM l);
-SCM_SRFI4_API SCM scm_u64vector_length (SCM uvec);
-SCM_SRFI4_API SCM scm_u64vector_ref (SCM uvec, SCM index);
-SCM_SRFI4_API SCM scm_u64vector_set_x (SCM uvec, SCM index, SCM value);
-SCM_SRFI4_API SCM scm_u64vector_to_list (SCM uvec);
-SCM_SRFI4_API SCM scm_list_to_u64vector (SCM l);
-
-SCM_SRFI4_API SCM scm_s64vector_p (SCM obj);
-SCM_SRFI4_API SCM scm_make_s64vector (SCM n, SCM fill);
-SCM_SRFI4_API SCM scm_s64vector (SCM l);
-SCM_SRFI4_API SCM scm_s64vector_length (SCM uvec);
-SCM_SRFI4_API SCM scm_s64vector_ref (SCM uvec, SCM index);
-SCM_SRFI4_API SCM scm_s64vector_set_x (SCM uvec, SCM index, SCM value);
-SCM_SRFI4_API SCM scm_s64vector_to_list (SCM uvec);
-SCM_SRFI4_API SCM scm_list_to_s64vector (SCM l);
-
-SCM_SRFI4_API SCM scm_f32vector_p (SCM obj);
-SCM_SRFI4_API SCM scm_make_f32vector (SCM n, SCM fill);
-SCM_SRFI4_API SCM scm_f32vector (SCM l);
-SCM_SRFI4_API SCM scm_f32vector_length (SCM uvec);
-SCM_SRFI4_API SCM scm_f32vector_ref (SCM uvec, SCM index);
-SCM_SRFI4_API SCM scm_f32vector_set_x (SCM uvec, SCM index, SCM value);
-SCM_SRFI4_API SCM scm_f32vector_to_list (SCM uvec);
-SCM_SRFI4_API SCM scm_list_to_f32vector (SCM l);
-
-SCM_SRFI4_API SCM scm_f64vector_p (SCM obj);
-SCM_SRFI4_API SCM scm_make_f64vector (SCM n, SCM fill);
-SCM_SRFI4_API SCM scm_f64vector (SCM l);
-SCM_SRFI4_API SCM scm_f64vector_length (SCM uvec);
-SCM_SRFI4_API SCM scm_f64vector_ref (SCM uvec, SCM index);
-SCM_SRFI4_API SCM scm_f64vector_set_x (SCM uvec, SCM index, SCM value);
-SCM_SRFI4_API SCM scm_f64vector_to_list (SCM uvec);
-SCM_SRFI4_API SCM scm_list_to_f64vector (SCM l);
-
-SCM_SRFI4_API void scm_init_srfi_4 (void);
-
-#endif /* SCM_SRFI_4_H */
diff --git a/srfi/srfi-4.scm b/srfi/srfi-4.scm
deleted file mode 100644
index 44aaade91..000000000
--- a/srfi/srfi-4.scm
+++ /dev/null
@@ -1,202 +0,0 @@
-;;; srfi-4.scm --- Homogeneous Numeric Vector Datatypes
-
-;; Copyright (C) 2001, 2002 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, 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 GUILE.
-;;
-;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;; code from other Free Software Foundation releases into a copy of
-;; GUILE, 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 GUILE, it is your choice
-;; whether to permit this exception to apply to your modifications.
-;; If you do not wish that, delete this exception notice.
-
-;;; Author: Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
-;;; Commentary:
-
-;; This module implements homogeneous numeric vectors as defined in SRFI-4.
-;; This module is fully documented in the Guile Reference Manual.
-
-;;; Code:
-
-(define-module (srfi srfi-4)
- :export (
-;;; Unsigned 8-bit vectors.
- u8vector? make-u8vector u8vector u8vector-length u8vector-ref
- u8vector-set! u8vector->list list->u8vector
-
-;;; Signed 8-bit vectors.
- s8vector? make-s8vector s8vector s8vector-length s8vector-ref
- s8vector-set! s8vector->list list->s8vector
-
-;;; Unsigned 16-bit vectors.
- u16vector? make-u16vector u16vector u16vector-length u16vector-ref
- u16vector-set! u16vector->list list->u16vector
-
-;;; Signed 16-bit vectors.
- s16vector? make-s16vector s16vector s16vector-length s16vector-ref
- s16vector-set! s16vector->list list->s16vector
-
-;;; Unsigned 32-bit vectors.
- u32vector? make-u32vector u32vector u32vector-length u32vector-ref
- u32vector-set! u32vector->list list->u32vector
-
-;;; Signed 32-bit vectors.
- s32vector? make-s32vector s32vector s32vector-length s32vector-ref
- s32vector-set! s32vector->list list->s32vector
-
-;;; Unsigned 64-bit vectors.
- u64vector? make-u64vector u64vector u64vector-length u64vector-ref
- u64vector-set! u64vector->list list->u64vector
-
-;;; Signed 64-bit vectors.
- s64vector? make-s64vector s64vector s64vector-length s64vector-ref
- s64vector-set! s64vector->list list->s64vector
-
-;;; 32-bit floating point vectors.
- f32vector? make-f32vector f32vector f32vector-length f32vector-ref
- f32vector-set! f32vector->list list->f32vector
-
-;;; 64-bit floating point vectors.
- f64vector? make-f64vector f64vector f64vector-length f64vector-ref
- f64vector-set! f64vector->list list->f64vector
- ))
-
-
-;; Make 'srfi-4 available as a feature identifiere to `cond-expand'.
-;;
-(cond-expand-provide (current-module) '(srfi-4))
-
-
-;; Load the compiled primitives from the shared library.
-;;
-(load-extension "libguile-srfi-srfi-4" "scm_init_srfi_4")
-
-
-;; Reader extension for #f32() and #f64() vectors.
-;;
-(define (hash-f char port)
- (if (or (char=? (peek-char port) #\3)
- (char=? (peek-char port) #\6))
- (let* ((obj (read port)))
- (if (number? obj)
- (cond ((= obj 32)
- (let ((l (read port)))
- (if (list? l)
- (list->f32vector l)
- (error "syntax error in #f32() vector literal"))))
- ((= obj 64)
- (let ((l (read port)))
- (if (list? l)
- (list->f64vector l)
- (error "syntax error in #f64() vector literal"))))
- (else
- (error "syntax error in #f...() vector literal")))
- (error "syntax error in #f...() vector literal")))
- #f))
-
-
-;; Reader extension for #u8(), #u16(), #u32() and #u64() vectors.
-;;
-(define (hash-u char port)
- (if (or (char=? (peek-char port) #\8)
- (char=? (peek-char port) #\1)
- (char=? (peek-char port) #\3)
- (char=? (peek-char port) #\6))
- (let ((obj (read port)))
- (cond ((= obj 8)
- (let ((l (read port)))
- (if (list? l)
- (list->u8vector l)
- (error "syntax error in #u8() vector literal"))))
- ((= obj 16)
- (let ((l (read port)))
- (if (list? l)
- (list->u16vector l)
- (error "syntax error in #u16() vector literal"))))
- ((= obj 32)
- (let ((l (read port)))
- (if (list? l)
- (list->u32vector l)
- (error "syntax error in #u32() vector literal"))))
- ((= obj 64)
- (let ((l (read port)))
- (if (list? l)
- (list->u64vector l)
- (error "syntax error in #u64() vector literal"))))
- (else
- (error "syntax error in #u...() vector literal"))))
- (error "syntax error in #u...() vector literal")))
-
-
-;; Reader extension for #s8(), #s16(), #s32() and #s64() vectors.
-;;
-(define (hash-s char port)
- (if (or (char=? (peek-char port) #\8)
- (char=? (peek-char port) #\1)
- (char=? (peek-char port) #\3)
- (char=? (peek-char port) #\6))
- (let ((obj (read port)))
- (cond ((= obj 8)
- (let ((l (read port)))
- (if (list? l)
- (list->s8vector l)
- (error "syntax error in #s8() vector literal"))))
- ((= obj 16)
- (let ((l (read port)))
- (if (list? l)
- (list->s16vector l)
- (error "syntax error in #s16() vector literal"))))
- ((= obj 32)
- (let ((l (read port)))
- (if (list? l)
- (list->s32vector l)
- (error "syntax error in #s32() vector literal"))))
- ((= obj 64)
- (let ((l (read port)))
- (if (list? l)
- (list->s64vector l)
- (error "syntax error in #s64() vector literal"))))
- (else
- (error "syntax error in #s...() vector literal"))))
- (error "syntax error in #s...() vector literal")))
-
-
-;; Install the hash extensions.
-;;
-(read-hash-extend #\f hash-f)
-(read-hash-extend #\u hash-u)
-(read-hash-extend #\s hash-s)
-
-;;; srfi-4.scm ends here
diff --git a/srfi/srfi-6.scm b/srfi/srfi-6.scm
deleted file mode 100644
index 5b6187ad5..000000000
--- a/srfi/srfi-6.scm
+++ /dev/null
@@ -1,57 +0,0 @@
-;;; srfi-6.scm --- Basic String Ports
-
-;; Copyright (C) 2001, 2002 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, 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 GUILE.
-;;
-;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;; code from other Free Software Foundation releases into a copy of
-;; GUILE, 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 GUILE, it is your choice
-;; whether to permit this exception to apply to your modifications.
-;; If you do not wish that, delete this exception notice.
-
-;;; Commentary:
-
-;; This module is fully documented in the Guile Reference Manual.
-
-;;; Code:
-
-(define-module (srfi srfi-6))
-
-;; Currently, guile provides these functions by default, so no action
-;; is needed, and this file is just a placeholder.
-
-(cond-expand-provide (current-module) '(srfi-6))
-
-;;; srfi-6.scm ends here
diff --git a/srfi/srfi-8.scm b/srfi/srfi-8.scm
deleted file mode 100644
index 21e141066..000000000
--- a/srfi/srfi-8.scm
+++ /dev/null
@@ -1,56 +0,0 @@
-;;; srfi-8.scm --- receive
-
-;; Copyright (C) 2000, 2001, 2002 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, 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 GUILE.
-;;
-;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;; code from other Free Software Foundation releases into a copy of
-;; GUILE, 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 GUILE, it is your choice
-;; whether to permit this exception to apply to your modifications.
-;; If you do not wish that, delete this exception notice.
-
-;;; Commentary:
-
-;; This module is fully documented in the Guile Reference Manual.
-
-;;; Code:
-
-(define-module (srfi srfi-8)
- :use-module (ice-9 receive)
- :re-export-syntax (receive))
-
-(cond-expand-provide (current-module) '(srfi-8))
-
-;;; srfi-8.scm ends here
diff --git a/srfi/srfi-9.scm b/srfi/srfi-9.scm
deleted file mode 100644
index 5a6591e5b..000000000
--- a/srfi/srfi-9.scm
+++ /dev/null
@@ -1,116 +0,0 @@
-;;; srfi-9.scm --- define-record-type
-
-;; Copyright (C) 2001, 2002 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, 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 GUILE.
-;;
-;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;; code from other Free Software Foundation releases into a copy of
-;; GUILE, 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 GUILE, it is your choice
-;; whether to permit this exception to apply to your modifications.
-;; If you do not wish that, delete this exception notice.
-
-;;; Commentary:
-
-;; This module exports the syntactic form `define-record-type', which
-;; is the means for creating record types defined in SRFI-9.
-;;
-;; The syntax of a record type definition is:
-;;
-;; <record type definition>
-;; -> (define-record-type <type name>
-;; (<constructor name> <field tag> ...)
-;; <predicate name>
-;; <field spec> ...)
-;;
-;; <field spec> -> (<field tag> <accessor name>)
-;; -> (<field tag> <accessor name> <modifier name>)
-;;
-;; <field tag> -> <identifier>
-;; <... name> -> <identifier>
-;;
-;; Usage example:
-;;
-;; guile> (use-modules (srfi srfi-9))
-;; guile> (define-record-type :foo (make-foo x) foo?
-;; (x get-x) (y get-y set-y!))
-;; guile> (define f (make-foo 1))
-;; guile> f
-;; #<:foo x: 1 y: #f>
-;; guile> (get-x f)
-;; 1
-;; guile> (set-y! f 2)
-;; 2
-;; guile> (get-y f)
-;; 2
-;; guile> f
-;; #<:foo x: 1 y: 2>
-;; guile> (foo? f)
-;; #t
-;; guile> (foo? 1)
-;; #f
-
-;;; Code:
-
-(define-module (srfi srfi-9)
- :export-syntax (define-record-type))
-
-(cond-expand-provide (current-module) '(srfi-9))
-
-(define-macro (define-record-type type-name constructor/field-tag
- predicate-name . field-specs)
- `(begin
- (define ,type-name
- (make-record-type ',type-name ',(map car field-specs)))
- (define ,(car constructor/field-tag)
- (record-constructor ,type-name ',(cdr constructor/field-tag)))
- (define ,predicate-name
- (record-predicate ,type-name))
- ,@(map
- (lambda (spec)
- (cond
- ((= (length spec) 2)
- `(define ,(cadr spec)
- (record-accessor ,type-name ',(car spec))))
- ((= (length spec) 3)
- `(begin
- (define ,(cadr spec)
- (record-accessor ,type-name ',(car spec)))
- (define ,(caddr spec)
- (record-modifier ,type-name ',(car spec)))))
- (else
- (error "invalid field spec " spec))))
- field-specs)))
-
-;;; srfi-9.scm ends here
diff --git a/test-suite/.cvsignore b/test-suite/.cvsignore
deleted file mode 100644
index 8ba23a55b..000000000
--- a/test-suite/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-guile.log
-tmp1
-tmp2
-tmp3
-Makefile
-Makefile.in
diff --git a/test-suite/COPYING b/test-suite/COPYING
deleted file mode 100644
index eeb586b39..000000000
--- a/test-suite/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED 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.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
-
- 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 of the License, 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 program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) 19yy name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/test-suite/ChangeLog b/test-suite/ChangeLog
deleted file mode 100644
index da61a418f..000000000
--- a/test-suite/ChangeLog
+++ /dev/null
@@ -1,815 +0,0 @@
-2002-07-13 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/goops.test: Added tests for define-generic and
- define-accessor.
-
-2002-07-13 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/goops.test: Added tests for define-class.
-
-2002-05-07 Marius Vollmer <mvo@zagadka.ping.de>
-
- * tests/numbers.test (/): Expect divison by an inexact zero to
- yield +inf.0.
-
-2002-05-06 Marius Vollmer <mvo@zagadka.ping.de>
-
- * tests/regexp.test (regexp-substitute/global): Do not test with
- empty regexp. Empty regexps do not work on NetBSD.
-
- * tests/syncase.test (basic syncase macro): Added.
-
-2002-04-26 Marius Vollmer <mvo@zagadka.ping.de>
-
- * tests/srfi-13.test (string-tokenize): Updated for fixed
- semantics.
-
-2002-04-16 Marius Vollmer <mvo@zagadka.ping.de>
-
- * Makefile.am (SCM_TESTS_DIRS, dist-hook): New, distribute
- directories manually.
-
-2002-02-09 Thien-Thi Nguyen <ttn@giblet.glug.org>
-
- * guile-test (main): Handle `--flag-unresolved'. No longer set
- exit value to #f unconditionally on UNRESOLVED results.
- (for-each-file): Do not recurse into "CVS" or "RCS" subdirs.
-
-2002-02-08 Neil Jerram <neil@ossau.uklinux.net>
-
- * tests/elisp.test: Add tests of Elisp expression evaluation.
-
-2002-01-25 Neil Jerram <neil@ossau.uklinux.net>
-
- * tests/load.test: New test; for search-path with Elisp
- nil-terminated lists for PATH and EXTENSIONS.
-
- * tests/elisp.test: More tests for Scheme primitives that should
- accept Elisp nil-terminated lists.
-
-2002-01-24 Neil Jerram <neil@ossau.uklinux.net>
-
- * tests/elisp.test: More new tests for the Elisp nil value.
-
-2002-01-22 Neil Jerram <neil@ossau.uklinux.net>
-
- * Makefile.am (SCM_TESTS): Added elisp.test.
-
- * tests/elisp.test: New file.
-
-2001-11-22 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/numbers.test: Added more division by zero tests.
-
-2001-11-22 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/numbers.test: Added division by zero tests.
-
-2001-11-17 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/syntax.test: Added some tests, updated some others with
- respect to recent changes in eval.c. Further, extracted test
- cases for guile's extended set! functionality to srfi-17.test.
-
- * tests/srfi-17.test: New file.
-
-2001-11-04 Stefan Jahn <stefan@lkcc.org>
-
- * tests/ports.test: Run (close-port) before (delete-file) if
- necessary/advisory.
-
-2001-10-26 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/eval.test: Added tests for promises.
-
-2001-10-21 Mikael Djurfeldt <mdj@linnaeus>
-
- * lib.scm: Move module the system directives `export',
- `export-syntax', `re-export' and `re-export-syntax' into the
- `define-module' form. This is the recommended way of exporting
- bindings.
-
-2001-10-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/syntax.test: Added test cases for 'cond =>' syntax with
- else clause. Changed some tests and comments related to the
- 'case' form to reflect recent changes in the implementation.
-
-2001-10-14 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/syntax.test: Added test cases for 'lambda' syntax.
-
-2001-10-13 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/syntax.test: Added test cases for 'case' syntax.
-
-2001-10-13 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/numbers.test: Added a test case that checks if valid
- number strings are transformed correctly by string->number.
-
-2001-09-21 Rob Browning <rlb@defaultvalue.org>
-
- * tests/numbers.test (fixnum-bit): compute dynamically.
-
- * tests/bit-operations.test (fixnum-bit): compute dynamically.
-
-2001-09-07 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * tests/getopt-long.test ("apples-blimps-catalexis example",
- "multiple occurances"): New top-level sections.
-
-2001-08-31 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/numbers.test: Made some of the patterns better readable.
-
-2001-08-25 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * tests/srfi-19.test (test-time-comparision,
- test-time-arithmatic): New procs.
-
- Add time comparison tests using new procs.
- Thanks to Alex Shinn.
-
-2001-08-25 Marius Vollmer <mvo@zagadka.ping.de>
-
- * tests/dynamic-scope.test: New file.
-
-2001-08-24 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * tests/srfi-13.test (string-for-each, string-for-each-index):
- Add tests. (Thanks to Alex Shinn.)
-
-2001-08-22 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
-
- * tests/srfi-13.test (string-map): Swapped order of string and
- proc args to conform with the srfi. (Thanks to Alex Shinn.)
-
-2001-08-12 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * tests/getopt-long.test (exception:no-such-option,
- exception:option-does-not-support-arg,
- exception:option-must-be-specified,
- exception:option-must-have-arg, exception:not-enough-args):
- New vars.
-
- ("option-ref", "required", "specified no value, given anyway",
- "specified arg required"): New top-level sections.
-
-2001-08-11 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/numbers.test: Added Some syntax tests for
- string->number.
-
-2001-08-09 Marius Vollmer <marius.vollmer@uni-dortmund.de>
-
- * Makefile.am (TESTS): Do not call the variable "TESTS", call it
- "SCM_TESTS". This has special meaning to automake. How many
- tries left to get this right, mvo?
-
-2001-08-08 Marius Vollmer <marius.vollmer@uni-dortmund.de>
-
- * Makefile.am (TESTS): List tests explicitely instead of using a
- wildcard. Wildcards don't seem to work for VPATH "make dist"s.
-
-2001-08-07 Marius Vollmer <mvo@zagadka.ping.de>
-
- * Makefile.am: New file, to control distribution of the
- test-suite.
-
-2001-08-02 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * tests/getopt-long.test: New file.
-
-2001-08-01 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * lib.scm (run-test-exception): Add special handling for
- `error'-generated exceptions, which pass key `misc-error' and
- leave messages unformatted.
-
-2001-07-18 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * tests/alist.test, tests/bit-operations.test,
- tests/common-list.test, tests/environments.test, tests/eval.test,
- tests/gc.test, tests/hooks.test, tests/import.test,
- tests/interp.test, tests/list.test, tests/load.test,
- tests/numbers.test, tests/ports.test, tests/r4rs.test,
- tests/version.test, tests/weaks.test, lib.scm, guile-test: Updated
- copyright notice.
-
-2001-07-16 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * tests/srfi-14.test: New file.
-
-2001-07-13 Marius Vollmer <mvo@zagadka.ping.de>
-
- * tests/import.test: New file.
-
-2001-06-30 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/goops.test: Started with some real tests.
-
-2001-06-30 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * guile-test: Use module (ice-9 rdelim).
-
-2001-06-27 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * tests/srfi-4.test: New file.
-
-2001-06-16 Marius Vollmer <mvo@zagadka.ping.de>
-
- Thanks to Matthias Köppe!
-
- * tests/ports.test: New test for output port line counts.
- * tests/format.test, tests/optargs.test, tests/srfi-19.test: New
- files.
-
-2001-05-28 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * tests/symbols.test ("gensym"): New tests for long gensym
- prefices and embedded NULs in prefices.
-
-2001-05-21 Marius Vollmer <mvo@zagadka.ping.de>
-
- * test/goops.test, test/syncase.test: New, minimal tests.
-
-2001-05-19 Marius Vollmer <mvo@zagadka.ping.de>
-
- * tests/version.test: Updated test for new micro version stuff.
-
-2001-05-16 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * tests/srfi-13.test: More tests.
-
-2001-05-10 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * tests/srfi-10.test: New file.
-
- * tests/srfi-9.test: New file.
-
- * tests/srfi-13.test: Added some more tests.
-
-2001-05-09 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * tests/eval.test: ("evaluator" "memoization"): New test
- prefix block.
- ("transparency"): New "evaluator memoization" test.
-
-2001-05-08 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * tests/srfi-13.test: Added module access kludge, and uncommented
- some tests depending on this.
-
-2001-05-07 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * tests/srfi-13.test: New file testing the SRFI string library.
-
-2001-04-26 Gary Houston <ghouston@arglist.com>
-
- * tests/r4rs.test: delete files tmp1, tmp2, tmp3 after the tests
- have run.
-
- * tests/ports.test (test-file), tests/load.test (temp-dir):
- redefined using data-file-name instead of tmpnam. the test files
- will be created in the build directory instead of /var/tmp or
- whereever tmpnam puts them.
-
-2001-04-02 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/symbols.c: Added some tests.
-
-2001-03-19 Gary Houston <ghouston@arglist.com>
-
- * tests/r4rs.test: use test-file-name to locate r4rs.test,
- not data-file-name.
-
- * guile-test: define tmp-dir, the location where r4rs.test will
- create it's temporary files.
- (data-file-name): use tmp-dir. this must be under build-dir,
- not src-dir.
-
-2001-03-18 Gary Houston <ghouston@arglist.com>
-
- * guile-test: use #!/bogus-path/..., not #!/home/dirk/... in the
- first line.
-
-2001-03-12 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/syntax.test: Added a test for let* bindings and
- re-arranged and slightly improved the existing one.
-
-2001-03-09 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
-
- * tests/syntax.test ("let*"): Changed the `duplicate bindings'
- test, dups are allowed in `let*' and are now expected to pass.
-
-2001-03-05 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * lib.scm (run-test-exception): Preserve the original error's
- stack for re-throwing.
-
-2001-03-04 Marius Vollmer <mvo@zagadka.ping.de>
-
- * tests/syntax.test ("let,duplicate bindings", "let*,duplicate
- bindings", "letrec,duplicate bindings"): Expect to pass, bug has
- been fixed.
-
-2001-03-03 Marius Vollmer <mvo@zagadka.ping.de>
-
- * tests/syntax.test ("duplicate formals"): New category, move
- appropriate tests here. Expect them to pass.
- ("empty parentheses"): Expect to pass, bug has been fixed.
-
- * tests/alist.test: Use "'()" instead of "()" in all places
- where the empty list is meant.
-
-2001-03-01 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * lib.scm (exception:unbound-var, exception:wrong-num-args): New
- exported constants.
-
- * tests/r4rs.test: Make sure that no bindings for x and y exist
- after the file is loaded.
-
- * tests/syntax.test: New file.
-
- * tests/exceptions.test, tests/syntax.test, tests/eval.test:
- Moved the test cases that are related to guile's syntactic forms
- from tests/exceptions.test to tests/syntax.test. Moved tests
- related to evaluation and application to tests/eval.test.
-
- * tests/exceptions.test: Added some test cases that check guile's
- exception handling.
-
-2001-03-01 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/exceptions.test, tests/numbers.test: Moved the number
- related test cases from tests/exceptions.test to
- tests/numbers.test.
-
- * tests/numbers.test: Added a test case.
-
-2001-03-01 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/symbols.test: New file.
-
- (exception:immutable-string): New constant. Currently, this is a
- dummy since guile does not have immutable strings.
-
- * tests/exceptions.test, tests/strings.test, tests/symbols.test:
- Moved the string related test cases from tests/exceptions.test to
- tests/strings.test and the symbol related test cases to
- tests/symbols.test.
-
- * tests/strings.test: Copyright notice updated. Added a couple
- of test cases.
-
- (exception:immutable-string): New constant. Currently, this is a
- dummy since guile does not have immutable strings.
-
-2001-02-28 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/exceptions.test: Use expect-fail-exception to indicate
- test cases where exceptions should occur, but don't.
-
- (exception:bad-bindings, exception:bad-formals, exception:bad-var,
- exception:missing/extra-expr): New constants.
-
-2001-02-28 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/reader.test, tests/exceptions.test: Moved the reader
- related test cases from tests/exceptions.test to
- tests/reader.test.
-
- * tests/reader.test (exception:eof, exception:unexpected-rparen):
- New constants.
-
- * tests/exceptions.test (read-string, x:eof, x:unexpected-rparen):
- Removed.
-
-2001-02-28 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * lib.scm (signals-error?, signals-error?*): Removed.
-
-2001-02-28 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * lib.scm: Added comment about new convenience functions/macros
- to test for exceptions.
-
- (exception:out-of-range, exception:wrong-type-arg): New exported
- constants.
-
- (run-test-exception): New function.
-
- (pass-if-exception, expect-fail-exception): New exported macros.
-
- * tests/environments.test: Fixed tests that were checking for
- exceptions when set!ing an unbound symbol.
-
- (exception:unbound-symbol): New constant.
-
- * tests/hooks.test (catch-error-returning-true, pass-if-not,
- catch-error-returning-false), tests/weaks.test
- (catch-error-returning-true, pass-if-not,
- catch-error-returning-false): Removed. The macro pass-if-not was
- not used. The macro catch-error-returning-false is unnecessary
- since exceptions are caught by the test-suite anyway. The
- functionality of catch-error-returning-true is provided by the new
- convenience macro pass-if-exception.
-
- * tests/hooks.test (exception:wrong-num-hook-args): New constant.
- Maybe a standard wrong-num-arg exception should be thrown instead
- of a misc-error?
-
- * tests/reader.test (try-to-read): Replaced by read-string.
-
- (read-string): New function.
-
- * tests/alist.test, tests/environments.test, tests/eval.test,
- tests/hooks.test, tests/list.test, tests/ports.test,
- tests/reader.test, tests/strings.test, tests/weaks.test: Replace
- tests for exceptions with the new convenience macros.
-
-2001-02-28 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/alist.test: Remove redundant test name prefix.
-
-2001-02-28 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * lib.scm (pass-if): Tests shall return a boolean value.
-
- * tests/bit-operations.test (documented?), tests/common-list.test
- (documented?), tests/environments.test (documented?),
- tests/eval.test (documented?), tests/gc.test (documented?),
- tests/numbers.test (documented?), tests/guardians.test,
- tests/hooks.test, tests/interp.test, tests/weaks.test: Make sure
- that tests return a boolean value.
-
- * tests/list.test (documented?): New function, replace all checks
- for documentation with calls to this function.
-
-2001-02-27 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * lib.scm (data-file): Remove from export list.
-
-2001-02-22 Thien-Thi Nguyen <ttn@revel.glug.org>
-
- * tests/exceptions.test (syntax lambda): Renamed from (lambda).
- (syntax lambda cond-arrow-proc): Renamed from (lambda cond-arrow-proc).
- (syntax reading): New section.
- (syntax let*): New section.
- (syntax letrec): New section.
- (syntax set!): New section.
- (syntax misc): New section.
- (bindings unbound): New section.
- (bindings immutable-modification): New section.
- (bindings let): New section.
- (bindings let*): New section.
- (bindings letrec): New section.
-
- * tests/exceptions.test: New file.
-
-2001-02-08 Marius Vollmer <marius.vollmer@uni-dortmund.de>
-
- * guile-test: Use (ice-9 and-let-star) instead of (ice-9
- and-let*).
-
-2001-01-26 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- This patch fixes things that I have broken with the last one :-(
-
- * guile-test (test-suite): New variable.
-
- (data-file-name): New function. Has the same purpose as the
- former function data-file from lib.scm. Moved here in order to
- have all file name handling at the same place. In contrast to the
- former 'data-file function, it is not checked whether a file
- exists. This allows to use this function also for file names of
- files that are still to be created.
-
- (test-file-name): Use the global 'test-suite variable.
-
- (main): Initialize 'test-suite instead of a local variable.
-
- * lib.scm: Don't import paths any more.
-
- (data-file): Removed. Resurrected with a sligtly different
- functionality as 'data-file-name' in guile-test.
-
- * r4rs.scm: For all references to temporary file, make use of
- data-file-name.
-
-2001-01-26 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- The following patch was sent by Thien-Thi Nguyen and a little bit
- modified by me.
-
- * guile-test: Usage and installation comments improved. Added
- support for --test-suite and --debug command line options.
-
- (default-test-suite): Added to allow for simplified
- configurability. No need to load the paths file any more.
-
- (enable-debug-mode): New function. Will be called when the
- --debug command line option is given.
-
- (test-root): Removed. The test directory has to be fully given.
- This allows for arbitrarily named test directories.
-
- (test-file-name, enumerate-tets): Take the test directory as a
- paramter instead of using the global variable 'test-root'.
-
- (main): Handle the new command line options. Return an exit code
- depending on whether all tests came out as expected.
-
- * README: Updated.
-
- * paths.scm: Removed.
-
-2001-01-24 Gary Houston <ghouston@arglist.com>
-
- * tests/ports.test: include (ice-9 rdelim) module.
-
-2001-01-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/numbers.test: Converted to do real boundary testing.
-
-2001-01-17 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/bit-operations.test: Added.
-
-2000-11-03 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/gc.test: Added.
-
-2000-10-30 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/strings.test: string=? is fixed.
-
-2000-10-13 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/list.test: Removed references to sloppy-mem(q|v|ber)
-
-2000-09-26 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/strings.test: Added a test to help remember that string=?
- and friends need fixing.
-
-2000-09-12 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/environments.test: For tests that rely on garbage
- collection, conservative scanning can be a problem. Add a comment
- for these tests and make them turn out unresolved if things don't
- work as expected.
-
-2000-09-05 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/environments.test: Finished and cleaned up the tests for
- the leaf environments. Added a complete set of testcases for the
- leaf environment based eval environments. Started with the tests
- for the import environments.
-
-2000-08-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/environments.test: Added.
-
-2000-08-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * lib.scm (pass-if, expect-fail): Generalized to allow a sequence
- of expressions.
-
- * tests/eval.test: Fix documentation test.
-
-2000-06-30 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/list.test: Added tests for list-ref, list-set! and
- list-cdr-set!
-
-2000-06-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/common-list.test: Added.
-
-2000-06-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/eval.test: Added.
-
-2000-06-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/list.test: Use cons* instead of list*.
-
-2000-06-13 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * tests/numbers.test, tests/list.test: Updated for new
- documentation module.
-
-2000-05-26 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/hooks.test: make-hook-with-name is deprecated.
-
-2000-05-08 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * tests/list.test, tests/numbers.test: Added.
-
-2000-05-08 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * guile-test: Eliminate use of catch-test-errors.
-
- * lib.scm: Adopted a couple of nice ideas from Greg.
-
- (pass, fail, expect-failure, expect-failure-if,
- expect-failure-if*, catch-test-errors, catch-test-errors*,
- expected-failure-fluid, pessimist?): Removed.
-
- (run-test, expect-fail, result-tags, important-result-tags):
- Added.
-
- (report, make-count-reporter, print-counts, make-log-reporter,
- full-reporter, user-reporter): Reporters take two mandatory
- arguments and make use of the tag descriptions in result-tags and
- important-result-tags.
-
- * tests/alist.test, tests/hooks.test, tests/ports.test,
- tests/weaks.test: Don't use catch-test-errors and
- expect-failure-if.
-
-2000-05-05 Dirk Herrmann <D.Herrmann@tu-bs.de>
-
- * mambo.test: Removed dummy file.
-
-2000-03-31 Gary Houston <ghouston@arglist.com>
-
- * tests/ports.test (non-blocking-I/O): a couple more details:
- a) combine the O_NONBLOCK flag with the default flags instead
- of replacing them. b) check EWOULDBLOCK as well as EAGAIN.
-
-2000-03-22 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * lib.scm: Doc fixes.
-
-Sun Jan 16 14:01:51 2000 Greg J. Badros <gjb@cs.washington.edu>
-
- * paths.scm: Assume that ~/guile-core/test-suite is the location
- of the test suite now.
-
- * tests/version.test: Added -- version.c had 0% coverage before,
- now at 100%.
-
- * tests/chars.test: Added -- needed test of char-is-both?.
-
-1999-12-22 Greg Harvey <Greg.Harvey@thezone.net>
-
- * tests/weaks.test, tests/hooks.test: Added.
-
-1999-12-18 Greg Harvey <Greg.Harvey@thezone.net>
-
- * tests/alist.test: Added.
-
-Fri Dec 17 12:14:10 1999 Greg J. Badros <gjb@cs.washington.edu>
-
- * tests/c-api.test: Refine the list of files that are checked in
- the seek-offset-test. Was just using files that end in "c", but
- that caught the new ".doc" files, too, so make sure that files end
- in ".c" before requiring that they include unistd.h if they
- reference SEEK_(SET|CUR|END).
-
-1999-10-24 Gary Houston <ghouston@freewire.co.uk>
-
- * tests/ports.test ("string ports"): test seeking/unreading from
- an input string and seeking an output string.
-
-1999-10-20 Gary Houston <ghouston@freewire.co.uk>
-
- * tests/ports.test: in seek/tell test on input port, also test
- that ftell doesn't discard unread chars.
-
-1999-10-18 Gary Houston <ghouston@freewire.co.uk>
-
- * tests/ports.test: add seek/tell tests for unidirectional ports.
-
-1999-09-25 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * tests/reader.test: Check that number->string checks its radix
- properly.
-
-1999-09-20 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * tests/ports.test: Check that our input functions cope when
- current-input-port is closed.
-
- * tests/regexp.test: Check regexp-substitute/global when there are
- no matches. (Duh.)
-
-1999-09-15 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * tests/c-api.test: New file. Add test to check that all source
- files which use SEEK_SET, SEEK_CUR, and SEEK_END include unistd.h.
-
-1999-09-14 Gary Houston <ghouston@freewire.co.uk>
-
- * tests/ports.test: test non-blocking I/O.
-
-1999-09-11 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * tests/strings.test: Add test for substring-move! argument checking.
-
- * lib.scm (signals-error?, signals-error?*): New macro and function.
- * tests/reader.test: Use them.
-
- * tests/interp.test: Add copyright notice.
-
- * tests/reader.test: New test file.
-
- * tests/regexp.test: New test file.
-
-1999-09-06 Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
-
- * tests/interp.test: Added tests for evaluation of closure bodies.
-
-1999-09-03 James Blandy <jimb@mule.m17n.org>
-
- * tests/multilingual.nottest: New file, which we will turn into a
- test file once we actually have multilingual support to test.
-
- * tests/load.test: New test file.
-
-1999-08-30 James Blandy <jimb@mule.m17n.org>
-
- * tests/strings.test: New test file.
-
-1999-08-29 Gary Houston <ghouston@easynet.co.uk>
-
- * tests/ports.test: test unread-char and unread-string.
-
-1999-08-19 Gary Houston <ghouston@easynet.co.uk>
-
- * tests/ports.test: test line-buffering of fports.
-
-1999-08-18 Gary Houston <ghouston@easynet.co.uk>
-
- * tests/ports.test: tests for NUL and non-ASCII chars to fports.
-
-1999-08-12 Gary Houston <ghouston@easynet.co.uk>
-
- * tests/ports.test: lseek -> seek.
-
-1999-08-04 Gary Houston <ghouston@easynet.co.uk>
-
- * tests/ports.test: tests for buffered and unbuffered input/output
- fports with seeking.
-
-1999-08-01 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * tests/r4rs.test (SECTION 3 4): Each element of type-matrix
- corresponds to an example object, not a predicate. Aubrey
- probably never noticed this because SCM doesn't check the lengths
- of the arguments to for-each and map...
-
- * tests/ports.test: Add some regression tests for char-ready?.
-
-1999-07-19 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * tests/ports.test: Fix copyright years.
-
- * tests/guardians.test: New test file.
-
- * tests/ports.test ("read-delimited!"): New tests.
-
-1999-06-19 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * tests/interp.test: New file.
-
-1999-06-15 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * tests/time.test: New test file.
-
- * tests/r4rs.test: New set of tests, taken from Guile's test
- script, taken from SCM.
-
- * tests/ports.test: Group the string port tests under a new
- test name prefix.
-
- * tests/ports.test ("line counter"): Check the final column, too.
-
- * lib.scm: Import (test-suite paths).
- (data-file): New exported function.
-
-1999-06-12 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * tests/ports.test ("line counter"): Add test for correct column
- at EOF.
-
-1999-06-09 Jim Blandy <jimb@savonarola.red-bean.com>
-
- * tests/ports.test ("line counter"): Verify that we do eventually
- get EOF on the port --- don't just read forever.
-
- * lib.scm (full-reporter): The test name is the cadr of the
- result, not the cdr. I'm not macho enough to handle run-time
- typechecking.
-
- * lib.scm (print-counts): XFAILS are "expected failures", not
- "unexpected failures."
-
- * lib.scm, guile-test, paths.scm: Log begins.
-
diff --git a/test-suite/Makefile.am b/test-suite/Makefile.am
deleted file mode 100644
index 727601ecd..000000000
--- a/test-suite/Makefile.am
+++ /dev/null
@@ -1,52 +0,0 @@
-SCM_TESTS = tests/alist.test \
- tests/bit-operations.test \
- tests/c-api.test \
- tests/chars.test \
- tests/common-list.test \
- tests/elisp.test \
- tests/environments.test \
- tests/eval.test \
- tests/exceptions.test \
- tests/format.test \
- tests/gc.test \
- tests/getopt-long.test \
- tests/goops.test \
- tests/guardians.test \
- tests/hooks.test \
- tests/import.test \
- tests/interp.test \
- tests/list.test \
- tests/load.test \
- tests/multilingual.nottest \
- tests/numbers.test \
- tests/optargs.test \
- tests/ports.test \
- tests/r4rs.test \
- tests/reader.test \
- tests/regexp.test \
- tests/srfi-10.test \
- tests/srfi-13.test \
- tests/srfi-14.test \
- tests/srfi-19.test \
- tests/srfi-4.test \
- tests/srfi-9.test \
- tests/strings.test \
- tests/symbols.test \
- tests/syncase.test \
- tests/syntax.test \
- tests/time.test \
- tests/version.test \
- tests/weaks.test
-
-SCM_TESTS_DIRS = tests/asmobs \
- tests/c-api
-
-EXTRA_DIST = guile-test lib.scm $(SCM_TESTS)
-
-## Automake should be able to handle the distribution of tests/asmobs
-## etc without any help, but not all version can handle 'deep'
-## directories. So we do it on our own.
-dist-hook:
- for d in $(SCM_TESTS_DIRS); do \
- cp -pR $(srcdir)/$$d $(distdir)/$$d; \
- done
diff --git a/test-suite/README b/test-suite/README
deleted file mode 100644
index 116869e17..000000000
--- a/test-suite/README
+++ /dev/null
@@ -1,47 +0,0 @@
-This directory contains some tests for Guile, and some generic test
-support code.
-
-To run these tests, you will need a version of Guile more recent than
-15 Feb 1999 --- the tests use the (ice-9 and-let*) and (ice-9
-getopt-long) modules, which were added to Guile around then.
-
-For information about how to run the test suite, read the usage
-instructions in the comments at the top of the guile-test script.
-
-You can reference the file `lib.scm' from your own code as the module
-(test-suite lib); it also has comments at the top and before each
-function explaining what's going on.
-
-Please write more Guile tests, and send them to bug-guile@gnu.org.
-We'll merge them into the distribution. All test suites must be
-licensed for our use under the GPL, but I don't think I'm going to
-collect assignment papers for them.
-
-
-
-Some test suite philosophy:
-
-GDB has an extensive test suite --- around 6300 tests. Every time the
-test suite catches a bug, it's great.
-
-GDB is so complicated that folks are often unable to get a solid
-understanding of the code before making a change --- we just don't
-have time. You'll see people say things like, "Here's a fix for X; it
-doesn't cause any regressions." The subtext is, I made a change that
-looks reasonable, and the test suite didn't complain, so it must be
-okay.
-
-I think this is terrible, because it suggests that the writer is using
-the test suite as a substitute for having a rock-solid explanation of
-why their changes are correct. The problem is that any test suite is
-woefully incomplete. Diligent reasoning about code can catch corner
-conditions or limitations that no test suite will ever find.
-
-
-
-Jim's rule for test suites:
-
-Every test suite failure should be a complete, mysterious surprise,
-never a possibility you were prepared for. Any other attitude
-indicates that you're using the test suite as a crutch, which you need
-only because your understanding is weak.
diff --git a/test-suite/guile-test b/test-suite/guile-test
deleted file mode 100755
index 1d16368d8..000000000
--- a/test-suite/guile-test
+++ /dev/null
@@ -1,235 +0,0 @@
-#!../libguile/guile \
--e main -s
-!#
-
-;;;; guile-test --- run the Guile test suite
-;;;; Jim Blandy <jimb@red-bean.com> --- May 1999
-;;;;
-;;;; Copyright (C) 1999, 2001 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-
-;;;; Usage: [guile -e main -s] guile-test [OPTIONS] [TEST ...]
-;;;;
-;;;; Run tests from the Guile test suite. Report failures and
-;;;; unexpected passes to the standard output, along with a summary of
-;;;; all the results. Record each reported test outcome in the log
-;;;; file, `guile.log'. The exit status is #f if any of the tests
-;;;; fail or pass unexpectedly.
-;;;;
-;;;; Normally, guile-test scans the test directory, and executes all
-;;;; files whose names end in `.test'. (It assumes they contain
-;;;; Scheme code.) However, you can have it execute specific tests by
-;;;; listing their filenames on the command line.
-;;;;
-;;;; The option `--test-suite' can be given to specify the test
-;;;; directory. If no such option is given, the test directory is
-;;;; taken from the environment variable TEST_SUITE_DIR (if defined),
-;;;; otherwise a default directory that is hardcoded in this file is
-;;;; used (see "Installation" below).
-;;;;
-;;;; If present, the `--log-file LOG' option tells `guile-test' to put
-;;;; the log output in a file named LOG.
-;;;;
-;;;; If present, the `--debug' option will enable a debugging mode.
-;;;;
-;;;; If present, the `--flag-unresolved' option will cause guile-test
-;;;; to exit with failure status if any tests are UNRESOLVED.
-;;;;
-;;;;
-;;;; Installation:
-;;;;
-;;;; If you change the #! line at the top of this script to point at
-;;;; the Guile interpreter you want to test, you can call this script
-;;;; as an executable instead of having to pass it as a parameter to
-;;;; guile via "guile -e main -s guile-test". Further, you can edit
-;;;; the definition of default-test-suite to point to the parent
-;;;; directory of the `tests' tree, which makes it unnecessary to set
-;;;; the environment variable `TEST_SUITE_DIR'.
-;;;;
-;;;;
-;;;; Shortcomings:
-;;;;
-;;;; At the moment, due to a simple-minded implementation, test files
-;;;; must live in the test directory, and you must specify their names
-;;;; relative to the top of the test directory. If you want to send
-;;;; me a patch that fixes this, but still leaves sane test names in
-;;;; the log file, that would be great. At the moment, all the tests
-;;;; I care about are in the test directory, though.
-;;;;
-;;;; It would be nice if you could specify the Guile interpreter you
-;;;; want to test on the command line. As it stands, if you want to
-;;;; change which Guile interpreter you're testing, you need to edit
-;;;; the #! line at the top of this file, which is stupid.
-
-
-;;; User configurable settings:
-(define default-test-suite
- (string-append (getenv "HOME") "/bogus-path/test-suite"))
-
-
-(use-modules (test-suite lib)
- (ice-9 getopt-long)
- (ice-9 and-let-star)
- (ice-9 rdelim))
-
-
-;;; Variables that will receive their actual values later.
-(define test-suite default-test-suite)
-
-(define tmp-dir #f)
-
-
-;;; General utilities, that probably should be in a library somewhere.
-
-;;; Enable debugging
-(define (enable-debug-mode)
- (write-line %load-path)
- (set! %load-verbosely #t)
- (debug-enable 'backtrace 'debug))
-
-;;; Traverse the directory tree at ROOT, applying F to the name of
-;;; each file in the tree, including ROOT itself. For a subdirectory
-;;; SUB, if (F SUB) is true, we recurse into SUB. Do not follow
-;;; symlinks.
-(define (for-each-file f root)
-
- ;; A "hard directory" is a path that denotes a directory and is not a
- ;; symlink.
- (define (file-is-hard-directory? filename)
- (eq? (stat:type (lstat filename)) 'directory))
-
- (let visit ((root root))
- (let ((should-recur (f root)))
- (if (and should-recur (file-is-hard-directory? root))
- (let ((dir (opendir root)))
- (let loop ()
- (let ((entry (readdir dir)))
- (cond
- ((eof-object? entry) #f)
- ((or (string=? entry ".")
- (string=? entry "..")
- (string=? entry "CVS")
- (string=? entry "RCS"))
- (loop))
- (else
- (visit (string-append root "/" entry))
- (loop))))))))))
-
-
-;;; The test driver.
-
-
-;;; Localizing test files and temporary data files.
-
-(define (data-file-name filename)
- (in-vicinity tmp-dir filename))
-
-(define (test-file-name test)
- (in-vicinity test-suite test))
-
-;;; Return a list of all the test files in the test tree.
-(define (enumerate-tests test-dir)
- (let ((root-len (+ 1 (string-length test-dir)))
- (tests '()))
- (for-each-file (lambda (file)
- (if (has-suffix? file ".test")
- (let ((short-name
- (substring file root-len)))
- (set! tests (cons short-name tests))))
- #t)
- test-dir)
-
- ;; for-each-file presents the files in whatever order it finds
- ;; them in the directory. We sort them here, so they'll always
- ;; appear in the same order. This makes it easier to compare test
- ;; log files mechanically.
- (sort tests string<?)))
-
-(define (main args)
- (let ((options (getopt-long args
- `((test-suite
- (single-char #\t)
- (value #t))
- (flag-unresolved
- (single-char #\u))
- (log-file
- (single-char #\l)
- (value #t))
- (debug
- (single-char #\d))))))
- (define (opt tag default)
- (let ((pair (assq tag options)))
- (if pair (cdr pair) default)))
-
- (if (opt 'debug #f)
- (enable-debug-mode))
-
- (set! test-suite
- (or (opt 'test-suite #f)
- (getenv "TEST_SUITE_DIR")
- default-test-suite))
-
- ;; directory where temporary files are created.
- ;; when run from "make check", this must be under the build-dir,
- ;; not the src-dir.
- (set! tmp-dir (getcwd))
-
- (let* ((tests
- (let ((foo (opt '() '())))
- (if (null? foo)
- (enumerate-tests test-suite)
- foo)))
- (log-file
- (opt 'log-file "guile.log")))
-
- ;; Open the log file.
- (let ((log-port (open-output-file log-file)))
-
- ;; Register some reporters.
- (let ((global-pass #t)
- (counter (make-count-reporter)))
- (register-reporter (car counter))
- (register-reporter (make-log-reporter log-port))
- (register-reporter user-reporter)
- (register-reporter (lambda results
- (case (car results)
- ((unresolved)
- (and (opt 'flag-unresolved #f)
- (set! global-pass #f)))
- ((fail upass error)
- (set! global-pass #f)))))
-
- ;; Run the tests.
- (for-each (lambda (test)
- (with-test-prefix test
- (load (test-file-name test))))
- tests)
-
- ;; Display the final counts, both to the user and in the log
- ;; file.
- (let ((counts ((cadr counter))))
- (print-counts counts)
- (print-counts counts log-port))
-
- (close-port log-port)
- (quit global-pass))))))
-
-
-;;; Local Variables:
-;;; mode: scheme
-;;; End:
diff --git a/test-suite/lib.scm b/test-suite/lib.scm
deleted file mode 100644
index de242bd11..000000000
--- a/test-suite/lib.scm
+++ /dev/null
@@ -1,484 +0,0 @@
-;;;; test-suite/lib.scm --- generic support for testing
-;;;; Copyright (C) 1999, 2000, 2001 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-(define-module (test-suite lib)
- :use-module (ice-9 stack-catch)
- :use-module (ice-9 regex)
- :export (
-
- ;; Exceptions which are commonly being tested for.
- exception:out-of-range exception:unbound-var
- exception:wrong-num-args exception:wrong-type-arg
-
- ;; Reporting passes and failures.
- run-test
- pass-if expect-fail
- pass-if-exception expect-fail-exception
-
- ;; Naming groups of tests in a regular fashion.
- with-test-prefix with-test-prefix* current-test-prefix
-
- ;; Reporting results in various ways.
- register-reporter unregister-reporter reporter-registered?
- make-count-reporter print-counts
- make-log-reporter
- full-reporter
- user-reporter
- format-test-name))
-
-
-;;;; If you're using Emacs's Scheme mode:
-;;;; (put 'with-test-prefix 'scheme-indent-function 1)
-
-
-;;;; CORE FUNCTIONS
-;;;;
-;;;; The function (run-test name expected-result thunk) is the heart of the
-;;;; testing environment. The first parameter NAME is a unique name for the
-;;;; test to be executed (for an explanation of this parameter see below under
-;;;; TEST NAMES). The second parameter EXPECTED-RESULT is a boolean value
-;;;; that indicates whether the corresponding test is expected to pass. If
-;;;; EXPECTED-RESULT is #t the test is expected to pass, if EXPECTED-RESULT is
-;;;; #f the test is expected to fail. Finally, THUNK is the function that
-;;;; actually performs the test. For example:
-;;;;
-;;;; (run-test "integer addition" #t (lambda () (= 2 (+ 1 1))))
-;;;;
-;;;; To report success, THUNK should either return #t or throw 'pass. To
-;;;; report failure, THUNK should either return #f or throw 'fail. If THUNK
-;;;; returns a non boolean value or throws 'unresolved, this indicates that
-;;;; the test did not perform as expected. For example the property that was
-;;;; to be tested could not be tested because something else went wrong.
-;;;; THUNK may also throw 'untested to indicate that the test was deliberately
-;;;; not performed, for example because the test case is not complete yet.
-;;;; Finally, if THUNK throws 'unsupported, this indicates that this test
-;;;; requires some feature that is not available in the configured testing
-;;;; environment. All other exceptions thrown by THUNK are considered as
-;;;; errors.
-;;;;
-;;;;
-;;;; Convenience macros for tests expected to pass or fail
-;;;;
-;;;; * (pass-if name body) is a short form for
-;;;; (run-test name #t (lambda () body))
-;;;; * (expect-fail name body) is a short form for
-;;;; (run-test name #f (lambda () body))
-;;;;
-;;;; For example:
-;;;;
-;;;; (pass-if "integer addition" (= 2 (+ 1 1)))
-;;;;
-;;;;
-;;;; Convenience macros to test for exceptions
-;;;;
-;;;; The following macros take exception parameters which are pairs
-;;;; (type . message), where type is a symbol that denotes an exception type
-;;;; like 'wrong-type-arg or 'out-of-range, and message is a string holding a
-;;;; regular expression that describes the error message for the exception
-;;;; like "Argument .* out of range".
-;;;;
-;;;; * (pass-if-exception name exception body) will pass if the execution of
-;;;; body causes the given exception to be thrown. If no exception is
-;;;; thrown, the test fails. If some other exception is thrown, is is an
-;;;; error.
-;;;; * (expect-fail-exception name exception body) will pass unexpectedly if
-;;;; the execution of body causes the given exception to be thrown. If no
-;;;; exception is thrown, the test fails expectedly. If some other
-;;;; exception is thrown, it is an error.
-
-
-;;;; TEST NAMES
-;;;;
-;;;; Every test in the test suite has a unique name, to help
-;;;; developers find tests that are failing (or unexpectedly passing),
-;;;; and to help gather statistics.
-;;;;
-;;;; A test name is a list of printable objects. For example:
-;;;; ("ports.scm" "file" "read and write back list of strings")
-;;;; ("ports.scm" "pipe" "read")
-;;;;
-;;;; Test names may contain arbitrary objects, but they always have
-;;;; the following properties:
-;;;; - Test names can be compared with EQUAL?.
-;;;; - Test names can be reliably stored and retrieved with the standard WRITE
-;;;; and READ procedures; doing so preserves their identity.
-;;;;
-;;;; For example:
-;;;;
-;;;; (pass-if "simple addition" (= 4 (+ 2 2)))
-;;;;
-;;;; In that case, the test name is the list ("simple addition").
-;;;;
-;;;; The WITH-TEST-PREFIX syntax and WITH-TEST-PREFIX* procedure establish
-;;;; a prefix for the names of all tests whose results are reported
-;;;; within their dynamic scope. For example:
-;;;;
-;;;; (begin
-;;;; (with-test-prefix "basic arithmetic"
-;;;; (pass-if "addition" (= (+ 2 2) 4))
-;;;; (pass-if "subtraction" (= (- 4 2) 2)))
-;;;; (pass-if "multiplication" (= (* 2 2) 4)))
-;;;;
-;;;; In that example, the three test names are:
-;;;; ("basic arithmetic" "addition"),
-;;;; ("basic arithmetic" "subtraction"), and
-;;;; ("multiplication").
-;;;;
-;;;; WITH-TEST-PREFIX can be nested. Each WITH-TEST-PREFIX postpends
-;;;; a new element to the current prefix:
-;;;;
-;;;; (with-test-prefix "arithmetic"
-;;;; (with-test-prefix "addition"
-;;;; (pass-if "integer" (= (+ 2 2) 4))
-;;;; (pass-if "complex" (= (+ 2+3i 4+5i) 6+8i)))
-;;;; (with-test-prefix "subtraction"
-;;;; (pass-if "integer" (= (- 2 2) 0))
-;;;; (pass-if "complex" (= (- 2+3i 1+2i) 1+1i))))
-;;;;
-;;;; The four test names here are:
-;;;; ("arithmetic" "addition" "integer")
-;;;; ("arithmetic" "addition" "complex")
-;;;; ("arithmetic" "subtraction" "integer")
-;;;; ("arithmetic" "subtraction" "complex")
-;;;;
-;;;; To print a name for a human reader, we DISPLAY its elements,
-;;;; separated by ": ". So, the last set of test names would be
-;;;; reported as:
-;;;;
-;;;; arithmetic: addition: integer
-;;;; arithmetic: addition: complex
-;;;; arithmetic: subtraction: integer
-;;;; arithmetic: subtraction: complex
-;;;;
-;;;; The Guile benchmarks use with-test-prefix to include the name of
-;;;; the source file containing the test in the test name, to help
-;;;; developers to find failing tests, and to provide each file with its
-;;;; own namespace.
-
-
-;;;; REPORTERS
-;;;;
-;;;; A reporter is a function which we apply to each test outcome.
-;;;; Reporters can log results, print interesting results to the
-;;;; standard output, collect statistics, etc.
-;;;;
-;;;; A reporter function takes two mandatory arguments, RESULT and TEST, and
-;;;; possibly additional arguments depending on RESULT; its return value
-;;;; is ignored. RESULT has one of the following forms:
-;;;;
-;;;; pass - The test named TEST passed.
-;;;; Additional arguments are ignored.
-;;;; upass - The test named TEST passed unexpectedly.
-;;;; Additional arguments are ignored.
-;;;; fail - The test named TEST failed.
-;;;; Additional arguments are ignored.
-;;;; xfail - The test named TEST failed, as expected.
-;;;; Additional arguments are ignored.
-;;;; unresolved - The test named TEST did not perform as expected, for
-;;;; example the property that was to be tested could not be
-;;;; tested because something else went wrong.
-;;;; Additional arguments are ignored.
-;;;; untested - The test named TEST was not actually performed, for
-;;;; example because the test case is not complete yet.
-;;;; Additional arguments are ignored.
-;;;; unsupported - The test named TEST requires some feature that is not
-;;;; available in the configured testing environment.
-;;;; Additional arguments are ignored.
-;;;; error - An error occurred while the test named TEST was
-;;;; performed. Since this result means that the system caught
-;;;; an exception it could not handle, the exception arguments
-;;;; are passed as additional arguments.
-;;;;
-;;;; This library provides some standard reporters for logging results
-;;;; to a file, reporting interesting results to the user, and
-;;;; collecting totals.
-;;;;
-;;;; You can use the REGISTER-REPORTER function and friends to add
-;;;; whatever reporting functions you like. If you don't register any
-;;;; reporters, the library uses FULL-REPORTER, which simply writes
-;;;; all results to the standard output.
-
-
-;;;; MISCELLANEOUS
-;;;;
-
-;;; Define some exceptions which are commonly being tested for.
-(define exception:out-of-range
- (cons 'out-of-range "^Argument .*out of range"))
-(define exception:unbound-var
- (cons 'unbound-variable "^Unbound variable"))
-(define exception:wrong-num-args
- (cons 'wrong-number-of-args "^Wrong number of arguments"))
-(define exception:wrong-type-arg
- (cons 'wrong-type-arg "^Wrong type argument"))
-
-;;; Display all parameters to the default output port, followed by a newline.
-(define (display-line . objs)
- (for-each display objs)
- (newline))
-
-;;; Display all parameters to the given output port, followed by a newline.
-(define (display-line-port port . objs)
- (for-each (lambda (obj) (display obj port)) objs)
- (newline port))
-
-
-;;;; CORE FUNCTIONS
-;;;;
-
-;;; The central testing routine.
-;;; The idea is taken from Greg, the GNUstep regression test environment.
-(define run-test #f)
-(let ((test-running #f))
- (define (local-run-test name expect-pass thunk)
- (if test-running
- (error "Nested calls to run-test are not permitted.")
- (let ((test-name (full-name name)))
- (set! test-running #t)
- (catch #t
- (lambda ()
- (let ((result (thunk)))
- (if (eq? result #t) (throw 'pass))
- (if (eq? result #f) (throw 'fail))
- (throw 'unresolved)))
- (lambda (key . args)
- (case key
- ((pass)
- (report (if expect-pass 'pass 'upass) test-name))
- ((fail)
- (report (if expect-pass 'fail 'xfail) test-name))
- ((unresolved untested unsupported)
- (report key test-name))
- ((quit)
- (report 'unresolved test-name)
- (quit))
- (else
- (report 'error test-name (cons key args))))))
- (set! test-running #f))))
- (set! run-test local-run-test))
-
-;;; A short form for tests that are expected to pass, taken from Greg.
-(defmacro pass-if (name body . rest)
- `(run-test ,name #t (lambda () ,body ,@rest)))
-
-;;; A short form for tests that are expected to fail, taken from Greg.
-(defmacro expect-fail (name body . rest)
- `(run-test ,name #f (lambda () ,body ,@rest)))
-
-;;; A helper function to implement the macros that test for exceptions.
-(define (run-test-exception name exception expect-pass thunk)
- (run-test name expect-pass
- (lambda ()
- (stack-catch (car exception)
- (lambda () (thunk) #f)
- (lambda (key proc message . rest)
- (cond
- ;; handle explicit key
- ((string-match (cdr exception) message)
- #t)
- ;; handle `(error ...)' which uses `misc-error' for key and doesn't
- ;; yet format the message and args (we have to do it here).
- ((and (eq? 'misc-error (car exception))
- (list? rest)
- (string-match (cdr exception)
- (apply simple-format #f message (car rest))))
- #t)
- ;; unhandled; throw again
- (else
- (apply throw key proc message rest))))))))
-
-;;; A short form for tests that expect a certain exception to be thrown.
-(defmacro pass-if-exception (name exception body . rest)
- `(,run-test-exception ,name ,exception #t (lambda () ,body ,@rest)))
-
-;;; A short form for tests expected to fail to throw a certain exception.
-(defmacro expect-fail-exception (name exception body . rest)
- `(,run-test-exception ,name ,exception #f (lambda () ,body ,@rest)))
-
-
-;;;; TEST NAMES
-;;;;
-
-;;;; Turn a test name into a nice human-readable string.
-(define (format-test-name name)
- (call-with-output-string
- (lambda (port)
- (let loop ((name name)
- (separator ""))
- (if (pair? name)
- (begin
- (display separator port)
- (display (car name) port)
- (loop (cdr name) ": ")))))))
-
-;;;; For a given test-name, deliver the full name including all prefixes.
-(define (full-name name)
- (append (current-test-prefix) (list name)))
-
-;;; A fluid containing the current test prefix, as a list.
-(define prefix-fluid (make-fluid))
-(fluid-set! prefix-fluid '())
-(define (current-test-prefix)
- (fluid-ref prefix-fluid))
-
-;;; Postpend PREFIX to the current name prefix while evaluting THUNK.
-;;; The name prefix is only changed within the dynamic scope of the
-;;; call to with-test-prefix*. Return the value returned by THUNK.
-(define (with-test-prefix* prefix thunk)
- (with-fluids ((prefix-fluid
- (append (fluid-ref prefix-fluid) (list prefix))))
- (thunk)))
-
-;;; (with-test-prefix PREFIX BODY ...)
-;;; Postpend PREFIX to the current name prefix while evaluating BODY ...
-;;; The name prefix is only changed within the dynamic scope of the
-;;; with-test-prefix expression. Return the value returned by the last
-;;; BODY expression.
-(defmacro with-test-prefix (prefix . body)
- `(with-test-prefix* ,prefix (lambda () ,@body)))
-
-
-;;;; REPORTERS
-;;;;
-
-;;; The global list of reporters.
-(define reporters '())
-
-;;; The default reporter, to be used only if no others exist.
-(define default-reporter #f)
-
-;;; Add the procedure REPORTER to the current set of reporter functions.
-;;; Signal an error if that reporter procedure object is already registered.
-(define (register-reporter reporter)
- (if (memq reporter reporters)
- (error "register-reporter: reporter already registered: " reporter))
- (set! reporters (cons reporter reporters)))
-
-;;; Remove the procedure REPORTER from the current set of reporter
-;;; functions. Signal an error if REPORTER is not currently registered.
-(define (unregister-reporter reporter)
- (if (memq reporter reporters)
- (set! reporters (delq! reporter reporters))
- (error "unregister-reporter: reporter not registered: " reporter)))
-
-;;; Return true iff REPORTER is in the current set of reporter functions.
-(define (reporter-registered? reporter)
- (if (memq reporter reporters) #t #f))
-
-;;; Send RESULT to all currently registered reporter functions.
-(define (report . args)
- (if (pair? reporters)
- (for-each (lambda (reporter) (apply reporter args))
- reporters)
- (apply default-reporter args)))
-
-
-;;;; Some useful standard reporters:
-;;;; Count reporters count the occurrence of each test result type.
-;;;; Log reporters write all test results to a given log file.
-;;;; Full reporters write all test results to the standard output.
-;;;; User reporters write interesting test results to the standard output.
-
-;;; The complete list of possible test results.
-(define result-tags
- '((pass "PASS" "passes: ")
- (fail "FAIL" "failures: ")
- (upass "UPASS" "unexpected passes: ")
- (xfail "XFAIL" "expected failures: ")
- (unresolved "UNRESOLVED" "unresolved test cases: ")
- (untested "UNTESTED" "untested test cases: ")
- (unsupported "UNSUPPORTED" "unsupported test cases: ")
- (error "ERROR" "errors: ")))
-
-;;; The list of important test results.
-(define important-result-tags
- '(fail upass unresolved error))
-
-;;; Display a single test result in formatted form to the given port
-(define (print-result port result name . args)
- (let* ((tag (assq result result-tags))
- (label (if tag (cadr tag) #f)))
- (if label
- (begin
- (display label port)
- (display ": " port)
- (display (format-test-name name) port)
- (if (pair? args)
- (begin
- (display " - arguments: " port)
- (write args port)))
- (newline port))
- (error "(test-suite lib) FULL-REPORTER: unrecognized result: "
- result))))
-
-;;; Return a list of the form (COUNTER RESULTS), where:
-;;; - COUNTER is a reporter procedure, and
-;;; - RESULTS is a procedure taking no arguments which returns the
-;;; results seen so far by COUNTER. The return value is an alist
-;;; mapping outcome symbols (`pass', `fail', etc.) onto counts.
-(define (make-count-reporter)
- (let ((counts (map (lambda (tag) (cons (car tag) 0)) result-tags)))
- (list
- (lambda (result name . args)
- (let ((pair (assq result counts)))
- (if pair
- (set-cdr! pair (+ 1 (cdr pair)))
- (error "count-reporter: unexpected test result: "
- (cons result (cons name args))))))
- (lambda ()
- (append counts '())))))
-
-;;; Print a count reporter's results nicely. Pass this function the value
-;;; returned by a count reporter's RESULTS procedure.
-(define (print-counts results . port?)
- (let ((port (if (pair? port?)
- (car port?)
- (current-output-port))))
- (newline port)
- (display-line-port port "Totals for this test run:")
- (for-each
- (lambda (tag)
- (let ((result (assq (car tag) results)))
- (if result
- (display-line-port port (caddr tag) (cdr result))
- (display-line-port port
- "Test suite bug: "
- "no total available for `" (car tag) "'"))))
- result-tags)
- (newline port)))
-
-;;; Return a reporter procedure which prints all results to the file
-;;; FILE, in human-readable form. FILE may be a filename, or a port.
-(define (make-log-reporter file)
- (let ((port (if (output-port? file) file
- (open-output-file file))))
- (lambda args
- (apply print-result port args)
- (force-output port))))
-
-;;; A reporter that reports all results to the user.
-(define (full-reporter . args)
- (apply print-result (current-output-port) args))
-
-;;; A reporter procedure which shows interesting results (failures,
-;;; unexpected passes etc.) to the user.
-(define (user-reporter result name . args)
- (if (memq result important-result-tags)
- (apply full-reporter result name args)))
-
-(set! default-reporter full-reporter)
diff --git a/test-suite/tests/alist.test b/test-suite/tests/alist.test
deleted file mode 100644
index c25459c53..000000000
--- a/test-suite/tests/alist.test
+++ /dev/null
@@ -1,269 +0,0 @@
-;;;; alist.test --- tests guile's alists -*- scheme -*-
-;;;; Copyright (C) 1999, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-
-(use-modules (test-suite lib))
-
-;;; (gbh) some of these are duplicated in r4rs. This is probably a bit
-;;; more thorough, though (maybe overkill? I need it, anyway).
-;;;
-;;;
-;;; Also: it will fail on the ass*-ref & remove functions.
-;;; Sloppy versions should be added with the current behaviour
-;;; (it's the only set of 'ref functions that won't cause an
-;;; error on an incorrect arg); they aren't actually used anywhere
-;;; so changing's not a big deal.
-
-;;; Misc
-
-(define-macro (pass-if-not str form)
- `(pass-if ,str (not ,form)))
-
-(define (safe-assq-ref alist elt)
- (let ((x (assq elt alist)))
- (if x (cdr x) x)))
-
-(define (safe-assv-ref alist elt)
- (let ((x (assv elt alist)))
- (if x (cdr x) x)))
-
-(define (safe-assoc-ref alist elt)
- (let ((x (assoc elt alist)))
- (if x (cdr x) x)))
-
-;;; Creators, getters
-(let ((a (acons 'a 'b (acons 'c 'd (acons 'e 'f '()))))
- (b (acons "this" "is" (acons "a" "test" '())))
- (deformed '(a b c d e f g)))
- (pass-if "acons"
- (and (equal? a '((a . b) (c . d) (e . f)))
- (equal? b '(("this" . "is") ("a" . "test")))))
- (pass-if "sloppy-assq"
- (let ((x (sloppy-assq 'c a)))
- (and (pair? x)
- (eq? (car x) 'c)
- (eq? (cdr x) 'd))))
- (pass-if "sloppy-assq not"
- (let ((x (sloppy-assq "this" b)))
- (not x)))
- (pass-if "sloppy-assv"
- (let ((x (sloppy-assv 'c a)))
- (and (pair? x)
- (eq? (car x) 'c)
- (eq? (cdr x) 'd))))
- (pass-if "sloppy-assv not"
- (let ((x (sloppy-assv "this" b)))
- (not x)))
- (pass-if "sloppy-assoc"
- (let ((x (sloppy-assoc "this" b)))
- (and (pair? x)
- (string=? (cdr x) "is"))))
- (pass-if "sloppy-assoc not"
- (let ((x (sloppy-assoc "heehee" b)))
- (not x)))
- (pass-if "assq"
- (let ((x (assq 'c a)))
- (and (pair? x)
- (eq? (car x) 'c)
- (eq? (cdr x) 'd))))
- (pass-if-exception "assq deformed"
- exception:wrong-type-arg
- (assq 'x deformed))
- (pass-if-not "assq not" (assq 'r a))
- (pass-if "assv"
- (let ((x (assv 'a a)))
- (and (pair? x)
- (eq? (car x) 'a)
- (eq? (cdr x) 'b))))
- (pass-if-exception "assv deformed"
- exception:wrong-type-arg
- (assv 'x deformed))
- (pass-if-not "assv not" (assq "this" b))
-
- (pass-if "assoc"
- (let ((x (assoc "this" b)))
- (and (pair? x)
- (string=? (car x) "this")
- (string=? (cdr x) "is"))))
- (pass-if-exception "assoc deformed"
- exception:wrong-type-arg
- (assoc 'x deformed))
- (pass-if-not "assoc not" (assoc "this isn't" b)))
-
-
-;;; Refers
-(let ((a '((foo bar) (baz quux)))
- (b '(("one" 2 3) ("four" 5 6) ("seven" 8 9)))
- (deformed '(thats a real sloppy assq you got there)))
- (pass-if "assq-ref"
- (let ((x (assq-ref a 'foo)))
- (and (list? x)
- (eq? (car x) 'bar))))
-
- (pass-if-not "assq-ref not" (assq-ref b "one"))
- (pass-if "assv-ref"
- (let ((x (assv-ref a 'baz)))
- (and (list? x)
- (eq? (car x) 'quux))))
-
- (pass-if-not "assv-ref not" (assv-ref b "one"))
-
- (pass-if "assoc-ref"
- (let ((x (assoc-ref b "one")))
- (and (list? x)
- (eq? (car x) 2)
- (eq? (cadr x) 3))))
-
-
- (pass-if-not "assoc-ref not" (assoc-ref a 'testing))
-
- (let* ((have-sloppy-assv-ref? (defined? 'sloppy-assv-ref)))
-
- (pass-if-exception "assv-ref deformed"
- exception:wrong-type-arg
- (if (not have-sloppy-assv-ref?) (throw 'unsupported))
- (assv-ref deformed 'sloppy))
-
- (pass-if-exception "assoc-ref deformed"
- exception:wrong-type-arg
- (if (not have-sloppy-assv-ref?) (throw 'unsupported))
- (assoc-ref deformed 'sloppy))
-
- (pass-if-exception "assq-ref deformed"
- exception:wrong-type-arg
- (if (not have-sloppy-assv-ref?) (throw 'unsupported))
- (assq-ref deformed 'sloppy))))
-
-
-;;; Setters
-(let ((a '((another . silly) (alist . test-case)))
- (b '(("this" "one" "has") ("strings" "!")))
- (deformed '(canada is a cold nation)))
- (pass-if "assq-set!"
- (begin
- (set! a (assq-set! a 'another 'stupid))
- (let ((x (safe-assq-ref a 'another)))
- (and x
- (symbol? x) (eq? x 'stupid)))))
-
- (pass-if "assq-set! add"
- (begin
- (set! a (assq-set! a 'fickle 'pickle))
- (let ((x (safe-assq-ref a 'fickle)))
- (and x (symbol? x)
- (eq? x 'pickle)))))
-
- (pass-if "assv-set!"
- (begin
- (set! a (assv-set! a 'another 'boring))
- (let ((x (safe-assv-ref a 'another)))
- (and x
- (eq? x 'boring)))))
- (pass-if "assv-set! add"
- (begin
- (set! a (assv-set! a 'whistle '(while you work)))
- (let ((x (safe-assv-ref a 'whistle)))
- (and x (equal? x '(while you work))))))
-
- (pass-if "assoc-set!"
- (begin
- (set! b (assoc-set! b "this" "has"))
- (let ((x (safe-assoc-ref b "this")))
- (and x (string? x)
- (string=? x "has")))))
- (pass-if "assoc-set! add"
- (begin
- (set! b (assoc-set! b "flugle" "horn"))
- (let ((x (safe-assoc-ref b "flugle")))
- (and x (string? x)
- (string=? x "horn")))))
-
- (let* ((have-sloppy-assv-ref? (defined? 'sloppy-assv-ref)))
-
- (pass-if-exception "assq-set! deformed"
- exception:wrong-type-arg
- (if (not have-sloppy-assv-ref?) (throw 'unsupported))
- (assq-set! deformed 'cold '(very cold)))
-
- (pass-if-exception "assv-set! deformed"
- exception:wrong-type-arg
- (if (not have-sloppy-assv-ref?) (throw 'unsupported))
- (assv-set! deformed 'canada 'Canada))
-
- (pass-if-exception "assoc-set! deformed"
- exception:wrong-type-arg
- (if (not have-sloppy-assv-ref?) (throw 'unsupported))
- (assoc-set! deformed 'canada '(Iceland hence the name)))))
-
-;;; Removers
-
-(let ((a '((a b) (c d) (e boring)))
- (b '(("what" . "else") ("could" . "I") ("say" . "here")))
- (deformed 1))
- (pass-if "assq-remove!"
- (begin
- (set! a (assq-remove! a 'a))
- (equal? a '((c d) (e boring)))))
- (pass-if "assv-remove!"
- (begin
- (set! a (assv-remove! a 'c))
- (equal? a '((e boring)))))
- (pass-if "assoc-remove!"
- (begin
- (set! b (assoc-remove! b "what"))
- (equal? b '(("could" . "I") ("say" . "here")))))
-
- (let* ((have-sloppy-assq-remove? (defined? 'sloppy-assq-remove)))
-
- (pass-if-exception "assq-remove! deformed"
- exception:wrong-type-arg
- (if (not have-sloppy-assq-remove?) (throw 'unsupported))
- (assq-remove! deformed 'puddle))
-
- (pass-if-exception "assv-remove! deformed"
- exception:wrong-type-arg
- (if (not have-sloppy-assq-remove?) (throw 'unsupported))
- (assv-remove! deformed 'splashing))
-
- (pass-if-exception "assoc-remove! deformed"
- exception:wrong-type-arg
- (if (not have-sloppy-assq-remove?) (throw 'unsupported))
- (assoc-remove! deformed 'fun))))
diff --git a/test-suite/tests/asmobs/Makefile b/test-suite/tests/asmobs/Makefile
deleted file mode 100644
index e69de29bb..000000000
--- a/test-suite/tests/asmobs/Makefile
+++ /dev/null
diff --git a/test-suite/tests/asmobs/README b/test-suite/tests/asmobs/README
deleted file mode 100644
index e69de29bb..000000000
--- a/test-suite/tests/asmobs/README
+++ /dev/null
diff --git a/test-suite/tests/asmobs/asmobs-test.scm b/test-suite/tests/asmobs/asmobs-test.scm
deleted file mode 100644
index e69de29bb..000000000
--- a/test-suite/tests/asmobs/asmobs-test.scm
+++ /dev/null
diff --git a/test-suite/tests/asmobs/asmobs.c b/test-suite/tests/asmobs/asmobs.c
deleted file mode 100644
index e69de29bb..000000000
--- a/test-suite/tests/asmobs/asmobs.c
+++ /dev/null
diff --git a/test-suite/tests/bit-operations.test b/test-suite/tests/bit-operations.test
deleted file mode 100644
index 47cca5fdc..000000000
--- a/test-suite/tests/bit-operations.test
+++ /dev/null
@@ -1,354 +0,0 @@
-;;;; bit-operations.test --- bitwise operations on numbers -*- scheme -*-
-;;;; Copyright (C) 2000, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-
-(use-modules (ice-9 documentation))
-
-
-;;;
-;;; miscellaneous
-;;;
-
-(define (run-tests name-proc test-proc arg-sets)
- (for-each
- (lambda (arg-set)
- (pass-if (apply name-proc arg-set)
- (apply test-proc arg-set)))
- arg-sets))
-
-(define (documented? object)
- (not (not (object-documentation object))))
-
-(define fixnum-bit
- (inexact->exact (+ (/ (log (+ most-positive-fixnum 1)) (log 2)) 1)))
-
-(define fixnum-min most-negative-fixnum)
-(define fixnum-max most-positive-fixnum)
-
-(with-test-prefix "bit-extract"
-
- (pass-if "documented?"
- (documented? bit-extract))
-
- (with-test-prefix "extract from zero"
-
- (run-tests
- (lambda (a b c d)
- (string-append "single bit " (number->string b)))
- (lambda (a b c d)
- (= (bit-extract a b c) d))
- (list
- (list 0 0 1 0)
- (list 0 1 2 0)
- (list 0 (+ fixnum-bit -2) (+ fixnum-bit -1) 0)
- (list 0 (+ fixnum-bit -1) (+ fixnum-bit 0) 0)
- (list 0 (+ fixnum-bit 0) (+ fixnum-bit 1) 0)
- (list 0 (+ fixnum-bit 1) (+ fixnum-bit 2) 0)))
-
- (run-tests
- (lambda (a b c d)
- (string-append "fixnum-bit - 1 bits starting at " (number->string b)))
- (lambda (a b c d)
- (= (bit-extract a b c) d))
- (list
- (list 0 0 (+ fixnum-bit -1) 0)
- (list 0 1 (+ fixnum-bit 0) 0)
- (list 0 2 (+ fixnum-bit 1) 0)
- (list 0 (+ fixnum-bit -2) (+ fixnum-bit fixnum-bit -3) 0)
- (list 0 (+ fixnum-bit -1) (+ fixnum-bit fixnum-bit -2) 0)
- (list 0 (+ fixnum-bit 0) (+ fixnum-bit fixnum-bit -1) 0)
- (list 0 (+ fixnum-bit 1) (+ fixnum-bit fixnum-bit 0) 0)))
-
- (run-tests
- (lambda (a b c d)
- (string-append "fixnum-bit bits starting at " (number->string b)))
- (lambda (a b c d)
- (= (bit-extract a b c) d))
- (list
- (list 0 0 (+ fixnum-bit 0) 0)
- (list 0 1 (+ fixnum-bit 1) 0)
- (list 0 2 (+ fixnum-bit 2) 0)
- (list 0 (+ fixnum-bit -2) (+ fixnum-bit fixnum-bit -2) 0)
- (list 0 (+ fixnum-bit -1) (+ fixnum-bit fixnum-bit -1) 0)
- (list 0 (+ fixnum-bit 0) (+ fixnum-bit fixnum-bit 0) 0)
- (list 0 (+ fixnum-bit 1) (+ fixnum-bit fixnum-bit 1) 0)))
-
- (run-tests
- (lambda (a b c d)
- (string-append "fixnum-bit + 1 bits starting at " (number->string b)))
- (lambda (a b c d)
- (= (bit-extract a b c) d))
- (list
- (list 0 0 (+ fixnum-bit 1) 0)
- (list 0 1 (+ fixnum-bit 2) 0)
- (list 0 2 (+ fixnum-bit 3) 0)
- (list 0 (+ fixnum-bit -2) (+ fixnum-bit fixnum-bit -1) 0)
- (list 0 (+ fixnum-bit -1) (+ fixnum-bit fixnum-bit 0) 0)
- (list 0 (+ fixnum-bit 0) (+ fixnum-bit fixnum-bit 1) 0)
- (list 0 (+ fixnum-bit 1) (+ fixnum-bit fixnum-bit 2) 0))))
-
- (with-test-prefix "extract from fixnum-max"
-
- (run-tests
- (lambda (a b c d)
- (string-append "single bit " (number->string b)))
- (lambda (a b c d)
- (= (bit-extract a b c) d))
- (list
- (list fixnum-max 0 1 1)
- (list fixnum-max 1 2 1)
- (list fixnum-max (+ fixnum-bit -2) (+ fixnum-bit -1) 1)
- (list fixnum-max (+ fixnum-bit -1) (+ fixnum-bit 0) 0)
- (list fixnum-max (+ fixnum-bit 0) (+ fixnum-bit 1) 0)
- (list fixnum-max (+ fixnum-bit 1) (+ fixnum-bit 2) 0)))
-
- (run-tests
- (lambda (a b c d)
- (string-append "fixnum-bit - 1 bits starting at " (number->string b)))
- (lambda (a b c d)
- (= (bit-extract a b c) d))
- (list
- (list fixnum-max 0 (+ fixnum-bit -1) (ash fixnum-max 0))
- (list fixnum-max 1 (+ fixnum-bit 0) (ash fixnum-max -1))
- (list fixnum-max 2 (+ fixnum-bit 1) (ash fixnum-max -2))
- (list fixnum-max (+ fixnum-bit -2) (+ fixnum-bit fixnum-bit -3) 1)
- (list fixnum-max (+ fixnum-bit -1) (+ fixnum-bit fixnum-bit -2) 0)
- (list fixnum-max (+ fixnum-bit 0) (+ fixnum-bit fixnum-bit -1) 0)
- (list fixnum-max (+ fixnum-bit 1) (+ fixnum-bit fixnum-bit 0) 0)))
-
- (run-tests
- (lambda (a b c d)
- (string-append "fixnum-bit bits starting at " (number->string b)))
- (lambda (a b c d)
- (= (bit-extract a b c) d))
- (list
- (list fixnum-max 0 (+ fixnum-bit 0) (ash fixnum-max 0))
- (list fixnum-max 1 (+ fixnum-bit 1) (ash fixnum-max -1))
- (list fixnum-max 2 (+ fixnum-bit 2) (ash fixnum-max -2))
- (list fixnum-max (+ fixnum-bit -2) (+ fixnum-bit fixnum-bit -2) 1)
- (list fixnum-max (+ fixnum-bit -1) (+ fixnum-bit fixnum-bit -1) 0)
- (list fixnum-max (+ fixnum-bit 0) (+ fixnum-bit fixnum-bit 0) 0)
- (list fixnum-max (+ fixnum-bit 1) (+ fixnum-bit fixnum-bit 1) 0)))
-
- (run-tests
- (lambda (a b c d)
- (string-append "fixnum-bit + 1 bits starting at " (number->string b)))
- (lambda (a b c d)
- (= (bit-extract a b c) d))
- (list
- (list fixnum-max 0 (+ fixnum-bit 1) (ash fixnum-max 0))
- (list fixnum-max 1 (+ fixnum-bit 2) (ash fixnum-max -1))
- (list fixnum-max 2 (+ fixnum-bit 3) (ash fixnum-max -2))
- (list fixnum-max (+ fixnum-bit -2) (+ fixnum-bit fixnum-bit -1) 1)
- (list fixnum-max (+ fixnum-bit -1) (+ fixnum-bit fixnum-bit 0) 0)
- (list fixnum-max (+ fixnum-bit 0) (+ fixnum-bit fixnum-bit 1) 0)
- (list fixnum-max (+ fixnum-bit 1) (+ fixnum-bit fixnum-bit 2) 0))))
-
- (with-test-prefix "extract from fixnum-max + 1"
-
- (run-tests
- (lambda (a b c d)
- (string-append "single bit " (number->string b)))
- (lambda (a b c d)
- (= (bit-extract a b c) d))
- (list
- (list (+ fixnum-max 1) 0 1 0)
- (list (+ fixnum-max 1) 1 2 0)
- (list (+ fixnum-max 1) (+ fixnum-bit -2) (+ fixnum-bit -1) 0)
- (list (+ fixnum-max 1) (+ fixnum-bit -1) (+ fixnum-bit 0) 1)
- (list (+ fixnum-max 1) (+ fixnum-bit 0) (+ fixnum-bit 1) 0)
- (list (+ fixnum-max 1) (+ fixnum-bit 1) (+ fixnum-bit 2) 0)))
-
- (run-tests
- (lambda (a b c d)
- (string-append "fixnum-bit - 1 bits starting at " (number->string b)))
- (lambda (a b c d)
- (= (bit-extract a b c) d))
- (list
- (list (+ fixnum-max 1) 0 (+ fixnum-bit -1) (ash 0 (- fixnum-bit 1)))
- (list (+ fixnum-max 1) 1 (+ fixnum-bit 0) (ash 1 (- fixnum-bit 2)))
- (list (+ fixnum-max 1) 2 (+ fixnum-bit 1) (ash 1 (- fixnum-bit 3)))
- (list (+ fixnum-max 1) (+ fixnum-bit -2) (+ fixnum-bit fixnum-bit -3) 2)
- (list (+ fixnum-max 1) (+ fixnum-bit -1) (+ fixnum-bit fixnum-bit -2) 1)
- (list (+ fixnum-max 1) (+ fixnum-bit 0) (+ fixnum-bit fixnum-bit -1) 0)
- (list (+ fixnum-max 1) (+ fixnum-bit 1) (+ fixnum-bit fixnum-bit 0) 0)))
-
- (run-tests
- (lambda (a b c d)
- (string-append "fixnum-bit bits starting at " (number->string b)))
- (lambda (a b c d)
- (= (bit-extract a b c) d))
- (list
- (list (+ fixnum-max 1) 0 (+ fixnum-bit 0) (ash 1 (- fixnum-bit 1)))
- (list (+ fixnum-max 1) 1 (+ fixnum-bit 1) (ash 1 (- fixnum-bit 2)))
- (list (+ fixnum-max 1) 2 (+ fixnum-bit 2) (ash 1 (- fixnum-bit 3)))
- (list (+ fixnum-max 1) (+ fixnum-bit -2) (+ fixnum-bit fixnum-bit -2) 2)
- (list (+ fixnum-max 1) (+ fixnum-bit -1) (+ fixnum-bit fixnum-bit -1) 1)
- (list (+ fixnum-max 1) (+ fixnum-bit 0) (+ fixnum-bit fixnum-bit 0) 0)
- (list (+ fixnum-max 1) (+ fixnum-bit 1) (+ fixnum-bit fixnum-bit 1) 0)))
-
- (run-tests
- (lambda (a b c d)
- (string-append "fixnum-bit + 1 bits starting at " (number->string b)))
- (lambda (a b c d)
- (= (bit-extract a b c) d))
- (list
- (list (+ fixnum-max 1) 0 (+ fixnum-bit 1) (ash 1 (- fixnum-bit 1)))
- (list (+ fixnum-max 1) 1 (+ fixnum-bit 2) (ash 1 (- fixnum-bit 2)))
- (list (+ fixnum-max 1) 2 (+ fixnum-bit 3) (ash 1 (- fixnum-bit 3)))
- (list (+ fixnum-max 1) (+ fixnum-bit -2) (+ fixnum-bit fixnum-bit -1) 2)
- (list (+ fixnum-max 1) (+ fixnum-bit -1) (+ fixnum-bit fixnum-bit 0) 1)
- (list (+ fixnum-max 1) (+ fixnum-bit 0) (+ fixnum-bit fixnum-bit 1) 0)
- (list (+ fixnum-max 1) (+ fixnum-bit 1) (+ fixnum-bit fixnum-bit 2) 0))))
-
- (with-test-prefix "extract from fixnum-min"
-
- (run-tests
- (lambda (a b c d)
- (string-append "single bit " (number->string b)))
- (lambda (a b c d)
- (= (bit-extract a b c) d))
- (list
- (list fixnum-min 0 1 0)
- (list fixnum-min 1 2 0)
- (list fixnum-min (+ fixnum-bit -2) (+ fixnum-bit -1) 0)
- (list fixnum-min (+ fixnum-bit -1) (+ fixnum-bit 0) 1)
- (list fixnum-min (+ fixnum-bit 0) (+ fixnum-bit 1) 1)
- (list fixnum-min (+ fixnum-bit 1) (+ fixnum-bit 2) 1)))
-
- (run-tests
- (lambda (a b c d)
- (string-append "fixnum-bit - 1 bits starting at " (number->string b)))
- (lambda (a b c d)
- (= (bit-extract a b c) d))
- (list
- (list fixnum-min 0 (+ fixnum-bit -1) (ash 0 (- fixnum-bit 1)))
- (list fixnum-min 1 (+ fixnum-bit 0) (ash 1 (- fixnum-bit 2)))
- (list fixnum-min 2 (+ fixnum-bit 1) (ash 3 (- fixnum-bit 3)))
- (list fixnum-min (+ fixnum-bit -2) (+ fixnum-bit fixnum-bit -3) (- (ash 1 (- fixnum-bit 1)) 2))
- (list fixnum-min (+ fixnum-bit -1) (+ fixnum-bit fixnum-bit -2) (- (ash 1 (- fixnum-bit 1)) 1))
- (list fixnum-min (+ fixnum-bit 0) (+ fixnum-bit fixnum-bit -1) (- (ash 1 (- fixnum-bit 1)) 1))
- (list fixnum-min (+ fixnum-bit 1) (+ fixnum-bit fixnum-bit 0) (- (ash 1 (- fixnum-bit 1)) 1))))
-
- (run-tests
- (lambda (a b c d)
- (string-append "fixnum-bit bits starting at " (number->string b)))
- (lambda (a b c d)
- (= (bit-extract a b c) d))
- (list
- (list fixnum-min 0 (+ fixnum-bit 0) (ash 1 (- fixnum-bit 1)))
- (list fixnum-min 1 (+ fixnum-bit 1) (ash 3 (- fixnum-bit 2)))
- (list fixnum-min 2 (+ fixnum-bit 2) (ash 7 (- fixnum-bit 3)))
- (list fixnum-min (+ fixnum-bit -2) (+ fixnum-bit fixnum-bit -2) (- (ash 1 fixnum-bit) 2))
- (list fixnum-min (+ fixnum-bit -1) (+ fixnum-bit fixnum-bit -1) (- (ash 1 fixnum-bit) 1))
- (list fixnum-min (+ fixnum-bit 0) (+ fixnum-bit fixnum-bit 0) (- (ash 1 fixnum-bit) 1))
- (list fixnum-min (+ fixnum-bit 1) (+ fixnum-bit fixnum-bit 1) (- (ash 1 fixnum-bit) 1))))
-
- (run-tests
- (lambda (a b c d)
- (string-append "fixnum-bit + 1 bits starting at " (number->string b)))
- (lambda (a b c d)
- (= (bit-extract a b c) d))
- (list
- (list fixnum-min 0 (+ fixnum-bit 1) (ash 3 (- fixnum-bit 1)))
- (list fixnum-min 1 (+ fixnum-bit 2) (ash 7 (- fixnum-bit 2)))
- (list fixnum-min 2 (+ fixnum-bit 3) (ash 15 (- fixnum-bit 3)))
- (list fixnum-min (+ fixnum-bit -2) (+ fixnum-bit fixnum-bit -1) (- (ash 1 (+ fixnum-bit 1)) 2))
- (list fixnum-min (+ fixnum-bit -1) (+ fixnum-bit fixnum-bit 0) (- (ash 1 (+ fixnum-bit 1)) 1))
- (list fixnum-min (+ fixnum-bit 0) (+ fixnum-bit fixnum-bit 1) (- (ash 1 (+ fixnum-bit 1)) 1))
- (list fixnum-min (+ fixnum-bit 1) (+ fixnum-bit fixnum-bit 2) (- (ash 1 (+ fixnum-bit 1)) 1)))))
-
- (with-test-prefix "extract from fixnum-min - 1"
-
- (run-tests
- (lambda (a b c d)
- (string-append "single bit " (number->string b)))
- (lambda (a b c d)
- (= (bit-extract a b c) d))
- (list
- (list (- fixnum-min 1) 0 1 1)
- (list (- fixnum-min 1) 1 2 1)
- (list (- fixnum-min 1) (+ fixnum-bit -2) (+ fixnum-bit -1) 1)
- (list (- fixnum-min 1) (+ fixnum-bit -1) (+ fixnum-bit 0) 0)
- (list (- fixnum-min 1) (+ fixnum-bit 0) (+ fixnum-bit 1) 1)
- (list (- fixnum-min 1) (+ fixnum-bit 1) (+ fixnum-bit 2) 1)))
-
- (run-tests
- (lambda (a b c d)
- (string-append "fixnum-bit - 1 bits starting at " (number->string b)))
- (lambda (a b c d)
- (= (bit-extract a b c) d))
- (list
- (list (- fixnum-min 1) 0 (+ fixnum-bit -1) (- (ash 1 (- fixnum-bit 1)) 1 (ash 0 (- fixnum-bit 1))))
- (list (- fixnum-min 1) 1 (+ fixnum-bit 0) (- (ash 1 (- fixnum-bit 1)) 1 (ash 1 (- fixnum-bit 2))))
- (list (- fixnum-min 1) 2 (+ fixnum-bit 1) (- (ash 1 (- fixnum-bit 1)) 1 (ash 1 (- fixnum-bit 3))))
- (list (- fixnum-min 1) (+ fixnum-bit -2) (+ fixnum-bit fixnum-bit -3) (- (ash 1 (- fixnum-bit 1)) 3))
- (list (- fixnum-min 1) (+ fixnum-bit -1) (+ fixnum-bit fixnum-bit -2) (- (ash 1 (- fixnum-bit 1)) 2))
- (list (- fixnum-min 1) (+ fixnum-bit 0) (+ fixnum-bit fixnum-bit -1) (- (ash 1 (- fixnum-bit 1)) 1))
- (list (- fixnum-min 1) (+ fixnum-bit 1) (+ fixnum-bit fixnum-bit 0) (- (ash 1 (- fixnum-bit 1)) 1))))
-
- (run-tests
- (lambda (a b c d)
- (string-append "fixnum-bit bits starting at " (number->string b)))
- (lambda (a b c d)
- (= (bit-extract a b c) d))
- (list
- (list (- fixnum-min 1) 0 (+ fixnum-bit 0) (- (ash 1 fixnum-bit) 1 (ash 1 (- fixnum-bit 1))))
- (list (- fixnum-min 1) 1 (+ fixnum-bit 1) (- (ash 1 fixnum-bit) 1 (ash 1 (- fixnum-bit 2))))
- (list (- fixnum-min 1) 2 (+ fixnum-bit 2) (- (ash 1 fixnum-bit) 1 (ash 1 (- fixnum-bit 3))))
- (list (- fixnum-min 1) (+ fixnum-bit -2) (+ fixnum-bit fixnum-bit -2) (- (ash 1 fixnum-bit) 3))
- (list (- fixnum-min 1) (+ fixnum-bit -1) (+ fixnum-bit fixnum-bit -1) (- (ash 1 fixnum-bit) 2))
- (list (- fixnum-min 1) (+ fixnum-bit 0) (+ fixnum-bit fixnum-bit 0) (- (ash 1 fixnum-bit) 1))
- (list (- fixnum-min 1) (+ fixnum-bit 1) (+ fixnum-bit fixnum-bit 1) (- (ash 1 fixnum-bit) 1))))
-
- (run-tests
- (lambda (a b c d)
- (string-append "fixnum-bit + 1 bits starting at " (number->string b)))
- (lambda (a b c d)
- (= (bit-extract a b c) d))
- (list
- (list (- fixnum-min 1) 0 (+ fixnum-bit 1) (- (ash 1 (+ fixnum-bit 1)) 1 (ash 1 (- fixnum-bit 1))))
- (list (- fixnum-min 1) 1 (+ fixnum-bit 2) (- (ash 1 (+ fixnum-bit 1)) 1 (ash 1 (- fixnum-bit 2))))
- (list (- fixnum-min 1) 2 (+ fixnum-bit 3) (- (ash 1 (+ fixnum-bit 1)) 1 (ash 1 (- fixnum-bit 3))))
- (list (- fixnum-min 1) (+ fixnum-bit -2) (+ fixnum-bit fixnum-bit -1) (- (ash 1 (+ fixnum-bit 1)) 3))
- (list (- fixnum-min 1) (+ fixnum-bit -1) (+ fixnum-bit fixnum-bit 0) (- (ash 1 (+ fixnum-bit 1)) 2))
- (list (- fixnum-min 1) (+ fixnum-bit 0) (+ fixnum-bit fixnum-bit 1) (- (ash 1 (+ fixnum-bit 1)) 1))
- (list (- fixnum-min 1) (+ fixnum-bit 1) (+ fixnum-bit fixnum-bit 2) (- (ash 1 (+ fixnum-bit 1)) 1))))))
diff --git a/test-suite/tests/c-api.test b/test-suite/tests/c-api.test
deleted file mode 100644
index 97146ea8a..000000000
--- a/test-suite/tests/c-api.test
+++ /dev/null
@@ -1,46 +0,0 @@
-;;;; c-api.test --- complementary test suite for the c-api -*- scheme -*-
-;;;; MDJ 990915 <djurfeldt@nada.kth.se>
-;;;;
-;;;; Copyright (C) 1999 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-(define srcdir (cdr (assq 'srcdir %guile-build-info)))
-
-(define (egrep string filename)
- (zero? (system (string-append "egrep '" string "' " filename " >/dev/null"))))
-
-(define (seek-offset-test dirname)
- (let ((dir (opendir dirname)))
- (do ((filename (readdir dir) (readdir dir)))
- ((eof-object? filename))
- (if (and
- (eqv? (string-ref filename (- (string-length filename) 1)) #\c)
- (eqv? (string-ref filename (- (string-length filename) 2)) #\.))
- (let ((file (string-append dirname "/" filename)))
- (if (and (file-exists? file)
- (egrep "SEEK_(SET|CUR|END)" file)
- (not (egrep "unistd.h" file)))
- (fail file)))))))
-
-;;; A rough conservative test to check that all source files
-;;; which use SEEK_SET, SEEK_CUR, and SEEK_END include unistd.h.
-;;;
-;;; If this test start to trigger without reason, we just modify it
-;;; to be more precise.
-(with-test-prefix "SEEK_XXX => #include <unistd.h>"
- (if (file-exists? srcdir)
- (seek-offset-test srcdir)))
diff --git a/test-suite/tests/c-api/Makefile b/test-suite/tests/c-api/Makefile
deleted file mode 100644
index 44488af50..000000000
--- a/test-suite/tests/c-api/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-CC = gcc
-CFLAGS = -g `guile-config compile`
-
-all: strings
-
-strings: strings.o testlib.o
- ${CC} ${CFLAGS} ${LDFLAGS} -o strings strings.o testlib.o \
- `guile-config link`
-
-strings.o: strings.c testlib.h
-testlib.o: testlib.c testlib.h
-
-
-clean:
- rm -f strings
- rm -f *.o
diff --git a/test-suite/tests/c-api/README b/test-suite/tests/c-api/README
deleted file mode 100644
index f041346ad..000000000
--- a/test-suite/tests/c-api/README
+++ /dev/null
@@ -1,7 +0,0 @@
-This directory contains tests for Guile's C API. At the moment, the
-test suite doesn't have any way to run these automatically --- we need
-to 1) figure out how to run the compiler, and 2) figure out how to
-integrate results from C tests into the test suite statistics.
-
-Nonetheless, it's better to have this code accumulating here than
-someplace else where nobody can find it.
diff --git a/test-suite/tests/c-api/strings.c b/test-suite/tests/c-api/strings.c
deleted file mode 100644
index 13cfcf0ef..000000000
--- a/test-suite/tests/c-api/strings.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/* strings.c --- test the Guile C API's string handling functions
- Jim Blandy <jimb@red-bean.com> --- August 1999 */
-
-#include <guile/gh.h>
-
-#include "testlib.h"
-
-static int
-string_equal (SCM str, char *lit)
-{
- int len = strlen (lit);
-
- return (SCM_LENGTH (str) == len
- && ! memcmp (SCM_ROCHARS (str), lit, len));
-}
-
-void
-test_gh_set_substr ()
-{
- test_context_t cx = test_enter_context ("gh_set_substr");
- SCM string;
-
- string = gh_str02scm ("Free, darnit!");
- test_pass_if ("make a string", gh_string_p (string));
-
- gh_set_substr ("dammit", string, 6, 6);
- test_pass_if ("gh_set_substr from literal",
- string_equal (string, "Free, dammit!"));
-
- /* Make sure that we can use the string itself as a source.
-
- I guess this behavior isn't really visible, since the GH API
- doesn't provide any direct access to the string contents. But I
- think it should, eventually. You can't write efficient string
- code if you have to copy the string just to look at it. */
-
- /* Copy a substring to an overlapping region to its right. */
- gh_set_substr (SCM_CHARS (string), string, 4, 6);
- test_pass_if ("gh_set_substr shifting right",
- string_equal (string, "FreeFree, it!"));
-
- string = gh_str02scm ("Free, darnit!");
- test_pass_if ("make another string", gh_string_p (string));
-
- /* Copy a substring to an overlapping region to its left. */
- gh_set_substr (SCM_CHARS (string) + 6, string, 2, 6);
- test_pass_if ("gh_set_substr shifting right",
- string_equal (string, "Frdarnitrnit!"));
-
- test_restore_context (cx);
-}
-
-void
-main_prog (int argc, char *argv[])
-{
- test_context_t strings = test_enter_context ("strings.c");
-
- test_gh_set_substr ();
-
- test_restore_context (strings);
-
- exit (test_summarize ());
-}
-
-int
-main (int argc, char *argv[])
-{
- gh_enter (argc, argv, main_prog);
- return 0;
-}
diff --git a/test-suite/tests/c-api/testlib.c b/test-suite/tests/c-api/testlib.c
deleted file mode 100644
index 21fff2492..000000000
--- a/test-suite/tests/c-api/testlib.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/* testlib.c --- reporting test results
- Jim Blandy <jimb@red-bean.com> --- August 1999 */
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "testlib.h"
-
-
-
-/* Dying. */
-
-static void
-fatal (char *message)
-{
- fprintf (stderr, "%s\n", message);
- exit (1);
-}
-
-
-/* Contexts. */
-
-/* If it gets deeper than this, that's probably an error, right? */
-#define MAX_NESTING 10
-
-int depth = 0;
-char *context_name_stack[MAX_NESTING];
-int marker;
-int context_marker_stack[MAX_NESTING];
-
-test_context_t
-test_enter_context (char *name)
-{
- if (depth >= MAX_NESTING)
- fatal ("test contexts nested too deeply");
-
- /* Generate a unique marker value for this context. */
- marker++;
-
- context_name_stack[depth] = name;
- context_marker_stack[depth] = marker;
-
- depth++;
-
- return marker;
-}
-
-void
-test_restore_context (test_context_t context)
-{
- if (depth <= 0)
- fatal ("attempt to leave outermost context");
-
- depth--;
-
- /* Make sure that we're exiting the same context we last entered. */
- if (context_marker_stack[depth] != context)
- fatal ("contexts not nested properly");
-}
-
-
-/* Reporting results. */
-
-int count_passes, count_fails;
-
-static void
-print_test_name (char *name)
-{
- int i;
-
- for (i = 0; i < depth; i++)
- printf ("%s: ", context_name_stack[i]);
-
- printf ("%s", name);
-}
-
-static void
-print_result (char *result, char *name)
-{
- printf ("%s: ", result);
- print_test_name (name);
- putchar ('\n');
-}
-
-void
-test_pass (char *name)
-{
- print_result ("PASS", name);
- count_passes++;
-}
-
-void
-test_fail (char *name)
-{
- print_result ("FAIL", name);
- count_fails++;
-}
-
-void
-test_pass_if (char *name, int condition)
-{
- (condition ? test_pass : test_fail) (name);
-}
-
-
-/* Printing a summary. */
-
-/* Print a summary of the reported test results. Return zero if
- no failures occurred, one otherwise. */
-
-int
-test_summarize ()
-{
- putchar ('\n');
-
- printf ("passes: %d\n", count_passes);
- printf ("failures: %d\n", count_fails);
- printf ("total tests: %d\n", count_passes + count_fails);
-
- return (count_fails != 0);
-}
diff --git a/test-suite/tests/c-api/testlib.h b/test-suite/tests/c-api/testlib.h
deleted file mode 100644
index 3adaf7fc2..000000000
--- a/test-suite/tests/c-api/testlib.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* testlib.h --- reporting test results
- Jim Blandy <jimb@red-bean.com> --- August 1999 */
-
-#ifndef TESTLIB_H
-#define TESTLIB_H
-
-extern void test_pass (char *name);
-extern void test_fail (char *name);
-extern void test_pass_if (char *name, int condition);
-
-/* We need a way to keep track of what groups of tests we're currently
- within. A call to test_enter_context assures that future tests
- will be reported with a name prefixed by NAME, until we call
- test_restore_context with the value it returned.
-
- Calls to test_enter_context and test_restore_context should be
- properly nested; passing the context around allows them to detect
- mismatches.
-
- It is the caller's responsibility to free NAME after exiting the
- context. (This is trivial if you're passing string literals to
- test_enter_context.) */
-
-typedef int test_context_t;
-extern test_context_t test_enter_context (char *name);
-extern void test_restore_context (test_context_t context);
-
-#endif /* TESTLIB_H */
diff --git a/test-suite/tests/chars.test b/test-suite/tests/chars.test
deleted file mode 100644
index de75d85eb..000000000
--- a/test-suite/tests/chars.test
+++ /dev/null
@@ -1,31 +0,0 @@
-;;;; chars.test --- test suite for Guile's char functions -*- scheme -*-
-;;;; Greg J. Badros <gjb@cs.washington.edu>
-;;;;
-;;;; Copyright (C) 2000 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-
-(use-modules (test-suite lib))
-
-(pass-if "char-is-both? works"
- (and
- (not (char-is-both? #\?))
- (not (char-is-both? #\newline))
- (char-is-both? #\a)
- (char-is-both? #\Z)
- (not (char-is-both? #\1))))
-
diff --git a/test-suite/tests/common-list.test b/test-suite/tests/common-list.test
deleted file mode 100644
index 8d675da9d..000000000
--- a/test-suite/tests/common-list.test
+++ /dev/null
@@ -1,242 +0,0 @@
-;;;; common-list.test --- tests guile's common list functions -*- scheme -*-
-;;;; Copyright (C) 2000, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-
-(use-modules (ice-9 documentation)
- (ice-9 common-list))
-
-
-;;;
-;;; miscellaneous
-;;;
-
-
-(define (documented? object)
- (not (not (object-documentation object))))
-
-
-;;;
-;;; intersection
-;;;
-
-(with-test-prefix "intersection"
-
- (pass-if "documented?"
- (documented? intersection))
-
- (pass-if "both arguments empty"
- (eq? (intersection '() '()) '()))
-
- (pass-if "first argument empty"
- (eq? (intersection '() '(1)) '()))
-
- (pass-if "second argument empty"
- (eq? (intersection '(1) '()) '()))
-
- (pass-if "disjoint arguments"
- (eq? (intersection '(1) '(2)) '()))
-
- (pass-if "equal arguments"
- (equal? (intersection '(1) '(1)) '(1)))
-
- (pass-if "reverse argument order"
- (equal? (intersection '(1 2 3) '(3 2 1)) '(1 2 3)))
-
- (pass-if "multiple matches in first list"
- (equal? (intersection '(1 1 2 2 3) '(3 2 1)) '(1 1 2 2 3)))
-
- (pass-if "multiple matches in second list"
- (equal? (intersection '(1 2 3) '(3 3 2 2 1)) '(1 2 3)))
-
- (pass-if "mixed arguments"
- (equal? (intersection '(1 2 3 5 7 8 10) '(1 3 4 7 8 9)) '(1 3 7 8)))
-
- )
-
-
-;;;
-;;; set-difference
-;;;
-
-(with-test-prefix "set-difference"
-
- (pass-if "documented?"
- (documented? set-difference))
-
- (pass-if "both arguments empty"
- (eq? (set-difference '() '()) '()))
-
- (pass-if "first argument empty"
- (eq? (set-difference '() '(1)) '()))
-
- (pass-if "second argument empty"
- (equal? (set-difference '(1) '()) '(1)))
-
- (pass-if "disjoint arguments"
- (equal? (set-difference '(1) '(2)) '(1)))
-
- (pass-if "equal arguments"
- (eq? (set-difference '(1) '(1)) '()))
-
- (pass-if "reverse argument order"
- (eq? (set-difference '(1 2 3) '(3 2 1)) '()))
-
- (pass-if "multiple matches in first list"
- (eq? (set-difference '(1 1 2 2 3) '(3 2 1)) '()))
-
- (pass-if "multiple matches in second list"
- (eq? (set-difference '(1 2 3) '(3 3 2 2 1)) '()))
-
- (pass-if "mixed arguments"
- (equal? (set-difference '(1 2 3 5 7 8 10) '(1 3 4 7 8 9)) '(2 5 10)))
-
- )
-
-
-;;;
-;;; remove-if
-;;;
-
-(with-test-prefix "remove-if"
-
- (pass-if "documented?"
- (documented? remove-if))
-
- (pass-if "empty list, remove all"
- (eq? (remove-if (lambda (x) #t) '()) '()))
-
- (pass-if "empty list, remove none"
- (eq? (remove-if (lambda (x) #f) '()) '()))
-
- (pass-if "non-empty list, remove all"
- (eq? (remove-if (lambda (x) #t) '(1 2 3 4)) '()))
-
- (pass-if "non-empty list, remove none"
- (equal? (remove-if (lambda (x) #f) '(1 2 3 4)) '(1 2 3 4)))
-
- (pass-if "non-empty list, remove some"
- (equal? (remove-if odd? '(1 2 3 4)) '(2 4)))
-
- )
-
-
-;;;
-;;; remove-if-not
-;;;
-
-
-(with-test-prefix "remove-if-not"
-
- (pass-if "documented?"
- (documented? remove-if-not))
-
- (pass-if "empty list, remove all"
- (eq? (remove-if-not (lambda (x) #f) '()) '()))
-
- (pass-if "empty list, remove none"
- (eq? (remove-if-not (lambda (x) #t) '()) '()))
-
- (pass-if "non-empty list, remove all"
- (eq? (remove-if-not (lambda (x) #f) '(1 2 3 4)) '()))
-
- (pass-if "non-empty list, remove none"
- (equal? (remove-if-not (lambda (x) #t) '(1 2 3 4)) '(1 2 3 4)))
-
- (pass-if "non-empty list, remove some"
- (equal? (remove-if-not odd? '(1 2 3 4)) '(1 3)))
-
- )
-
-
-;;;
-;;; delete-if!
-;;;
-
-
-(with-test-prefix "delete-if!"
-
- (pass-if "documented?"
- (documented? delete-if!))
-
- (pass-if "empty list, remove all"
- (eq? (delete-if! (lambda (x) #t) '()) '()))
-
- (pass-if "empty list, remove none"
- (eq? (delete-if! (lambda (x) #f) '()) '()))
-
- (pass-if "non-empty list, remove all"
- (eq? (delete-if! (lambda (x) #t) '(1 2 3 4)) '()))
-
- (pass-if "non-empty list, remove none"
- (equal? (delete-if! (lambda (x) #f) '(1 2 3 4)) '(1 2 3 4)))
-
- (pass-if "non-empty list, remove some"
- (equal? (delete-if! odd? '(1 2 3 4)) '(2 4)))
-
- )
-
-
-;;;
-;;; delete-if-not!
-;;;
-
-
-(with-test-prefix "delete-if-not!"
-
- (pass-if "documented?"
- (documented? delete-if-not!))
-
- (pass-if "empty list, remove all"
- (eq? (delete-if-not! (lambda (x) #f) '()) '()))
-
- (pass-if "empty list, remove none"
- (eq? (delete-if-not! (lambda (x) #t) '()) '()))
-
- (pass-if "non-empty list, remove all"
- (eq? (delete-if-not! (lambda (x) #f) '(1 2 3 4)) '()))
-
- (pass-if "non-empty list, remove none"
- (equal? (delete-if-not! (lambda (x) #t) '(1 2 3 4)) '(1 2 3 4)))
-
- (pass-if "non-empty list, remove some"
- (equal? (delete-if-not! odd? '(1 2 3 4)) '(1 3)))
-
- )
diff --git a/test-suite/tests/dynamic-scope.test b/test-suite/tests/dynamic-scope.test
deleted file mode 100644
index bb7e1adda..000000000
--- a/test-suite/tests/dynamic-scope.test
+++ /dev/null
@@ -1,78 +0,0 @@
-;;;; -*- scheme -*-
-;;;; dynamic-scop.test --- test suite for dynamic scoping constructs
-;;;;
-;;;; Copyright (C) 2001 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-(use-modules (test-suite lib))
-
-(define global-a 0)
-(define (fetch-global-a) global-a)
-
-(with-test-prefix "dynamic scope"
-
- (pass-if "@bind binds"
- (= (@bind ((global-a 1)) (fetch-global-a)) 1))
-
- (pass-if "@bind unbinds"
- (begin
- (set! global-a 0)
- (@bind ((global-a 1)) (fetch-global-a))
- (= global-a 0)))
-
- (pass-if-exception "duplicate @binds"
- (cons 'misc-error "^duplicate bindings")
- (@bind ((a 1) (a 2)) (+ a a)))
-
- (pass-if-exception "@bind missing expression"
- (cons 'misc-error "^missing or extra expression")
- (@bind ((global-a 1))))
-
- (pass-if-exception "@bind bad bindings"
- (cons 'misc-error "^bad bindings")
- (@bind (a) #f))
-
- (pass-if-exception "@bind bad bindings"
- (cons 'misc-error "^bad bindings")
- (@bind ((a)) #f))
-
- (pass-if "@bind and dynamic-wind"
- (letrec ((co-routine #f)
- (spawn (lambda (proc)
- (set! co-routine proc)))
- (yield (lambda (val)
- (call-with-current-continuation
- (lambda (k)
- (let ((next co-routine))
- (set! co-routine k)
- (next val)))))))
-
- (spawn (lambda (val)
- (@bind ((global-a 'inside))
- (yield global-a)
- (yield global-a))))
-
- (set! global-a 'outside)
- (let ((inside-a (yield #f)))
- (let ((outside-a global-a))
- (let ((inside-a2 (yield #f)))
- (and (eq? inside-a 'inside)
- (eq? outside-a 'outside)
- (eq? inside-a2 'inside))))))))
-
-
-
diff --git a/test-suite/tests/elisp.test b/test-suite/tests/elisp.test
deleted file mode 100644
index ab0039332..000000000
--- a/test-suite/tests/elisp.test
+++ /dev/null
@@ -1,355 +0,0 @@
-;;;; elisp.test --- tests guile's elisp support -*- scheme -*-
-;;;; Copyright (C) 2002 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-
-;;;
-;;; elisp
-;;;
-
-(if (defined? '%nil)
-
- (with-test-prefix "scheme"
-
- (with-test-prefix "nil value is a boolean"
-
- (pass-if "boolean?"
- (boolean? %nil))
-
- )
-
- (with-test-prefix "nil value is false"
-
- (pass-if "not"
- (eq? (not %nil) #t))
-
- (pass-if "if"
- (if %nil #f #t))
-
- (pass-if "and"
- (eq? (and %nil #t) #f))
-
- (pass-if "or"
- (eq? (or %nil #f) #f))
-
- (pass-if "cond"
- (cond (%nil #f) (else #t)))
-
- (pass-if "do"
- (call-with-current-continuation
- (lambda (exit)
- (do ((i 0 (+ i 1)))
- (%nil (exit #f))
- (if (> i 10)
- (exit #t))))))
-
- )
-
- (with-test-prefix "nil value as an empty list"
-
- (pass-if "list?"
- (list? %nil))
-
- (pass-if "null?"
- (null? %nil))
-
- (pass-if "sort"
- (eq? (sort %nil <) %nil))
-
- )
-
- (with-test-prefix "lists formed using nil value"
-
- (pass-if "list?"
- (list? (cons 'a %nil)))
-
- (pass-if "length of %nil"
- (= (length %nil) 0))
-
- (pass-if "length"
- (= (length (cons 'a (cons 'b (cons 'c %nil)))) 3))
-
- (pass-if "length (with backquoted list)"
- (= (length `(a b c . ,%nil)) 3))
-
- (pass-if "write (%nil)"
- (string=? (with-output-to-string
- (lambda () (write %nil)))
- "#nil")) ; Hmmm... should be "()" ?
-
- (pass-if "display (%nil)"
- (string=? (with-output-to-string
- (lambda () (display %nil)))
- "#nil")) ; Ditto.
-
- (pass-if "write (list)"
- (string=? (with-output-to-string
- (lambda () (write (cons 'a %nil))))
- "(a)"))
-
- (pass-if "display (list)"
- (string=? (with-output-to-string
- (lambda () (display (cons 'a %nil))))
- "(a)"))
-
- (pass-if "assq"
- (and (equal? (assq 1 `((1 one) (2 two) . ,%nil))
- '(1 one))
- (equal? (assq 3 `((1 one) (2 two) . ,%nil))
- #f)))
-
- (pass-if "assv"
- (and (equal? (assv 1 `((1 one) (2 two) . ,%nil))
- '(1 one))
- (equal? (assv 3 `((1 one) (2 two) . ,%nil))
- #f)))
-
- (pass-if "assoc"
- (and (equal? (assoc 1 `((1 one) (2 two) . ,%nil))
- '(1 one))
- (equal? (assoc 3 `((1 one) (2 two) . ,%nil))
- #f)))
-
- (pass-if "with-fluids*"
- (let ((f (make-fluid))
- (g (make-fluid)))
- (with-fluids* (cons f (cons g %nil))
- '(3 4)
- (lambda ()
- (and (eq? (fluid-ref f) 3)
- (eq? (fluid-ref g) 4))))))
-
- (pass-if "append!"
- (let ((a (copy-tree '(1 2 3)))
- (b (copy-tree `(4 5 6 . ,%nil)))
- (c (copy-tree '(7 8 9)))
- (d (copy-tree `(a b c . ,%nil))))
- (equal? (append! a b c d)
- `(1 2 3 4 5 6 7 8 9 a b c . ,%nil))))
-
- (pass-if "last-pair"
- (equal? (last-pair `(1 2 3 4 5 . ,%nil))
- (cons 5 %nil)))
-
- (pass-if "reverse"
- (equal? (reverse `(1 2 3 4 5 . ,%nil))
- '(5 4 3 2 1))) ; Hmmm... is this OK, or
- ; should it be
- ; `(5 4 3 2 1 . ,%nil) ?
-
- (pass-if "reverse!"
- (equal? (reverse! (copy-tree `(1 2 3 4 5 . ,%nil)))
- '(5 4 3 2 1))) ; Ditto.
-
- (pass-if "list-ref"
- (eq? (list-ref `(0 1 2 3 4 . ,%nil) 4) 4))
-
- (pass-if-exception "list-ref"
- exception:out-of-range
- (eq? (list-ref `(0 1 2 3 4 . ,%nil) 6) 6))
-
- (pass-if "list-set!"
- (let ((l (copy-tree `(0 1 2 3 4 . ,%nil))))
- (list-set! l 4 44)
- (= (list-ref l 4) 44)))
-
- (pass-if-exception "list-set!"
- exception:out-of-range
- (let ((l (copy-tree `(0 1 2 3 4 . ,%nil))))
- (list-set! l 6 44)
- (= (list-ref l 6) 44)))
-
- (pass-if "list-cdr-set!"
- (let ((l (copy-tree `(0 1 2 3 4 . ,%nil))))
- (and (begin
- (list-cdr-set! l 4 44)
- (equal? l '(0 1 2 3 4 . 44)))
- (begin
- (list-cdr-set! l 3 `(new . ,%nil))
- (equal? l `(0 1 2 3 new . ,%nil))))))
-
- (pass-if-exception "list-cdr-set!"
- exception:out-of-range
- (let ((l (copy-tree `(0 1 2 3 4 . ,%nil))))
- (list-cdr-set! l 6 44)))
-
- (pass-if "memq"
- (equal? (memq 'c `(a b c d . ,%nil)) `(c d . ,%nil)))
-
- (pass-if "memv"
- (equal? (memv 'c `(a b c d . ,%nil)) `(c d . ,%nil)))
-
- (pass-if "member"
- (equal? (member "c" `("a" "b" "c" "d" . ,%nil)) `("c" "d" . ,%nil)))
-
- (pass-if "list->vector"
- (equal? #(1 2 3) (list->vector `(1 2 3 . ,%nil))))
-
- (pass-if "list->vector"
- (equal? #(1 2 3) (list->vector `(1 2 3 . ,%nil))))
-
- (pass-if "list->weak-vector"
- (equal? (weak-vector 1 2 3) (list->weak-vector `(1 2 3 . ,%nil))))
-
- (pass-if "sorted?"
- (and (sorted? `(1 2 3 . ,%nil) <)
- (not (sorted? `(1 6 3 . ,%nil) <))))
-
- (pass-if "merge"
- (equal? (merge '(1 4 7 10)
- (merge `(2 5 8 11 . ,%nil)
- `(3 6 9 12 . ,%nil)
- <)
- <)
- `(1 2 3 4 5 6 7 8 9 10 11 12 . ,%nil)))
-
- (pass-if "merge!"
- (equal? (merge! (copy-tree '(1 4 7 10))
- (merge! (copy-tree `(2 5 8 11 . ,%nil))
- (copy-tree `(3 6 9 12 . ,%nil))
- <)
- <)
- `(1 2 3 4 5 6 7 8 9 10 11 12 . ,%nil)))
-
- (pass-if "sort"
- (equal? (sort `(1 5 3 8 4 . ,%nil) <) '(1 3 4 5 8)))
-
- (pass-if "stable-sort"
- (equal? (stable-sort `(1 5 3 8 4 . ,%nil) <) '(1 3 4 5 8)))
-
- (pass-if "sort!"
- (equal? (sort! (copy-tree `(1 5 3 8 4 . ,%nil)) <)
- '(1 3 4 5 8)))
-
- (pass-if "stable-sort!"
- (equal? (stable-sort! (copy-tree `(1 5 3 8 4 . ,%nil)) <)
- '(1 3 4 5 8)))
-
- )
-
- (with-test-prefix "value preservation"
-
- (pass-if "car"
- (eq? (car (cons %nil 'a)) %nil))
-
- (pass-if "cdr"
- (eq? (cdr (cons 'a %nil)) %nil))
-
- (pass-if "vector-ref"
- (eq? (vector-ref (vector %nil) 0) %nil))
-
- )
-
- ))
-
-(if (defined? '%nil)
- (use-modules (lang elisp interface)))
-
-(if (defined? '%nil)
-
- (with-test-prefix "elisp"
-
- (define (elisp-pass-if expr expected)
- (pass-if (with-output-to-string
- (lambda ()
- (write expr)))
- (let ((calc (with-output-to-string
- (lambda ()
- (write (eval-elisp expr))))))
- (string=? calc expected))))
-
- (elisp-pass-if '(and #f) "#f")
- (elisp-pass-if '(and #t) "#t")
- (elisp-pass-if '(and nil) "#nil")
- (elisp-pass-if '(and t) "#t")
- (elisp-pass-if '(and) "#t")
- (elisp-pass-if '(cond (nil t) (t 3)) "3")
- (elisp-pass-if '(cond (nil t) (t)) "#t")
- (elisp-pass-if '(cond (nil)) "#nil")
- (elisp-pass-if '(cond) "#nil")
- (elisp-pass-if '(if #f 'a 'b) "b")
- (elisp-pass-if '(if #t 'a 'b) "a")
- (elisp-pass-if '(if '() 'a 'b) "b")
- (elisp-pass-if '(if nil 'a 'b) "b")
- (elisp-pass-if '(if nil 1 2 3 4) "4")
- (elisp-pass-if '(if nil 1 2) "2")
- (elisp-pass-if '(if nil 1) "#nil")
- (elisp-pass-if '(if t 1 2) "1")
- (elisp-pass-if '(if t 1) "1")
- (elisp-pass-if '(let (a) a) "#nil")
- (elisp-pass-if '(let* (a) a) "#nil")
- (elisp-pass-if '(let* ((a 1) (b (* a 2))) b) "2")
- (elisp-pass-if '(memq '() '(())) "(())")
- (elisp-pass-if '(memq '() '(nil)) "(#nil)")
- (elisp-pass-if '(memq '() '(t)) "#nil")
- (elisp-pass-if '(memq nil '(())) "(())")
- (elisp-pass-if '(memq nil '(nil)) "(#nil)")
- (elisp-pass-if '(memq nil (list nil)) "(#nil)")
- (elisp-pass-if '(null '#f) "#t")
- (elisp-pass-if '(null '()) "#t")
- (elisp-pass-if '(null 'nil) "#t")
- (elisp-pass-if '(null nil) "#t")
- (elisp-pass-if '(or 1 2 3) "1")
- (elisp-pass-if '(or nil t nil) "#t")
- (elisp-pass-if '(or nil) "#nil")
- (elisp-pass-if '(or t nil t) "#t")
- (elisp-pass-if '(or t) "#t")
- (elisp-pass-if '(or) "#nil")
- (elisp-pass-if '(prog1 1 2 3) "1")
- (elisp-pass-if '(prog2 1 2 3) "2")
- (elisp-pass-if '(progn 1 2 3) "3")
- (elisp-pass-if '(while nil 1) "#nil")
-
- (elisp-pass-if '(defun testf (x y &optional o &rest r) (list x y o r)) "testf")
- (elisp-pass-if '(testf 1 2) "(1 2 #nil #nil)")
- (elisp-pass-if '(testf 1 2 3 4 5 56) "(1 2 3 (4 5 56))")
- ;; NB `lambda' in Emacs is self-quoting, but that's only after
- ;; loading the macro definition of lambda in subr.el.
- (elisp-pass-if '(function (lambda (x y &optional o &rest r) (list x y o r))) "(lambda (x y &optional o &rest r) (list x y o r))")
- (elisp-pass-if '(funcall (lambda (x y &optional o &rest r) (list x y o r)) 1 2 3 4) "(1 2 3 (4))")
- (elisp-pass-if '(apply (lambda (x y &optional o &rest r) (list x y o r)) 1 2 3 nil) "(1 2 3 #nil)")
-
- (elisp-pass-if '(setq x 3) "3")
- (elisp-pass-if '(defvar x 4) "x")
- (elisp-pass-if 'x "3")
-
- ))
-
-;;; elisp.test ends here
diff --git a/test-suite/tests/environments.test b/test-suite/tests/environments.test
deleted file mode 100644
index 507dff7fe..000000000
--- a/test-suite/tests/environments.test
+++ /dev/null
@@ -1,1070 +0,0 @@
-;;;; environments.test -*- scheme -*-
-;;;; Copyright (C) 2000, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-
-(use-modules (ice-9 documentation))
-
-
-;;;
-;;; miscellaneous
-;;;
-
-(define exception:unbound-symbol
- (cons 'misc-error "^Symbol .* not bound in environment"))
-
-(define (documented? object)
- (not (not (object-documentation object))))
-
-(define (folder sym val res)
- (cons (cons sym val) res))
-
-(define (make-observer-func)
- (let* ((counter 0))
- (lambda args
- (if (null? args)
- counter
- (set! counter (+ counter 1))))))
-
-(define (make-erroneous-observer-func)
- (let* ((func (make-observer-func)))
- (lambda args
- (if (null? args)
- (func)
- (begin
- (func args)
- (error))))))
-
-;;;
-;;; leaf-environments
-;;;
-
-(with-test-prefix "leaf-environments"
-
- (with-test-prefix "leaf-environment?"
-
- (pass-if "documented?"
- (documented? leaf-environment?))
-
- (pass-if "non-environment-object"
- (not (leaf-environment? #f))))
-
-
- (with-test-prefix "make-leaf-environment"
-
- (pass-if "documented?"
- (documented? make-leaf-environment))
-
- (pass-if "produces an environment"
- (environment? (make-leaf-environment)))
-
- (pass-if "produces a leaf-environment"
- (leaf-environment? (make-leaf-environment)))
-
- (pass-if "produces always a new environment"
- (not (eq? (make-leaf-environment) (make-leaf-environment)))))
-
-
- (with-test-prefix "bound, define, ref, set!, cell"
-
- (pass-if "symbols are unbound by default"
- (let* ((env (make-leaf-environment)))
- (and (not (environment-bound? env 'a))
- (not (environment-bound? env 'b))
- (not (environment-bound? env 'c)))))
-
- (pass-if "symbol is bound after define"
- (let* ((env (make-leaf-environment)))
- (environment-bound? env 'a)
- (environment-define env 'a #t)
- (environment-bound? env 'a)))
-
- (pass-if "ref a defined symbol"
- (let* ((env (make-leaf-environment)))
- (environment-bound? env 'a)
- (environment-bound? env 'b)
- (environment-define env 'a #t)
- (environment-define env 'b #f)
- (and (environment-ref env 'a)
- (not (environment-ref env 'b)))))
-
- (pass-if "set! a defined symbol"
- (let* ((env (make-leaf-environment)))
- (environment-define env 'a #t)
- (environment-define env 'b #f)
- (environment-ref env 'a)
- (environment-ref env 'b)
- (environment-set! env 'a #f)
- (environment-set! env 'b #t)
- (and (not (environment-ref env 'a))
- (environment-ref env 'b))))
-
- (pass-if "get a read-only cell"
- (let* ((env (make-leaf-environment)))
- (environment-define env 'a #t)
- (let* ((cell (environment-cell env 'a #f)))
- (and (cdr cell)
- (begin
- (environment-set! env 'a #f)
- (not (cdr cell)))))))
-
- (pass-if "a read-only cell gets rebound after define"
- (let* ((env (make-leaf-environment)))
- (environment-define env 'a #t)
- (let* ((cell (environment-cell env 'a #f)))
- (environment-define env 'a #f)
- (not (eq? (environment-cell env 'a #f) cell)))))
-
- (pass-if "get a writable cell"
- (let* ((env (make-leaf-environment)))
- (environment-define env 'a #t)
- (let* ((readable (environment-cell env 'a #f))
- (writable (environment-cell env 'a #t)))
- (and (eq? readable writable)
- (begin
- (environment-set! env 'a #f)
- (not (cdr writable)))
- (begin
- (set-cdr! writable #t)
- (environment-ref env 'a))
- (begin
- (set-cdr! (environment-cell env 'a #t) #f)
- (not (cdr writable)))))))
-
- (pass-if "a writable cell gets rebound after define"
- (let* ((env (make-leaf-environment)))
- (environment-define env 'a #t)
- (let* ((cell (environment-cell env 'a #t)))
- (environment-define env 'a #f)
- (not (eq? (environment-cell env 'a #t) cell)))))
-
- (pass-if-exception "reference an unbound symbol"
- exception:unbound-symbol
- (environment-ref (make-leaf-environment) 'a))
-
- (pass-if-exception "set! an unbound symbol"
- exception:unbound-symbol
- (environment-set! (make-leaf-environment) 'a #f))
-
- (pass-if-exception "get a readable cell for an unbound symbol"
- exception:unbound-symbol
- (environment-cell (make-leaf-environment) 'a #f))
-
- (pass-if-exception "get a writable cell for an unbound symbol"
- exception:unbound-symbol
- (environment-cell (make-leaf-environment) 'a #t)))
-
-
- (with-test-prefix "undefine"
-
- (pass-if "undefine a defined symbol"
- (let* ((env (make-leaf-environment)))
- (environment-define env 'a 1)
- (environment-ref env 'a)
- (environment-undefine env 'a)
- (not (environment-bound? env 'a))))
-
- (pass-if "undefine an already undefined symbol"
- (environment-undefine (make-leaf-environment) 'a)
- #t))
-
-
- (with-test-prefix "fold"
-
- (pass-if "empty environment"
- (let* ((env (make-leaf-environment)))
- (eq? 'success (environment-fold env folder 'success))))
-
- (pass-if "one symbol"
- (let* ((env (make-leaf-environment)))
- (environment-define env 'a #t)
- (equal? '((a . #t)) (environment-fold env folder '()))))
-
- (pass-if "two symbols"
- (let* ((env (make-leaf-environment)))
- (environment-define env 'a #t)
- (environment-define env 'b #f)
- (let ((folded (environment-fold env folder '())))
- (or (equal? folded '((a . #t) (b . #f)))
- (equal? folded '((b . #f) (a . #t))))))))
-
-
- (with-test-prefix "observe"
-
- (pass-if "observe an environment"
- (let* ((env (make-leaf-environment)))
- (environment-observe env (make-observer-func))
- #t))
-
- (pass-if "observe an environment twice"
- (let* ((env (make-leaf-environment))
- (observer-1 (environment-observe env (make-observer-func)))
- (observer-2 (environment-observe env (make-observer-func))))
- (not (eq? observer-1 observer-2))))
-
- (pass-if "definition of an undefined symbol"
- (let* ((env (make-leaf-environment))
- (func (make-observer-func)))
- (environment-observe env func)
- (environment-define env 'a 1)
- (eqv? (func) 1)))
-
- (pass-if "definition of an already defined symbol"
- (let* ((env (make-leaf-environment)))
- (environment-define env 'a 1)
- (let* ((func (make-observer-func)))
- (environment-observe env func)
- (environment-define env 'a 1)
- (eqv? (func) 1))))
-
- (pass-if "set!ing of a defined symbol"
- (let* ((env (make-leaf-environment)))
- (environment-define env 'a 1)
- (let* ((func (make-observer-func)))
- (environment-observe env func)
- (environment-set! env 'a 1)
- (eqv? (func) 0))))
-
- (pass-if "undefining a defined symbol"
- (let* ((env (make-leaf-environment)))
- (environment-define env 'a 1)
- (let* ((func (make-observer-func)))
- (environment-observe env func)
- (environment-undefine env 'a)
- (eqv? (func) 1))))
-
- (pass-if "undefining an already undefined symbol"
- (let* ((env (make-leaf-environment))
- (func (make-observer-func)))
- (environment-observe env func)
- (environment-undefine env 'a)
- (eqv? (func) 0)))
-
- (pass-if "unobserve an active observer"
- (let* ((env (make-leaf-environment))
- (func (make-observer-func))
- (observer (environment-observe env func)))
- (environment-unobserve observer)
- (environment-define env 'a 1)
- (eqv? (func) 0)))
-
- (pass-if "unobserve an inactive observer"
- (let* ((env (make-leaf-environment))
- (func (make-observer-func))
- (observer (environment-observe env func)))
- (environment-unobserve observer)
- (environment-unobserve observer)
- #t)))
-
-
- (with-test-prefix "observe-weak"
-
- (pass-if "observe an environment"
- (let* ((env (make-leaf-environment)))
- (environment-observe-weak env (make-observer-func))
- #t))
-
- (pass-if "observe an environment twice"
- (let* ((env (make-leaf-environment))
- (observer-1 (environment-observe-weak env (make-observer-func)))
- (observer-2 (environment-observe-weak env (make-observer-func))))
- (not (eq? observer-1 observer-2))))
-
- (pass-if "definition of an undefined symbol"
- (let* ((env (make-leaf-environment))
- (func (make-observer-func)))
- (environment-observe-weak env func)
- (environment-define env 'a 1)
- (eqv? (func) 1)))
-
- (pass-if "definition of an already defined symbol"
- (let* ((env (make-leaf-environment)))
- (environment-define env 'a 1)
- (let* ((func (make-observer-func)))
- (environment-observe-weak env func)
- (environment-define env 'a 1)
- (eqv? (func) 1))))
-
- (pass-if "set!ing of a defined symbol"
- (let* ((env (make-leaf-environment)))
- (environment-define env 'a 1)
- (let* ((func (make-observer-func)))
- (environment-observe-weak env func)
- (environment-set! env 'a 1)
- (eqv? (func) 0))))
-
- (pass-if "undefining a defined symbol"
- (let* ((env (make-leaf-environment)))
- (environment-define env 'a 1)
- (let* ((func (make-observer-func)))
- (environment-observe-weak env func)
- (environment-undefine env 'a)
- (eqv? (func) 1))))
-
- (pass-if "undefining an already undefined symbol"
- (let* ((env (make-leaf-environment))
- (func (make-observer-func)))
- (environment-observe-weak env func)
- (environment-undefine env 'a)
- (eqv? (func) 0)))
-
- (pass-if "unobserve an active observer"
- (let* ((env (make-leaf-environment))
- (func (make-observer-func))
- (observer (environment-observe-weak env func)))
- (environment-unobserve observer)
- (environment-define env 'a 1)
- (eqv? (func) 0)))
-
- (pass-if "unobserve an inactive observer"
- (let* ((env (make-leaf-environment))
- (func (make-observer-func))
- (observer (environment-observe-weak env func)))
- (environment-unobserve observer)
- (environment-unobserve observer)
- #t))
-
- (pass-if "weak observer gets collected"
- (gc)
- (let* ((env (make-leaf-environment))
- (func (make-observer-func)))
- (environment-observe-weak env func)
- (gc)
- (environment-define env 'a 1)
- (if (not (eqv? (func) 0))
- (throw 'unresolved) ; note: conservative scanning
- #t))))
-
-
- (with-test-prefix "erroneous observers"
-
- (pass-if "update continues after error"
- (let* ((env (make-leaf-environment))
- (func-1 (make-erroneous-observer-func))
- (func-2 (make-erroneous-observer-func)))
- (environment-observe env func-1)
- (environment-observe env func-2)
- (catch #t
- (lambda ()
- (environment-define env 'a 1)
- #f)
- (lambda args
- (and (eq? (func-1) 1)
- (eq? (func-2) 1))))))))
-
-
-;;;
-;;; leaf-environment based eval-environments
-;;;
-
-(with-test-prefix "leaf-environment based eval-environments"
-
- (with-test-prefix "eval-environment?"
-
- (pass-if "documented?"
- (documented? eval-environment?))
-
- (pass-if "non-environment-object"
- (not (eval-environment? #f)))
-
- (pass-if "leaf-environment-object"
- (not (eval-environment? (make-leaf-environment)))))
-
-
- (with-test-prefix "make-eval-environment"
-
- (pass-if "documented?"
- (documented? make-eval-environment))
-
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment)))
-
- (pass-if "produces an environment"
- (environment? (make-eval-environment local imported)))
-
- (pass-if "produces an eval-environment"
- (eval-environment? (make-eval-environment local imported)))
-
- (pass-if "produces always a new environment"
- (not (eq? (make-eval-environment local imported)
- (make-eval-environment local imported))))))
-
-
- (with-test-prefix "eval-environment-local"
-
- (pass-if "documented?"
- (documented? eval-environment-local))
-
- (pass-if "returns local"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (eq? (eval-environment-local env) local))))
-
-
- (with-test-prefix "eval-environment-imported"
-
- (pass-if "documented?"
- (documented? eval-environment-imported))
-
- (pass-if "returns imported"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (eq? (eval-environment-imported env) imported))))
-
-
- (with-test-prefix "bound, define, ref, set!, cell"
-
- (pass-if "symbols are unbound by default"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (and (not (environment-bound? env 'a))
- (not (environment-bound? env 'b))
- (not (environment-bound? env 'c)))))
-
- (with-test-prefix "symbols bound in imported"
-
- (pass-if "binding is visible"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-bound? env 'a)
- (environment-define imported 'a #t)
- (environment-bound? env 'a)))
-
- (pass-if "ref works"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-bound? env 'a)
- (environment-define imported 'a #t)
- (environment-ref env 'a)))
-
- (pass-if "set! works"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define imported 'a #f)
- (environment-set! env 'a #t)
- (environment-ref imported 'a)))
-
- (pass-if "cells are passed through"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define imported 'a #t)
- (let* ((imported-cell (environment-cell imported 'a #f))
- (env-cell (environment-cell env 'a #f)))
- (eq? env-cell imported-cell)))))
-
- (with-test-prefix "symbols bound in local"
-
- (pass-if "binding is visible"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-bound? env 'a)
- (environment-define local 'a #t)
- (environment-bound? env 'a)))
-
- (pass-if "ref works"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define local 'a #t)
- (environment-ref env 'a)))
-
- (pass-if "set! works"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define local 'a #f)
- (environment-set! env 'a #t)
- (environment-ref local 'a)))
-
- (pass-if "cells are passed through"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define local 'a #t)
- (let* ((local-cell (environment-cell local 'a #f))
- (env-cell (environment-cell env 'a #f)))
- (eq? env-cell local-cell)))))
-
- (with-test-prefix "symbols bound in local and imported"
-
- (pass-if "binding is visible"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-bound? env 'a)
- (environment-define imported 'a #t)
- (environment-define local 'a #f)
- (environment-bound? env 'a)))
-
- (pass-if "ref works"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define imported 'a #f)
- (environment-define local 'a #t)
- (environment-ref env 'a)))
-
- (pass-if "set! changes local"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define imported 'a #f)
- (environment-define local 'a #f)
- (environment-set! env 'a #t)
- (environment-ref local 'a)))
-
- (pass-if "set! does not touch imported"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define imported 'a #t)
- (environment-define local 'a #t)
- (environment-set! env 'a #f)
- (environment-ref imported 'a)))
-
- (pass-if "cells from local are passed through"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define local 'a #t)
- (let* ((local-cell (environment-cell local 'a #f))
- (env-cell (environment-cell env 'a #f)))
- (eq? env-cell local-cell)))))
-
- (with-test-prefix "defining symbols"
-
- (pass-if "symbols are bound in local after define"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define env 'a #t)
- (environment-bound? local 'a)))
-
- (pass-if "cells in local get rebound after define"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define env 'a #f)
- (let* ((old-cell (environment-cell local 'a #f)))
- (environment-define env 'a #f)
- (let* ((new-cell (environment-cell local 'a #f)))
- (not (eq? new-cell old-cell))))))
-
- (pass-if "cells in imported get shadowed after define"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define imported 'a #f)
- (environment-define env 'a #t)
- (environment-ref local 'a))))
-
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
-
- (pass-if-exception "reference an unbound symbol"
- exception:unbound-symbol
- (environment-ref env 'b))
-
- (pass-if-exception "set! an unbound symbol"
- exception:unbound-symbol
- (environment-set! env 'b #f))
-
- (pass-if-exception "get a readable cell for an unbound symbol"
- exception:unbound-symbol
- (environment-cell env 'b #f))
-
- (pass-if-exception "get a writable cell for an unbound symbol"
- exception:unbound-symbol
- (environment-cell env 'b #t))))
-
- (with-test-prefix "eval-environment-set-local!"
-
- (pass-if "documented?"
- (documented? eval-environment-set-local!))
-
- (pass-if "new binding becomes visible"
- (let* ((old-local (make-leaf-environment))
- (new-local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment old-local imported)))
- (environment-bound? env 'a)
- (environment-define new-local 'a #t)
- (eval-environment-set-local! env new-local)
- (environment-bound? env 'a)))
-
- (pass-if "existing binding is replaced"
- (let* ((old-local (make-leaf-environment))
- (new-local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment old-local imported)))
- (environment-define old-local 'a #f)
- (environment-ref env 'a)
- (environment-define new-local 'a #t)
- (eval-environment-set-local! env new-local)
- (environment-ref env 'a)))
-
- (pass-if "undefined binding is removed"
- (let* ((old-local (make-leaf-environment))
- (new-local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment old-local imported)))
- (environment-define old-local 'a #f)
- (environment-ref env 'a)
- (eval-environment-set-local! env new-local)
- (not (environment-bound? env 'a))))
-
- (pass-if "binding in imported remains shadowed"
- (let* ((old-local (make-leaf-environment))
- (new-local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment old-local imported)))
- (environment-define imported 'a #f)
- (environment-define old-local 'a #f)
- (environment-ref env 'a)
- (environment-define new-local 'a #t)
- (eval-environment-set-local! env new-local)
- (environment-ref env 'a)))
-
- (pass-if "binding in imported gets shadowed"
- (let* ((old-local (make-leaf-environment))
- (new-local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment old-local imported)))
- (environment-define imported 'a #f)
- (environment-ref env 'a)
- (environment-define new-local 'a #t)
- (eval-environment-set-local! env new-local)
- (environment-ref env 'a)))
-
- (pass-if "binding in imported becomes visible"
- (let* ((old-local (make-leaf-environment))
- (new-local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment old-local imported)))
- (environment-define imported 'a #t)
- (environment-define old-local 'a #f)
- (environment-ref env 'a)
- (eval-environment-set-local! env new-local)
- (environment-ref env 'a))))
-
- (with-test-prefix "eval-environment-set-imported!"
-
- (pass-if "documented?"
- (documented? eval-environment-set-imported!))
-
- (pass-if "new binding becomes visible"
- (let* ((local (make-leaf-environment))
- (old-imported (make-leaf-environment))
- (new-imported (make-leaf-environment))
- (env (make-eval-environment local old-imported)))
- (environment-bound? env 'a)
- (environment-define new-imported 'a #t)
- (eval-environment-set-imported! env new-imported)
- (environment-bound? env 'a)))
-
- (pass-if "existing binding is replaced"
- (let* ((local (make-leaf-environment))
- (old-imported (make-leaf-environment))
- (new-imported (make-leaf-environment))
- (env (make-eval-environment local old-imported)))
- (environment-define old-imported 'a #f)
- (environment-ref env 'a)
- (environment-define new-imported 'a #t)
- (eval-environment-set-imported! env new-imported)
- (environment-ref env 'a)))
-
- (pass-if "undefined binding is removed"
- (let* ((local (make-leaf-environment))
- (old-imported (make-leaf-environment))
- (new-imported (make-leaf-environment))
- (env (make-eval-environment local old-imported)))
- (environment-define old-imported 'a #f)
- (environment-ref env 'a)
- (eval-environment-set-imported! env new-imported)
- (not (environment-bound? env 'a))))
-
- (pass-if "binding in imported remains shadowed"
- (let* ((local (make-leaf-environment))
- (old-imported (make-leaf-environment))
- (new-imported (make-leaf-environment))
- (env (make-eval-environment local old-imported)))
- (environment-define local 'a #t)
- (environment-define old-imported 'a #f)
- (environment-ref env 'a)
- (environment-define new-imported 'a #t)
- (eval-environment-set-imported! env new-imported)
- (environment-ref env 'a)))
-
- (pass-if "binding in imported gets shadowed"
- (let* ((local (make-leaf-environment))
- (old-imported (make-leaf-environment))
- (new-imported (make-leaf-environment))
- (env (make-eval-environment local old-imported)))
- (environment-define local 'a #t)
- (environment-ref env 'a)
- (environment-define new-imported 'a #f)
- (eval-environment-set-imported! env new-imported)
- (environment-ref env 'a))))
-
- (with-test-prefix "undefine"
-
- (pass-if "undefine an already undefined symbol"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-undefine env 'a)
- #t))
-
- (pass-if "undefine removes a binding from local"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define local 'a #t)
- (environment-undefine env 'a)
- (not (environment-bound? local 'a))))
-
- (pass-if "undefine does not influence imported"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define imported 'a #t)
- (environment-undefine env 'a)
- (environment-bound? imported 'a)))
-
- (pass-if "undefine an imported symbol does not undefine it"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define imported 'a #t)
- (environment-undefine env 'a)
- (environment-bound? env 'a)))
-
- (pass-if "undefine unshadows an imported symbol"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define imported 'a #t)
- (environment-define local 'a #f)
- (environment-undefine env 'a)
- (environment-ref env 'a))))
-
- (with-test-prefix "fold"
-
- (pass-if "empty environment"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (eq? 'success (environment-fold env folder 'success))))
-
- (pass-if "one symbol in local"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define local 'a #t)
- (equal? '((a . #t)) (environment-fold env folder '()))))
-
- (pass-if "one symbol in imported"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define imported 'a #t)
- (equal? '((a . #t)) (environment-fold env folder '()))))
-
- (pass-if "shadowed symbol"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define local 'a #t)
- (environment-define imported 'a #f)
- (equal? '((a . #t)) (environment-fold env folder '()))))
-
- (pass-if "one symbol each"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define local 'a #t)
- (environment-define imported 'b #f)
- (let ((folded (environment-fold env folder '())))
- (or (equal? folded '((a . #t) (b . #f)))
- (equal? folded '((b . #f) (a . #t))))))))
-
-
- (with-test-prefix "observe"
-
- (pass-if "observe an environment"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-observe env (make-observer-func))
- #t))
-
- (pass-if "observe an environment twice"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported))
- (observer-1 (environment-observe env (make-observer-func)))
- (observer-2 (environment-observe env (make-observer-func))))
- (not (eq? observer-1 observer-2))))
-
- (pass-if "definition of an undefined symbol"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported))
- (func (make-observer-func)))
- (environment-observe env func)
- (environment-define env 'a 1)
- (eqv? (func) 1)))
-
- (pass-if "definition of an already defined symbol"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define env 'a 1)
- (let* ((func (make-observer-func)))
- (environment-observe env func)
- (environment-define env 'a 1)
- (eqv? (func) 1))))
-
- (pass-if "set!ing of a defined symbol"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define env 'a 1)
- (let* ((func (make-observer-func)))
- (environment-observe env func)
- (environment-set! env 'a 1)
- (eqv? (func) 0))))
-
- (pass-if "undefining a defined symbol"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define env 'a 1)
- (let* ((func (make-observer-func)))
- (environment-observe env func)
- (environment-undefine env 'a)
- (eqv? (func) 1))))
-
- (pass-if "undefining an already undefined symbol"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported))
- (func (make-observer-func)))
- (environment-observe env func)
- (environment-undefine env 'a)
- (eqv? (func) 0)))
-
- (pass-if "unobserve an active observer"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported))
- (func (make-observer-func))
- (observer (environment-observe env func)))
- (environment-unobserve observer)
- (environment-define env 'a 1)
- (eqv? (func) 0)))
-
- (pass-if "unobserve an inactive observer"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported))
- (func (make-observer-func))
- (observer (environment-observe env func)))
- (environment-unobserve observer)
- (environment-unobserve observer)
- #t)))
-
-
- (with-test-prefix "observe-weak"
-
- (pass-if "observe an environment"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-observe-weak env (make-observer-func))
- #t))
-
- (pass-if "observe an environment twice"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported))
- (observer-1 (environment-observe-weak env (make-observer-func)))
- (observer-2 (environment-observe-weak env (make-observer-func))))
- (not (eq? observer-1 observer-2))))
-
- (pass-if "definition of an undefined symbol"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported))
- (func (make-observer-func)))
- (environment-observe-weak env func)
- (environment-define env 'a 1)
- (eqv? (func) 1)))
-
- (pass-if "definition of an already defined symbol"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define env 'a 1)
- (let* ((func (make-observer-func)))
- (environment-observe-weak env func)
- (environment-define env 'a 1)
- (eqv? (func) 1))))
-
- (pass-if "set!ing of a defined symbol"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define env 'a 1)
- (let* ((func (make-observer-func)))
- (environment-observe-weak env func)
- (environment-set! env 'a 1)
- (eqv? (func) 0))))
-
- (pass-if "undefining a defined symbol"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (environment-define env 'a 1)
- (let* ((func (make-observer-func)))
- (environment-observe-weak env func)
- (environment-undefine env 'a)
- (eqv? (func) 1))))
-
- (pass-if "undefining an already undefined symbol"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported))
- (func (make-observer-func)))
- (environment-observe-weak env func)
- (environment-undefine env 'a)
- (eqv? (func) 0)))
-
- (pass-if "unobserve an active observer"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported))
- (func (make-observer-func))
- (observer (environment-observe-weak env func)))
- (environment-unobserve observer)
- (environment-define env 'a 1)
- (eqv? (func) 0)))
-
- (pass-if "unobserve an inactive observer"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported))
- (func (make-observer-func))
- (observer (environment-observe-weak env func)))
- (environment-unobserve observer)
- (environment-unobserve observer)
- #t))
-
- (pass-if "weak observer gets collected"
- (gc)
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported))
- (func (make-observer-func)))
- (environment-observe-weak env func)
- (gc)
- (environment-define env 'a 1)
- (if (not (eqv? (func) 0))
- (throw 'unresolved) ; note: conservative scanning
- #t))))
-
-
- (with-test-prefix "erroneous observers"
-
- (pass-if "update continues after error"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported))
- (func-1 (make-erroneous-observer-func))
- (func-2 (make-erroneous-observer-func)))
- (environment-observe env func-1)
- (environment-observe env func-2)
- (catch #t
- (lambda ()
- (environment-define env 'a 1)
- #f)
- (lambda args
- (and (eq? (func-1) 1)
- (eq? (func-2) 1))))))))
-
-
-;;;
-;;; leaf-environment based import-environments
-;;;
-
-(with-test-prefix "leaf-environment based import-environments"
-
- (with-test-prefix "import-environment?"
-
- (pass-if "documented?"
- (documented? import-environment?))
-
- (pass-if "non-environment-object"
- (not (import-environment? #f)))
-
- (pass-if "leaf-environment-object"
- (not (import-environment? (make-leaf-environment))))
-
- (pass-if "eval-environment-object"
- (let* ((local (make-leaf-environment))
- (imported (make-leaf-environment))
- (env (make-eval-environment local imported)))
- (not (import-environment? (make-leaf-environment))))))
-
-
- (with-test-prefix "make-import-environment"
-
- (pass-if "documented?"
- (documented? make-import-environment))))
-
diff --git a/test-suite/tests/eval.test b/test-suite/tests/eval.test
deleted file mode 100644
index fc97fa5a9..000000000
--- a/test-suite/tests/eval.test
+++ /dev/null
@@ -1,248 +0,0 @@
-;;;; eval.test --- tests guile's evaluator -*- scheme -*-
-;;;; Copyright (C) 2000, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-
-(use-modules (ice-9 documentation))
-
-
-;;;
-;;; miscellaneous
-;;;
-
-(define (documented? object)
- (not (not (object-documentation object))))
-
-
-;;;
-;;; eval
-;;;
-
-(with-test-prefix "evaluator"
-
- (with-test-prefix "memoization"
-
- (pass-if "transparency"
- (let ((x '(begin 1)))
- (eval x (current-module))
- (equal? '(begin 1) x))))
-
- (with-test-prefix "symbol lookup"
-
- (with-test-prefix "top level"
-
- (with-test-prefix "unbound"
-
- (pass-if-exception "variable reference"
- exception:unbound-var
- x)
-
- (pass-if-exception "procedure"
- exception:unbound-var
- (x)))))
-
- (with-test-prefix "parameter error"
-
- ;; This is currently a bug in guile:
- ;; Macros are accepted as function parameters.
- ;; Functions that 'apply' macros are rewritten!!!
-
- (expect-fail-exception "macro as argument"
- exception:wrong-type-arg
- (let ((f (lambda (p a b) (p a b))))
- (f and #t #t)))
-
- (expect-fail-exception "passing macro as parameter"
- exception:wrong-type-arg
- (let* ((f (lambda (p a b) (p a b)))
- (foo (procedure-source f)))
- (f and #t #t)
- (equal? (procedure-source f) foo)))
-
- ))
-
-;;;
-;;; apply
-;;;
-
-(with-test-prefix "application"
-
- (with-test-prefix "wrong number of arguments"
-
- (pass-if-exception "((lambda () #f) 1)"
- exception:wrong-num-args
- ((lambda () #f) 1))
-
- (pass-if-exception "((lambda (x) #f))"
- exception:wrong-num-args
- ((lambda (x) #f)))
-
- (pass-if-exception "((lambda (x) #f) 1 2)"
- exception:wrong-num-args
- ((lambda (x) #f) 1 2))
-
- (pass-if-exception "((lambda (x y) #f))"
- exception:wrong-num-args
- ((lambda (x y) #f)))
-
- (pass-if-exception "((lambda (x y) #f) 1)"
- exception:wrong-num-args
- ((lambda (x y) #f) 1))
-
- (pass-if-exception "((lambda (x y) #f) 1 2 3)"
- exception:wrong-num-args
- ((lambda (x y) #f) 1 2 3))
-
- (pass-if-exception "((lambda (x . rest) #f))"
- exception:wrong-num-args
- ((lambda (x . rest) #f)))
-
- (pass-if-exception "((lambda (x y . rest) #f))"
- exception:wrong-num-args
- ((lambda (x y . rest) #f)))
-
- (pass-if-exception "((lambda (x y . rest) #f) 1)"
- exception:wrong-num-args
- ((lambda (x y . rest) #f) 1))))
-
-;;;
-;;; map
-;;;
-
-(with-test-prefix "map"
-
- ;; Is documentation available?
-
- (expect-fail "documented?"
- (documented? map))
-
- (with-test-prefix "argument error"
-
- (with-test-prefix "non list argument"
- #t)
-
- (with-test-prefix "different length lists"
-
- (pass-if-exception "first list empty"
- exception:out-of-range
- (map + '() '(1)))
-
- (pass-if-exception "second list empty"
- exception:out-of-range
- (map + '(1) '()))
-
- (pass-if-exception "first list shorter"
- exception:out-of-range
- (map + '(1) '(2 3)))
-
- (pass-if-exception "second list shorter"
- exception:out-of-range
- (map + '(1 2) '(3)))
- )))
-
-;;;
-;;; promises
-;;;
-
-(with-test-prefix "promises"
-
- (with-test-prefix "basic promise behaviour"
-
- (pass-if "delay gives a promise"
- (promise? (delay 1)))
-
- (pass-if "force evaluates a promise"
- (eqv? (force (delay (+ 1 2))) 3))
-
- (pass-if "a forced promise is a promise"
- (let ((p (delay (+ 1 2))))
- (force p)
- (promise? p)))
-
- (pass-if "forcing a forced promise works"
- (let ((p (delay (+ 1 2))))
- (force p)
- (eqv? (force p) 3)))
-
- (pass-if "a promise is evaluated once"
- (let* ((x 1)
- (p (delay (+ x 1))))
- (force p)
- (set! x (+ x 1))
- (eqv? (force p) 2)))
-
- (pass-if "a promise may call itself"
- (define p
- (let ((x 0))
- (delay
- (begin
- (set! x (+ x 1))
- (if (> x 1) x (force p))))))
- (eqv? (force p) 2))
-
- (pass-if "a promise carries its environment"
- (let* ((x 1) (p #f))
- (let* ((x 2))
- (set! p (delay (+ x 1))))
- (eqv? (force p) 3)))
-
- (pass-if "a forced promise does not reference its environment"
- (let* ((g (make-guardian))
- (p #f))
- (let* ((x (cons #f #f)))
- (g x)
- (set! p (delay (car x))))
- (force p)
- (gc)
- (if (not (equal? (g) (cons #f #f)))
- (throw 'unresolved)
- #t))))
-
- (with-test-prefix "extended promise behaviour"
-
- (pass-if-exception "forcing a non-promise object is not supported"
- exception:wrong-type-arg
- (force 1))
-
- (pass-if-exception "implicit forcing is not supported"
- exception:wrong-type-arg
- (+ (delay (* 3 7)) 13))))
-
-;;; eval.test ends here
diff --git a/test-suite/tests/exceptions.test b/test-suite/tests/exceptions.test
deleted file mode 100644
index 6e3c0d9cd..000000000
--- a/test-suite/tests/exceptions.test
+++ /dev/null
@@ -1,86 +0,0 @@
-;;;; exceptions.test --- tests for Guile's exception handling -*- scheme -*-
-;;;; Copyright (C) 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-
-
-(with-test-prefix "throw/catch"
-
- (with-test-prefix "wrong type argument"
-
- (pass-if-exception "(throw 1)"
- exception:wrong-type-arg
- (throw 1)))
-
- (with-test-prefix "wrong number of arguments"
-
- (pass-if-exception "(throw)"
- exception:wrong-num-args
- (throw))
-
- (pass-if-exception "throw 1 / catch 0"
- exception:wrong-num-args
- (catch 'a
- (lambda () (throw 'a))
- (lambda () #f)))
-
- (pass-if-exception "throw 2 / catch 1"
- exception:wrong-num-args
- (catch 'a
- (lambda () (throw 'a 2))
- (lambda (x) #f)))
-
- (pass-if-exception "throw 1 / catch 2"
- exception:wrong-num-args
- (catch 'a
- (lambda () (throw 'a))
- (lambda (x y) #f)))
-
- (pass-if-exception "throw 3 / catch 2"
- exception:wrong-num-args
- (catch 'a
- (lambda () (throw 'a 2 3))
- (lambda (y x) #f)))
-
- (pass-if-exception "throw 1 / catch 2+"
- exception:wrong-num-args
- (catch 'a
- (lambda () (throw 'a))
- (lambda (x y . rest) #f)))))
diff --git a/test-suite/tests/format.test b/test-suite/tests/format.test
deleted file mode 100644
index dd740579b..000000000
--- a/test-suite/tests/format.test
+++ /dev/null
@@ -1,39 +0,0 @@
-;;;; format.test --- test suite for Guile's CL-ish format -*- scheme -*-
-;;;; Matthias Koeppe <mkoeppe@mail.math.uni-magdeburg.de> --- June 2001
-;;;;
-;;;; Copyright (C) 2001 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-(use-modules (test-suite lib)
- (ice-9 format))
-
-;;; FORMAT Basic Output
-
-(with-test-prefix "format basic output"
- (pass-if "format ~% produces a new line"
- (string=? (format "~%") "\n"))
- (pass-if "format ~& starts a fresh line"
- (string=? (format "~&abc~&~&") "abc\n"))
- (pass-if "format ~& is stateless but works properly across outputs via port-column"
- (string=?
- (with-output-to-string
- (lambda ()
- (display "xyz")
- (format #t "~&abc")
- (format #f "~&") ; shall have no effect
- (format #t "~&~&")))
- "xyz\nabc\n")))
diff --git a/test-suite/tests/gc.test b/test-suite/tests/gc.test
deleted file mode 100644
index 2617eff69..000000000
--- a/test-suite/tests/gc.test
+++ /dev/null
@@ -1,67 +0,0 @@
-;;;; gc.test --- test guile's garbage collection -*- scheme -*-
-;;;; Copyright (C) 2000, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-
-(use-modules (ice-9 documentation))
-
-
-;;;
-;;; miscellaneous
-;;;
-
-
-(define (documented? object)
- (not (not (object-documentation object))))
-
-
-;;;
-;;;
-;;;
-
-(with-test-prefix "gc"
-
- (pass-if "after-gc-hook gets called"
- (let* ((foo #f)
- (thunk (lambda () (set! foo #t))))
- (add-hook! after-gc-hook thunk)
- (gc)
- (remove-hook! after-gc-hook thunk)
- foo)))
diff --git a/test-suite/tests/getopt-long.test b/test-suite/tests/getopt-long.test
deleted file mode 100644
index fcfe8905f..000000000
--- a/test-suite/tests/getopt-long.test
+++ /dev/null
@@ -1,274 +0,0 @@
-;;;; getopt-long.test --- long options processing -*- scheme -*-
-;;;; Thien-Thi Nguyen <ttn@gnu.org> --- August 2001
-;;;;
-;;;; Copyright (C) 2001 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-(use-modules (test-suite lib)
- (ice-9 getopt-long)
- (ice-9 regex))
-
-(defmacro deferr (name-frag re)
- (let ((name (symbol-append 'exception: name-frag)))
- `(define ,name (cons 'misc-error ,re))))
-
-(deferr no-such-option "^no such option")
-(deferr option-predicate-failed "^option predicate failed")
-(deferr option-does-not-support-arg "^option does not support argument")
-(deferr option-must-be-specified "^option must be specified")
-(deferr option-must-have-arg "^option must be specified with argument")
-
-(with-test-prefix "exported procs"
- (pass-if "`option-ref' defined" (defined? 'option-ref))
- (pass-if "`getopt-long' defined" (defined? 'getopt-long)))
-
-(with-test-prefix "specifying predicate"
-
- (define (test1 . args)
- (getopt-long args
- `((test (value #t)
- (predicate ,(lambda (x)
- (string-match "^[0-9]+$" x)))))))
-
- (pass-if "valid arg"
- (equal? (test1 "foo" "bar" "--test=123")
- '((() "bar") (test . "123"))))
-
- (pass-if-exception "invalid arg"
- exception:option-predicate-failed
- (test1 "foo" "bar" "--test=foo"))
-
- (pass-if-exception "option has no arg"
- exception:option-must-have-arg
- (test1 "foo" "bar" "--test"))
-
- )
-
-(with-test-prefix "not specifying predicate"
-
- (define (test2 . args)
- (getopt-long args `((test (value #t)))))
-
- (pass-if "option has arg"
- (equal? (test2 "foo" "bar" "--test=foo")
- '((() "bar") (test . "foo"))))
-
- (pass-if "option has no arg"
- (equal? (test2 "foo" "bar")
- '((() "bar"))))
-
- )
-
-(with-test-prefix "value optional"
-
- (define (test3 . args)
- (getopt-long args '((foo (value optional) (single-char #\f))
- (bar))))
-
- (pass-if "long option `foo' w/ arg, long option `bar'"
- (equal? (test3 "prg" "--foo" "fooval" "--bar")
- '((()) (bar . #t) (foo . "fooval"))))
-
- (pass-if "short option `foo' w/ arg, long option `bar'"
- (equal? (test3 "prg" "-f" "fooval" "--bar")
- '((()) (bar . #t) (foo . "fooval"))))
-
- (pass-if "short option `foo', long option `bar', no args"
- (equal? (test3 "prg" "-f" "--bar")
- '((()) (bar . #t) (foo . #t))))
-
- (pass-if "long option `foo', long option `bar', no args"
- (equal? (test3 "prg" "--foo" "--bar")
- '((()) (bar . #t) (foo . #t))))
-
- (pass-if "long option `bar', short option `foo', no args"
- (equal? (test3 "prg" "--bar" "-f")
- '((()) (foo . #t) (bar . #t))))
-
- (pass-if "long option `bar', long option `foo', no args"
- (equal? (test3 "prg" "--bar" "--foo")
- '((()) (foo . #t) (bar . #t))))
-
- )
-
-(with-test-prefix "option-ref"
-
- (define (test4 option-arg . args)
- (equal? option-arg (option-ref (getopt-long
- (cons "prog" args)
- '((foo
- (value optional)
- (single-char #\f))
- (bar)))
- 'foo #f)))
-
- (pass-if "option-ref `--foo 4'"
- (test4 "4" "--foo" "4"))
-
- (pass-if "option-ref `-f 4'"
- (test4 "4" "-f" "4"))
-
- (pass-if "option-ref `-f4'"
- (test4 "4" "-f4"))
-
- (pass-if "option-ref `--foo=4'"
- (test4 "4" "--foo=4"))
-
- )
-
-(with-test-prefix "required"
-
- (define (test5 args specs)
- (getopt-long (cons "foo" args) specs))
-
- (pass-if "not mentioned, not given"
- (equal? (test5 '() '())
- '((()))))
-
- (pass-if-exception "not mentioned, given"
- exception:no-such-option
- (test5 '("--req") '((something))))
-
- (pass-if "not specified required, not given"
- (equal? (test5 '() '((req (required? #f))))
- '((()))))
-
- (pass-if "not specified required, given anyway"
- (equal? (test5 '("--req") '((req (required? #f))))
- '((()) (req . #t))))
-
- (pass-if "not specified required, but w/ value, given anyway w/ \"=\" val"
- (equal? (test5 '("--req=7") '((req (required? #f) (value #t))))
- '((()) (req . "7"))))
-
- (pass-if "not specified required, but w/ value, given anyway w/ non-\"=\" val"
- (equal? (test5 '("--req" "7") '((req (required? #f) (value #t))))
- '((()) (req . "7"))))
-
- (pass-if-exception "specified required, not given"
- exception:option-must-be-specified
- (test5 '() '((req (required? #t)))))
-
- )
-
-(with-test-prefix "specified no-value, given anyway"
-
- (define (test6 args specs)
- (getopt-long (cons "foo" args) specs))
-
- (pass-if-exception "using \"=\" syntax"
- exception:option-does-not-support-arg
- (test6 '("--maybe=yes") '((maybe))))
-
- )
-
-(with-test-prefix "specified arg required"
-
- (define (test7 args)
- (getopt-long (cons "foo" args) '((hmm (value #t) (single-char #\H))
- (ignore))))
-
- (pass-if "short opt, arg given"
- (equal? (test7 '("-H" "99"))
- '((()) (hmm . "99"))))
-
- (pass-if "long non-\"=\" opt, arg given"
- (equal? (test7 '("--hmm" "100"))
- '((()) (hmm . "100"))))
-
- (pass-if "long \"=\" opt, arg given"
- (equal? (test7 '("--hmm=101"))
- '((()) (hmm . "101"))))
-
- (pass-if-exception "short opt, arg not given"
- exception:option-must-have-arg
- (test7 '("-H")))
-
- (pass-if-exception "long non-\"=\" opt, arg not given (next arg an option)"
- exception:option-must-have-arg
- (test7 '("--hmm" "--ignore")))
-
- (pass-if-exception "long \"=\" opt, arg not given"
- exception:option-must-have-arg
- (test7 '("--hmm")))
-
- )
-
-(with-test-prefix "apples-blimps-catalexis example"
-
- (define (test8 . args)
- (equal? (sort (getopt-long (cons "foo" args)
- '((apples (single-char #\a))
- (blimps (single-char #\b) (value #t))
- (catalexis (single-char #\c) (value #t))))
- (lambda (a b)
- (cond ((null? (car a)) #t)
- ((null? (car b)) #f)
- (else (string<? (symbol->string (car a))
- (symbol->string (car b)))))))
- '((())
- (apples . #t)
- (blimps . "bang")
- (catalexis . "couth"))))
-
- (pass-if "normal 1" (test8 "-a" "-b" "bang" "-c" "couth"))
- (pass-if "normal 2" (test8 "-ab" "bang" "-c" "couth"))
- (pass-if "normal 3" (test8 "-ac" "couth" "-b" "bang"))
-
- (pass-if-exception "bad ordering causes missing option"
- exception:option-must-have-arg
- (test8 "-abc" "couth" "bang"))
-
- )
-
-(with-test-prefix "multiple occurrances"
-
- (define (test9 . args)
- (equal? (getopt-long (cons "foo" args)
- '((inc (single-char #\I) (value #t))
- (foo (single-char #\f))))
- '((()) (inc . "2") (foo . #t) (inc . "1"))))
-
- ;; terminology:
- ;; sf -- single-char free
- ;; sa -- single-char abutted
- ;; lf -- long free
- ;; la -- long abutted (using "=")
-
- (pass-if "sf/sf" (test9 "-I" "1" "-f" "-I" "2"))
- (pass-if "sa/sa" (test9 "-I1" "-f" "-I2"))
- (pass-if "sf/sa" (test9 "-I" "1" "-f" "-I2"))
- (pass-if "sa/sf" (test9 "-I1" "-f" "-I" "2"))
-
- (pass-if "lf/lf" (test9 "--inc" "1" "-f" "--inc" "2"))
- (pass-if "la/la" (test9 "--inc=1" "-f" "--inc=2"))
- (pass-if "lf/la" (test9 "--inc" "1" "-f" "--inc=2"))
- (pass-if "la/lf" (test9 "--inc=1" "-f" "--inc" "2"))
-
- (pass-if "sf/lf" (test9 "-I" "1" "-f" "--inc" "2"))
- (pass-if "lf/sf" (test9 "--inc" "1" "-f" "-I" "2"))
- (pass-if "sf/la" (test9 "-I" "1" "-f" "--inc=2"))
- (pass-if "la/sf" (test9 "--inc=1" "-f" "-I" "2"))
-
- (pass-if "sa/lf" (test9 "-I1" "-f" "--inc" "2"))
- (pass-if "lf/sa" (test9 "--inc" "1" "-f" "-I2"))
- (pass-if "sa/la" (test9 "-I1" "-f" "--inc=2"))
- (pass-if "la/sa" (test9 "--inc=1" "-f" "-I2"))
-
- )
-
-;;; getopt-long.test ends here
diff --git a/test-suite/tests/goops.test b/test-suite/tests/goops.test
deleted file mode 100644
index 08f1f58ac..000000000
--- a/test-suite/tests/goops.test
+++ /dev/null
@@ -1,169 +0,0 @@
-;;;; goops.test --- test suite for GOOPS -*- scheme -*-
-;;;;
-;;;; Copyright (C) 2001 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-(use-modules (test-suite lib))
-
-(pass-if "GOOPS loads"
- (false-if-exception
- (begin (resolve-module '(oop goops))
- #t)))
-
-(use-modules (oop goops))
-
-;;; more tests here...
-
-(with-test-prefix "basic classes"
-
- (with-test-prefix "<top>"
-
- (pass-if "instance?"
- (instance? <top>))
-
- (pass-if "class-of"
- (eq? (class-of <top>) <class>))
-
- (pass-if "is a class?"
- (is-a? <top> <class>))
-
- (pass-if "class-name"
- (eq? (class-name <top>) '<top>))
-
- (pass-if "direct superclasses"
- (equal? (class-direct-supers <top>) '()))
-
- (pass-if "superclasses"
- (equal? (class-precedence-list <top>) (list <top>)))
-
- (pass-if "direct slots"
- (equal? (class-direct-slots <top>) '()))
-
- (pass-if "slots"
- (equal? (class-slots <top>) '())))
-
- (with-test-prefix "<object>"
-
- (pass-if "instance?"
- (instance? <object>))
-
- (pass-if "class-of"
- (eq? (class-of <object>) <class>))
-
- (pass-if "is a class?"
- (is-a? <object> <class>))
-
- (pass-if "class-name"
- (eq? (class-name <object>) '<object>))
-
- (pass-if "direct superclasses"
- (equal? (class-direct-supers <object>) (list <top>)))
-
- (pass-if "superclasses"
- (equal? (class-precedence-list <object>) (list <object> <top>)))
-
- (pass-if "direct slots"
- (equal? (class-direct-slots <object>) '()))
-
- (pass-if "slots"
- (equal? (class-slots <object>) '())))
-
- (with-test-prefix "<class>"
-
- (pass-if "instance?"
- (instance? <class>))
-
- (pass-if "class-of"
- (eq? (class-of <class>) <class>))
-
- (pass-if "is a class?"
- (is-a? <class> <class>))
-
- (pass-if "class-name"
- (eq? (class-name <class>) '<class>))
-
- (pass-if "direct superclass"
- (equal? (class-direct-supers <class>) (list <object>)))))
-
-(with-test-prefix "defining classes"
-
- (with-test-prefix "define-class"
-
- (pass-if "creating a new binding"
- (eval '(define <foo> #f) (current-module))
- (eval '(undefine <foo>) (current-module))
- (eval '(define-class <foo> ()) (current-module))
- (eval '(is-a? <foo> <class>) (current-module)))
-
- (pass-if "overwriting a binding to a non-class"
- (eval '(define <foo> #f) (current-module))
- (eval '(define-class <foo> ()) (current-module))
- (eval '(is-a? <foo> <class>) (current-module)))))
-
-(with-test-prefix "defining generics"
-
- (with-test-prefix "define-generic"
-
- (pass-if "creating a new top-level binding"
- (eval '(define foo #f) (current-module))
- (eval '(undefine foo) (current-module))
- (eval '(define-generic foo) (current-module))
- (eval '(and (is-a? foo <generic>)
- (null? (generic-function-methods foo)))
- (current-module)))
-
- (pass-if "overwriting a top-level binding to a non-generic"
- (eval '(define (foo) #f) (current-module))
- (eval '(define-generic foo) (current-module))
- (eval '(and (is-a? foo <generic>)
- (= 1 (length (generic-function-methods foo))))
- (current-module)))
-
- (pass-if "overwriting a top-level binding to a generic"
- (eval '(define (foo) #f) (current-module))
- (eval '(define-generic foo) (current-module))
- (eval '(define-generic foo) (current-module))
- (eval '(and (is-a? foo <generic>)
- (null? (generic-function-methods foo)))
- (current-module)))))
-
-(with-test-prefix "defining accessors"
-
- (with-test-prefix "define-accessor"
-
- (pass-if "creating a new top-level binding"
- (eval '(define foo #f) (current-module))
- (eval '(undefine foo) (current-module))
- (eval '(define-accessor foo) (current-module))
- (eval '(and (is-a? foo <generic-with-setter>)
- (null? (generic-function-methods foo)))
- (current-module)))
-
- (pass-if "overwriting a top-level binding to a non-accessor"
- (eval '(define (foo) #f) (current-module))
- (eval '(define-accessor foo) (current-module))
- (eval '(and (is-a? foo <generic-with-setter>)
- (= 1 (length (generic-function-methods foo))))
- (current-module)))
-
- (pass-if "overwriting a top-level binding to an accessor"
- (eval '(define (foo) #f) (current-module))
- (eval '(define-accessor foo) (current-module))
- (eval '(define-accessor foo) (current-module))
- (eval '(and (is-a? foo <generic-with-setter>)
- (null? (generic-function-methods foo)))
- (current-module)))))
diff --git a/test-suite/tests/guardians.test b/test-suite/tests/guardians.test
deleted file mode 100644
index 8fc42c2f6..000000000
--- a/test-suite/tests/guardians.test
+++ /dev/null
@@ -1,65 +0,0 @@
-;;;; guardians.test --- test suite for Guile Guardians -*- scheme -*-
-;;;; Jim Blandy <jimb@red-bean.com> --- July 1999
-;;;;
-;;;; Copyright (C) 1999, 2001 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-;;; These tests make some questionable assumptions.
-;;; - They assume that a GC will find all dead objects, so they
-;;; will become flaky if we have a generational GC.
-;;; - They assume that objects won't be saved by the guardian until
-;;; they explicitly invoke GC --- in other words, they assume that GC
-;;; won't happen too often.
-
-(gc)
-
-(define g1 (make-guardian))
-(define not-g1-garbage (list 'not-g1-garbage))
-(g1 not-g1-garbage)
-(g1 (list 'g1-garbage))
-(pass-if "g1-garbage not collected yet" (equal? (g1) #f))
-(gc)
-(pass-if "g1-garbage saved" (equal? (g1) '(g1-garbage)))
-
-;;; Who guards the guardian?
-(gc)
-(define g2 (make-guardian))
-(g2 (list 'g2-garbage))
-(define g3 (make-guardian))
-(g3 (list 'g3-garbage))
-(g3 g2)
-(pass-if "g2-garbage not collected yet" (equal? (g2) #f))
-(pass-if "g3-garbage not collected yet" (equal? (g3) #f))
-(set! g2 #f)
-(gc)
-(let ((seen-g3-garbage #f)
- (seen-g2 #f)
- (seen-something-else #f))
- (let loop ()
- (let ((saved (g3)))
- (if saved
- (begin
- (cond
- ((equal? saved '(g3-garbage)) (set! seen-g3-garbage #t))
- ((procedure? saved) (set! seen-g2 saved))
- (else (set! seen-something-else #t)))
- (loop)))))
- (pass-if "g3-garbage saved" seen-g3-garbage)
- (pass-if "g2-saved" (procedure? seen-g2))
- (pass-if "nothing else saved" (not seen-something-else))
- (pass-if "g2-garbage saved" (and (procedure? seen-g2)
- (equal? (seen-g2) '(g2-garbage)))))
diff --git a/test-suite/tests/hooks.test b/test-suite/tests/hooks.test
deleted file mode 100644
index 45398d9ff..000000000
--- a/test-suite/tests/hooks.test
+++ /dev/null
@@ -1,149 +0,0 @@
-;;;; hooks.test --- tests guile's hooks implementation -*- scheme -*-
-;;;; Copyright (C) 1999, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-
-;;;
-;;; miscellaneous
-;;;
-
-;; FIXME: Maybe a standard wrong-num-arg exception should be thrown instead
-;; of a misc-error? If so, the tests should be changed to expect failure.
-(define exception:wrong-num-hook-args
- (cons 'misc-error "Hook .* requires .* arguments"))
-
-;;;
-;;; {The tests}
-;;;
-
-(let ((proc1 (lambda (x) (+ x 1)))
- (proc2 (lambda (x) (- x 1)))
- (bad-proc (lambda (x y) #t)))
- (with-test-prefix "hooks"
- (pass-if "make-hook"
- (make-hook 1)
- #t)
-
- (pass-if "add-hook!"
- (let ((x (make-hook 1)))
- (add-hook! x proc1)
- (add-hook! x proc2)
- #t))
-
- (with-test-prefix "add-hook!"
- (pass-if "append"
- (let ((x (make-hook 1)))
- (add-hook! x proc1)
- (add-hook! x proc2 #t)
- (eq? (cadr (hook->list x))
- proc2)))
- (pass-if-exception "illegal proc"
- exception:wrong-type-arg
- (let ((x (make-hook 1)))
- (add-hook! x bad-proc)))
- (pass-if-exception "illegal hook"
- exception:wrong-type-arg
- (add-hook! '(foo) proc1)))
- (pass-if "run-hook"
- (let ((x (make-hook 1)))
- (add-hook! x proc1)
- (add-hook! x proc2)
- (run-hook x 1)
- #t))
- (with-test-prefix "run-hook"
- (pass-if-exception "bad hook"
- exception:wrong-type-arg
- (let ((x (cons 'a 'b)))
- (run-hook x 1)))
- (pass-if-exception "too many args"
- exception:wrong-num-hook-args
- (let ((x (make-hook 1)))
- (add-hook! x proc1)
- (add-hook! x proc2)
- (run-hook x 1 2)))
-
- (pass-if
- "destructive procs"
- (let ((x (make-hook 1))
- (dest-proc1 (lambda (x)
- (set-car! x
- 'i-sunk-your-battleship)))
- (dest-proc2 (lambda (x) (set-cdr! x 'no-way!)))
- (val '(a-game-of battleship)))
- (add-hook! x dest-proc1)
- (add-hook! x dest-proc2 #t)
- (run-hook x val)
- (and (eq? (car val) 'i-sunk-your-battleship)
- (eq? (cdr val) 'no-way!)))))
-
- (with-test-prefix "remove-hook!"
- (pass-if ""
- (let ((x (make-hook 1)))
- (add-hook! x proc1)
- (add-hook! x proc2)
- (remove-hook! x proc1)
- (not (memq proc1 (hook->list x)))))
- ; Maybe it should error, but this is probably
- ; more convienient
- (pass-if "empty hook"
- (let ((x (make-hook 1)))
- (remove-hook! x proc1)
- #t)))
- (pass-if "hook->list"
- (let ((x (make-hook 1)))
- (add-hook! x proc1)
- (add-hook! x proc2)
- (and (memq proc1 (hook->list x))
- (memq proc2 (hook->list x))
- #t)))
- (pass-if "reset-hook!"
- (let ((x (make-hook 1)))
- (add-hook! x proc1)
- (add-hook! x proc2)
- (reset-hook! x)
- (null? (hook->list x))))
- (with-test-prefix "reset-hook!"
- (pass-if "empty hook"
- (let ((x (make-hook 1)))
- (reset-hook! x)
- #t))
- (pass-if-exception "bad hook"
- exception:wrong-type-arg
- (reset-hook! '(a b))))))
diff --git a/test-suite/tests/import.test b/test-suite/tests/import.test
deleted file mode 100644
index f22522f8d..000000000
--- a/test-suite/tests/import.test
+++ /dev/null
@@ -1,76 +0,0 @@
-;;;; import.test --- test selective and renaming imports -*- scheme -*-
-;;;; Copyright (C) 2000, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-
-(define-module (exporter)
- :export (foo bar))
-
-(define foo 1)
-(define bar 2)
-
-(define-module (importer)
- :use-module (test-suite lib))
-
-(use-modules ((exporter)
- :select (foo (bar . baz))))
-
-(pass-if-exception "selective non-import" (cons 'unbound-variable
- "^Unbound variable")
- (= bar 2))
-
-(pass-if "selective import"
- (= foo 1))
-
-(pass-if "renaming import"
- (= baz 2))
-
-(use-modules ((exporter) :renamer (symbol-prefix-proc 'external:)))
-
-(pass-if "symbol-prefic-proc import"
- (and (= external:foo 1)
- (= external:bar 2)))
-
-(use-modules ((exporter) :renamer (lambda (sym)
- (symbol-append sym ':external))))
-
-(pass-if "renamer import"
- (and (= foo:external 1)
- (= bar:external 2)))
diff --git a/test-suite/tests/interp.test b/test-suite/tests/interp.test
deleted file mode 100644
index 5d872759b..000000000
--- a/test-suite/tests/interp.test
+++ /dev/null
@@ -1,53 +0,0 @@
-;;;; interp.test --- tests for bugs in the Guile interpreter -*- scheme -*-
-;;;;
-;;;; Copyright (C) 1999, 2001 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-(pass-if "Internal defines 1"
- (letrec ((foo (lambda (arg)
- (or arg (and (procedure? foo)
- (foo 99))))))
- (define bar (foo #f))
- (= (foo #f) 99)))
-
-(pass-if "Internal defines 2"
- (letrec ((foo 77)
- (bar #f)
- (retfoo (lambda () foo)))
- (define baz (retfoo))
- (= (retfoo) 77)))
-
-;; Test that evaluation of closure bodies works as it should
-
-(with-test-prefix "closure bodies"
- (with-test-prefix "eval"
- (pass-if "expansion"
- ;; we really want exactly #f back from the closure
- (not ((lambda () (define ret #f) ret))))
- (pass-if "iloc escape"
- (not (let* ((x #f)
- (foo (lambda () x)))
- (foo) ; causes memoization of x
- (foo)))))
- (with-test-prefix "apply"
- (pass-if "expansion"
- (not (catch #t (lambda () (define ret #f) ret) (lambda a #t))))
- (pass-if "iloc escape"
- (not (let* ((x #f)
- (foo (lambda () x)))
- (foo)
- (catch #t foo (lambda a #t)))))))
diff --git a/test-suite/tests/list.test b/test-suite/tests/list.test
deleted file mode 100644
index 04929a2cc..000000000
--- a/test-suite/tests/list.test
+++ /dev/null
@@ -1,628 +0,0 @@
-;;;; list.test --- tests guile's lists -*- scheme -*-
-;;;; Copyright (C) 2000, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-
-(use-modules (ice-9 documentation))
-
-
-;;;
-;;; miscellaneous
-;;;
-
-(define (documented? object)
- (not (not (object-documentation object))))
-
-;;
-;; This unique tag is reserved for the unroll and diff-unrolled functions.
-;;
-
-(define circle-indicator
- (cons 'circle 'indicator))
-
-;;
-;; Extract every single scheme object that is contained within OBJ into a new
-;; data structure. That means, if OBJ somewhere contains a pair, the newly
-;; created structure holds a reference to the pair as well as references to
-;; the car and cdr of that pair. For vectors, the newly created structure
-;; holds a reference to that vector as well as references to every element of
-;; that vector. Since this is done recursively, the original data structure
-;; is deeply unrolled. If there are circles within the original data
-;; structures, every reference that points backwards into the data structure
-;; is denoted by storing the circle-indicator tag as well as the object the
-;; circular reference points to.
-;;
-
-(define (unroll obj)
- (let unroll* ((objct obj)
- (hist '()))
- (reverse!
- (let loop ((object objct)
- (histry hist)
- (result '()))
- (if (memq object histry)
- (cons (cons circle-indicator object) result)
- (let ((history (cons object histry)))
- (cond ((pair? object)
- (loop (cdr object) history
- (cons (cons object (unroll* (car object) history))
- result)))
- ((vector? object)
- (cons (cons object
- (map (lambda (x)
- (unroll* x history))
- (vector->list object)))
- result))
- (else (cons object result)))))))))
-
-;;
-;; Compare two data-structures that were generated with unroll. If any of the
-;; elements found not to be eq?, return a pair that holds the position of the
-;; first found differences of the two data structures. If all elements are
-;; found to be eq?, #f is returned.
-;;
-
-(define (diff-unrolled a b)
- (cond ;; has everything been compared already?
- ((and (null? a) (null? b))
- #f)
- ;; do both structures still contain elements?
- ((and (pair? a) (pair? b))
- (cond ;; are the next elements both plain objects?
- ((and (not (pair? (car a))) (not (pair? (car b))))
- (if (eq? (car a) (car b))
- (diff-unrolled (cdr a) (cdr b))
- (cons a b)))
- ;; are the next elements both container objects?
- ((and (pair? (car a)) (pair? (car b)))
- (if (eq? (caar a) (caar b))
- (cond ;; do both objects close a circular structure?
- ((eq? circle-indicator (caar a))
- (if (eq? (cdar a) (cdar b))
- (diff-unrolled (cdr a) (cdr b))
- (cons a b)))
- ;; do both objects hold a vector?
- ((vector? (caar a))
- (or (let loop ((a1 (cdar a)) (b1 (cdar b)))
- (cond
- ((and (null? a1) (null? b1))
- #f)
- ((and (pair? a1) (pair? b1))
- (or (diff-unrolled (car a1) (car b1))
- (loop (cdr a1) (cdr b1))))
- (else
- (cons a1 b1))))
- (diff-unrolled (cdr a) (cdr b))))
- ;; do both objects hold a pair?
- (else
- (or (diff-unrolled (cdar a) (cdar b))
- (diff-unrolled (cdr a) (cdr b)))))
- (cons a b)))
- (else
- (cons a b))))
- (else
- (cons a b))))
-
-;;; list
-
-
-;;; cons*
-
-
-;;; null?
-
-
-;;; list?
-
-
-;;; length
-
-
-;;; append
-
-
-;;;
-;;; append!
-;;;
-
-(with-test-prefix "append!"
-
- (pass-if "documented?"
- (documented? append!))
-
- ;; Is the handling of empty lists as arguments correct?
-
- (pass-if "no arguments"
- (eq? (append!)
- '()))
-
- (pass-if "empty list argument"
- (eq? (append! '())
- '()))
-
- (pass-if "some empty list arguments"
- (eq? (append! '() '() '())
- '()))
-
- ;; Does the last non-empty-list argument remain unchanged?
-
- (pass-if "some empty lists with non-empty list"
- (let* ((foo (list 1 2))
- (foo-unrolled (unroll foo))
- (tst (append! '() '() '() foo))
- (tst-unrolled (unroll tst)))
- (and (eq? tst foo)
- (not (diff-unrolled foo-unrolled tst-unrolled)))))
-
- (pass-if "some empty lists with improper list"
- (let* ((foo (cons 1 2))
- (foo-unrolled (unroll foo))
- (tst (append! '() '() '() foo))
- (tst-unrolled (unroll tst)))
- (and (eq? tst foo)
- (not (diff-unrolled foo-unrolled tst-unrolled)))))
-
- (pass-if "some empty lists with circular list"
- (let ((foo (list 1 2)))
- (set-cdr! (cdr foo) (cdr foo))
- (let* ((foo-unrolled (unroll foo))
- (tst (append! '() '() '() foo))
- (tst-unrolled (unroll tst)))
- (and (eq? tst foo)
- (not (diff-unrolled foo-unrolled tst-unrolled))))))
-
- (pass-if "some empty lists with non list object"
- (let* ((foo (vector 1 2 3))
- (foo-unrolled (unroll foo))
- (tst (append! '() '() '() foo))
- (tst-unrolled (unroll tst)))
- (and (eq? tst foo)
- (not (diff-unrolled foo-unrolled tst-unrolled)))))
-
- (pass-if "non-empty list between empty lists"
- (let* ((foo (list 1 2))
- (foo-unrolled (unroll foo))
- (tst (append! '() '() '() foo '() '() '()))
- (tst-unrolled (unroll tst)))
- (and (eq? tst foo)
- (not (diff-unrolled foo-unrolled tst-unrolled)))))
-
- ;; Are arbitrary lists append!ed correctly?
-
- (pass-if "two one-element lists"
- (let* ((foo (list 1))
- (foo-unrolled (unroll foo))
- (bar (list 2))
- (bar-unrolled (unroll bar))
- (tst (append! foo bar))
- (tst-unrolled (unroll tst))
- (diff-foo-tst (diff-unrolled foo-unrolled tst-unrolled)))
- (and (equal? tst '(1 2))
- (not (diff-unrolled (car diff-foo-tst) (unroll '())))
- (not (diff-unrolled bar-unrolled (cdr diff-foo-tst))))))
-
- (pass-if "three one-element lists"
- (let* ((foo (list 1))
- (foo-unrolled (unroll foo))
- (bar (list 2))
- (bar-unrolled (unroll bar))
- (baz (list 3))
- (baz-unrolled (unroll baz))
- (tst (append! foo bar baz))
- (tst-unrolled (unroll tst))
- (diff-foo-tst (diff-unrolled foo-unrolled tst-unrolled)))
- (and (equal? tst '(1 2 3))
- (not (diff-unrolled (car diff-foo-tst) (unroll '())))
- (let* ((tst-unrolled-2 (cdr diff-foo-tst))
- (diff-foo-bar (diff-unrolled bar-unrolled tst-unrolled-2)))
- (and (not (diff-unrolled (car diff-foo-bar) (unroll '())))
- (not (diff-unrolled baz-unrolled (cdr diff-foo-bar))))))))
-
- (pass-if "two two-element lists"
- (let* ((foo (list 1 2))
- (foo-unrolled (unroll foo))
- (bar (list 3 4))
- (bar-unrolled (unroll bar))
- (tst (append! foo bar))
- (tst-unrolled (unroll tst))
- (diff-foo-tst (diff-unrolled foo-unrolled tst-unrolled)))
- (and (equal? tst '(1 2 3 4))
- (not (diff-unrolled (car diff-foo-tst) (unroll '())))
- (not (diff-unrolled bar-unrolled (cdr diff-foo-tst))))))
-
- (pass-if "three two-element lists"
- (let* ((foo (list 1 2))
- (foo-unrolled (unroll foo))
- (bar (list 3 4))
- (bar-unrolled (unroll bar))
- (baz (list 5 6))
- (baz-unrolled (unroll baz))
- (tst (append! foo bar baz))
- (tst-unrolled (unroll tst))
- (diff-foo-tst (diff-unrolled foo-unrolled tst-unrolled)))
- (and (equal? tst '(1 2 3 4 5 6))
- (not (diff-unrolled (car diff-foo-tst) (unroll '())))
- (let* ((tst-unrolled-2 (cdr diff-foo-tst))
- (diff-foo-bar (diff-unrolled bar-unrolled tst-unrolled-2)))
- (and (not (diff-unrolled (car diff-foo-bar) (unroll '())))
- (not (diff-unrolled baz-unrolled (cdr diff-foo-bar))))))))
-
- (pass-if "empty list between non-empty lists"
- (let* ((foo (list 1 2))
- (foo-unrolled (unroll foo))
- (bar (list 3 4))
- (bar-unrolled (unroll bar))
- (baz (list 5 6))
- (baz-unrolled (unroll baz))
- (tst (append! foo '() bar '() '() baz '() '() '()))
- (tst-unrolled (unroll tst))
- (diff-foo-tst (diff-unrolled foo-unrolled tst-unrolled)))
- (and (equal? tst '(1 2 3 4 5 6))
- (not (diff-unrolled (car diff-foo-tst) (unroll '())))
- (let* ((tst-unrolled-2 (cdr diff-foo-tst))
- (diff-foo-bar (diff-unrolled bar-unrolled tst-unrolled-2)))
- (and (not (diff-unrolled (car diff-foo-bar) (unroll '())))
- (not (diff-unrolled baz-unrolled (cdr diff-foo-bar))))))))
-
- (pass-if "list and improper list"
- (let* ((foo (list 1 2))
- (foo-unrolled (unroll foo))
- (bar (cons 3 4))
- (bar-unrolled (unroll bar))
- (tst (append! foo bar))
- (tst-unrolled (unroll tst))
- (diff-foo-tst (diff-unrolled foo-unrolled tst-unrolled)))
- (and (equal? tst '(1 2 3 . 4))
- (not (diff-unrolled (car diff-foo-tst) (unroll '())))
- (not (diff-unrolled bar-unrolled (cdr diff-foo-tst))))))
-
- (pass-if "list and circular list"
- (let* ((foo (list 1 2))
- (foo-unrolled (unroll foo))
- (bar (list 3 4 5)))
- (set-cdr! (cddr bar) (cdr bar))
- (let* ((bar-unrolled (unroll bar))
- (tst (append! foo bar))
- (tst-unrolled (unroll tst))
- (diff-foo-tst (diff-unrolled foo-unrolled tst-unrolled)))
- (and (equal? (map (lambda (n x) (eqv? (list-ref tst n) x))
- (iota 9)
- '(1 2 3 4 5 4 5 4 5))
- '(#t #t #t #t #t #t #t #t #t))
- (not (diff-unrolled (car diff-foo-tst) (unroll '())))
- (not (diff-unrolled bar-unrolled (cdr diff-foo-tst)))))))
-
- (pass-if "list and non list object"
- (let* ((foo (list 1 2))
- (foo-unrolled (unroll foo))
- (bar (vector 3 4))
- (bar-unrolled (unroll bar))
- (tst (append! foo bar))
- (tst-unrolled (unroll tst))
- (diff-foo-tst (diff-unrolled foo-unrolled tst-unrolled)))
- (and (equal? tst '(1 2 . #(3 4)))
- (not (diff-unrolled (car diff-foo-tst) (unroll '())))
- (not (diff-unrolled bar-unrolled (cdr diff-foo-tst))))))
-
- (pass-if "several arbitrary lists"
- (equal? (append! (list 1 2)
- (list (list 3) 4)
- (list (list 5) (list 6))
- (list 7 (cons 8 9))
- (list 10 11)
- (list (cons 12 13) 14)
- (list (list)))
- (list 1 2
- (list 3) 4
- (list 5) (list 6)
- 7 (cons 8 9)
- 10 11
- (cons 12 13)
- 14 (list))))
-
- (pass-if "list to itself"
- (let* ((foo (list 1 2))
- (foo-unrolled (unroll foo))
- (tst (append! foo foo))
- (tst-unrolled (unroll tst))
- (diff-foo-tst (diff-unrolled foo-unrolled tst-unrolled)))
- (and (equal? (map (lambda (n x) (eqv? (list-ref tst n) x))
- (iota 6)
- '(1 2 1 2 1 2))
- '(#t #t #t #t #t #t))
- (not (diff-unrolled (car diff-foo-tst) (unroll '())))
- (eq? (caar (cdr diff-foo-tst)) circle-indicator)
- (eq? (cdar (cdr diff-foo-tst)) foo))))
-
- ;; Are wrong type arguments detected correctly?
-
- (with-test-prefix "wrong argument"
-
- (expect-fail-exception "improper list and empty list"
- exception:wrong-type-arg
- (append! (cons 1 2) '()))
-
- (expect-fail-exception "improper list and list"
- exception:wrong-type-arg
- (append! (cons 1 2) (list 3 4)))
-
- (expect-fail-exception "list, improper list and list"
- exception:wrong-type-arg
- (append! (list 1 2) (cons 3 4) (list 5 6)))
-
- (expect-fail "circular list and empty list"
- (let ((foo (list 1 2 3)))
- (set-cdr! (cddr foo) (cdr foo))
- (catch #t
- (lambda ()
- (catch 'wrong-type-arg
- (lambda ()
- (append! foo '())
- #f)
- (lambda (key . args)
- #t)))
- (lambda (key . args)
- #f))))
-
- (expect-fail "circular list and list"
- (let ((foo (list 1 2 3)))
- (set-cdr! (cddr foo) (cdr foo))
- (catch #t
- (lambda ()
- (catch 'wrong-type-arg
- (lambda ()
- (append! foo (list 4 5))
- #f)
- (lambda (key . args)
- #t)))
- (lambda (key . args)
- #f))))
-
- (expect-fail "list, circular list and list"
- (let ((foo (list 3 4 5)))
- (set-cdr! (cddr foo) (cdr foo))
- (catch #t
- (lambda ()
- (catch 'wrong-type-arg
- (lambda ()
- (append! (list 1 2) foo (list 6 7))
- #f)
- (lambda (key . args)
- #t)))
- (lambda (key . args)
- #f))))))
-
-
-;;; last-pair
-
-
-;;; reverse
-
-
-;;; reverse!
-
-
-;;; list-ref
-
-(with-test-prefix "list-ref"
-
- (pass-if "documented?"
- (documented? list-ref))
-
- (with-test-prefix "argument error"
-
- (with-test-prefix "non list argument"
- #t)
-
- (with-test-prefix "improper list argument"
- #t)
-
- (with-test-prefix "non integer index"
- #t)
-
- (with-test-prefix "index out of range"
-
- (with-test-prefix "empty list"
-
- (pass-if-exception "index 0"
- exception:out-of-range
- (list-ref '() 0))
-
- (pass-if-exception "index > 0"
- exception:out-of-range
- (list-ref '() 1))
-
- (pass-if-exception "index < 0"
- exception:out-of-range
- (list-ref '() -1)))
-
- (with-test-prefix "non-empty list"
-
- (pass-if-exception "index > length"
- exception:out-of-range
- (list-ref '(1) 1))
-
- (pass-if-exception "index < 0"
- exception:out-of-range
- (list-ref '(1) -1))))))
-
-
-;;; list-set!
-
-(with-test-prefix "list-set!"
-
- (pass-if "documented?"
- (documented? list-set!))
-
- (with-test-prefix "argument error"
-
- (with-test-prefix "non list argument"
- #t)
-
- (with-test-prefix "improper list argument"
- #t)
-
- (with-test-prefix "read-only list argument"
- #t)
-
- (with-test-prefix "non integer index"
- #t)
-
- (with-test-prefix "index out of range"
-
- (with-test-prefix "empty list"
-
- (pass-if-exception "index 0"
- exception:out-of-range
- (list-set! (list) 0 #t))
-
- (pass-if-exception "index > 0"
- exception:out-of-range
- (list-set! (list) 1 #t))
-
- (pass-if-exception "index < 0"
- exception:out-of-range
- (list-set! (list) -1 #t)))
-
- (with-test-prefix "non-empty list"
-
- (pass-if-exception "index > length"
- exception:out-of-range
- (list-set! (list 1) 1 #t))
-
- (pass-if-exception "index < 0"
- exception:out-of-range
- (list-set! (list 1) -1 #t))))))
-
-
-;;; list-cdr-ref
-
-
-;;; list-tail
-
-
-;;; list-cdr-set!
-
-(with-test-prefix "list-cdr-set!"
-
- (pass-if "documented?"
- (documented? list-cdr-set!))
-
- (with-test-prefix "argument error"
-
- (with-test-prefix "non list argument"
- #t)
-
- (with-test-prefix "improper list argument"
- #t)
-
- (with-test-prefix "read-only list argument"
- #t)
-
- (with-test-prefix "non integer index"
- #t)
-
- (with-test-prefix "index out of range"
-
- (with-test-prefix "empty list"
-
- (pass-if-exception "index 0"
- exception:out-of-range
- (list-cdr-set! (list) 0 #t))
-
- (pass-if-exception "index > 0"
- exception:out-of-range
- (list-cdr-set! (list) 1 #t))
-
- (pass-if-exception "index < 0"
- exception:out-of-range
- (list-cdr-set! (list) -1 #t)))
-
- (with-test-prefix "non-empty list"
-
- (pass-if-exception "index > length"
- exception:out-of-range
- (list-cdr-set! (list 1) 1 #t))
-
- (pass-if-exception "index < 0"
- exception:out-of-range
- (list-cdr-set! (list 1) -1 #t))))))
-
-
-;;; list-head
-
-
-;;; list-copy
-
-
-;;; memq
-
-
-;;; memv
-
-
-;;; member
-
-
-;;; delq!
-
-
-;;; delv!
-
-
-;;; delete!
-
-
-;;; delq
-
-
-;;; delv
-
-
-;;; delete
-
-
-;;; delq1!
-
-
-;;; delv1!
-
-
-;;; delete1!
diff --git a/test-suite/tests/load.test b/test-suite/tests/load.test
deleted file mode 100644
index 6b0de7612..000000000
--- a/test-suite/tests/load.test
+++ /dev/null
@@ -1,126 +0,0 @@
-;;;; load.test --- test LOAD and path searching functions -*- scheme -*-
-;;;; Jim Blandy <jimb@red-bean.com> --- September 1999
-;;;;
-;;;; Copyright (C) 1999, 2001 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-(use-modules (test-suite lib))
-
-(define temp-dir (data-file-name "load-test.dir"))
-
-(define (create-tree parent tree)
- (let loop ((parent parent)
- (tree tree))
- (if (pair? tree)
- (let ((elt (car tree)))
- (cond
-
- ;; A string means to create an empty file with that name.
- ((string? elt)
- (close-port (open-file (string-append parent "/" elt) "w")))
-
- ;; A list means to create a directory, and then create files
- ;; within it.
- ((pair? elt)
- (let ((dirname (string-append parent "/" (car elt))))
- (mkdir dirname)
- (loop dirname (cdr elt))))
-
- (else
- (error "create-tree: bad tree structure")))
-
- (loop parent (cdr tree))))))
-
-(define (delete-tree tree)
- (cond
- ((file-is-directory? tree)
- (let ((dir (opendir tree)))
- (let loop ()
- (let ((entry (readdir dir)))
- (cond
- ((member entry '("." ".."))
- (loop))
- ((not (eof-object? entry))
- (let ((name (string-append tree "/" entry)))
- (delete-tree name)
- (loop))))))
- (closedir dir)
- (rmdir tree)))
- ((file-exists? tree)
- (delete-file tree))
- (else
- (error "delete-tree: can't delete " tree))))
-
-(define (try-search-with-extensions path input extensions expected)
- (let ((test-name (call-with-output-string
- (lambda (port)
- (display "search-path for " port)
- (write input port)
- (if (pair? extensions)
- (begin
- (display " with extensions " port)
- (write extensions port)))
- (display " yields " port)
- (write expected port)))))
- (let ((result (search-path path input extensions)))
- (pass-if test-name
- (equal? (if (string? expected)
- (string-append temp-dir "/" expected)
- expected)
- result)))))
-
-(define (try-search path input expected)
- (try-search-with-extensions path input '() expected))
-
-;; Create a bunch of files for use in testing.
-(mkdir temp-dir)
-(create-tree temp-dir
- '(("dir1" "foo.scm" "bar.scm" "ugly.scm.scm"
- ("subdir1"))
- ("dir2" "foo.scm" "baz.scm" "baz.ss" "ugly.scm.ss")
- ("dir3" "ugly.scm" "ugly.ss.scm")))
-
-;; Try some searches without extensions.
-(define path (list
- (string-append temp-dir "/dir1")
- (string-append temp-dir "/dir2")
- (string-append temp-dir "/dir3")))
-
-(try-search path "foo.scm" "dir1/foo.scm")
-(try-search path "bar.scm" "dir1/bar.scm")
-(try-search path "baz.scm" "dir2/baz.scm")
-(try-search path "baz.ss" "dir2/baz.ss")
-(try-search path "ugly.scm" "dir3/ugly.scm")
-(try-search path "subdir1" #f)
-
-(define extensions '(".ss" ".scm" ""))
-(try-search-with-extensions path "foo" extensions "dir1/foo.scm")
-(try-search-with-extensions path "bar" extensions "dir1/bar.scm")
-(try-search-with-extensions path "baz" extensions "dir2/baz.ss")
-(try-search-with-extensions path "ugly.scm" extensions "dir3/ugly.scm")
-(try-search-with-extensions path "ugly.ss" extensions #f)
-
-(if (defined? '%nil)
- ;; Check that search-path accepts Elisp nil-terminated lists for
- ;; PATH and EXTENSIONS.
- (with-test-prefix "elisp-nil"
- (set-cdr! (last-pair path) %nil)
- (set-cdr! (last-pair extensions) %nil)
- (try-search-with-extensions path "ugly.scm" extensions "dir3/ugly.scm")
- (try-search-with-extensions path "ugly.ss" extensions #f)))
-
-(delete-tree temp-dir)
diff --git a/test-suite/tests/multilingual.nottest b/test-suite/tests/multilingual.nottest
deleted file mode 100644
index 468acd924..000000000
--- a/test-suite/tests/multilingual.nottest
+++ /dev/null
@@ -1,81 +0,0 @@
-;;;; multilingual.nottest --- tests of multilingual support -*- scheme -*-
-;;;; Jim Blandy <jimb@red-bean.com> --- September 1999
-;;;; This isn't a test yet, because we don't have multilingual support yet.
-;;;;
-;;;; Copyright (C) 1999 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-(use-modules (test-suite lib))
-
-
-;;; Tests of Emacs 20.4 character encoding.
-
-;;; Check that characters are being encoded correctly.
-
-;;; These tests are specific to the Emacs 20.4 encoding; they'll need
-;;; to be replaced when Guile switches to UTF-8. See mb.c for a
-;;; description of this encoding.
-
-(define (check-encoding char-number encoding)
- (let ((singleton (string (integer->char char-number))))
- (pass-if (string-append "encoding character "
- (number->string char-number))
- (equal? (string->bytes singleton) encoding))
- (pass-if (string-append "decoding character "
- (number->string char-number))
- (catch #t
- (lambda ()
- (equal? (bytes->string encoding) singleton))
- (lambda dummy #f)))))
-
-
-;; Check some ASCII characters.
-(check-encoding 0 #y(0))
-(check-encoding 127 #y(127))
-(check-encoding 31 #y(31))
-(check-encoding 32 #y(32))
-(check-encoding 42 #y(42))
-
-;;; Sometimes we mark something as an "end of range", when it's not
-;;; actually the last character that would use that encoding form.
-;;; This is because not all character set numbers are assigned, and we
-;;; can't use unassigned character set numbers. So the value given is
-;;; the last value which actually corresponds to something in a real
-;;; character set.
-
-;; Check some characters encoded in two bytes.
-(check-encoding 2208 #y(#x81 #xA0)) ; beginning of range
-(check-encoding 3839 #y(#x8d #xFF)) ; end of range
-(check-encoding 2273 #y(#x81 #xE1))
-
-;; Check some big characters encoded in three bytes.
-(check-encoding 20512 #y(#x90 #xA0 #xA0)) ; beginning of range
-(check-encoding 180223 #y(#x99 #xFF #xFF)) ; end of range
-(check-encoding 53931 #y(#x92 #xA5 #xAB))
-
-;; Check some small characters encoded in three bytes --- some from
-;; the #x9A prefix range, and some from the #x9B prefix range.
-(check-encoding 6176 #y(#x9A #xA0 #xA0)) ; start of the #9A prefix range
-(check-encoding 7167 #y(#x9A #xA7 #xFF)) ; end of the #9A prefix range
-(check-encoding 14368 #y(#x9B #xE0 #xA0)) ; start of the #9B prefix range
-(check-encoding 14591 #y(#x9B #xE1 #xFF)) ; end of the #9B prefix range
-
-;; Check some characters encoded in four bytes.
-(check-encoding 266272 #y(#x9C #xF0 #xA0 #xA0)) ; start of the #9C prefix range
-(check-encoding 294911 #y(#x9C #xF1 #xFF #xFF)) ; end of the #9C prefix range
-(check-encoding 348192 #y(#x9D #xF5 #xA0 #xA0)) ; start of the #9D prefix range
-(check-encoding 475135 #y(#x9D #xFC #xFF #xFF)) ; start of the #9D prefix range
diff --git a/test-suite/tests/numbers.test b/test-suite/tests/numbers.test
deleted file mode 100644
index 951325f71..000000000
--- a/test-suite/tests/numbers.test
+++ /dev/null
@@ -1,1490 +0,0 @@
-;;;; numbers.test --- tests guile's numbers -*- scheme -*-
-;;;; Copyright (C) 2000, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-
-(use-modules (ice-9 documentation))
-
-
-;;;
-;;; miscellaneous
-;;;
-
-(define exception:numerical-overflow
- (cons 'numerical-overflow "^Numerical overflow"))
-
-(define (documented? object)
- (not (not (object-documentation object))))
-
-(define fixnum-bit
- (inexact->exact (+ (/ (log (+ most-positive-fixnum 1)) (log 2)) 1)))
-
-(define fixnum-min most-negative-fixnum)
-(define fixnum-max most-positive-fixnum)
-
-
-;;;
-;;; exact?
-;;;
-
-(with-test-prefix "exact?"
-
- (pass-if "documented?"
- (documented? exact?))
-
- (with-test-prefix "integers"
-
- (pass-if "0"
- (exact? 0))
-
- (pass-if "fixnum-max"
- (exact? fixnum-max))
-
- (pass-if "fixnum-max + 1"
- (exact? (+ fixnum-max 1)))
-
- (pass-if "fixnum-min"
- (exact? fixnum-min))
-
- (pass-if "fixnum-min - 1"
- (exact? (- fixnum-min 1))))
-
- (with-test-prefix "reals"
-
- ;; (FIXME: need better examples.)
-
- (pass-if "sqrt (fixnum-max^2 - 1)"
- (eq? #f (exact? (sqrt (- (expt fixnum-max 2) 1)))))
-
- (pass-if "sqrt ((fixnum-max+1)^2 - 1)"
- (eq? #f (exact? (sqrt (- (expt (+ fixnum-max 1) 2) 1)))))))
-
-;;;
-;;; odd?
-;;;
-
-
-;;;
-;;; even?
-;;;
-
-
-;;;
-;;; abs
-;;;
-
-
-;;;
-;;; quotient
-;;;
-
-(with-test-prefix "quotient"
-
- (expect-fail "documented?"
- (documented? quotient))
-
- (with-test-prefix "0 / n"
-
- (pass-if "n = 1"
- (eqv? 0 (quotient 0 1)))
-
- (pass-if "n = -1"
- (eqv? 0 (quotient 0 -1)))
-
- (pass-if "n = 2"
- (eqv? 0 (quotient 0 2)))
-
- (pass-if "n = fixnum-max"
- (eqv? 0 (quotient 0 fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? 0 (quotient 0 (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? 0 (quotient 0 fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? 0 (quotient 0 (- fixnum-min 1)))))
-
- (with-test-prefix "1 / n"
-
- (pass-if "n = 1"
- (eqv? 1 (quotient 1 1)))
-
- (pass-if "n = -1"
- (eqv? -1 (quotient 1 -1)))
-
- (pass-if "n = 2"
- (eqv? 0 (quotient 1 2)))
-
- (pass-if "n = fixnum-max"
- (eqv? 0 (quotient 1 fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? 0 (quotient 1 (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? 0 (quotient 1 fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? 0 (quotient 1 (- fixnum-min 1)))))
-
- (with-test-prefix "-1 / n"
-
- (pass-if "n = 1"
- (eqv? -1 (quotient -1 1)))
-
- (pass-if "n = -1"
- (eqv? 1 (quotient -1 -1)))
-
- (pass-if "n = 2"
- (eqv? 0 (quotient -1 2)))
-
- (pass-if "n = fixnum-max"
- (eqv? 0 (quotient -1 fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? 0 (quotient -1 (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? 0 (quotient -1 fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? 0 (quotient -1 (- fixnum-min 1)))))
-
- (with-test-prefix "fixnum-max / n"
-
- (pass-if "n = 1"
- (eqv? fixnum-max (quotient fixnum-max 1)))
-
- (pass-if "n = -1"
- (eqv? (- fixnum-max) (quotient fixnum-max -1)))
-
- (pass-if "n = 2"
- (eqv? fixnum-max (+ (* (quotient fixnum-max 2) 2) 1)))
-
- (pass-if "n = fixnum-max"
- (eqv? 1 (quotient fixnum-max fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? 0 (quotient fixnum-max (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? 0 (quotient fixnum-max fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? 0 (quotient fixnum-max (- fixnum-min 1)))))
-
- (with-test-prefix "(fixnum-max + 1) / n"
-
- (pass-if "n = 1"
- (eqv? (+ fixnum-max 1) (quotient (+ fixnum-max 1) 1)))
-
- (pass-if "n = -1"
- (eqv? (- (+ fixnum-max 1)) (quotient (+ fixnum-max 1) -1)))
-
- (pass-if "n = 2"
- (eqv? (+ fixnum-max 1) (* (quotient (+ fixnum-max 1) 2) 2)))
-
- (pass-if "n = fixnum-max"
- (eqv? 1 (quotient (+ fixnum-max 1) fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? 1 (quotient (+ fixnum-max 1) (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? -1 (quotient (+ fixnum-max 1) fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? 0 (quotient (+ fixnum-max 1) (- fixnum-min 1)))))
-
- (with-test-prefix "fixnum-min / n"
-
- (pass-if "n = 1"
- (eqv? fixnum-min (quotient fixnum-min 1)))
-
- (pass-if "n = -1"
- (eqv? (- fixnum-min) (quotient fixnum-min -1)))
-
- (pass-if "n = 2"
- (eqv? fixnum-min (* (quotient fixnum-min 2) 2)))
-
- (pass-if "n = fixnum-max"
- (eqv? -1 (quotient fixnum-min fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? -1 (quotient fixnum-min (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? 1 (quotient fixnum-min fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? 0 (quotient fixnum-min (- fixnum-min 1)))))
-
- (with-test-prefix "(fixnum-min - 1) / n"
-
- (pass-if "n = 1"
- (eqv? (- fixnum-min 1) (quotient (- fixnum-min 1) 1)))
-
- (pass-if "n = -1"
- (eqv? (- (- fixnum-min 1)) (quotient (- fixnum-min 1) -1)))
-
- (pass-if "n = 2"
- (eqv? fixnum-min (* (quotient (- fixnum-min 1) 2) 2)))
-
- (pass-if "n = fixnum-max"
- (eqv? -1 (quotient (- fixnum-min 1) fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? -1 (quotient (- fixnum-min 1) (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? 1 (quotient (- fixnum-min 1) fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? 1 (quotient (- fixnum-min 1) (- fixnum-min 1)))))
-
- ;; Positive dividend and divisor
-
- (pass-if "35 / 7"
- (eqv? 5 (quotient 35 7)))
-
- ;; Negative dividend, positive divisor
-
- (pass-if "-35 / 7"
- (eqv? -5 (quotient -35 7)))
-
- ;; Positive dividend, negative divisor
-
- (pass-if "35 / -7"
- (eqv? -5 (quotient 35 -7)))
-
- ;; Negative dividend and divisor
-
- (pass-if "-35 / -7"
- (eqv? 5 (quotient -35 -7)))
-
- ;; Are numerical overflows detected correctly?
-
- (with-test-prefix "division by zero"
-
- (pass-if-exception "(quotient 1 0)"
- exception:numerical-overflow
- (quotient 1 0))
-
- (pass-if-exception "(quotient bignum 0)"
- exception:numerical-overflow
- (quotient (+ fixnum-max 1) 0)))
-
- ;; Are wrong type arguments detected correctly?
-
- )
-
-;;;
-;;; remainder
-;;;
-
-(with-test-prefix "remainder"
-
- (expect-fail "documented?"
- (documented? remainder))
-
- (with-test-prefix "0 / n"
-
- (pass-if "n = 1"
- (eqv? 0 (remainder 0 1)))
-
- (pass-if "n = -1"
- (eqv? 0 (remainder 0 -1)))
-
- (pass-if "n = fixnum-max"
- (eqv? 0 (remainder 0 fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? 0 (remainder 0 (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? 0 (remainder 0 fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? 0 (remainder 0 (- fixnum-min 1)))))
-
- (with-test-prefix "1 / n"
-
- (pass-if "n = 1"
- (eqv? 0 (remainder 1 1)))
-
- (pass-if "n = -1"
- (eqv? 0 (remainder 1 -1)))
-
- (pass-if "n = fixnum-max"
- (eqv? 1 (remainder 1 fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? 1 (remainder 1 (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? 1 (remainder 1 fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? 1 (remainder 1 (- fixnum-min 1)))))
-
- (with-test-prefix "-1 / n"
-
- (pass-if "n = 1"
- (eqv? 0 (remainder -1 1)))
-
- (pass-if "n = -1"
- (eqv? 0 (remainder -1 -1)))
-
- (pass-if "n = fixnum-max"
- (eqv? -1 (remainder -1 fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? -1 (remainder -1 (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? -1 (remainder -1 fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? -1 (remainder -1 (- fixnum-min 1)))))
-
- (with-test-prefix "fixnum-max / n"
-
- (pass-if "n = 1"
- (eqv? 0 (remainder fixnum-max 1)))
-
- (pass-if "n = -1"
- (eqv? 0 (remainder fixnum-max -1)))
-
- (pass-if "n = fixnum-max"
- (eqv? 0 (remainder fixnum-max fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? fixnum-max (remainder fixnum-max (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? fixnum-max (remainder fixnum-max fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? fixnum-max (remainder fixnum-max (- fixnum-min 1)))))
-
- (with-test-prefix "(fixnum-max + 1) / n"
-
- (pass-if "n = 1"
- (eqv? 0 (remainder (+ fixnum-max 1) 1)))
-
- (pass-if "n = -1"
- (eqv? 0 (remainder (+ fixnum-max 1) -1)))
-
- (pass-if "n = fixnum-max"
- (eqv? 1 (remainder (+ fixnum-max 1) fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? 0 (remainder (+ fixnum-max 1) (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? 0 (remainder (+ fixnum-max 1) fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? (+ fixnum-max 1) (remainder (+ fixnum-max 1) (- fixnum-min 1)))))
-
- (with-test-prefix "fixnum-min / n"
-
- (pass-if "n = 1"
- (eqv? 0 (remainder fixnum-min 1)))
-
- (pass-if "n = -1"
- (eqv? 0 (remainder fixnum-min -1)))
-
- (pass-if "n = fixnum-max"
- (eqv? -1 (remainder fixnum-min fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? 0 (remainder fixnum-min (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? 0 (remainder fixnum-min fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? fixnum-min (remainder fixnum-min (- fixnum-min 1)))))
-
- (with-test-prefix "(fixnum-min - 1) / n"
-
- (pass-if "n = 1"
- (eqv? 0 (remainder (- fixnum-min 1) 1)))
-
- (pass-if "n = -1"
- (eqv? 0 (remainder (- fixnum-min 1) -1)))
-
- (pass-if "n = fixnum-max"
- (eqv? -2 (remainder (- fixnum-min 1) fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? -1 (remainder (- fixnum-min 1) (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? -1 (remainder (- fixnum-min 1) fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? 0 (remainder (- fixnum-min 1) (- fixnum-min 1)))))
-
- ;; Positive dividend and divisor
-
- (pass-if "35 / 7"
- (eqv? 0 (remainder 35 7)))
-
- ;; Negative dividend, positive divisor
-
- (pass-if "-35 / 7"
- (eqv? 0 (remainder -35 7)))
-
- ;; Positive dividend, negative divisor
-
- (pass-if "35 / -7"
- (eqv? 0 (remainder 35 -7)))
-
- ;; Negative dividend and divisor
-
- (pass-if "-35 / -7"
- (eqv? 0 (remainder -35 -7)))
-
- ;; Are numerical overflows detected correctly?
-
- (with-test-prefix "division by zero"
-
- (pass-if-exception "(remainder 1 0)"
- exception:numerical-overflow
- (remainder 1 0))
-
- (pass-if-exception "(remainder bignum 0)"
- exception:numerical-overflow
- (remainder (+ fixnum-max 1) 0)))
-
- ;; Are wrong type arguments detected correctly?
-
- )
-
-;;;
-;;; modulo
-;;;
-
-(with-test-prefix "modulo"
-
- (expect-fail "documented?"
- (documented? modulo))
-
- (with-test-prefix "0 % n"
-
- (pass-if "n = 1"
- (eqv? 0 (modulo 0 1)))
-
- (pass-if "n = -1"
- (eqv? 0 (modulo 0 -1)))
-
- (pass-if "n = fixnum-max"
- (eqv? 0 (modulo 0 fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? 0 (modulo 0 (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? 0 (modulo 0 fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? 0 (modulo 0 (- fixnum-min 1)))))
-
- (with-test-prefix "1 % n"
-
- (pass-if "n = 1"
- (eqv? 0 (modulo 1 1)))
-
- (pass-if "n = -1"
- (eqv? 0 (modulo 1 -1)))
-
- (pass-if "n = fixnum-max"
- (eqv? 1 (modulo 1 fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? 1 (modulo 1 (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? (+ fixnum-min 1) (modulo 1 fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? fixnum-min (modulo 1 (- fixnum-min 1)))))
-
- (with-test-prefix "-1 % n"
-
- (pass-if "n = 1"
- (eqv? 0 (modulo -1 1)))
-
- (pass-if "n = -1"
- (eqv? 0 (modulo -1 -1)))
-
- (pass-if "n = fixnum-max"
- (eqv? (- fixnum-max 1) (modulo -1 fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? fixnum-max (modulo -1 (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? -1 (modulo -1 fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? -1 (modulo -1 (- fixnum-min 1)))))
-
- (with-test-prefix "fixnum-max % n"
-
- (pass-if "n = 1"
- (eqv? 0 (modulo fixnum-max 1)))
-
- (pass-if "n = -1"
- (eqv? 0 (modulo fixnum-max -1)))
-
- (pass-if "n = fixnum-max"
- (eqv? 0 (modulo fixnum-max fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? fixnum-max (modulo fixnum-max (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? -1 (modulo fixnum-max fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? -2 (modulo fixnum-max (- fixnum-min 1)))))
-
- (with-test-prefix "(fixnum-max + 1) % n"
-
- (pass-if "n = 1"
- (eqv? 0 (modulo (+ fixnum-max 1) 1)))
-
- (pass-if "n = -1"
- (eqv? 0 (modulo (+ fixnum-max 1) -1)))
-
- (pass-if "n = fixnum-max"
- (eqv? 1 (modulo (+ fixnum-max 1) fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? 0 (modulo (+ fixnum-max 1) (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? 0 (modulo (+ fixnum-max 1) fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? -1 (modulo (+ fixnum-max 1) (- fixnum-min 1)))))
-
- (with-test-prefix "fixnum-min % n"
-
- (pass-if "n = 1"
- (eqv? 0 (modulo fixnum-min 1)))
-
- (pass-if "n = -1"
- (eqv? 0 (modulo fixnum-min -1)))
-
- (pass-if "n = fixnum-max"
- (eqv? (- fixnum-max 1) (modulo fixnum-min fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? 0 (modulo fixnum-min (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? 0 (modulo fixnum-min fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? fixnum-min (modulo fixnum-min (- fixnum-min 1)))))
-
- (with-test-prefix "(fixnum-min - 1) % n"
-
- (pass-if "n = 1"
- (eqv? 0 (modulo (- fixnum-min 1) 1)))
-
- (pass-if "n = -1"
- (eqv? 0 (modulo (- fixnum-min 1) -1)))
-
- (pass-if "n = fixnum-max"
- (eqv? (- fixnum-max 2) (modulo (- fixnum-min 1) fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? fixnum-max (modulo (- fixnum-min 1) (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? -1 (modulo (- fixnum-min 1) fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? 0 (modulo (- fixnum-min 1) (- fixnum-min 1)))))
-
- ;; Positive dividend and divisor
-
- (pass-if "13 % 4"
- (eqv? 1 (modulo 13 4)))
-
- (pass-if "2177452800 % 86400"
- (eqv? 0 (modulo 2177452800 86400)))
-
- ;; Negative dividend, positive divisor
-
- (pass-if "-13 % 4"
- (eqv? 3 (modulo -13 4)))
-
- (pass-if "-2177452800 % 86400"
- (eqv? 0 (modulo -2177452800 86400)))
-
- ;; Positive dividend, negative divisor
-
- (pass-if "13 % -4"
- (eqv? -3 (modulo 13 -4)))
-
- (pass-if "2177452800 % -86400"
- (eqv? 0 (modulo 2177452800 -86400)))
-
- ;; Negative dividend and divisor
-
- (pass-if "-13 % -4"
- (eqv? -1 (modulo -13 -4)))
-
- (pass-if "-2177452800 % -86400"
- (eqv? 0 (modulo -2177452800 -86400)))
-
- ;; Are numerical overflows detected correctly?
-
- (with-test-prefix "division by zero"
-
- (pass-if-exception "(modulo 1 0)"
- exception:numerical-overflow
- (modulo 1 0))
-
- (pass-if-exception "(modulo bignum 0)"
- exception:numerical-overflow
- (modulo (+ fixnum-max 1) 0)))
-
- ;; Are wrong type arguments detected correctly?
-
- )
-
-;;;
-;;; gcd
-;;;
-
-(with-test-prefix "gcd"
-
- (expect-fail "documented?"
- (documented? gcd))
-
- (with-test-prefix "(0 n)"
-
- (pass-if "n = 0"
- (eqv? 0 (gcd 0 0)))
-
- (pass-if "n = 1"
- (eqv? 1 (gcd 0 1)))
-
- (pass-if "n = -1"
- (eqv? 1 (gcd 0 -1)))
-
- (pass-if "n = fixnum-max"
- (eqv? fixnum-max (gcd 0 fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? (+ fixnum-max 1) (gcd 0 (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? (- fixnum-min) (gcd 0 fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? (- (- fixnum-min 1)) (gcd 0 (- fixnum-min 1)))))
-
- (with-test-prefix "(1 n)"
-
- (pass-if "n = 0"
- (eqv? 1 (gcd 1 0)))
-
- (pass-if "n = 1"
- (eqv? 1 (gcd 1 1)))
-
- (pass-if "n = -1"
- (eqv? 1 (gcd 1 -1)))
-
- (pass-if "n = fixnum-max"
- (eqv? 1 (gcd 1 fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? 1 (gcd 1 (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? 1 (gcd 1 fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? 1 (gcd 1 (- fixnum-min 1)))))
-
- (with-test-prefix "(-1 n)"
-
- (pass-if "n = 0"
- (eqv? 1 (gcd -1 0)))
-
- (pass-if "n = 1"
- (eqv? 1 (gcd -1 1)))
-
- (pass-if "n = -1"
- (eqv? 1 (gcd -1 -1)))
-
- (pass-if "n = fixnum-max"
- (eqv? 1 (gcd -1 fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? 1 (gcd -1 (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? 1 (gcd -1 fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? 1 (gcd -1 (- fixnum-min 1)))))
-
- (with-test-prefix "(fixnum-max n)"
-
- (pass-if "n = 0"
- (eqv? fixnum-max (gcd fixnum-max 0)))
-
- (pass-if "n = 1"
- (eqv? 1 (gcd fixnum-max 1)))
-
- (pass-if "n = -1"
- (eqv? 1 (gcd fixnum-max -1)))
-
- (pass-if "n = fixnum-max"
- (eqv? fixnum-max (gcd fixnum-max fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? 1 (gcd fixnum-max (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? 1 (gcd fixnum-max fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? 1 (gcd fixnum-max (- fixnum-min 1)))))
-
- (with-test-prefix "((+ fixnum-max 1) n)"
-
- (pass-if "n = 0"
- (eqv? (+ fixnum-max 1) (gcd (+ fixnum-max 1) 0)))
-
- (pass-if "n = 1"
- (eqv? 1 (gcd (+ fixnum-max 1) 1)))
-
- (pass-if "n = -1"
- (eqv? 1 (gcd (+ fixnum-max 1) -1)))
-
- (pass-if "n = fixnum-max"
- (eqv? 1 (gcd (+ fixnum-max 1) fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? (+ fixnum-max 1) (gcd (+ fixnum-max 1) (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? (+ fixnum-max 1) (gcd (+ fixnum-max 1) fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? 1 (gcd (+ fixnum-max 1) (- fixnum-min 1)))))
-
- (with-test-prefix "(fixnum-min n)"
-
- (pass-if "n = 0"
- (eqv? (- fixnum-min) (gcd fixnum-min 0)))
-
- (pass-if "n = 1"
- (eqv? 1 (gcd fixnum-min 1)))
-
- (pass-if "n = -1"
- (eqv? 1 (gcd fixnum-min -1)))
-
- (pass-if "n = fixnum-max"
- (eqv? 1 (gcd fixnum-min fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? (+ fixnum-max 1) (gcd fixnum-min (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? (- fixnum-min) (gcd fixnum-min fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? 1 (gcd fixnum-min (- fixnum-min 1)))))
-
- (with-test-prefix "((- fixnum-min 1) n)"
-
- (pass-if "n = 0"
- (eqv? (- (- fixnum-min 1)) (gcd (- fixnum-min 1) 0)))
-
- (pass-if "n = 1"
- (eqv? 1 (gcd (- fixnum-min 1) 1)))
-
- (pass-if "n = -1"
- (eqv? 1 (gcd (- fixnum-min 1) -1)))
-
- (pass-if "n = fixnum-max"
- (eqv? 1 (gcd (- fixnum-min 1) fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (eqv? 1 (gcd (- fixnum-min 1) (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (eqv? 1 (gcd (- fixnum-min 1) fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (eqv? (- (- fixnum-min 1)) (gcd (- fixnum-min 1) (- fixnum-min 1)))))
-
- ;; Are wrong type arguments detected correctly?
-
- )
-
-;;;
-;;; lcm
-;;;
-
-;;;
-;;; number->string
-;;;
-
-;;;
-;;; string->number
-;;;
-
-(with-test-prefix "string->number"
-
- (pass-if "string->number"
- (documented? string->number))
-
- (pass-if "non number strings"
- (for-each (lambda (x) (if (string->number x) (throw 'fail)))
- '("" "q" "1q" "6+7iq" "8+9q" "10+11" "13+" "18@19q" "20@q" "23@"
- "+25iq" "26i" "-q" "-iq" "i" "5#.0" "8/" "10#11" ".#" "."
- "#o.2" "3.4q" "15.16e17q" "18.19e+q" ".q" ".17#18" "10q" "#b2"
- "#b3" "#b4" "#b5" "#b6" "#b7" "#b8" "#b9" "#ba" "#bb" "#bc"
- "#bd" "#be" "#bf" "#q" "#b#b1" "#o#o1" "#d#d1" "#x#x1" "#e#e1"
- "#i#i1" "12@12+0i"))
- #t)
-
- (pass-if "valid number strings"
- (for-each (lambda (couple)
- (apply
- (lambda (x y)
- (let ((x (string->number x)))
- (if (or (eq? x #f) (not (eqv? x y))) (throw 'fail))))
- couple))
- `(;; Radix:
- ("#b0" 0) ("#B0" 0) ("#b1" 1) ("#B1" 1) ("#o0" 0) ("#O0" 0)
- ("#o1" 1) ("#O1" 1) ("#o2" 2) ("#O2" 2) ("#o3" 3) ("#O3" 3)
- ("#o4" 4) ("#O4" 4) ("#o5" 5) ("#O5" 5) ("#o6" 6) ("#O6" 6)
- ("#o7" 7) ("#O7" 7) ("#d0" 0) ("#D0" 0) ("#d1" 1) ("#D1" 1)
- ("#d2" 2) ("#D2" 2) ("#d3" 3) ("#D3" 3) ("#d4" 4) ("#D4" 4)
- ("#d5" 5) ("#D5" 5) ("#d6" 6) ("#D6" 6) ("#d7" 7) ("#D7" 7)
- ("#d8" 8) ("#D8" 8) ("#d9" 9) ("#D9" 9)
- ("#xa" 10) ("#Xa" 10) ("#xb" 11) ("#Xb" 11)
- ("#xc" 12) ("#Xc" 12) ("#xd" 13) ("#Xd" 13)
- ("#xe" 14) ("#Xe" 14) ("#xf" 15) ("#Xf" 15)
- ("#b1010" 10)
- ("#o12345670" 2739128)
- ("#d1234567890" 1234567890)
- ("#x1234567890abcdef" 1311768467294899695)
- ;; Exactness:
- ("#e1" 1) ("#e1.2" 1) ("#i1.1" 1.1) ("#i1" 1.0)
- ;; Integers:
- ("1" ,(1+ 0)) ("23" ,(+ 9 9 5)) ("-1" ,(- 0 1))
- ("-45" ,(- 0 45)) ("2#" 20.0) ("2##" 200.0) ("12##" 1200.0)
- ("#b#i100" 4.0)
- ;; Rationals:
- ("1/1" 1) ("1/2" 0.5) ("-1/2" -0.5) ("1#/1" 10.0)
- ("10/1#" 1.0) ("1#/1#" 1.0) ("#e9/10" 1) ("#e10/1#" 1)
- ("#i6/8" 0.75) ("#i1/1" 1.0)
- ;; Decimal numbers:
- ;; * <uinteger 10> <suffix>
- ("1e2" 100.0) ("1E2" 100.0) ("1s2" 100.0) ("1S2" 100.0)
- ("1f2" 100.0) ("1F2" 100.0) ("1d2" 100.0) ("1D2" 100.0)
- ("1l2" 100.0) ("1L2" 100.0) ("1e+2" 100.0) ("1e-2" 0.01)
- ;; * . <digit 10>+ #* <suffix>
- (".1" .1) (".0123456789" 123456789e-10) (".16#" 0.16)
- (".0123456789e10" 123456789.0) (".16#e3" 160.0) ("#d.3" 0.3)
- ;; * <digit 10>+ . <digit 10>* #* <suffix>
- ("3." ,(exact->inexact 3)) ("3.e0" ,(exact->inexact 3))
- ("3.1" ,(exact->inexact 31/10)) ("3.1e0" 3.1) ("3.1#" 3.1)
- ("3.1#e0" 3.1)
- ;; * <digit 10>+ #+ . #* <suffix>
- ("3#." 30.0) ("3#.e0" 30.0) ("3#.#" 30.0) ("3#.#e0" 30.0)
- ;; Complex:
- ("1@0" 1.0) ("1@+0" 1.0) ("1@-0" 1.0)
- ("2+3i" ,(+ 2 (* 3 +i))) ("4-5i" ,(- 4 (* 5 +i)))
- ("1+i" 1+1i) ("1-i" 1-1i) ("+1i" 0+1i) ("-1i" 0-1i)
- ("+i" +1i) ("-i" -1i)))
- #t)
-
- (pass-if-exception "exponent too big"
- exception:out-of-range
- (string->number "12.13e141414")))
-
-;;;
-;;; number?
-;;;
-
-;;;
-;;; complex?
-;;;
-
-;;;
-;;; real?
-;;;
-
-;;;
-;;; rational?
-;;;
-
-;;;
-;;; integer?
-;;;
-
-;;;
-;;; inexact?
-;;;
-
-;;;
-;;; =
-;;;
-
-;;;
-;;; <
-;;;
-
-(with-test-prefix "<"
-
- (expect-fail "documented?"
- (documented? <))
-
- (with-test-prefix "(< 0 n)"
-
- (pass-if "n = 0"
- (not (< 0 0)))
-
- (pass-if "n = 0.0"
- (not (< 0 0.0)))
-
- (pass-if "n = 1"
- (< 0 1))
-
- (pass-if "n = 1.0"
- (< 0 1.0))
-
- (pass-if "n = -1"
- (not (< 0 -1)))
-
- (pass-if "n = -1.0"
- (not (< 0 -1.0)))
-
- (pass-if "n = fixnum-max"
- (< 0 fixnum-max))
-
- (pass-if "n = fixnum-max + 1"
- (< 0 (+ fixnum-max 1)))
-
- (pass-if "n = fixnum-min"
- (not (< 0 fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (not (< 0 (- fixnum-min 1)))))
-
- (with-test-prefix "(< 0.0 n)"
-
- (pass-if "n = 0"
- (not (< 0.0 0)))
-
- (pass-if "n = 0.0"
- (not (< 0.0 0.0)))
-
- (pass-if "n = 1"
- (< 0.0 1))
-
- (pass-if "n = 1.0"
- (< 0.0 1.0))
-
- (pass-if "n = -1"
- (not (< 0.0 -1)))
-
- (pass-if "n = -1.0"
- (not (< 0.0 -1.0)))
-
- (pass-if "n = fixnum-max"
- (< 0.0 fixnum-max))
-
- (pass-if "n = fixnum-max + 1"
- (< 0.0 (+ fixnum-max 1)))
-
- (pass-if "n = fixnum-min"
- (not (< 0.0 fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (not (< 0.0 (- fixnum-min 1)))))
-
- (with-test-prefix "(< 1 n)"
-
- (pass-if "n = 0"
- (not (< 1 0)))
-
- (pass-if "n = 0.0"
- (not (< 1 0.0)))
-
- (pass-if "n = 1"
- (not (< 1 1)))
-
- (pass-if "n = 1.0"
- (not (< 1 1.0)))
-
- (pass-if "n = -1"
- (not (< 1 -1)))
-
- (pass-if "n = -1.0"
- (not (< 1 -1.0)))
-
- (pass-if "n = fixnum-max"
- (< 1 fixnum-max))
-
- (pass-if "n = fixnum-max + 1"
- (< 1 (+ fixnum-max 1)))
-
- (pass-if "n = fixnum-min"
- (not (< 1 fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (not (< 1 (- fixnum-min 1)))))
-
- (with-test-prefix "(< 1.0 n)"
-
- (pass-if "n = 0"
- (not (< 1.0 0)))
-
- (pass-if "n = 0.0"
- (not (< 1.0 0.0)))
-
- (pass-if "n = 1"
- (not (< 1.0 1)))
-
- (pass-if "n = 1.0"
- (not (< 1.0 1.0)))
-
- (pass-if "n = -1"
- (not (< 1.0 -1)))
-
- (pass-if "n = -1.0"
- (not (< 1.0 -1.0)))
-
- (pass-if "n = fixnum-max"
- (< 1.0 fixnum-max))
-
- (pass-if "n = fixnum-max + 1"
- (< 1.0 (+ fixnum-max 1)))
-
- (pass-if "n = fixnum-min"
- (not (< 1.0 fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (not (< 1.0 (- fixnum-min 1)))))
-
- (with-test-prefix "(< -1 n)"
-
- (pass-if "n = 0"
- (< -1 0))
-
- (pass-if "n = 0.0"
- (< -1 0.0))
-
- (pass-if "n = 1"
- (< -1 1))
-
- (pass-if "n = 1.0"
- (< -1 1.0))
-
- (pass-if "n = -1"
- (not (< -1 -1)))
-
- (pass-if "n = -1.0"
- (not (< -1 -1.0)))
-
- (pass-if "n = fixnum-max"
- (< -1 fixnum-max))
-
- (pass-if "n = fixnum-max + 1"
- (< -1 (+ fixnum-max 1)))
-
- (pass-if "n = fixnum-min"
- (not (< -1 fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (not (< -1 (- fixnum-min 1)))))
-
- (with-test-prefix "(< -1.0 n)"
-
- (pass-if "n = 0"
- (< -1.0 0))
-
- (pass-if "n = 0.0"
- (< -1.0 0.0))
-
- (pass-if "n = 1"
- (< -1.0 1))
-
- (pass-if "n = 1.0"
- (< -1.0 1.0))
-
- (pass-if "n = -1"
- (not (< -1.0 -1)))
-
- (pass-if "n = -1.0"
- (not (< -1.0 -1.0)))
-
- (pass-if "n = fixnum-max"
- (< -1.0 fixnum-max))
-
- (pass-if "n = fixnum-max + 1"
- (< -1.0 (+ fixnum-max 1)))
-
- (pass-if "n = fixnum-min"
- (not (< -1.0 fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (not (< -1.0 (- fixnum-min 1)))))
-
- (with-test-prefix "(< fixnum-max n)"
-
- (pass-if "n = 0"
- (not (< fixnum-max 0)))
-
- (pass-if "n = 0.0"
- (not (< fixnum-max 0.0)))
-
- (pass-if "n = 1"
- (not (< fixnum-max 1)))
-
- (pass-if "n = 1.0"
- (not (< fixnum-max 1.0)))
-
- (pass-if "n = -1"
- (not (< fixnum-max -1)))
-
- (pass-if "n = -1.0"
- (not (< fixnum-max -1.0)))
-
- (pass-if "n = fixnum-max"
- (not (< fixnum-max fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (< fixnum-max (+ fixnum-max 1)))
-
- (pass-if "n = fixnum-min"
- (not (< fixnum-max fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (not (< fixnum-max (- fixnum-min 1)))))
-
- (with-test-prefix "(< (+ fixnum-max 1) n)"
-
- (pass-if "n = 0"
- (not (< (+ fixnum-max 1) 0)))
-
- (pass-if "n = 0.0"
- (not (< (+ fixnum-max 1) 0.0)))
-
- (pass-if "n = 1"
- (not (< (+ fixnum-max 1) 1)))
-
- (pass-if "n = 1.0"
- (not (< (+ fixnum-max 1) 1.0)))
-
- (pass-if "n = -1"
- (not (< (+ fixnum-max 1) -1)))
-
- (pass-if "n = -1.0"
- (not (< (+ fixnum-max 1) -1.0)))
-
- (pass-if "n = fixnum-max"
- (not (< (+ fixnum-max 1) fixnum-max)))
-
- (pass-if "n = fixnum-max + 1"
- (not (< (+ fixnum-max 1) (+ fixnum-max 1))))
-
- (pass-if "n = fixnum-min"
- (not (< (+ fixnum-max 1) fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (not (< (+ fixnum-max 1) (- fixnum-min 1)))))
-
- (with-test-prefix "(< fixnum-min n)"
-
- (pass-if "n = 0"
- (< fixnum-min 0))
-
- (pass-if "n = 0.0"
- (< fixnum-min 0.0))
-
- (pass-if "n = 1"
- (< fixnum-min 1))
-
- (pass-if "n = 1.0"
- (< fixnum-min 1.0))
-
- (pass-if "n = -1"
- (< fixnum-min -1))
-
- (pass-if "n = -1.0"
- (< fixnum-min -1.0))
-
- (pass-if "n = fixnum-max"
- (< fixnum-min fixnum-max))
-
- (pass-if "n = fixnum-max + 1"
- (< fixnum-min (+ fixnum-max 1)))
-
- (pass-if "n = fixnum-min"
- (not (< fixnum-min fixnum-min)))
-
- (pass-if "n = fixnum-min - 1"
- (not (< fixnum-min (- fixnum-min 1)))))
-
- (with-test-prefix "(< (- fixnum-min 1) n)"
-
- (pass-if "n = 0"
- (< (- fixnum-min 1) 0))
-
- (pass-if "n = 0.0"
- (< (- fixnum-min 1) 0.0))
-
- (pass-if "n = 1"
- (< (- fixnum-min 1) 1))
-
- (pass-if "n = 1.0"
- (< (- fixnum-min 1) 1.0))
-
- (pass-if "n = -1"
- (< (- fixnum-min 1) -1))
-
- (pass-if "n = -1.0"
- (< (- fixnum-min 1) -1.0))
-
- (pass-if "n = fixnum-max"
- (< (- fixnum-min 1) fixnum-max))
-
- (pass-if "n = fixnum-max + 1"
- (< (- fixnum-min 1) (+ fixnum-max 1)))
-
- (pass-if "n = fixnum-min"
- (< (- fixnum-min 1) fixnum-min))
-
- (pass-if "n = fixnum-min - 1"
- (not (< (- fixnum-min 1) (- fixnum-min 1))))))
-
-;;;
-;;; >
-;;;
-
-;;;
-;;; <=
-;;;
-
-;;;
-;;; >=
-;;;
-
-;;;
-;;; zero?
-;;;
-
-;;;
-;;; positive?
-;;;
-
-;;;
-;;; negative?
-;;;
-
-;;;
-;;; max
-;;;
-
-;;;
-;;; min
-;;;
-
-;;;
-;;; +
-;;;
-
-(with-test-prefix "+"
-
- (expect-fail "documented?"
- (documented? +))
-
- (with-test-prefix "wrong type argument"
-
- (pass-if-exception "1st argument string"
- exception:wrong-type-arg
- (+ "1" 2))
-
- (pass-if-exception "2nd argument bool"
- exception:wrong-type-arg
- (+ 1 #f))))
-;;;
-;;; -
-;;;
-
-;;;
-;;; *
-;;;
-
-;;;
-;;; /
-;;;
-
-(with-test-prefix "/"
-
- (expect-fail "documented?"
- (documented? /))
-
- (with-test-prefix "division by zero"
-
- (pass-if-exception "(/ 0)"
- exception:numerical-overflow
- (/ 0))
-
- (pass-if "(/ 0.0)"
- (= +inf.0 (/ 0.0)))
-
- (pass-if-exception "(/ 1 0)"
- exception:numerical-overflow
- (/ 1 0))
-
- (pass-if "(/ 1 0.0)"
- (= +inf.0 (/ 1 0.0)))
-
- (pass-if-exception "(/ bignum 0)"
- exception:numerical-overflow
- (/ (+ fixnum-max 1) 0))
-
- (pass-if "(/ bignum 0.0)"
- (= +inf.0 (/ (+ fixnum-max 1) 0.0)))
-
- (pass-if-exception "(/ 1.0 0)"
- exception:numerical-overflow
- (/ 1.0 0))
-
- (pass-if "(/ 1.0 0.0)"
- (= +inf.0 (/ 1.0 0.0)))
-
- (pass-if-exception "(/ +i 0)"
- exception:numerical-overflow
- (/ +i 0))
-
- (pass-if "(/ +i 0.0)"
- (= +inf.0 (imag-part (/ +i 0.0)))))
-
- (with-test-prefix "complex division"
-
- (pass-if "(/ 3+4i)"
- (= (/ 3+4i) 0.12-0.16i))
-
- (pass-if "(/ 4+3i)"
- (= (/ 4+3i) 0.16-0.12i))
-
- (pass-if "(/ 25+125i 3+4i)"
- (= (/ 25+125i 3+4i) 23.0+11.0i))
-
- (pass-if "(/ 25+125i 4+3i)"
- (= (/ 25+125i 4+3i) 19.0+17.0i))
-
- (pass-if "(/ 25 3+4i)"
- (= (/ 25 3+4i) 3.0-4.0i))
-
- (pass-if "(/ 25 4+3i)"
- (= (/ 25 4+3i) 4.0-3.0i))
-
- (pass-if "(/ 1e200+1e200i)"
- (= (/ 1e200+1e200i) 5.0e-201-5.0e-201i))))
-
-;;;
-;;; truncate
-;;;
-
-;;;
-;;; round
-;;;
-
-;;;
-;;; exact->inexact
-;;;
-
-;;;
-;;; floor
-;;;
-
-;;;
-;;; ceiling
-;;;
-
-;;;
-;;; make-rectangular
-;;;
-
-;;;
-;;; make-polar
-;;;
-
-;;;
-;;; real-part
-;;;
-
-;;;
-;;; imag-part
-;;;
-
-;;;
-;;; magnitude
-;;;
-
-;;;
-;;; angle
-;;;
-
-;;;
-;;; inexact->exact
-;;;
diff --git a/test-suite/tests/optargs.test b/test-suite/tests/optargs.test
deleted file mode 100644
index 4f356b020..000000000
--- a/test-suite/tests/optargs.test
+++ /dev/null
@@ -1,29 +0,0 @@
-;;;; optargs.test --- test suite for optional arg processing -*- scheme -*-
-;;;; Matthias Koeppe <mkoeppe@mail.math.uni-magdeburg.de> --- June 2001
-;;;;
-;;;; Copyright (C) 2001 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-(use-modules (test-suite lib)
- (ice-9 optargs))
-
-(with-test-prefix "optional argument processing"
- (define* (test-1 #:optional (x 0))
- (define d 1) ; local define
- #t)
- (pass-if "local defines work with optional arguments"
- (false-if-exception (test-1))))
diff --git a/test-suite/tests/ports.test b/test-suite/tests/ports.test
deleted file mode 100644
index cc46ee855..000000000
--- a/test-suite/tests/ports.test
+++ /dev/null
@@ -1,466 +0,0 @@
-;;;; ports.test --- test suite for Guile I/O ports -*- scheme -*-
-;;;; Jim Blandy <jimb@red-bean.com> --- May 1999
-;;;;
-;;;; Copyright (C) 1999, 2001 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-(use-modules (test-suite lib)
- (ice-9 popen)
- (ice-9 rdelim))
-
-(define (display-line . args)
- (for-each display args)
- (newline))
-
-(define (test-file)
- (data-file-name "ports-test.tmp"))
-
-
-;;;; Some general utilities for testing ports.
-
-;;; Read from PORT until EOF, and return the result as a string.
-(define (read-all port)
- (let loop ((chars '()))
- (let ((char (read-char port)))
- (if (eof-object? char)
- (list->string (reverse! chars))
- (loop (cons char chars))))))
-
-(define (read-file filename)
- (let* ((port (open-input-file filename))
- (string (read-all port)))
- (close-port port)
- string))
-
-
-;;;; Normal file ports.
-
-;;; Write out an s-expression, and read it back.
-(let ((string '("From fairest creatures we desire increase,"
- "That thereby beauty's rose might never die,"))
- (filename (test-file)))
- (let ((port (open-output-file filename)))
- (write string port)
- (close-port port))
- (let ((port (open-input-file filename)))
- (let ((in-string (read port)))
- (pass-if "file: write and read back list of strings"
- (equal? string in-string)))
- (close-port port))
- (delete-file filename))
-
-;;; Write out a string, and read it back a character at a time.
-(let ((string "This is a test string\nwith no newline at the end")
- (filename (test-file)))
- (let ((port (open-output-file filename)))
- (display string port)
- (close-port port))
- (let ((in-string (read-file filename)))
- (pass-if "file: write and read back characters"
- (equal? string in-string)))
- (delete-file filename))
-
-;;; Buffered input/output port with seeking.
-(let* ((filename (test-file))
- (port (open-file filename "w+")))
- (display "J'Accuse" port)
- (seek port -1 SEEK_CUR)
- (pass-if "file: r/w 1"
- (char=? (read-char port) #\e))
- (pass-if "file: r/w 2"
- (eof-object? (read-char port)))
- (seek port -1 SEEK_CUR)
- (write-char #\x port)
- (seek port 7 SEEK_SET)
- (pass-if "file: r/w 3"
- (char=? (read-char port) #\x))
- (seek port -2 SEEK_END)
- (pass-if "file: r/w 4"
- (char=? (read-char port) #\s))
- (close-port port)
- (delete-file filename))
-
-;;; Unbuffered input/output port with seeking.
-(let* ((filename (test-file))
- (port (open-file filename "w+0")))
- (display "J'Accuse" port)
- (seek port -1 SEEK_CUR)
- (pass-if "file: ub r/w 1"
- (char=? (read-char port) #\e))
- (pass-if "file: ub r/w 2"
- (eof-object? (read-char port)))
- (seek port -1 SEEK_CUR)
- (write-char #\x port)
- (seek port 7 SEEK_SET)
- (pass-if "file: ub r/w 3"
- (char=? (read-char port) #\x))
- (seek port -2 SEEK_END)
- (pass-if "file: ub r/w 4"
- (char=? (read-char port) #\s))
- (close-port port)
- (delete-file filename))
-
-;;; Buffered output-only and input-only ports with seeking.
-(let* ((filename (test-file))
- (port (open-output-file filename)))
- (display "J'Accuse" port)
- (pass-if "file: out tell"
- (= (seek port 0 SEEK_CUR) 8))
- (seek port -1 SEEK_CUR)
- (write-char #\x port)
- (close-port port)
- (let ((iport (open-input-file filename)))
- (pass-if "file: in tell 0"
- (= (seek iport 0 SEEK_CUR) 0))
- (read-char iport)
- (pass-if "file: in tell 1"
- (= (seek iport 0 SEEK_CUR) 1))
- (unread-char #\z iport)
- (pass-if "file: in tell 0 after unread"
- (= (seek iport 0 SEEK_CUR) 0))
- (pass-if "file: unread char still there"
- (char=? (read-char iport) #\z))
- (seek iport 7 SEEK_SET)
- (pass-if "file: in last char"
- (char=? (read-char iport) #\x))
- (close-port iport))
- (delete-file filename))
-
-;;; unusual characters.
-(let* ((filename (test-file))
- (port (open-output-file filename)))
- (display (string #\nul (integer->char 255) (integer->char 128)
- #\nul) port)
- (close-port port)
- (let* ((port (open-input-file filename))
- (line (read-line port)))
- (pass-if "file: read back NUL 1"
- (char=? (string-ref line 0) #\nul))
- (pass-if "file: read back 255"
- (char=? (string-ref line 1) (integer->char 255)))
- (pass-if "file: read back 128"
- (char=? (string-ref line 2) (integer->char 128)))
- (pass-if "file: read back NUL 2"
- (char=? (string-ref line 3) #\nul))
- (pass-if "file: EOF"
- (eof-object? (read-char port)))
- (close-port port))
- (delete-file filename))
-
-;;; line buffering mode.
-(let* ((filename (test-file))
- (port (open-file filename "wl"))
- (test-string "one line more or less"))
- (write-line test-string port)
- (let* ((in-port (open-input-file filename))
- (line (read-line in-port)))
- (close-port in-port)
- (close-port port)
- (pass-if "file: line buffering"
- (string=? line test-string)))
- (delete-file filename))
-
-;;; ungetting characters and strings.
-(with-input-from-string "walk on the moon\nmoon"
- (lambda ()
- (read-char)
- (unread-char #\a (current-input-port))
- (pass-if "unread-char"
- (char=? (read-char) #\a))
- (read-line)
- (let ((replacenoid "chicken enchilada"))
- (unread-char #\newline (current-input-port))
- (unread-string replacenoid (current-input-port))
- (pass-if "unread-string"
- (string=? (read-line) replacenoid)))
- (pass-if "unread residue"
- (string=? (read-line) "moon"))))
-
-;;; non-blocking mode on a port. create a pipe and set O_NONBLOCK on
-;;; the reading end. try to read a byte: should get EAGAIN or
-;;; EWOULDBLOCK error.
-(let* ((p (pipe))
- (r (car p)))
- (fcntl r F_SETFL (logior (fcntl r F_GETFL) O_NONBLOCK))
- (pass-if "non-blocking-I/O"
- (catch 'system-error
- (lambda () (read-char r) #f)
- (lambda (key . args)
- (and (eq? key 'system-error)
- (let ((errno (car (list-ref args 3))))
- (or (= errno EAGAIN)
- (= errno EWOULDBLOCK))))))))
-
-
-;;;; Pipe (popen) ports.
-
-;;; Run a command, and read its output.
-(let* ((pipe (open-pipe "echo 'Howdy there, partner!'" "r"))
- (in-string (read-all pipe)))
- (close-pipe pipe)
- (pass-if "pipe: read"
- (equal? in-string "Howdy there, partner!\n")))
-
-;;; Run a command, send some output to it, and see if it worked.
-(let* ((filename (test-file))
- (pipe (open-pipe (string-append "grep Mommy > " filename) "w")))
- (display "Now Jimmy lives on a mushroom cloud\n" pipe)
- (display "Mommy, why does everybody have a bomb?\n" pipe)
- (close-pipe pipe)
- (let ((in-string (read-file filename)))
- (pass-if "pipe: write"
- (equal? in-string "Mommy, why does everybody have a bomb?\n")))
- (delete-file filename))
-
-
-;;;; Void ports. These are so trivial we don't test them.
-
-
-;;;; String ports.
-
-(with-test-prefix "string ports"
-
- ;; Write text to a string port.
- (let* ((string "Howdy there, partner!")
- (in-string (call-with-output-string
- (lambda (port)
- (display string port)
- (newline port)))))
- (pass-if "display text"
- (equal? in-string (string-append string "\n"))))
-
- ;; Write an s-expression to a string port.
- (let* ((sexpr '("more utterly random text" 1729 #(a vector) 3.1415926))
- (in-sexpr
- (call-with-input-string (call-with-output-string
- (lambda (port)
- (write sexpr port)))
- read)))
- (pass-if "write/read sexpr"
- (equal? in-sexpr sexpr)))
-
- ;; seeking and unreading from an input string.
- (let ((text "that text didn't look random to me"))
- (call-with-input-string text
- (lambda (p)
- (pass-if "input tell 0"
- (= (seek p 0 SEEK_CUR) 0))
- (read-char p)
- (pass-if "input tell 1"
- (= (seek p 0 SEEK_CUR) 1))
- (unread-char #\x p)
- (pass-if "input tell back to 0"
- (= (seek p 0 SEEK_CUR) 0))
- (pass-if "input ungetted char"
- (char=? (read-char p) #\x))
- (seek p 0 SEEK_END)
- (pass-if "input seek to end"
- (= (seek p 0 SEEK_CUR)
- (string-length text)))
- (unread-char #\x p)
- (pass-if "input seek to beginning"
- (= (seek p 0 SEEK_SET) 0))
- (pass-if "input reread first char"
- (char=? (read-char p)
- (string-ref text 0))))))
-
- ;; seeking an output string.
- (let* ((text "123456789")
- (len (string-length text))
- (result (call-with-output-string
- (lambda (p)
- (pass-if "output tell 0"
- (= (seek p 0 SEEK_CUR) 0))
- (display text p)
- (pass-if "output tell end"
- (= (seek p 0 SEEK_CUR) len))
- (pass-if "output seek to beginning"
- (= (seek p 0 SEEK_SET) 0))
- (write-char #\a p)
- (seek p -1 SEEK_END)
- (pass-if "output seek to last char"
- (= (seek p 0 SEEK_CUR)
- (- len 1)))
- (write-char #\b p)))))
- (string-set! text 0 #\a)
- (string-set! text (- len 1) #\b)
- (pass-if "output check"
- (string=? text result))))
-
-
-
-;;;; Soft ports. No tests implemented yet.
-
-
-;;;; Generic operations across all port types.
-
-(let ((port-loop-temp (test-file)))
-
- ;; Return a list of input ports that all return the same text.
- ;; We map tests over this list.
- (define (input-port-list text)
-
- ;; Create a text file some of the ports will use.
- (let ((out-port (open-output-file port-loop-temp)))
- (display text out-port)
- (close-port out-port))
-
- (list (open-input-file port-loop-temp)
- (open-input-pipe (string-append "cat " port-loop-temp))
- (call-with-input-string text (lambda (x) x))
- ;; We don't test soft ports at the moment.
- ))
-
- (define port-list-names '("file" "pipe" "string"))
-
- ;; Test the line counter.
- (define (test-line-counter text second-line final-column)
- (with-test-prefix "line counter"
- (let ((ports (input-port-list text)))
- (for-each
- (lambda (port port-name)
- (with-test-prefix port-name
- (pass-if "at beginning of input"
- (= (port-line port) 0))
- (pass-if "read first character"
- (eqv? (read-char port) #\x))
- (pass-if "after reading one character"
- (= (port-line port) 0))
- (pass-if "read first newline"
- (eqv? (read-char port) #\newline))
- (pass-if "after reading first newline char"
- (= (port-line port) 1))
- (pass-if "second line read correctly"
- (equal? (read-line port) second-line))
- (pass-if "read-line increments line number"
- (= (port-line port) 2))
- (pass-if "read-line returns EOF"
- (let loop ((i 0))
- (cond
- ((eof-object? (read-line port)) #t)
- ((> i 20) #f)
- (else (loop (+ i 1))))))
- (pass-if "line count is 5 at EOF"
- (= (port-line port) 5))
- (pass-if "column is correct at EOF"
- (= (port-column port) final-column))))
- ports port-list-names)
- (for-each close-port ports)
- (delete-file port-loop-temp))))
-
- (with-test-prefix "newline"
- (test-line-counter
- (string-append "x\n"
- "He who receives an idea from me, receives instruction\n"
- "himself without lessening mine; as he who lights his\n"
- "taper at mine, receives light without darkening me.\n"
- " --- Thomas Jefferson\n")
- "He who receives an idea from me, receives instruction"
- 0))
-
- (with-test-prefix "no newline"
- (test-line-counter
- (string-append "x\n"
- "He who receives an idea from me, receives instruction\n"
- "himself without lessening mine; as he who lights his\n"
- "taper at mine, receives light without darkening me.\n"
- " --- Thomas Jefferson\n"
- "no newline here")
- "He who receives an idea from me, receives instruction"
- 15)))
-
-;; Test port-line and port-column for output ports
-
-(define (test-output-line-counter text final-column)
- (with-test-prefix "port-line and port-column for output ports"
- (let ((port (open-output-string)))
- (pass-if "at beginning of input"
- (and (= (port-line port) 0)
- (= (port-column port) 0)))
- (write-char #\x port)
- (pass-if "after writing one character"
- (and (= (port-line port) 0)
- (= (port-column port) 1)))
- (write-char #\newline port)
- (pass-if "after writing first newline char"
- (and (= (port-line port) 1)
- (= (port-column port) 0)))
- (display text port)
- (pass-if "line count is 5 at end"
- (= (port-line port) 5))
- (pass-if "column is correct at end"
- (= (port-column port) final-column)))))
-
-(test-output-line-counter
- (string-append "He who receives an idea from me, receives instruction\n"
- "himself without lessening mine; as he who lights his\n"
- "taper at mine, receives light without darkening me.\n"
- " --- Thomas Jefferson\n"
- "no newline here")
- 15)
-
-;;;; testing read-delimited and friends
-
-(with-test-prefix "read-delimited!"
- (let ((c (make-string 20 #\!)))
- (call-with-input-string
- "defdef\nghighi\n"
- (lambda (port)
-
- (read-delimited! "\n" c port 'concat)
- (pass-if "read-delimited! reads a first line"
- (string=? c "defdef\n!!!!!!!!!!!!!"))
-
- (read-delimited! "\n" c port 'concat 3)
- (pass-if "read-delimited! reads a first line"
- (string=? c "defghighi\n!!!!!!!!!!"))))))
-
-
-;;;; char-ready?
-
-(call-with-input-string
- "howdy"
- (lambda (port)
- (pass-if "char-ready? returns true on string port"
- (char-ready? port))))
-
-;;; This segfaults on some versions of Guile. We really should run
-;;; the tests in a subprocess...
-
-(call-with-input-string
- "howdy"
- (lambda (port)
- (with-input-from-port
- port
- (lambda ()
- (pass-if "char-ready? returns true on string port as default port"
- (char-ready?))))))
-
-
-;;;; Close current-input-port, and make sure everyone can handle it.
-
-(with-test-prefix "closing current-input-port"
- (for-each (lambda (procedure name)
- (with-input-from-port
- (call-with-input-string "foo" (lambda (p) p))
- (lambda ()
- (close-port (current-input-port))
- (pass-if-exception name
- exception:wrong-type-arg
- (procedure)))))
- (list read read-char read-line)
- '("read" "read-char" "read-line")))
diff --git a/test-suite/tests/r4rs.test b/test-suite/tests/r4rs.test
deleted file mode 100644
index c9fbb1525..000000000
--- a/test-suite/tests/r4rs.test
+++ /dev/null
@@ -1,1024 +0,0 @@
-;;;; r4rs.test --- tests for R4RS compliance -*- scheme -*-
-;;;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1999, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-
-
-;;;; ============= NOTE =============
-
-;;;; This file is a quick-and-dirty adaptation of Aubrey's test suite
-;;;; to Guile's testing framework. As such, it's not as clean as one
-;;;; might hope. (In particular, it uses with-test-prefix oddly.)
-;;;;
-;;;; If you're looking for an example of a test suite to imitate, you
-;;;; might do better by looking at ports.test, which uses the
-;;;; (test-suite lib) functions much more idiomatically.
-
-
-;;;; "test.scm" Test correctness of scheme implementations.
-;;;; Author: Aubrey Jaffer
-;;;; Modified: Mikael Djurfeldt
-;;;; Removed tests which Guile deliberately
-;;;; won't pass. Made the the tests (test-cont), (test-sc4), and
-;;;; (test-delay) start to run automatically.
-;;;; Modified: Jim Blandy
-;;;; adapted to new Guile test suite framework
-
-;;; This includes examples from
-;;; William Clinger and Jonathan Rees, editors.
-;;; Revised^4 Report on the Algorithmic Language Scheme
-;;; and the IEEE specification.
-
-;;; The input tests read this file expecting it to be named
-;;; "test.scm", so you'll have to run it from the ice-9 source
-;;; directory, or copy this file elsewhere
-;;; Files `tmp1', `tmp2' and `tmp3' will be created in the course of running
-;;; these tests. You may need to delete them in order to run
-;;; "test.scm" more than once.
-
-;;; There are three optional tests:
-;;; (TEST-CONT) tests multiple returns from call-with-current-continuation
-;;;
-;;; (TEST-SC4) tests procedures required by R4RS but not by IEEE
-;;;
-;;; (TEST-DELAY) tests DELAY and FORCE, which are not required by
-;;; either standard.
-
-;;; If you are testing a R3RS version which does not have `list?' do:
-;;; (define list? #f)
-
-;;; send corrections or additions to jaffer@ai.mit.edu or
-;;; Aubrey Jaffer, 84 Pleasant St., Wakefield MA 01880, USA
-
-(define cur-section '())(define errs '())
-(define SECTION (lambda args
- (set! cur-section args) #t))
-(define record-error (lambda (e) (set! errs (cons (list cur-section e) errs))))
-(define (report-errs) #f)
-
-(define test
- (lambda (expect fun . args)
- (let ((res (if (procedure? fun) (apply fun args) (car args))))
- (with-test-prefix cur-section
- (pass-if (call-with-output-string (lambda (port)
- (write (cons fun args) port)))
- (equal? expect res))))))
-
-;; test that all symbol characters are supported.
-(SECTION 2 1)
-'(+ - ... !.. $.+ %.- &.! *.: /:. :+. <-. =. >. ?. ~. _. ^.)
-
-(SECTION 3 4)
-(define disjoint-type-functions
- (list boolean? char? null? number? pair? procedure? string? symbol? vector?))
-(define type-examples
- (list
- #t #f #\a '() 9739 '(test) (lambda () #f) car "test" "" 'test
- '#() '#(a b c)))
-(define type-matrix
- (map (lambda (x)
- (let ((t (map (lambda (f) (f x)) disjoint-type-functions)))
- t))
- type-examples))
-(for-each (lambda (object row)
- (let ((count (apply + (map (lambda (elt) (if elt 1 0))
- row))))
- (pass-if (call-with-output-string
- (lambda (port)
- (display "object recognized by only one predicate: "
- port)
- (display object port)))
- (= count 1))))
- type-examples
- type-matrix)
-
-(SECTION 4 1 2)
-(test '(quote a) 'quote (quote 'a))
-(test '(quote a) 'quote ''a)
-(SECTION 4 1 3)
-(test 12 (if #f + *) 3 4)
-(SECTION 4 1 4)
-(test 8 (lambda (x) (+ x x)) 4)
-(define reverse-subtract
- (lambda (x y) (- y x)))
-(test 3 reverse-subtract 7 10)
-(define add4
- (let ((x 4))
- (lambda (y) (+ x y))))
-(test 10 add4 6)
-(test '(3 4 5 6) (lambda x x) 3 4 5 6)
-(test '(5 6) (lambda (x y . z) z) 3 4 5 6)
-(SECTION 4 1 5)
-(test 'yes 'if (if (> 3 2) 'yes 'no))
-(test 'no 'if (if (> 2 3) 'yes 'no))
-(test '1 'if (if (> 3 2) (- 3 2) (+ 3 2)))
-(SECTION 4 1 6)
-(define x 2)
-(test 3 'define (+ x 1))
-(set! x 4)
-(test 5 'set! (+ x 1))
-(SECTION 4 2 1)
-(test 'greater 'cond (cond ((> 3 2) 'greater)
- ((< 3 2) 'less)))
-(test 'equal 'cond (cond ((> 3 3) 'greater)
- ((< 3 3) 'less)
- (else 'equal)))
-(test 2 'cond (cond ((assv 'b '((a 1) (b 2))) => cadr)
- (else #f)))
-(test 'composite 'case (case (* 2 3)
- ((2 3 5 7) 'prime)
- ((1 4 6 8 9) 'composite)))
-(test 'consonant 'case (case (car '(c d))
- ((a e i o u) 'vowel)
- ((w y) 'semivowel)
- (else 'consonant)))
-(test #t 'and (and (= 2 2) (> 2 1)))
-(test #f 'and (and (= 2 2) (< 2 1)))
-(test '(f g) 'and (and 1 2 'c '(f g)))
-(test #t 'and (and))
-(test #t 'or (or (= 2 2) (> 2 1)))
-(test #t 'or (or (= 2 2) (< 2 1)))
-(test #f 'or (or #f #f #f))
-(test #f 'or (or))
-(test '(b c) 'or (or (memq 'b '(a b c)) (+ 3 0)))
-(SECTION 4 2 2)
-(test 6 'let (let ((x 2) (y 3)) (* x y)))
-(test 35 'let (let ((x 2) (y 3)) (let ((x 7) (z (+ x y))) (* z x))))
-(test 70 'let* (let ((x 2) (y 3)) (let* ((x 7) (z (+ x y))) (* z x))))
-(test #t 'letrec (letrec ((even?
- (lambda (n) (if (zero? n) #t (odd? (- n 1)))))
- (odd?
- (lambda (n) (if (zero? n) #f (even? (- n 1))))))
- (even? 88)))
-(define x 34)
-(test 5 'let (let ((x 3)) (define x 5) x))
-(test 34 'let x)
-(test 6 'let (let () (define x 6) x))
-(test 34 'let x)
-(test 7 'let* (let* ((x 3)) (define x 7) x))
-(test 34 'let* x)
-(test 8 'let* (let* () (define x 8) x))
-(test 34 'let* x)
-(test 9 'letrec (letrec () (define x 9) x))
-(test 34 'letrec x)
-(test 10 'letrec (letrec ((x 3)) (define x 10) x))
-(test 34 'letrec x)
-(SECTION 4 2 3)
-(define x 0)
-(test 6 'begin (begin (set! x 5) (+ x 1)))
-(SECTION 4 2 4)
-(test '#(0 1 2 3 4) 'do (do ((vec (make-vector 5))
- (i 0 (+ i 1)))
- ((= i 5) vec)
- (vector-set! vec i i)))
-(test 25 'do (let ((x '(1 3 5 7 9)))
- (do ((x x (cdr x))
- (sum 0 (+ sum (car x))))
- ((null? x) sum))))
-(test 1 'let (let foo () 1))
-(test '((6 1 3) (-5 -2)) 'let
- (let loop ((numbers '(3 -2 1 6 -5))
- (nonneg '())
- (neg '()))
- (cond ((null? numbers) (list nonneg neg))
- ((negative? (car numbers))
- (loop (cdr numbers)
- nonneg
- (cons (car numbers) neg)))
- (else
- (loop (cdr numbers)
- (cons (car numbers) nonneg)
- neg)))))
-(SECTION 4 2 6)
-(test '(list 3 4) 'quasiquote `(list ,(+ 1 2) 4))
-(test '(list a (quote a)) 'quasiquote (let ((name 'a)) `(list ,name ',name)))
-(test '(a 3 4 5 6 b) 'quasiquote `(a ,(+ 1 2) ,@(map abs '(4 -5 6)) b))
-(test '((foo 7) . cons)
- 'quasiquote
- `((foo ,(- 10 3)) ,@(cdr '(c)) . ,(car '(cons))))
-
-;;; sqt is defined here because not all implementations are required to
-;;; support it.
-(define (sqt x)
- (do ((i 0 (+ i 1)))
- ((> (* i i) x) (- i 1))))
-
-(test '#(10 5 2 4 3 8) 'quasiquote `#(10 5 ,(sqt 4) ,@(map sqt '(16 9)) 8))
-(test 5 'quasiquote `,(+ 2 3))
-(test '(a `(b ,(+ 1 2) ,(foo 4 d) e) f)
- 'quasiquote `(a `(b ,(+ 1 2) ,(foo ,(+ 1 3) d) e) f))
-(test '(a `(b ,x ,'y d) e) 'quasiquote
- (let ((name1 'x) (name2 'y)) `(a `(b ,,name1 ,',name2 d) e)))
-(test '(list 3 4) 'quasiquote (quasiquote (list (unquote (+ 1 2)) 4)))
-(test '`(list ,(+ 1 2) 4) 'quasiquote '(quasiquote (list (unquote (+ 1 2)) 4)))
-(SECTION 5 2 1)
-(define add3 (lambda (x) (+ x 3)))
-(test 6 'define (add3 3))
-(define first car)
-(test 1 'define (first '(1 2)))
-(SECTION 5 2 2)
-(test 45 'define
- (let ((x 5))
- (define foo (lambda (y) (bar x y)))
- (define bar (lambda (a b) (+ (* a b) a)))
- (foo (+ x 3))))
-(define x 34)
-(define (foo) (define x 5) x)
-(test 5 foo)
-(test 34 'define x)
-(define foo (lambda () (define x 5) x))
-(test 5 foo)
-(test 34 'define x)
-(define (foo x) ((lambda () (define x 5) x)) x)
-(test 88 foo 88)
-(test 4 foo 4)
-(test 34 'define x)
-(SECTION 6 1)
-(test #f not #t)
-(test #f not 3)
-(test #f not (list 3))
-(test #t not #f)
-(test #f not '())
-(test #f not (list))
-(test #f not 'nil)
-
-(test #t boolean? #f)
-(test #f boolean? 0)
-(test #f boolean? '())
-(SECTION 6 2)
-(test #t eqv? 'a 'a)
-(test #f eqv? 'a 'b)
-(test #t eqv? 2 2)
-(test #t eqv? '() '())
-(test #t eqv? '10000 '10000)
-(test #f eqv? (cons 1 2)(cons 1 2))
-(test #f eqv? (lambda () 1) (lambda () 2))
-(test #f eqv? #f 'nil)
-(let ((p (lambda (x) x)))
- (test #t eqv? p p))
-(define gen-counter
- (lambda ()
- (let ((n 0))
- (lambda () (set! n (+ n 1)) n))))
-(let ((g (gen-counter))) (test #t eqv? g g))
-(test #f eqv? (gen-counter) (gen-counter))
-(letrec ((f (lambda () (if (eqv? f g) 'f 'both)))
- (g (lambda () (if (eqv? f g) 'g 'both))))
- (test #f eqv? f g))
-
-(test #t eq? 'a 'a)
-(test #f eq? (list 'a) (list 'a))
-(test #t eq? '() '())
-(test #t eq? car car)
-(let ((x '(a))) (test #t eq? x x))
-(let ((x '#())) (test #t eq? x x))
-(let ((x (lambda (x) x))) (test #t eq? x x))
-
-(test #t equal? 'a 'a)
-(test #t equal? '(a) '(a))
-(test #t equal? '(a (b) c) '(a (b) c))
-(test #t equal? "abc" "abc")
-(test #t equal? 2 2)
-(test #t equal? (make-vector 5 'a) (make-vector 5 'a))
-(SECTION 6 3)
-(test '(a b c d e) 'dot '(a . (b . (c . (d . (e . ()))))))
-(define x (list 'a 'b 'c))
-(define y x)
-(and list? (test #t list? y))
-(set-cdr! x 4)
-(test '(a . 4) 'set-cdr! x)
-(test #t eqv? x y)
-(test '(a b c . d) 'dot '(a . (b . (c . d))))
-(and list? (test #f list? y))
-(and list? (let ((x (list 'a))) (set-cdr! x x) (test #f 'list? (list? x))))
-
-(test #t pair? '(a . b))
-(test #t pair? '(a . 1))
-(test #t pair? '(a b c))
-(test #f pair? '())
-(test #f pair? '#(a b))
-
-(test '(a) cons 'a '())
-(test '((a) b c d) cons '(a) '(b c d))
-(test '("a" b c) cons "a" '(b c))
-(test '(a . 3) cons 'a 3)
-(test '((a b) . c) cons '(a b) 'c)
-
-(test 'a car '(a b c))
-(test '(a) car '((a) b c d))
-(test 1 car '(1 . 2))
-
-(test '(b c d) cdr '((a) b c d))
-(test 2 cdr '(1 . 2))
-
-(test '(a 7 c) list 'a (+ 3 4) 'c)
-(test '() list)
-
-(test 3 length '(a b c))
-(test 3 length '(a (b) (c d e)))
-(test 0 length '())
-
-(test '(x y) append '(x) '(y))
-(test '(a b c d) append '(a) '(b c d))
-(test '(a (b) (c)) append '(a (b)) '((c)))
-(test '() append)
-(test '(a b c . d) append '(a b) '(c . d))
-(test 'a append '() 'a)
-
-(test '(c b a) reverse '(a b c))
-(test '((e (f)) d (b c) a) reverse '(a (b c) d (e (f))))
-
-(test 'c list-ref '(a b c d) 2)
-
-(test '(a b c) memq 'a '(a b c))
-(test '(b c) memq 'b '(a b c))
-(test '#f memq 'a '(b c d))
-(test '#f memq (list 'a) '(b (a) c))
-(test '((a) c) member (list 'a) '(b (a) c))
-(test '(101 102) memv 101 '(100 101 102))
-
-(define e '((a 1) (b 2) (c 3)))
-(test '(a 1) assq 'a e)
-(test '(b 2) assq 'b e)
-(test #f assq 'd e)
-(test #f assq (list 'a) '(((a)) ((b)) ((c))))
-(test '((a)) assoc (list 'a) '(((a)) ((b)) ((c))))
-(test '(5 7) assv 5 '((2 3) (5 7) (11 13)))
-(SECTION 6 4)
-(test #t symbol? 'foo)
-(test #t symbol? (car '(a b)))
-(test #f symbol? "bar")
-(test #t symbol? 'nil)
-(test #f symbol? '())
-(test #f symbol? #f)
-;;; But first, what case are symbols in? Determine the standard case:
-(define char-standard-case char-upcase)
-(if (string=? (symbol->string 'A) "a")
- (set! char-standard-case char-downcase))
-;;; Not for Guile
-;(test #t 'standard-case
-; (string=? (symbol->string 'a) (symbol->string 'A)))
-;(test #t 'standard-case
-; (or (string=? (symbol->string 'a) "A")
-; (string=? (symbol->string 'A) "a")))
-(define (str-copy s)
- (let ((v (make-string (string-length s))))
- (do ((i (- (string-length v) 1) (- i 1)))
- ((< i 0) v)
- (string-set! v i (string-ref s i)))))
-(define (string-standard-case s)
- (set! s (str-copy s))
- (do ((i 0 (+ 1 i))
- (sl (string-length s)))
- ((>= i sl) s)
- (string-set! s i (char-standard-case (string-ref s i)))))
-;;; Not for Guile
-;(test (string-standard-case "flying-fish") symbol->string 'flying-fish)
-;(test (string-standard-case "martin") symbol->string 'Martin)
-(test "Malvina" symbol->string (string->symbol "Malvina"))
-;;; Not for Guile
-;(test #t 'standard-case (eq? 'a 'A))
-
-(define x (string #\a #\b))
-(define y (string->symbol x))
-(string-set! x 0 #\c)
-(test "cb" 'string-set! x)
-(test "ab" symbol->string y)
-(test y string->symbol "ab")
-
-;;; Not for Guile
-;(test #t eq? 'mISSISSIppi 'mississippi)
-;(test #f 'string->symbol (eq? 'bitBlt (string->symbol "bitBlt")))
-(test 'JollyWog string->symbol (symbol->string 'JollyWog))
-
-(SECTION 6 5 5)
-(test #t number? 3)
-(test #t complex? 3)
-(test #t real? 3)
-(test #t rational? 3)
-(test #t integer? 3)
-
-(test #t exact? 3)
-(test #f inexact? 3)
-
-(test #t = 22 22 22)
-(test #t = 22 22)
-(test #f = 34 34 35)
-(test #f = 34 35)
-(test #t > 3 -6246)
-(test #f > 9 9 -2424)
-(test #t >= 3 -4 -6246)
-(test #t >= 9 9)
-(test #f >= 8 9)
-(test #t < -1 2 3 4 5 6 7 8)
-(test #f < -1 2 3 4 4 5 6 7)
-(test #t <= -1 2 3 4 5 6 7 8)
-(test #t <= -1 2 3 4 4 5 6 7)
-(test #f < 1 3 2)
-(test #f >= 1 3 2)
-
-(test #t zero? 0)
-(test #f zero? 1)
-(test #f zero? -1)
-(test #f zero? -100)
-(test #t positive? 4)
-(test #f positive? -4)
-(test #f positive? 0)
-(test #f negative? 4)
-(test #t negative? -4)
-(test #f negative? 0)
-(test #t odd? 3)
-(test #f odd? 2)
-(test #f odd? -4)
-(test #t odd? -1)
-(test #f even? 3)
-(test #t even? 2)
-(test #t even? -4)
-(test #f even? -1)
-
-(test 38 max 34 5 7 38 6)
-(test -24 min 3 5 5 330 4 -24)
-
-(test 7 + 3 4)
-(test '3 + 3)
-(test 0 +)
-(test 4 * 4)
-(test 1 *)
-
-(test -1 - 3 4)
-(test -3 - 3)
-(test 7 abs -7)
-(test 7 abs 7)
-(test 0 abs 0)
-
-(test 5 quotient 35 7)
-(test -5 quotient -35 7)
-(test -5 quotient 35 -7)
-(test 5 quotient -35 -7)
-(test 1 modulo 13 4)
-(test 1 remainder 13 4)
-(test 3 modulo -13 4)
-(test -1 remainder -13 4)
-(test -3 modulo 13 -4)
-(test 1 remainder 13 -4)
-(test -1 modulo -13 -4)
-(test -1 remainder -13 -4)
-(define (divtest n1 n2)
- (= n1 (+ (* n2 (quotient n1 n2))
- (remainder n1 n2))))
-(test #t divtest 238 9)
-(test #t divtest -238 9)
-(test #t divtest 238 -9)
-(test #t divtest -238 -9)
-
-(test 4 gcd 0 4)
-(test 4 gcd -4 0)
-(test 4 gcd 32 -36)
-(test 0 gcd)
-(test 288 lcm 32 -36)
-(test 1 lcm)
-
-;;;;From: fred@sce.carleton.ca (Fred J Kaudel)
-;;; Modified by jaffer.
-(define (test-inexact)
- (define f3.9 (string->number "3.9"))
- (define f4.0 (string->number "4.0"))
- (define f-3.25 (string->number "-3.25"))
- (define f.25 (string->number ".25"))
- (define f4.5 (string->number "4.5"))
- (define f3.5 (string->number "3.5"))
- (define f0.0 (string->number "0.0"))
- (define f0.8 (string->number "0.8"))
- (define f1.0 (string->number "1.0"))
- (define wto write-test-obj)
- (define dto display-test-obj)
- (define lto load-test-obj)
- (SECTION 6 5 5)
- (test #t inexact? f3.9)
- (test #t 'inexact? (inexact? (max f3.9 4)))
- (test f4.0 'max (max f3.9 4))
- (test f4.0 'exact->inexact (exact->inexact 4))
- (test (- f4.0) round (- f4.5))
- (test (- f4.0) round (- f3.5))
- (test (- f4.0) round (- f3.9))
- (test f0.0 round f0.0)
- (test f0.0 round f.25)
- (test f1.0 round f0.8)
- (test f4.0 round f3.5)
- (test f4.0 round f4.5)
- (set! write-test-obj (list f.25 f-3.25));.25 inexact errors less likely.
- (set! display-test-obj (list f.25 f-3.25));.3 often has such errors (~10^-13)
- (set! load-test-obj (list 'define 'foo (list 'quote write-test-obj)))
- (test #t call-with-output-file
- (data-file-name "tmp3")
- (lambda (test-file)
- (write-char #\; test-file)
- (display write-test-obj test-file)
- (newline test-file)
- (write load-test-obj test-file)
- (output-port? test-file)))
- (check-test-file (data-file-name "tmp3"))
- (set! write-test-obj wto)
- (set! display-test-obj dto)
- (set! load-test-obj lto)
- (let ((x (string->number "4195835.0"))
- (y (string->number "3145727.0")))
- (test #t 'pentium-fdiv-bug (> f1.0 (- x (* (/ x y) y)))))
- (report-errs))
-
-(define (test-bignum)
- (define tb
- (lambda (n1 n2)
- (= n1 (+ (* n2 (quotient n1 n2))
- (remainder n1 n2)))))
- (SECTION 6 5 5)
- (test 0 modulo -2177452800 86400)
- (test 0 modulo 2177452800 -86400)
- (test 0 modulo 2177452800 86400)
- (test 0 modulo -2177452800 -86400)
- (test #t 'remainder (tb 281474976710655 65535))
- (test #t 'remainder (tb 281474976710654 65535))
- (SECTION 6 5 6)
- (test 281474976710655 string->number "281474976710655")
- (test "281474976710655" number->string 281474976710655)
- (report-errs))
-
-(SECTION 6 5 6)
-(test "0" number->string 0)
-(test "100" number->string 100)
-(test "100" number->string 256 16)
-(test 100 string->number "100")
-(test 256 string->number "100" 16)
-(test #f string->number "")
-(test #f string->number ".")
-(test #f string->number "d")
-(test #f string->number "D")
-(test #f string->number "i")
-(test #f string->number "I")
-(test #f string->number "3i")
-(test #f string->number "3I")
-(test #f string->number "33i")
-(test #f string->number "33I")
-(test #f string->number "3.3i")
-(test #f string->number "3.3I")
-(test #f string->number "-")
-(test #f string->number "+")
-
-(SECTION 6 6)
-(test #t eqv? '#\ #\Space)
-(test #t eqv? #\space '#\Space)
-(test #t char? #\a)
-(test #t char? #\()
-(test #t char? #\ )
-(test #t char? '#\newline)
-
-(test #f char=? #\A #\B)
-(test #f char=? #\a #\b)
-(test #f char=? #\9 #\0)
-(test #t char=? #\A #\A)
-
-(test #t char<? #\A #\B)
-(test #t char<? #\a #\b)
-(test #f char<? #\9 #\0)
-(test #f char<? #\A #\A)
-
-(test #f char>? #\A #\B)
-(test #f char>? #\a #\b)
-(test #t char>? #\9 #\0)
-(test #f char>? #\A #\A)
-
-(test #t char<=? #\A #\B)
-(test #t char<=? #\a #\b)
-(test #f char<=? #\9 #\0)
-(test #t char<=? #\A #\A)
-
-(test #f char>=? #\A #\B)
-(test #f char>=? #\a #\b)
-(test #t char>=? #\9 #\0)
-(test #t char>=? #\A #\A)
-
-(test #f char-ci=? #\A #\B)
-(test #f char-ci=? #\a #\B)
-(test #f char-ci=? #\A #\b)
-(test #f char-ci=? #\a #\b)
-(test #f char-ci=? #\9 #\0)
-(test #t char-ci=? #\A #\A)
-(test #t char-ci=? #\A #\a)
-
-(test #t char-ci<? #\A #\B)
-(test #t char-ci<? #\a #\B)
-(test #t char-ci<? #\A #\b)
-(test #t char-ci<? #\a #\b)
-(test #f char-ci<? #\9 #\0)
-(test #f char-ci<? #\A #\A)
-(test #f char-ci<? #\A #\a)
-
-(test #f char-ci>? #\A #\B)
-(test #f char-ci>? #\a #\B)
-(test #f char-ci>? #\A #\b)
-(test #f char-ci>? #\a #\b)
-(test #t char-ci>? #\9 #\0)
-(test #f char-ci>? #\A #\A)
-(test #f char-ci>? #\A #\a)
-
-(test #t char-ci<=? #\A #\B)
-(test #t char-ci<=? #\a #\B)
-(test #t char-ci<=? #\A #\b)
-(test #t char-ci<=? #\a #\b)
-(test #f char-ci<=? #\9 #\0)
-(test #t char-ci<=? #\A #\A)
-(test #t char-ci<=? #\A #\a)
-
-(test #f char-ci>=? #\A #\B)
-(test #f char-ci>=? #\a #\B)
-(test #f char-ci>=? #\A #\b)
-(test #f char-ci>=? #\a #\b)
-(test #t char-ci>=? #\9 #\0)
-(test #t char-ci>=? #\A #\A)
-(test #t char-ci>=? #\A #\a)
-
-(test #t char-alphabetic? #\a)
-(test #t char-alphabetic? #\A)
-(test #t char-alphabetic? #\z)
-(test #t char-alphabetic? #\Z)
-(test #f char-alphabetic? #\0)
-(test #f char-alphabetic? #\9)
-(test #f char-alphabetic? #\space)
-(test #f char-alphabetic? #\;)
-
-(test #f char-numeric? #\a)
-(test #f char-numeric? #\A)
-(test #f char-numeric? #\z)
-(test #f char-numeric? #\Z)
-(test #t char-numeric? #\0)
-(test #t char-numeric? #\9)
-(test #f char-numeric? #\space)
-(test #f char-numeric? #\;)
-
-(test #f char-whitespace? #\a)
-(test #f char-whitespace? #\A)
-(test #f char-whitespace? #\z)
-(test #f char-whitespace? #\Z)
-(test #f char-whitespace? #\0)
-(test #f char-whitespace? #\9)
-(test #t char-whitespace? #\space)
-(test #f char-whitespace? #\;)
-
-(test #f char-upper-case? #\0)
-(test #f char-upper-case? #\9)
-(test #f char-upper-case? #\space)
-(test #f char-upper-case? #\;)
-
-(test #f char-lower-case? #\0)
-(test #f char-lower-case? #\9)
-(test #f char-lower-case? #\space)
-(test #f char-lower-case? #\;)
-
-(test #\. integer->char (char->integer #\.))
-(test #\A integer->char (char->integer #\A))
-(test #\a integer->char (char->integer #\a))
-(test #\A char-upcase #\A)
-(test #\A char-upcase #\a)
-(test #\a char-downcase #\A)
-(test #\a char-downcase #\a)
-(SECTION 6 7)
-(test #t string? "The word \"recursion\\\" has many meanings.")
-(test #t string? "")
-(define f (make-string 3 #\*))
-(test "?**" 'string-set! (begin (string-set! f 0 #\?) f))
-(test "abc" string #\a #\b #\c)
-(test "" string)
-(test 3 string-length "abc")
-(test #\a string-ref "abc" 0)
-(test #\c string-ref "abc" 2)
-(test 0 string-length "")
-(test "" substring "ab" 0 0)
-(test "" substring "ab" 1 1)
-(test "" substring "ab" 2 2)
-(test "a" substring "ab" 0 1)
-(test "b" substring "ab" 1 2)
-(test "ab" substring "ab" 0 2)
-(test "foobar" string-append "foo" "bar")
-(test "foo" string-append "foo")
-(test "foo" string-append "foo" "")
-(test "foo" string-append "" "foo")
-(test "" string-append)
-(test "" make-string 0)
-(test #t string=? "" "")
-(test #f string<? "" "")
-(test #f string>? "" "")
-(test #t string<=? "" "")
-(test #t string>=? "" "")
-(test #t string-ci=? "" "")
-(test #f string-ci<? "" "")
-(test #f string-ci>? "" "")
-(test #t string-ci<=? "" "")
-(test #t string-ci>=? "" "")
-
-(test #f string=? "A" "B")
-(test #f string=? "a" "b")
-(test #f string=? "9" "0")
-(test #t string=? "A" "A")
-
-(test #t string<? "A" "B")
-(test #t string<? "a" "b")
-(test #f string<? "9" "0")
-(test #f string<? "A" "A")
-
-(test #f string>? "A" "B")
-(test #f string>? "a" "b")
-(test #t string>? "9" "0")
-(test #f string>? "A" "A")
-
-(test #t string<=? "A" "B")
-(test #t string<=? "a" "b")
-(test #f string<=? "9" "0")
-(test #t string<=? "A" "A")
-
-(test #f string>=? "A" "B")
-(test #f string>=? "a" "b")
-(test #t string>=? "9" "0")
-(test #t string>=? "A" "A")
-
-(test #f string-ci=? "A" "B")
-(test #f string-ci=? "a" "B")
-(test #f string-ci=? "A" "b")
-(test #f string-ci=? "a" "b")
-(test #f string-ci=? "9" "0")
-(test #t string-ci=? "A" "A")
-(test #t string-ci=? "A" "a")
-
-(test #t string-ci<? "A" "B")
-(test #t string-ci<? "a" "B")
-(test #t string-ci<? "A" "b")
-(test #t string-ci<? "a" "b")
-(test #f string-ci<? "9" "0")
-(test #f string-ci<? "A" "A")
-(test #f string-ci<? "A" "a")
-
-(test #f string-ci>? "A" "B")
-(test #f string-ci>? "a" "B")
-(test #f string-ci>? "A" "b")
-(test #f string-ci>? "a" "b")
-(test #t string-ci>? "9" "0")
-(test #f string-ci>? "A" "A")
-(test #f string-ci>? "A" "a")
-
-(test #t string-ci<=? "A" "B")
-(test #t string-ci<=? "a" "B")
-(test #t string-ci<=? "A" "b")
-(test #t string-ci<=? "a" "b")
-(test #f string-ci<=? "9" "0")
-(test #t string-ci<=? "A" "A")
-(test #t string-ci<=? "A" "a")
-
-(test #f string-ci>=? "A" "B")
-(test #f string-ci>=? "a" "B")
-(test #f string-ci>=? "A" "b")
-(test #f string-ci>=? "a" "b")
-(test #t string-ci>=? "9" "0")
-(test #t string-ci>=? "A" "A")
-(test #t string-ci>=? "A" "a")
-(SECTION 6 8)
-(test #t vector? '#(0 (2 2 2 2) "Anna"))
-(test #t vector? '#())
-(test '#(a b c) vector 'a 'b 'c)
-(test '#() vector)
-(test 3 vector-length '#(0 (2 2 2 2) "Anna"))
-(test 0 vector-length '#())
-(test 8 vector-ref '#(1 1 2 3 5 8 13 21) 5)
-(test '#(0 ("Sue" "Sue") "Anna") 'vector-set
- (let ((vec (vector 0 '(2 2 2 2) "Anna")))
- (vector-set! vec 1 '("Sue" "Sue"))
- vec))
-(test '#(hi hi) make-vector 2 'hi)
-(test '#() make-vector 0)
-(test '#() make-vector 0 'a)
-(SECTION 6 9)
-(test #t procedure? car)
-(test #f procedure? 'car)
-(test #t procedure? (lambda (x) (* x x)))
-(test #f procedure? '(lambda (x) (* x x)))
-(test #t call-with-current-continuation procedure?)
-(test 7 apply + (list 3 4))
-(test 7 apply (lambda (a b) (+ a b)) (list 3 4))
-(test 17 apply + 10 (list 3 4))
-(test '() apply list '())
-(define compose (lambda (f g) (lambda args (f (apply g args)))))
-(test 30 (compose sqt *) 12 75)
-
-(test '(b e h) map cadr '((a b) (d e) (g h)))
-(test '(5 7 9) map + '(1 2 3) '(4 5 6))
-(test '#(0 1 4 9 16) 'for-each
- (let ((v (make-vector 5)))
- (for-each (lambda (i) (vector-set! v i (* i i)))
- '(0 1 2 3 4))
- v))
-(test -3 call-with-current-continuation
- (lambda (exit)
- (for-each (lambda (x) (if (negative? x) (exit x)))
- '(54 0 37 -3 245 19))
- #t))
-(define list-length
- (lambda (obj)
- (call-with-current-continuation
- (lambda (return)
- (letrec ((r (lambda (obj) (cond ((null? obj) 0)
- ((pair? obj) (+ (r (cdr obj)) 1))
- (else (return #f))))))
- (r obj))))))
-(test 4 list-length '(1 2 3 4))
-(test #f list-length '(a b . c))
-(test '() map cadr '())
-
-;;; This tests full conformance of call-with-current-continuation. It
-;;; is a separate test because some schemes do not support call/cc
-;;; other than escape procedures. I am indebted to
-;;; raja@copper.ucs.indiana.edu (Raja Sooriamurthi) for fixing this
-;;; code. The function leaf-eq? compares the leaves of 2 arbitrary
-;;; trees constructed of conses.
-(define (next-leaf-generator obj eot)
- (letrec ((return #f)
- (cont (lambda (x)
- (recur obj)
- (set! cont (lambda (x) (return eot)))
- (cont #f)))
- (recur (lambda (obj)
- (if (pair? obj)
- (for-each recur obj)
- (call-with-current-continuation
- (lambda (c)
- (set! cont c)
- (return obj)))))))
- (lambda () (call-with-current-continuation
- (lambda (ret) (set! return ret) (cont #f))))))
-(define (leaf-eq? x y)
- (let* ((eot (list 'eot))
- (xf (next-leaf-generator x eot))
- (yf (next-leaf-generator y eot)))
- (letrec ((loop (lambda (x y)
- (cond ((not (eq? x y)) #f)
- ((eq? eot x) #t)
- (else (loop (xf) (yf)))))))
- (loop (xf) (yf)))))
-(define (test-cont)
- (SECTION 6 9)
- (test #t leaf-eq? '(a (b (c))) '((a) b c))
- (test #f leaf-eq? '(a (b (c))) '((a) b c d))
- (report-errs))
-
-;;; Test Optional R4RS DELAY syntax and FORCE procedure
-(define (test-delay)
- (SECTION 6 9)
- (test 3 'delay (force (delay (+ 1 2))))
- (test '(3 3) 'delay (let ((p (delay (+ 1 2))))
- (list (force p) (force p))))
- (test 2 'delay (letrec ((a-stream
- (letrec ((next (lambda (n)
- (cons n (delay (next (+ n 1)))))))
- (next 0)))
- (head car)
- (tail (lambda (stream) (force (cdr stream)))))
- (head (tail (tail a-stream)))))
- (letrec ((count 0)
- (p (delay (begin (set! count (+ count 1))
- (if (> count x)
- count
- (force p)))))
- (x 5))
- (test 6 force p)
- (set! x 10)
- (test 6 force p))
- (test 3 'force
- (letrec ((p (delay (if c 3 (begin (set! c #t) (+ (force p) 1)))))
- (c #f))
- (force p)))
- (report-errs))
-
-(SECTION 6 10 1)
-(test #t input-port? (current-input-port))
-(test #t output-port? (current-output-port))
-(test #t call-with-input-file (test-file-name "r4rs.test") input-port?)
-(define this-file (open-input-file (test-file-name "r4rs.test")))
-(test #t input-port? this-file)
-(SECTION 6 10 2)
-(test #\; peek-char this-file)
-(test #\; read-char this-file)
-(test '(define cur-section '()) read this-file)
-(test #\( peek-char this-file)
-(test '(define errs '()) read this-file)
-(close-input-port this-file)
-(close-input-port this-file)
-(define (check-test-file name)
- (define test-file (open-input-file name))
- (test #t 'input-port?
- (call-with-input-file
- name
- (lambda (test-file)
- (test load-test-obj read test-file)
- (test #t eof-object? (peek-char test-file))
- (test #t eof-object? (read-char test-file))
- (input-port? test-file))))
- (test #\; read-char test-file)
- (test display-test-obj read test-file)
- (test load-test-obj read test-file)
- (close-input-port test-file))
-(SECTION 6 10 3)
-(define write-test-obj
- '(#t #f #\a () 9739 -3 . #((test) "te \" \" st" "" test #() b c)))
-(define display-test-obj
- '(#t #f a () 9739 -3 . #((test) te " " st test #() b c)))
-(define load-test-obj
- (list 'define 'foo (list 'quote write-test-obj)))
-(test #t call-with-output-file
- (data-file-name "tmp1")
- (lambda (test-file)
- (write-char #\; test-file)
- (display write-test-obj test-file)
- (newline test-file)
- (write load-test-obj test-file)
- (output-port? test-file)))
-(check-test-file (data-file-name "tmp1"))
-
-(define test-file (open-output-file (data-file-name "tmp2")))
-(write-char #\; test-file)
-(display write-test-obj test-file)
-(newline test-file)
-(write load-test-obj test-file)
-(test #t output-port? test-file)
-(close-output-port test-file)
-(check-test-file (data-file-name "tmp2"))
-(define (test-sc4)
- (SECTION 6 7)
- (test '(#\P #\space #\l) string->list "P l")
- (test '() string->list "")
- (test "1\\\"" list->string '(#\1 #\\ #\"))
- (test "" list->string '())
- (SECTION 6 8)
- (test '(dah dah didah) vector->list '#(dah dah didah))
- (test '() vector->list '#())
- (test '#(dididit dah) list->vector '(dididit dah))
- (test '#() list->vector '())
- (SECTION 6 10 4)
- (load (data-file-name "tmp1"))
- (test write-test-obj 'load foo)
- (report-errs))
-
-(report-errs)
-(if (and (string->number "0.0") (inexact? (string->number "0.0")))
- (test-inexact))
-
-(let ((n (string->number "281474976710655")))
- (if (and n (exact? n))
- (test-bignum)))
-(test-cont)
-(test-sc4)
-(test-delay)
-"last item in file"
-
-
-;; FIXME: We shouldn't create any global bindings in the test files or
-;; alternatively execute every test file's code in a module of its own
-(if (defined? 'x) (undefine x))
-(if (defined? 'y) (undefine y))
-
-(delete-file (data-file-name "tmp1"))
-(delete-file (data-file-name "tmp2"))
-(delete-file (data-file-name "tmp3"))
diff --git a/test-suite/tests/reader.test b/test-suite/tests/reader.test
deleted file mode 100644
index 64bd05aa7..000000000
--- a/test-suite/tests/reader.test
+++ /dev/null
@@ -1,41 +0,0 @@
-;;;; reader.test --- test the Guile parser -*- scheme -*-
-;;;; Jim Blandy <jimb@red-bean.com> --- September 1999
-
-(define exception:eof
- (cons 'misc-error "^end of file"))
-(define exception:unexpected-rparen
- (cons 'misc-error "^unexpected \")\""))
-
-(define (read-string s)
- (with-input-from-string s (lambda () (read))))
-
-(with-test-prefix "reading"
- (pass-if "0"
- (equal? (read-string "0") 0))
- (pass-if "1++i"
- (equal? (read-string "1++i") '1++i))
- (pass-if "1+i+i"
- (equal? (read-string "1+i+i") '1+i+i))
- (pass-if "1+e10000i"
- (equal? (read-string "1+e10000i") '1+e10000i)))
-
-(pass-if-exception "radix passed to number->string can't be zero"
- exception:out-of-range
- (number->string 10 0))
-(pass-if-exception "radix passed to number->string can't be one either"
- exception:out-of-range
- (number->string 10 1))
-
-(with-test-prefix "mismatching parentheses"
- (pass-if-exception "opening parenthesis"
- exception:eof
- (read-string "("))
- (pass-if-exception "closing parenthesis following mismatched opening"
- exception:unexpected-rparen
- (read-string ")"))
- (pass-if-exception "opening vector parenthesis"
- exception:eof
- (read-string "#("))
- (pass-if-exception "closing parenthesis following mismatched vector opening"
- exception:unexpected-rparen
- (read-string ")")))
diff --git a/test-suite/tests/regexp.test b/test-suite/tests/regexp.test
deleted file mode 100644
index 0358354ba..000000000
--- a/test-suite/tests/regexp.test
+++ /dev/null
@@ -1,102 +0,0 @@
-;;;; regexp.test --- test Guile's regular expression functions -*- scheme -*-
-;;;; Jim Blandy <jimb@red-bean.com> --- September 1999
-;;;;
-;;;; Copyright (C) 1999 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-(use-modules (test-suite lib)
- (ice-9 regex))
-
-;;; Run a regexp-substitute or regexp-substitute/global test, once
-;;; providing a real port and once providing #f, requesting direct
-;;; string output.
-(define (vary-port func expected . args)
- (pass-if "port is string port"
- (equal? expected
- (call-with-output-string
- (lambda (port)
- (apply func port args)))))
- (pass-if "port is #f"
- (equal? expected
- (apply func #f args))))
-
-(define (object->string obj)
- (call-with-output-string
- (lambda (port)
- (write obj port))))
-
-(with-test-prefix "regexp-substitute"
- (let ((match
- (string-match "patleft(sub1)patmid(sub2)patright"
- "contleftpatleftsub1patmidsub2patrightcontright")))
- (define (try expected . args)
- (with-test-prefix (object->string args)
- (apply vary-port regexp-substitute expected match args)))
-
- (try "")
- (try "string1" "string1")
- (try "string1string2" "string1" "string2")
- (try "patleftsub1patmidsub2patright" 0)
- (try "hi-patleftsub1patmidsub2patright-bye" "hi-" 0 "-bye")
- (try "sub1" 1)
- (try "hi-sub1-bye" "hi-" 1 "-bye")
- (try "hi-sub2-bye" "hi-" 2 "-bye")
- (try "contleft" 'pre)
- (try "contright" 'post)
- (try "contrightcontleft" 'post 'pre)
- (try "contrightcontleftcontrightcontleft" 'post 'pre 'post 'pre)
- (try "contrightsub2sub1contleft" 'post 2 1 'pre)
- (try "foosub1sub1sub1sub1bar" "foo" 1 1 1 1 "bar")))
-
-(with-test-prefix "regexp-substitute/global"
-
- (define (try expected . args)
- (with-test-prefix (object->string args)
- (apply vary-port regexp-substitute/global expected args)))
-
- (try "hi" "a(x*)b" "ab" "hi")
- (try "" "a(x*)b" "ab" 1)
- (try "xx" "a(x*)b" "axxb" 1)
- (try "xx" "a(x*)b" "_axxb_" 1)
- (try "pre" "a(x*)b" "preaxxbpost" 'pre)
- (try "post" "a(x*)b" "preaxxbpost" 'post)
- (try "string" "x" "string" 'pre "y" 'post)
- (try "4" "a(x*)b" "_axxb_" (lambda (m)
- (number->string (match:end m 1))))
-
- (try "_aybycyd_" "x+" "_axbxxcxxxd_" 'pre "y" 'post)
-
- ;; This should not go into an infinite loop, just because the regexp
- ;; can match the empty string. This test also kind of beats on our
- ;; definition of where a null string can match.
- (try "y_yaybycydy_y" "x*" "_axbxxcxxxd_" 'pre "y" 'post)
-
- ;; These kind of bother me. The extension from regexp-substitute to
- ;; regexp-substitute/global is only natural if your item list
- ;; includes both pre and post. If those are required, why bother
- ;; to include them at all?
- (try "4:7:12:_" "a(x*)b" "_axxbaxbaxxxb_"
- (lambda (m) (number->string (match:end m 1))) ":"
- 'post)
- (try "4:10:19:_:19:10:4" "a(x*)b" "_axxbaxxxxbaxxxxxxxb_"
- (lambda (m) (number->string (match:end m 1))) ":"
- 'post
- ":" (lambda (m) (number->string (match:end m 1))))
-
- ;; Jan Nieuwenhuizen's bug, 2 Sep 1999
- (try "" "_" (make-string 500 #\_)
- 'post))
diff --git a/test-suite/tests/srfi-10.test b/test-suite/tests/srfi-10.test
deleted file mode 100644
index 28caf3ad3..000000000
--- a/test-suite/tests/srfi-10.test
+++ /dev/null
@@ -1,30 +0,0 @@
-;;;; srfi-10.test --- Test suite for Guile's SRFI-10 functions. -*- scheme -*-
-;;;; Martin Grabmueller, 2001-05-10
-;;;;
-;;;; Copyright (C) 2001 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-(use-modules (srfi srfi-10))
-
-(define-reader-ctor 'rx make-regexp)
-
-(with-test-prefix "hash-comma read extension"
-
- (pass-if "basic feature"
- (let* ((rx #,(rx "^foo$")))
- (and (->bool (regexp-exec rx "foo"))
- (not (regexp-exec rx "bar foo frob"))))))
diff --git a/test-suite/tests/srfi-13.test b/test-suite/tests/srfi-13.test
deleted file mode 100644
index c74f06350..000000000
--- a/test-suite/tests/srfi-13.test
+++ /dev/null
@@ -1,1029 +0,0 @@
-;;;; srfi-13.test --- Test suite for Guile's SRFI-13 functions. -*- scheme -*-
-;;;; Martin Grabmueller, 2001-05-07
-;;;;
-;;;; Copyright (C) 2001 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-(use-modules (srfi srfi-13) (srfi srfi-14) (test-suite lib))
-
-;;; This kludge is needed, because SRFI-13 redefines some bindings in
-;;; the core.
-(define (module-peek module-name sym)
- (variable-ref (module-variable (resolve-module module-name) sym)))
-
-(define exception:strict-infix-grammar
- (cons 'misc-error "^strict-infix"))
-
-(with-test-prefix "string-any"
-
- (pass-if "no match"
- (not (string-any char-upper-case? "abcde")))
-
- (pass-if "one match"
- (string-any char-upper-case? "abCde"))
-
- (pass-if "more than one match"
- (string-any char-upper-case? "abCDE"))
-
- (pass-if "no match, start index"
- (not (string-any char-upper-case? "Abcde" 1)))
-
- (pass-if "one match, start index"
- (string-any char-upper-case? "abCde" 1))
-
- (pass-if "more than one match, start index"
- (string-any char-upper-case? "abCDE" 1))
-
- (pass-if "no match, start and end index"
- (not (string-any char-upper-case? "AbcdE" 1 4)))
-
- (pass-if "one match, start and end index"
- (string-any char-upper-case? "abCde" 1 4))
-
- (pass-if "more than one match, start and end index"
- (string-any char-upper-case? "abCDE" 1 4)))
-
-(with-test-prefix "string-every"
-
- (pass-if "no match at all"
- (not (string-every char-upper-case? "abcde")))
-
- (pass-if "not all match"
- (not (string-every char-upper-case? "abCDE")))
-
- (pass-if "all match"
- (string-every char-upper-case? "ABCDE"))
-
- (pass-if "no match at all, start index"
- (not (string-every char-upper-case? "Abcde" 1)))
-
- (pass-if "not all match, start index"
- (not (string-every char-upper-case? "ABcde" 1)))
-
- (pass-if "all match, start index"
- (string-every char-upper-case? "aBCDE" 1))
-
- (pass-if "no match at all, start and end index"
- (not (string-every char-upper-case? "AbcdE" 1 4)))
-
- (pass-if "not all match, start and end index"
- (not (string-every char-upper-case? "ABcde" 1 4)))
-
- (pass-if "all match, start and end index"
- (string-every char-upper-case? "aBCDe" 1 4)))
-
-(with-test-prefix "string-tabulate"
-
- (pass-if "static fill-char"
- (string=? (string-tabulate (lambda (idx) #\!) 10) "!!!!!!!!!!"))
-
- (pass-if "variable fill-char"
- (string=? (string-tabulate
- (lambda (idx) (integer->char (+ idx 32))) 10) " !\"#$%&'()")))
-
-;; Get the procedure from the library.
-(define string->list (module-peek '(srfi srfi-13) 'string->list))
-
-(with-test-prefix "string->list"
-
- (pass-if "empty"
- (zero? (length (string->list ""))))
-
- (pass-if "nonempty"
- (= (length (string->list "foo")) 3))
-
- (pass-if "empty, start index"
- (zero? (length (string->list "foo" 3 3))))
-
- (pass-if "nonempty, start index"
- (= (length (string->list "foo" 1 3)) 2))
- )
-
-(with-test-prefix "reverse-list->string"
-
- (pass-if "empty"
- (string-null? (reverse-list->string '())))
-
- (pass-if "nonempty"
- (string=? "foo" (reverse-list->string '(#\o #\o #\f)))))
-
-
-(with-test-prefix "string-join"
-
- (pass-if "empty list, no delimiter, implicit infix, empty 1"
- (string=? "" (string-join '())))
-
- (pass-if "empty string, no delimiter, implicit infix, empty 2"
- (string=? "" (string-join '(""))))
-
- (pass-if "non-empty, no delimiter, implicit infix"
- (string=? "bla" (string-join '("bla"))))
-
- (pass-if "empty list, implicit infix, empty 1"
- (string=? "" (string-join '() "|delim|")))
-
- (pass-if "empty string, implicit infix, empty 2"
- (string=? "" (string-join '("") "|delim|")))
-
- (pass-if "non-empty, implicit infix"
- (string=? "bla" (string-join '("bla") "|delim|")))
-
- (pass-if "non-empty, implicit infix"
- (string=? "bla" (string-join '("bla") "|delim|")))
-
- (pass-if "two strings, implicit infix"
- (string=? "bla|delim|fasel" (string-join '("bla" "fasel") "|delim|")))
-
- (pass-if "empty, explicit infix"
- (string=? "" (string-join '("") "|delim|" 'infix)))
-
- (pass-if "empty list, explicit infix"
- (string=? "" (string-join '() "|delim|" 'infix)))
-
- (pass-if "non-empty, explicit infix"
- (string=? "bla" (string-join '("bla") "|delim|" 'infix)))
-
- (pass-if "two strings, explicit infix"
- (string=? "bla|delim|fasel" (string-join '("bla" "fasel") "|delim|"
- 'infix)))
-
- (pass-if-exception "empty list, strict infix"
- exception:strict-infix-grammar
- (string-join '() "|delim|" 'strict-infix))
-
- (pass-if "empty, strict infix"
- (string=? "" (string-join '("") "|delim|" 'strict-infix)))
-
- (pass-if "non-empty, strict infix"
- (string=? "foo" (string-join '("foo") "|delim|" 'strict-infix)))
-
- (pass-if "two strings, strict infix"
- (string=? "foo|delim|bar" (string-join '("foo" "bar") "|delim|"
- 'strict-infix)))
-
- (pass-if "empty list, prefix"
- (string=? "" (string-join '() "|delim|" 'prefix)))
-
- (pass-if "empty, prefix"
- (string=? "|delim|" (string-join '("") "|delim|" 'prefix)))
-
- (pass-if "non-empty, prefix"
- (string=? "|delim|foo" (string-join '("foo") "|delim|" 'prefix)))
-
- (pass-if "two strings, prefix"
- (string=? "|delim|foo|delim|bar" (string-join '("foo" "bar") "|delim|"
- 'prefix)))
-
- (pass-if "empty list, suffix"
- (string=? "" (string-join '() "|delim|" 'suffix)))
-
- (pass-if "empty, suffix"
- (string=? "|delim|" (string-join '("") "|delim|" 'suffix)))
-
- (pass-if "non-empty, suffix"
- (string=? "foo|delim|" (string-join '("foo") "|delim|" 'suffix)))
-
- (pass-if "two strings, suffix"
- (string=? "foo|delim|bar|delim|" (string-join '("foo" "bar") "|delim|"
- 'suffix))))
-
-;; Get the procedure from the library.
-(define string-copy (module-peek '(srfi srfi-13) 'string-copy))
-
-(with-test-prefix "string-copy"
-
- (pass-if "empty string"
- (string=? "" (string-copy "")))
-
- (pass-if "full string"
- (string=? "foo-bar" (string-copy "foo-bar")))
-
- (pass-if "start index"
- (string=? "o-bar" (string-copy "foo-bar" 2)))
-
- (pass-if "start and end index"
- (string=? "o-ba" (string-copy "foo-bar" 2 6)))
-)
-
-(with-test-prefix "substring/shared"
-
- (pass-if "empty string"
- (eq? "" (substring/shared "" 0)))
-
- (pass-if "non-empty string"
- (string=? "foo" (substring/shared "foo-bar" 0 3)))
-
- (pass-if "non-empty string, not eq?"
- (string=? "foo-bar" (substring/shared "foo-bar" 0 7))))
-
-(with-test-prefix "string-copy!"
-
- (pass-if "non-empty string"
- (string=? "welld, oh yeah!"
- (let* ((s "hello")
- (t "world, oh yeah!"))
- (string-copy! t 1 s 1 3)
- t))))
-
-(with-test-prefix "string-take"
-
- (pass-if "empty string"
- (string=? "" (string-take "foo bar braz" 0)))
-
- (pass-if "non-empty string"
- (string=? "foo " (string-take "foo bar braz" 4)))
-
- (pass-if "full string"
- (string=? "foo bar braz" (string-take "foo bar braz" 12))))
-
-(with-test-prefix "string-take-right"
-
- (pass-if "empty string"
- (string=? "" (string-take-right "foo bar braz" 0)))
-
- (pass-if "non-empty string"
- (string=? "braz" (string-take-right "foo bar braz" 4)))
-
- (pass-if "full string"
- (string=? "foo bar braz" (string-take-right "foo bar braz" 12))))
-
-(with-test-prefix "string-drop"
-
- (pass-if "empty string"
- (string=? "" (string-drop "foo bar braz" 12)))
-
- (pass-if "non-empty string"
- (string=? "braz" (string-drop "foo bar braz" 8)))
-
- (pass-if "full string"
- (string=? "foo bar braz" (string-drop "foo bar braz" 0))))
-
-(with-test-prefix "string-drop-right"
-
- (pass-if "empty string"
- (string=? "" (string-drop-right "foo bar braz" 12)))
-
- (pass-if "non-empty string"
- (string=? "foo " (string-drop-right "foo bar braz" 8)))
-
- (pass-if "full string"
- (string=? "foo bar braz" (string-drop-right "foo bar braz" 0))))
-
-(with-test-prefix "string-pad"
-
- (pass-if "empty string, zero pad"
- (string=? "" (string-pad "" 0)))
-
- (pass-if "empty string, zero pad, pad char"
- (string=? "" (string-pad "" 0)))
-
- (pass-if "empty pad string, 2 pad "
- (string=? " " (string-pad "" 2)))
-
- (pass-if "empty pad string, 2 pad, pad char"
- (string=? "!!" (string-pad "" 2 #\!)))
-
- (pass-if "empty pad string, 2 pad, pad char, start index"
- (string=? "!c" (string-pad "abc" 2 #\! 2)))
-
- (pass-if "empty pad string, 2 pad, pad char, start and end index"
- (string=? "!c" (string-pad "abcd" 2 #\! 2 3)))
-
- (pass-if "freestyle 1"
- (string=? "32" (string-pad (number->string 532) 2 #\!)))
-
- (pass-if "freestyle 2"
- (string=? "!532" (string-pad (number->string 532) 4 #\!))))
-
-(with-test-prefix "string-pad-right"
-
- (pass-if "empty string, zero pad"
- (string=? "" (string-pad-right "" 0)))
-
- (pass-if "empty string, zero pad, pad char"
- (string=? "" (string-pad-right "" 0)))
-
- (pass-if "empty pad string, 2 pad "
- (string=? " " (string-pad-right "" 2)))
-
- (pass-if "empty pad string, 2 pad, pad char"
- (string=? "!!" (string-pad-right "" 2 #\!)))
-
- (pass-if "empty pad string, 2 pad, pad char, start index"
- (string=? "c!" (string-pad-right "abc" 2 #\! 2)))
-
- (pass-if "empty pad string, 2 pad, pad char, start and end index"
- (string=? "c!" (string-pad-right "abcd" 2 #\! 2 3)))
-
- (pass-if "freestyle 1"
- (string=? "53" (string-pad-right (number->string 532) 2 #\!)))
-
- (pass-if "freestyle 2"
- (string=? "532!" (string-pad-right (number->string 532) 4 #\!))))
-
-(with-test-prefix "string-trim"
-
- (pass-if "empty string"
- (string=? "" (string-trim "")))
-
- (pass-if "no char/pred"
- (string=? "foo " (string-trim " \tfoo ")))
-
- (pass-if "start index, pred"
- (string=? "foo " (string-trim " \tfoo " char-whitespace? 1)))
-
- (pass-if "start and end index, pred"
- (string=? "f" (string-trim " \tfoo " char-whitespace? 1 3)))
-
- (pass-if "start index, char"
- (string=? "\tfoo " (string-trim " \tfoo " #\space 1)))
-
- (pass-if "start and end index, char"
- (string=? "\tf" (string-trim " \tfoo " #\space 1 3)))
-
- (pass-if "start index, charset"
- (string=? "foo " (string-trim " \tfoo " char-set:whitespace 1)))
-
- (pass-if "start and end index, charset"
- (string=? "f" (string-trim " \tfoo " char-set:whitespace 1 3))))
-
-(with-test-prefix "string-trim-right"
-
- (pass-if "empty string"
- (string=? "" (string-trim-right "")))
-
- (pass-if "no char/pred"
- (string=? " \tfoo" (string-trim-right " \tfoo ")))
-
- (pass-if "start index, pred"
- (string=? "\tfoo" (string-trim-right " \tfoo " char-whitespace? 1)))
-
- (pass-if "start and end index, pred"
- (string=? "\tf" (string-trim-right " \tfoo " char-whitespace? 1 3)))
-
- (pass-if "start index, char"
- (string=? "\tfoo" (string-trim-right " \tfoo " #\space 1)))
-
- (pass-if "start and end index, char"
- (string=? "\tf" (string-trim-right " \tfoo " #\space 1 3)))
-
- (pass-if "start index, charset"
- (string=? "\tfoo" (string-trim-right " \tfoo " char-set:whitespace 1)))
-
- (pass-if "start and end index, charset"
- (string=? "\tf" (string-trim-right " \tfoo " char-set:whitespace 1 3))))
-
-(with-test-prefix "string-trim-both"
-
- (pass-if "empty string"
- (string=? "" (string-trim-both "")))
-
- (pass-if "no char/pred"
- (string=? "foo" (string-trim-both " \tfoo ")))
-
- (pass-if "start index, pred"
- (string=? "foo" (string-trim-both " \tfoo " char-whitespace? 1)))
-
- (pass-if "start and end index, pred"
- (string=? "f" (string-trim-both " \tfoo " char-whitespace? 1 3)))
-
- (pass-if "start index, char"
- (string=? "\tfoo" (string-trim-both " \tfoo " #\space 1)))
-
- (pass-if "start and end index, char"
- (string=? "\tf" (string-trim-both " \tfoo " #\space 1 3)))
-
- (pass-if "start index, charset"
- (string=? "foo" (string-trim-both " \tfoo " char-set:whitespace 1)))
-
- (pass-if "start and end index, charset"
- (string=? "f" (string-trim-both " \tfoo " char-set:whitespace 1 3))))
-
-;; Get the procedure from the library.
-(define string-fill! (module-peek '(srfi srfi-13) 'string-fill!))
-
-(define s0 (make-string 200 #\!))
-(define s1 (make-string 0 #\!))
-
-(with-test-prefix "string-fill!"
-
- (pass-if "empty string, no indices"
- (string-fill! s1 #\*)
- (= (string-length s1) 0))
-
- (pass-if "empty string, start index"
- (string-fill! s1 #\* 0)
- (= (string-length s1) 0))
-
- (pass-if "empty string, start and end index"
- (string-fill! s1 #\* 0 0)
- (= (string-length s1) 0))
-
- (pass-if "no indices"
- (string-fill! s0 #\*)
- (char=? (string-ref s0 0) #\*))
-
- (pass-if "start index"
- (string-fill! s0 #\+ 10)
- (char=? (string-ref s0 11) #\+))
-
- (pass-if "start and end index"
- (string-fill! s0 #\| 12 20)
- (char=? (string-ref s0 13) #\|)))
-
-(with-test-prefix "string-prefix-length"
-
- (pass-if "empty prefix"
- (= 0 (string-prefix-length "" "foo bar")))
-
- (pass-if "non-empty prefix - match"
- (= 3 (string-prefix-length "foo" "foo bar")))
-
- (pass-if "non-empty prefix - no match"
- (= 0 (string-prefix-length "bar" "foo bar"))))
-
-(with-test-prefix "string-prefix-length-ci"
-
- (pass-if "empty prefix"
- (= 0 (string-prefix-length-ci "" "foo bar")))
-
- (pass-if "non-empty prefix - match"
- (= 3 (string-prefix-length-ci "fOo" "foo bar")))
-
- (pass-if "non-empty prefix - no match"
- (= 0 (string-prefix-length-ci "bAr" "foo bar"))))
-
-(with-test-prefix "string-suffix-length"
-
- (pass-if "empty suffix"
- (= 0 (string-suffix-length "" "foo bar")))
-
- (pass-if "non-empty suffix - match"
- (= 3 (string-suffix-length "bar" "foo bar")))
-
- (pass-if "non-empty suffix - no match"
- (= 0 (string-suffix-length "foo" "foo bar"))))
-
-(with-test-prefix "string-suffix-length-ci"
-
- (pass-if "empty suffix"
- (= 0 (string-suffix-length-ci "" "foo bar")))
-
- (pass-if "non-empty suffix - match"
- (= 3 (string-suffix-length-ci "bAr" "foo bar")))
-
- (pass-if "non-empty suffix - no match"
- (= 0 (string-suffix-length-ci "fOo" "foo bar"))))
-
-(with-test-prefix "string-prefix?"
-
- (pass-if "empty prefix"
- (string-prefix? "" "foo bar"))
-
- (pass-if "non-empty prefix - match"
- (string-prefix? "foo" "foo bar"))
-
- (pass-if "non-empty prefix - no match"
- (not (string-prefix? "bar" "foo bar"))))
-
-(with-test-prefix "string-prefix-ci?"
-
- (pass-if "empty prefix"
- (string-prefix-ci? "" "foo bar"))
-
- (pass-if "non-empty prefix - match"
- (string-prefix-ci? "fOo" "foo bar"))
-
- (pass-if "non-empty prefix - no match"
- (not (string-prefix-ci? "bAr" "foo bar"))))
-
-(with-test-prefix "string-suffix?"
-
- (pass-if "empty suffix"
- (string-suffix? "" "foo bar"))
-
- (pass-if "non-empty suffix - match"
- (string-suffix? "bar" "foo bar"))
-
- (pass-if "non-empty suffix - no match"
- (not (string-suffix? "foo" "foo bar"))))
-
-(with-test-prefix "string-suffix-ci?"
-
- (pass-if "empty suffix"
- (string-suffix-ci? "" "foo bar"))
-
- (pass-if "non-empty suffix - match"
- (string-suffix-ci? "bAr" "foo bar"))
-
- (pass-if "non-empty suffix - no match"
- (not (string-suffix-ci? "fOo" "foo bar"))))
-
-;; Get the procedure from the library.
-(define string-index (module-peek '(srfi srfi-13) 'string-index))
-
-(with-test-prefix "string-index"
-
- (pass-if "empty string - char"
- (not (string-index "" #\a)))
-
- (pass-if "non-empty - char - match"
- (= 5 (string-index "foo bar" #\a)))
-
- (pass-if "non-empty - char - no match"
- (not (string-index "frobnicate" #\x)))
-
- (pass-if "empty string - char - start index"
- (not (string-index "" #\a 0)))
-
- (pass-if "non-empty - char - match - start index"
- (= 5 (string-index "foo bar" #\a 1)))
-
- (pass-if "non-empty - char - no match - start index"
- (not (string-index "frobnicate" #\x 2)))
-
- (pass-if "empty string - char - start and end index"
- (not (string-index "" #\a 0 0)))
-
- (pass-if "non-empty - char - match - start and end index"
- (= 5 (string-index "foo bar" #\a 1 6)))
-
- (pass-if "non-empty - char - no match - start and end index"
- (not (string-index "frobnicate" #\a 2 5)))
-
- (pass-if "empty string - charset"
- (not (string-index "" char-set:letter)))
-
- (pass-if "non-empty - charset - match"
- (= 0 (string-index "foo bar" char-set:letter)))
-
- (pass-if "non-empty - charset - no match"
- (not (string-index "frobnicate" char-set:digit)))
-
- (pass-if "empty string - charset - start index"
- (not (string-index "" char-set:letter 0)))
-
- (pass-if "non-empty - charset - match - start index"
- (= 1 (string-index "foo bar" char-set:letter 1)))
-
- (pass-if "non-empty - charset - no match - start index"
- (not (string-index "frobnicate" char-set:digit 2)))
-
- (pass-if "empty string - charset - start and end index"
- (not (string-index "" char-set:letter 0 0)))
-
- (pass-if "non-empty - charset - match - start and end index"
- (= 1 (string-index "foo bar" char-set:letter 1 6)))
-
- (pass-if "non-empty - charset - no match - start and end index"
- (not (string-index "frobnicate" char-set:digit 2 5)))
-
- (pass-if "empty string - pred"
- (not (string-index "" char-alphabetic?)))
-
- (pass-if "non-empty - pred - match"
- (= 0 (string-index "foo bar" char-alphabetic?)))
-
- (pass-if "non-empty - pred - no match"
- (not (string-index "frobnicate" char-numeric?)))
-
- (pass-if "empty string - pred - start index"
- (not (string-index "" char-alphabetic? 0)))
-
- (pass-if "non-empty - pred - match - start index"
- (= 1 (string-index "foo bar" char-alphabetic? 1)))
-
- (pass-if "non-empty - pred - no match - start index"
- (not (string-index "frobnicate" char-numeric? 2)))
-
- (pass-if "empty string - pred - start and end index"
- (not (string-index "" char-alphabetic? 0 0)))
-
- (pass-if "non-empty - pred - match - start and end index"
- (= 1 (string-index "foo bar" char-alphabetic? 1 6)))
-
- (pass-if "non-empty - pred - no match - start and end index"
- (not (string-index "frobnicate" char-numeric? 2 5))))
-
-(with-test-prefix "string-index-right"
-
- (pass-if "empty string - char"
- (not (string-index-right "" #\a)))
-
- (pass-if "non-empty - char - match"
- (= 5 (string-index-right "foo bar" #\a)))
-
- (pass-if "non-empty - char - no match"
- (not (string-index-right "frobnicate" #\x)))
-
- (pass-if "empty string - char - start index-right"
- (not (string-index-right "" #\a 0)))
-
- (pass-if "non-empty - char - match - start index"
- (= 5 (string-index-right "foo bar" #\a 1)))
-
- (pass-if "non-empty - char - no match - start index"
- (not (string-index-right "frobnicate" #\x 2)))
-
- (pass-if "empty string - char - start and end index"
- (not (string-index-right "" #\a 0 0)))
-
- (pass-if "non-empty - char - match - start and end index"
- (= 5 (string-index-right "foo bar" #\a 1 6)))
-
- (pass-if "non-empty - char - no match - start and end index"
- (not (string-index-right "frobnicate" #\a 2 5)))
-
- (pass-if "empty string - charset"
- (not (string-index-right "" char-set:letter)))
-
- (pass-if "non-empty - charset - match"
- (= 6 (string-index-right "foo bar" char-set:letter)))
-
- (pass-if "non-empty - charset - no match"
- (not (string-index-right "frobnicate" char-set:digit)))
-
- (pass-if "empty string - charset - start index"
- (not (string-index-right "" char-set:letter 0)))
-
- (pass-if "non-empty - charset - match - start index"
- (= 6 (string-index-right "foo bar" char-set:letter 1)))
-
- (pass-if "non-empty - charset - no match - start index"
- (not (string-index-right "frobnicate" char-set:digit 2)))
-
- (pass-if "empty string - charset - start and end index"
- (not (string-index-right "" char-set:letter 0 0)))
-
- (pass-if "non-empty - charset - match - start and end index"
- (= 5 (string-index-right "foo bar" char-set:letter 1 6)))
-
- (pass-if "non-empty - charset - no match - start and end index"
- (not (string-index-right "frobnicate" char-set:digit 2 5)))
-
- (pass-if "empty string - pred"
- (not (string-index-right "" char-alphabetic?)))
-
- (pass-if "non-empty - pred - match"
- (= 6 (string-index-right "foo bar" char-alphabetic?)))
-
- (pass-if "non-empty - pred - no match"
- (not (string-index-right "frobnicate" char-numeric?)))
-
- (pass-if "empty string - pred - start index"
- (not (string-index-right "" char-alphabetic? 0)))
-
- (pass-if "non-empty - pred - match - start index"
- (= 6 (string-index-right "foo bar" char-alphabetic? 1)))
-
- (pass-if "non-empty - pred - no match - start index"
- (not (string-index-right "frobnicate" char-numeric? 2)))
-
- (pass-if "empty string - pred - start and end index"
- (not (string-index-right "" char-alphabetic? 0 0)))
-
- (pass-if "non-empty - pred - match - start and end index"
- (= 5 (string-index-right "foo bar" char-alphabetic? 1 6)))
-
- (pass-if "non-empty - pred - no match - start and end index"
- (not (string-index-right "frobnicate" char-numeric? 2 5))))
-
-(with-test-prefix "string-skip"
-
- (pass-if "empty string - char"
- (not (string-skip "" #\a)))
-
- (pass-if "non-empty - char - match"
- (= 0 (string-skip "foo bar" #\a)))
-
- (pass-if "non-empty - char - no match"
- (= 0 (string-skip "frobnicate" #\x)))
-
- (pass-if "empty string - char - start index"
- (not (string-skip "" #\a 0)))
-
- (pass-if "non-empty - char - match - start index"
- (= 1 (string-skip "foo bar" #\a 1)))
-
- (pass-if "non-empty - char - no match - start index"
- (= 2 (string-skip "frobnicate" #\x 2)))
-
- (pass-if "empty string - char - start and end index"
- (not (string-skip "" #\a 0 0)))
-
- (pass-if "non-empty - char - match - start and end index"
- (= 1 (string-skip "foo bar" #\a 1 6)))
-
- (pass-if "non-empty - char - no match - start and end index"
- (= 2 (string-skip "frobnicate" #\a 2 5)))
-
- (pass-if "empty string - charset"
- (not (string-skip "" char-set:letter)))
-
- (pass-if "non-empty - charset - match"
- (= 3 (string-skip "foo bar" char-set:letter)))
-
- (pass-if "non-empty - charset - no match"
- (= 0 (string-skip "frobnicate" char-set:digit)))
-
- (pass-if "empty string - charset - start index"
- (not (string-skip "" char-set:letter 0)))
-
- (pass-if "non-empty - charset - match - start index"
- (= 3 (string-skip "foo bar" char-set:letter 1)))
-
- (pass-if "non-empty - charset - no match - start index"
- (= 2 (string-skip "frobnicate" char-set:digit 2)))
-
- (pass-if "empty string - charset - start and end index"
- (not (string-skip "" char-set:letter 0 0)))
-
- (pass-if "non-empty - charset - match - start and end index"
- (= 3 (string-skip "foo bar" char-set:letter 1 6)))
-
- (pass-if "non-empty - charset - no match - start and end index"
- (= 2 (string-skip "frobnicate" char-set:digit 2 5)))
-
- (pass-if "empty string - pred"
- (not (string-skip "" char-alphabetic?)))
-
- (pass-if "non-empty - pred - match"
- (= 3 (string-skip "foo bar" char-alphabetic?)))
-
- (pass-if "non-empty - pred - no match"
- (= 0 (string-skip "frobnicate" char-numeric?)))
-
- (pass-if "empty string - pred - start index"
- (not (string-skip "" char-alphabetic? 0)))
-
- (pass-if "non-empty - pred - match - start index"
- (= 3 (string-skip "foo bar" char-alphabetic? 1)))
-
- (pass-if "non-empty - pred - no match - start index"
- (= 2 (string-skip "frobnicate" char-numeric? 2)))
-
- (pass-if "empty string - pred - start and end index"
- (not (string-skip "" char-alphabetic? 0 0)))
-
- (pass-if "non-empty - pred - match - start and end index"
- (= 3 (string-skip "foo bar" char-alphabetic? 1 6)))
-
- (pass-if "non-empty - pred - no match - start and end index"
- (= 2 (string-skip "frobnicate" char-numeric? 2 5))))
-
-(with-test-prefix "string-skip-right"
-
- (pass-if "empty string - char"
- (not (string-skip-right "" #\a)))
-
- (pass-if "non-empty - char - match"
- (= 6 (string-skip-right "foo bar" #\a)))
-
- (pass-if "non-empty - char - no match"
- (= 9 (string-skip-right "frobnicate" #\x)))
-
- (pass-if "empty string - char - start index-right"
- (not (string-skip-right "" #\a 0)))
-
- (pass-if "non-empty - char - match - start index"
- (= 6 (string-skip-right "foo bar" #\a 1)))
-
- (pass-if "non-empty - char - no match - start index"
- (= 9 (string-skip-right "frobnicate" #\x 2)))
-
- (pass-if "empty string - char - start and end index"
- (not (string-skip-right "" #\a 0 0)))
-
- (pass-if "non-empty - char - match - start and end index"
- (= 4 (string-skip-right "foo bar" #\a 1 6)))
-
- (pass-if "non-empty - char - no match - start and end index"
- (= 4 (string-skip-right "frobnicate" #\a 2 5)))
-
- (pass-if "empty string - charset"
- (not (string-skip-right "" char-set:letter)))
-
- (pass-if "non-empty - charset - match"
- (= 3 (string-skip-right "foo bar" char-set:letter)))
-
- (pass-if "non-empty - charset - no match"
- (= 9 (string-skip-right "frobnicate" char-set:digit)))
-
- (pass-if "empty string - charset - start index"
- (not (string-skip-right "" char-set:letter 0)))
-
- (pass-if "non-empty - charset - match - start index"
- (= 3 (string-skip-right "foo bar" char-set:letter 1)))
-
- (pass-if "non-empty - charset - no match - start index"
- (= 9 (string-skip-right "frobnicate" char-set:digit 2)))
-
- (pass-if "empty string - charset - start and end index"
- (not (string-skip-right "" char-set:letter 0 0)))
-
- (pass-if "non-empty - charset - match - start and end index"
- (= 3 (string-skip-right "foo bar" char-set:letter 1 6)))
-
- (pass-if "non-empty - charset - no match - start and end index"
- (= 4 (string-skip-right "frobnicate" char-set:digit 2 5)))
-
- (pass-if "empty string - pred"
- (not (string-skip-right "" char-alphabetic?)))
-
- (pass-if "non-empty - pred - match"
- (= 3 (string-skip-right "foo bar" char-alphabetic?)))
-
- (pass-if "non-empty - pred - no match"
- (= 9 (string-skip-right "frobnicate" char-numeric?)))
-
- (pass-if "empty string - pred - start index"
- (not (string-skip-right "" char-alphabetic? 0)))
-
- (pass-if "non-empty - pred - match - start index"
- (= 3 (string-skip-right "foo bar" char-alphabetic? 1)))
-
- (pass-if "non-empty - pred - no match - start index"
- (= 9 (string-skip-right "frobnicate" char-numeric? 2)))
-
- (pass-if "empty string - pred - start and end index"
- (not (string-skip-right "" char-alphabetic? 0 0)))
-
- (pass-if "non-empty - pred - match - start and end index"
- (= 3 (string-skip-right "foo bar" char-alphabetic? 1 6)))
-
- (pass-if "non-empty - pred - no match - start and end index"
- (= 4 (string-skip-right "frobnicate" char-numeric? 2 5))))
-
-(with-test-prefix "string-replace"
-
- (pass-if "empty string(s), no indices"
- (string=? "" (string-replace "" "")))
-
- (pass-if "empty string(s), 1 index"
- (string=? "" (string-replace "" "" 0)))
-
- (pass-if "empty string(s), 2 indices"
- (string=? "" (string-replace "" "" 0 0)))
-
- (pass-if "empty string(s), 3 indices"
- (string=? "" (string-replace "" "" 0 0 0)))
-
- (pass-if "empty string(s), 4 indices"
- (string=? "" (string-replace "" "" 0 0 0 0)))
-
- (pass-if "no indices"
- (string=? "uu" (string-replace "foo bar" "uu")))
-
- (pass-if "one index"
- (string=? "fuu" (string-replace "foo bar" "uu" 1)))
-
- (pass-if "two indices"
- (string=? "fuuar" (string-replace "foo bar" "uu" 1 5)))
-
- (pass-if "three indices"
- (string=? "fuar" (string-replace "foo bar" "uu" 1 5 1)))
-
- (pass-if "four indices"
- (string=? "fuar" (string-replace "foo bar" "uu" 1 5 1 2))))
-
-(with-test-prefix "string-tokenize"
-
- (pass-if "empty string, no char/pred"
- (zero? (length (string-tokenize ""))))
-
- (pass-if "empty string, charset"
- (zero? (length (string-tokenize "" char-set:punctuation))))
-
- (pass-if "no char/pred"
- (equal? '("foo" "bar" "!a") (string-tokenize "foo\tbar !a")))
-
- (pass-if "charset"
- (equal? '("foo" "bar" "!a") (string-tokenize "foo\tbar !a"
- char-set:graphic)))
-
- (pass-if "charset, start index"
- (equal? '("oo" "bar" "!a") (string-tokenize "foo\tbar !a"
- char-set:graphic 1)))
-
- (pass-if "charset, start and end index"
- (equal? '("oo" "bar" "!") (string-tokenize "foo\tbar !a"
- char-set:graphic 1 9))))
-
-(with-test-prefix "string-filter"
-
- (pass-if "empty string, char"
- (string=? "" (string-filter "" #\.)))
-
- (pass-if "empty string, charset"
- (string=? "" (string-filter "" char-set:punctuation)))
-
- (pass-if "empty string, pred"
- (string=? "" (string-filter "" char-alphabetic?)))
-
- (pass-if "char"
- (string=? "..." (string-filter ".foo.bar." #\.)))
-
- (pass-if "charset"
- (string=? "..." (string-filter ".foo.bar." char-set:punctuation)))
-
- (pass-if "pred"
- (string=? "foobar" (string-filter ".foo.bar." char-alphabetic?)))
-
- (pass-if "char, start index"
- (string=? ".." (string-filter ".foo.bar." #\. 2)))
-
- (pass-if "charset, start index"
- (string=? ".." (string-filter ".foo.bar." char-set:punctuation 2)))
-
- (pass-if "pred, start index"
- (string=? "oobar" (string-filter ".foo.bar." char-alphabetic? 2)))
-
- (pass-if "char, start and end index"
- (string=? "" (string-filter ".foo.bar." #\. 2 4)))
-
- (pass-if "charset, start and end index"
- (string=? "" (string-filter ".foo.bar." char-set:punctuation 2 4)))
-
- (pass-if "pred, start and end index"
- (string=? "oo" (string-filter ".foo.bar." char-alphabetic? 2 4))))
-
-(with-test-prefix "string-delete"
-
- (pass-if "empty string, char"
- (string=? "" (string-delete "" #\.)))
-
- (pass-if "empty string, charset"
- (string=? "" (string-delete "" char-set:punctuation)))
-
- (pass-if "empty string, pred"
- (string=? "" (string-delete "" char-alphabetic?)))
-
- (pass-if "char"
- (string=? "foobar" (string-delete ".foo.bar." #\.)))
-
- (pass-if "charset"
- (string=? "foobar" (string-delete ".foo.bar." char-set:punctuation)))
-
- (pass-if "pred"
- (string=? "..." (string-delete ".foo.bar." char-alphabetic?)))
-
- (pass-if "char, start index"
- (string=? "oobar" (string-delete ".foo.bar." #\. 2)))
-
- (pass-if "charset, start index"
- (string=? "oobar" (string-delete ".foo.bar." char-set:punctuation 2)))
-
- (pass-if "pred, start index"
- (string=? ".." (string-delete ".foo.bar." char-alphabetic? 2)))
-
- (pass-if "char, start and end index"
- (string=? "oo" (string-delete ".foo.bar." #\. 2 4)))
-
- (pass-if "charset, start and end index"
- (string=? "oo" (string-delete ".foo.bar." char-set:punctuation 2 4)))
-
- (pass-if "pred, start and end index"
- (string=? "" (string-delete ".foo.bar." char-alphabetic? 2 4))))
-
-(with-test-prefix "string-map"
-
- (pass-if "constant"
- (string=? "xxx" (string-map (lambda (c) #\x) "foo")))
-
- (pass-if "identity"
- (string=? "foo" (string-map identity "foo")))
-
- (pass-if "upcase"
- (string=? "FOO" (string-map char-upcase "foo"))))
-
-(with-test-prefix "string-for-each"
-
- (pass-if "copy"
- (let* ((foo "foo")
- (bar (make-string (string-length foo)))
- (i 0))
- (string-for-each
- (lambda (c) (string-set! bar i c) (set! i (1+ i))) foo)
- (string=? foo bar)))
-
- (pass-if "index"
- (let* ((foo "foo")
- (bar (make-string (string-length foo))))
- (string-for-each-index
- (lambda (i) (string-set! bar i (string-ref foo i))) foo)
- (string=? foo bar))))
-
diff --git a/test-suite/tests/srfi-14.test b/test-suite/tests/srfi-14.test
deleted file mode 100644
index bd927c0bb..000000000
--- a/test-suite/tests/srfi-14.test
+++ /dev/null
@@ -1,188 +0,0 @@
-;;;; srfi-14.test --- Test suite for Guile's SRFI-14 functions. -*- scheme -*-
-;;;; Martin Grabmueller, 2001-07-16
-;;;;
-;;;; Copyright (C) 2001 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-(use-modules (srfi srfi-14))
-
-(define exception:invalid-char-set-cursor
- (cons 'misc-error "^invalid character set cursor"))
-
-(define exception:non-char-return
- (cons 'misc-error "returned non-char"))
-
-(with-test-prefix "char-set?"
-
- (pass-if "success on empty set"
- (char-set? (char-set)))
-
- (pass-if "success on non-empty set"
- (char-set? char-set:printing))
-
- (pass-if "failure on empty set"
- (not (char-set? #t))))
-
-
-(with-test-prefix "char-set="
- (pass-if "success, no arg"
- (char-set=))
-
- (pass-if "success, one arg"
- (char-set= char-set:lower-case))
-
- (pass-if "success, two args"
- (char-set= char-set:upper-case char-set:upper-case))
-
- (pass-if "failure, first empty"
- (not (char-set= (char-set) (char-set #\a))))
-
- (pass-if "failure, second empty"
- (not (char-set= (char-set #\a) (char-set))))
-
- (pass-if "success, more args"
- (char-set= char-set:blank char-set:blank char-set:blank)))
-
-(with-test-prefix "char-set<="
- (pass-if "success, no arg"
- (char-set<=))
-
- (pass-if "success, one arg"
- (char-set<= char-set:lower-case))
-
- (pass-if "success, two args"
- (char-set<= char-set:upper-case char-set:upper-case))
-
- (pass-if "success, first empty"
- (char-set<= (char-set) (char-set #\a)))
-
- (pass-if "failure, second empty"
- (not (char-set<= (char-set #\a) (char-set))))
-
- (pass-if "success, more args, equal"
- (char-set<= char-set:blank char-set:blank char-set:blank))
-
- (pass-if "success, more args, not equal"
- (char-set<= char-set:blank
- (char-set-adjoin char-set:blank #\F)
- (char-set-adjoin char-set:blank #\F #\o))))
-
-(with-test-prefix "char-set-hash"
- (pass-if "empty set, bound"
- (let ((h (char-set-hash char-set:empty 31)))
- (and h (number? h) (exact? h) (>= h 0) (< h 31))))
-
- (pass-if "empty set, no bound"
- (let ((h (char-set-hash char-set:empty)))
- (and h (number? h) (exact? h) (>= h 0))))
-
- (pass-if "full set, bound"
- (let ((h (char-set-hash char-set:full 31)))
- (and h (number? h) (exact? h) (>= h 0) (< h 31))))
-
- (pass-if "full set, no bound"
- (let ((h (char-set-hash char-set:full)))
- (and h (number? h) (exact? h) (>= h 0))))
-
- (pass-if "other set, bound"
- (let ((h (char-set-hash (char-set #\f #\o #\b #\a #\r) 31)))
- (and h (number? h) (exact? h) (>= h 0) (< h 31))))
-
- (pass-if "other set, no bound"
- (let ((h (char-set-hash (char-set #\f #\o #\b #\a #\r))))
- (and h (number? h) (exact? h) (>= h 0)))))
-
-
-(with-test-prefix "char-set cursor"
-
- (pass-if-exception "invalid character cursor"
- exception:invalid-char-set-cursor
- (let* ((cs (char-set #\B #\r #\a #\z))
- (cc (char-set-cursor cs)))
- (char-set-ref cs 1000)))
-
- (pass-if "success"
- (let* ((cs (char-set #\B #\r #\a #\z))
- (cc (char-set-cursor cs)))
- (char? (char-set-ref cs cc))))
-
- (pass-if "end of set fails"
- (let* ((cs (char-set #\a))
- (cc (char-set-cursor cs)))
- (not (end-of-char-set? cc))))
-
- (pass-if "end of set succeeds, empty set"
- (let* ((cs (char-set))
- (cc (char-set-cursor cs)))
- (end-of-char-set? cc)))
-
- (pass-if "end of set succeeds, non-empty set"
- (let* ((cs (char-set #\a))
- (cc (char-set-cursor cs))
- (cc (char-set-cursor-next cs cc)))
- (end-of-char-set? cc))))
-
-(with-test-prefix "char-set-fold"
-
- (pass-if "count members"
- (= (char-set-fold (lambda (c n) (+ n 1)) 0 (char-set #\a #\b)) 2))
-
- (pass-if "copy set"
- (= (char-set-size (char-set-fold (lambda (c cs) (char-set-adjoin cs c))
- (char-set) (char-set #\a #\b))) 2)))
-
-(with-test-prefix "char-set-unfold"
-
- (pass-if "create char set"
- (char-set= char-set:full
- (char-set-unfold (lambda (s) (= s 256)) integer->char
- (lambda (s) (+ s 1)) 0)))
- (pass-if "create char set (base set)"
- (char-set= char-set:full
- (char-set-unfold (lambda (s) (= s 256)) integer->char
- (lambda (s) (+ s 1)) 0 char-set:empty))))
-
-(with-test-prefix "char-set-unfold!"
-
- (pass-if "create char set"
- (char-set= char-set:full
- (char-set-unfold! (lambda (s) (= s 256)) integer->char
- (lambda (s) (+ s 1)) 0
- (char-set-copy char-set:empty))))
-
- (pass-if "create char set"
- (char-set= char-set:full
- (char-set-unfold! (lambda (s) (= s 32)) integer->char
- (lambda (s) (+ s 1)) 0
- (char-set-copy char-set:full)))))
-
-
-(with-test-prefix "char-set-for-each"
-
- (pass-if "copy char set"
- (= (char-set-size (let ((cs (char-set)))
- (char-set-for-each
- (lambda (c) (char-set-adjoin! cs c))
- (char-set #\a #\b))
- cs))
- 2)))
-
-(with-test-prefix "char-set-map"
-
- (pass-if "upper case char set"
- (char-set= (char-set-map char-upcase char-set:lower-case)
- char-set:upper-case)))
diff --git a/test-suite/tests/srfi-17.test b/test-suite/tests/srfi-17.test
deleted file mode 100644
index dc6fd7e06..000000000
--- a/test-suite/tests/srfi-17.test
+++ /dev/null
@@ -1,32 +0,0 @@
-;;;; srfi-17.test --- test suite for Guile's SRFI-17 functions. -*- scheme -*-
-;;;;
-;;;; Copyright (C) 2001 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-(use-modules (srfi srfi-17))
-
-(with-test-prefix "set!"
-
- (with-test-prefix "target is not procedure with setter"
-
- (pass-if-exception "(set! (symbol->string 'x) 1)"
- exception:wrong-type-arg
- (set! (symbol->string 'x) 1))
-
- (pass-if-exception "(set! '#f 1)"
- exception:wrong-type-arg
- (set! '#f 1))))
diff --git a/test-suite/tests/srfi-19.test b/test-suite/tests/srfi-19.test
deleted file mode 100644
index 75eb25637..000000000
--- a/test-suite/tests/srfi-19.test
+++ /dev/null
@@ -1,157 +0,0 @@
-;;;; srfi-19.test --- test suite for SRFI-19 -*- scheme -*-
-;;;; Matthias Koeppe <mkoeppe@mail.math.uni-magdeburg.de> --- June 2001
-;;;;
-;;;; Copyright (C) 2001 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-;; SRFI-19 overrides current-date, so we have to do the test in a
-;; separate module, or later tests will fail.
-
-(define-module (test-suite test-srfi-19)
- :use-module (test-suite lib)
- :use-module (srfi srfi-19)
- :use-module (ice-9 format))
-
-(define (with-tz* tz thunk)
- "Temporarily set the TZ environment variable to the passed string
-value and call THUNK."
- (let ((old-tz #f))
- (dynamic-wind
- (lambda ()
- (set! old-tz (getenv "TZ"))
- (putenv (format "TZ=~A" tz)))
- thunk
- (lambda ()
- (if old-tz
- (putenv (format "TZ=~A" old-tz))
- (putenv "TZ"))))))
-
-(defmacro with-tz (tz . body)
- `(with-tz* ,tz (lambda () ,@body)))
-
-(define (test-integral-time-structure date->time)
- "Test whether the given DATE->TIME procedure creates a time
-structure with integral seconds. (The seconds shall be maintained as
-integers, or precision may go away silently. The SRFI-19 reference
-implementation was not OK for Guile in this respect because of Guile's
-incomplete numerical tower implementation.)"
- (pass-if (format "~A makes integer seconds"
- date->time)
- (exact? (time-second
- (date->time (make-date 0 0 0 12 1 6 2001 0))))))
-
-(define (test-time->date time->date date->time)
- (pass-if (format "~A works"
- time->date)
- (begin
- (time->date (date->time (make-date 0 0 0 12 1 6 2001 0)))
- #t)))
-
-(define (test-dst time->date date->time)
- (pass-if (format "~A respects local DST if no TZ-OFFSET given"
- time->date)
- (let ((time (date->time (make-date 0 0 0 12 1 6 2001 0))))
- ;; on 2001-06-01, there should be two hours zone offset
- ;; between CET (CEST) and GMT
- (= (date-zone-offset
- (with-tz "CET"
- (time->date time)))
- 7200))))
-
-(define-macro (test-time-conversion a b)
- (let* ((a->b-sym (symbol-append a '-> b))
- (b->a-sym (symbol-append b '-> a)))
- `(pass-if (format "~A and ~A work and are inverses of each other"
- ',a->b-sym ',b->a-sym)
- (let ((time (make-time ,a 12345 67890123)))
- (time=? time (,b->a-sym (,a->b-sym time)))))))
-
-(define (test-time-comparison cmp a b)
- (pass-if (format #f "~A works" cmp)
- (cmp a b)))
-
-(define (test-time-arithmetic op a b res)
- (pass-if (format #f "~A works" op)
- (time=? (op a b) res)))
-
-(with-test-prefix "SRFI date/time library"
- ;; check for typos and silly errors
- (pass-if "date-zone-offset is defined"
- (and (defined? 'date-zone-offset)
- date-zone-offset
- #t))
- (pass-if "add-duration is defined"
- (and (defined? 'add-duration)
- add-duration
- #t))
- (pass-if "(current-time time-tai) works"
- (begin (current-time time-tai) #t))
- (test-time-conversion time-utc time-tai)
- (test-time-conversion time-utc time-monotonic)
- (test-time-conversion time-tai time-monotonic)
- (pass-if "string->date works"
- (begin (string->date "2001-06-01@14:00" "~Y-~m-~d@~H:~M")
- #t))
- ;; check for code paths where reals were passed to quotient, which
- ;; doesn't work in Guile (and is unspecified in R5RS)
- (test-time->date time-utc->date date->time-utc)
- (test-time->date time-tai->date date->time-tai)
- (test-time->date time-monotonic->date date->time-monotonic)
- (pass-if "Fractional nanoseconds are handled"
- (begin (make-time time-duration 1000000000.5 0) #t))
- ;; the seconds in a time shall be maintained as integers, or
- ;; precision may silently go away
- (test-integral-time-structure date->time-utc)
- (test-integral-time-structure date->time-tai)
- (test-integral-time-structure date->time-monotonic)
- ;; check for DST and zone related problems
- (pass-if "date->time-utc is the inverse of time-utc->date"
- (let ((time (date->time-utc
- (make-date 0 0 0 14 1 6 2001 7200))))
- (time=? time
- (date->time-utc (time-utc->date time 7200)))))
- (test-dst time-utc->date date->time-utc)
- (test-dst time-tai->date date->time-tai)
- (test-dst time-monotonic->date date->time-monotonic)
- (test-dst julian-day->date date->julian-day)
- (test-dst modified-julian-day->date date->modified-julian-day)
- (pass-if "string->date respects local DST if no time zone is read"
- (time=? (date->time-utc
- (with-tz "CET"
- (string->date "2001-06-01@14:00" "~Y-~m-~d@~H:~M")))
- (date->time-utc
- (make-date 0 0 0 12 1 6 2001 0))))
- ;; check time comparison procedures
- (let* ((time1 (make-time time-monotonic 0 0))
- (time2 (make-time time-monotonic 0 0))
- (time3 (make-time time-monotonic 385907 998360432))
- (time4 (make-time time-monotonic 385907 998360432)))
- (test-time-comparison time<=? time1 time3)
- (test-time-comparison time<? time1 time3)
- (test-time-comparison time=? time1 time2)
- (test-time-comparison time>=? time3 time3)
- (test-time-comparison time>? time3 time2))
- ;; check time arithmetic procedures
- (let* ((time1 (make-time time-monotonic 0 0))
- (time2 (make-time time-monotonic 385907 998360432))
- (diff (time-difference time2 time1)))
- (test-time-arithmetic add-duration time1 diff time2)
- (test-time-arithmetic subtract-duration time2 diff time1)))
-
-;; Local Variables:
-;; eval: (put 'with-tz 'scheme-indent-function 1)
-;; End:
diff --git a/test-suite/tests/srfi-4.test b/test-suite/tests/srfi-4.test
deleted file mode 100644
index ac6ce3792..000000000
--- a/test-suite/tests/srfi-4.test
+++ /dev/null
@@ -1,312 +0,0 @@
-;;;; srfi-4.test --- Test suite for Guile's SRFI-4 functions. -*- scheme -*-
-;;;; Martin Grabmueller, 2001-06-26
-;;;;
-;;;; Copyright (C) 2001 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-(use-modules (srfi srfi-4))
-
-(with-test-prefix "u8 vectors"
-
- (pass-if "u8vector? success"
- (u8vector? (u8vector)))
-
- (pass-if "u8vector? failure"
- (not (u8vector? (s8vector))))
-
- (pass-if "u8vector-length success 1"
- (= (u8vector-length (u8vector)) 0))
-
- (pass-if "u8vector-length success 2"
- (= (u8vector-length (u8vector 3)) 1))
-
- (pass-if "u8vector-length failure"
- (not (= (u8vector-length (u8vector 3)) 3)))
-
- (pass-if "u8vector-ref"
- (= (u8vector-ref (u8vector 1 2 3) 1) 2))
-
- (pass-if "u8vector-set!/ref"
- (= (let ((s (make-u8vector 10 0)))
- (u8vector-set! s 4 33)
- (u8vector-ref s 4)) 33))
-
- (pass-if "u8vector->list/list->u8vector"
- (equal? (u8vector->list (u8vector 1 2 3 4))
- (u8vector->list (list->u8vector '(1 2 3 4))))))
-
-(with-test-prefix "s8 vectors"
-
- (pass-if "s8vector? success"
- (s8vector? (s8vector)))
-
- (pass-if "s8vector? failure"
- (not (s8vector? (u8vector))))
-
- (pass-if "s8vector-length success 1"
- (= (s8vector-length (s8vector)) 0))
-
- (pass-if "s8vector-length success 2"
- (= (s8vector-length (s8vector -3)) 1))
-
- (pass-if "s8vector-length failure"
- (not (= (s8vector-length (s8vector 3)) 3)))
-
- (pass-if "s8vector-ref"
- (= (s8vector-ref (s8vector 1 2 3) 1) 2))
-
- (pass-if "s8vector-set!/ref"
- (= (let ((s (make-s8vector 10 0)))
- (s8vector-set! s 4 33)
- (s8vector-ref s 4)) 33))
-
- (pass-if "s8vector->list/list->s8vector"
- (equal? (s8vector->list (s8vector 1 2 3 4))
- (s8vector->list (list->s8vector '(1 2 3 4))))))
-
-
-(with-test-prefix "u16 vectors"
-
- (pass-if "u16vector? success"
- (u16vector? (u16vector)))
-
- (pass-if "u16vector? failure"
- (not (u16vector? (s16vector))))
-
- (pass-if "u16vector-length success 1"
- (= (u16vector-length (u16vector)) 0))
-
- (pass-if "u16vector-length success 2"
- (= (u16vector-length (u16vector 3)) 1))
-
- (pass-if "u16vector-length failure"
- (not (= (u16vector-length (u16vector 3)) 3)))
-
- (pass-if "u16vector-ref"
- (= (u16vector-ref (u16vector 1 2 3) 1) 2))
-
- (pass-if "u16vector-set!/ref"
- (= (let ((s (make-u16vector 10 0)))
- (u16vector-set! s 4 33)
- (u16vector-ref s 4)) 33))
-
- (pass-if "u16vector->list/list->u16vector"
- (equal? (u16vector->list (u16vector 1 2 3 4))
- (u16vector->list (list->u16vector '(1 2 3 4))))))
-
-(with-test-prefix "s16 vectors"
-
- (pass-if "s16vector? success"
- (s16vector? (s16vector)))
-
- (pass-if "s16vector? failure"
- (not (s16vector? (u16vector))))
-
- (pass-if "s16vector-length success 1"
- (= (s16vector-length (s16vector)) 0))
-
- (pass-if "s16vector-length success 2"
- (= (s16vector-length (s16vector -3)) 1))
-
- (pass-if "s16vector-length failure"
- (not (= (s16vector-length (s16vector 3)) 3)))
-
- (pass-if "s16vector-ref"
- (= (s16vector-ref (s16vector 1 2 3) 1) 2))
-
- (pass-if "s16vector-set!/ref"
- (= (let ((s (make-s16vector 10 0)))
- (s16vector-set! s 4 33)
- (s16vector-ref s 4)) 33))
-
- (pass-if "s16vector->list/list->s16vector"
- (equal? (s16vector->list (s16vector 1 2 3 4))
- (s16vector->list (list->s16vector '(1 2 3 4))))))
-
-(with-test-prefix "u32 vectors"
-
- (pass-if "u32vector? success"
- (u32vector? (u32vector)))
-
- (pass-if "u32vector? failure"
- (not (u32vector? (s32vector))))
-
- (pass-if "u32vector-length success 1"
- (= (u32vector-length (u32vector)) 0))
-
- (pass-if "u32vector-length success 2"
- (= (u32vector-length (u32vector 3)) 1))
-
- (pass-if "u32vector-length failure"
- (not (= (u32vector-length (u32vector 3)) 3)))
-
- (pass-if "u32vector-ref"
- (= (u32vector-ref (u32vector 1 2 3) 1) 2))
-
- (pass-if "u32vector-set!/ref"
- (= (let ((s (make-u32vector 10 0)))
- (u32vector-set! s 4 33)
- (u32vector-ref s 4)) 33))
-
- (pass-if "u32vector->list/list->u32vector"
- (equal? (u32vector->list (u32vector 1 2 3 4))
- (u32vector->list (list->u32vector '(1 2 3 4))))))
-
-(with-test-prefix "s32 vectors"
-
- (pass-if "s32vector? success"
- (s32vector? (s32vector)))
-
- (pass-if "s32vector? failure"
- (not (s32vector? (u32vector))))
-
- (pass-if "s32vector-length success 1"
- (= (s32vector-length (s32vector)) 0))
-
- (pass-if "s32vector-length success 2"
- (= (s32vector-length (s32vector -3)) 1))
-
- (pass-if "s32vector-length failure"
- (not (= (s32vector-length (s32vector 3)) 3)))
-
- (pass-if "s32vector-ref"
- (= (s32vector-ref (s32vector 1 2 3) 1) 2))
-
- (pass-if "s32vector-set!/ref"
- (= (let ((s (make-s32vector 10 0)))
- (s32vector-set! s 4 33)
- (s32vector-ref s 4)) 33))
-
- (pass-if "s32vector->list/list->s32vector"
- (equal? (s32vector->list (s32vector 1 2 3 4))
- (s32vector->list (list->s32vector '(1 2 3 4))))))
-
-(with-test-prefix "u64 vectors"
-
- (pass-if "u64vector? success"
- (u64vector? (u64vector)))
-
- (pass-if "u64vector? failure"
- (not (u64vector? (s64vector))))
-
- (pass-if "u64vector-length success 1"
- (= (u64vector-length (u64vector)) 0))
-
- (pass-if "u64vector-length success 2"
- (= (u64vector-length (u64vector 3)) 1))
-
- (pass-if "u64vector-length failure"
- (not (= (u64vector-length (u64vector 3)) 3)))
-
- (pass-if "u64vector-ref"
- (= (u64vector-ref (u64vector 1 2 3) 1) 2))
-
- (pass-if "u64vector-set!/ref"
- (= (let ((s (make-u64vector 10 0)))
- (u64vector-set! s 4 33)
- (u64vector-ref s 4)) 33))
-
- (pass-if "u64vector->list/list->u64vector"
- (equal? (u64vector->list (u64vector 1 2 3 4))
- (u64vector->list (list->u64vector '(1 2 3 4))))))
-
-(with-test-prefix "s64 vectors"
-
- (pass-if "s64vector? success"
- (s64vector? (s64vector)))
-
- (pass-if "s64vector? failure"
- (not (s64vector? (u64vector))))
-
- (pass-if "s64vector-length success 1"
- (= (s64vector-length (s64vector)) 0))
-
- (pass-if "s64vector-length success 2"
- (= (s64vector-length (s64vector -3)) 1))
-
- (pass-if "s64vector-length failure"
- (not (= (s64vector-length (s64vector 3)) 3)))
-
- (pass-if "s64vector-ref"
- (= (s64vector-ref (s64vector 1 2 3) 1) 2))
-
- (pass-if "s64vector-set!/ref"
- (= (let ((s (make-s64vector 10 0)))
- (s64vector-set! s 4 33)
- (s64vector-ref s 4)) 33))
-
- (pass-if "s64vector->list/list->s64vector"
- (equal? (s64vector->list (s64vector 1 2 3 4))
- (s64vector->list (list->s64vector '(1 2 3 4))))))
-
-(with-test-prefix "f32 vectors"
-
- (pass-if "f32vector? success"
- (f32vector? (f32vector)))
-
- (pass-if "f32vector? failure"
- (not (f32vector? (s8vector))))
-
- (pass-if "f32vector-length success 1"
- (= (f32vector-length (f32vector)) 0))
-
- (pass-if "f32vector-length success 2"
- (= (f32vector-length (f32vector -3)) 1))
-
- (pass-if "f32vector-length failure"
- (not (= (f32vector-length (f32vector 3)) 3)))
-
- (pass-if "f32vector-ref"
- (= (f32vector-ref (f32vector 1 2 3) 1) 2))
-
- (pass-if "f32vector-set!/ref"
- (= (let ((s (make-f32vector 10 0)))
- (f32vector-set! s 4 33)
- (f32vector-ref s 4)) 33))
-
- (pass-if "f32vector->list/list->f32vector"
- (equal? (f32vector->list (f32vector 1 2 3 4))
- (f32vector->list (list->f32vector '(1 2 3 4))))))
-
-(with-test-prefix "f64 vectors"
-
- (pass-if "f64vector? success"
- (f64vector? (f64vector)))
-
- (pass-if "f64vector? failure"
- (not (f64vector? (f32vector))))
-
- (pass-if "f64vector-length success 1"
- (= (f64vector-length (f64vector)) 0))
-
- (pass-if "f64vector-length success 2"
- (= (f64vector-length (f64vector -3)) 1))
-
- (pass-if "f64vector-length failure"
- (not (= (f64vector-length (f64vector 3)) 3)))
-
- (pass-if "f64vector-ref"
- (= (f64vector-ref (f64vector 1 2 3) 1) 2))
-
- (pass-if "f64vector-set!/ref"
- (= (let ((s (make-f64vector 10 0)))
- (f64vector-set! s 4 33)
- (f64vector-ref s 4)) 33))
-
- (pass-if "f64vector->list/list->f64vector"
- (equal? (f64vector->list (f64vector 1 2 3 4))
- (f64vector->list (list->f64vector '(1 2 3 4))))))
diff --git a/test-suite/tests/srfi-9.test b/test-suite/tests/srfi-9.test
deleted file mode 100644
index da33d5488..000000000
--- a/test-suite/tests/srfi-9.test
+++ /dev/null
@@ -1,42 +0,0 @@
-;;;; srfi-9.test --- Test suite for Guile's SRFI-9 functions. -*- scheme -*-
-;;;; Martin Grabmueller, 2001-05-10
-;;;;
-;;;; Copyright (C) 2001 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-(use-modules (srfi srfi-9))
-
-(define-record-type :foo (make-foo x) foo?
- (x get-x) (y get-y set-y!))
-
-(define f (make-foo 1))
-(set-y! f 2)
-
-(with-test-prefix "record procedures"
-
- (pass-if "predicate"
- (foo? f))
-
- (pass-if "accessor 1"
- (= 1 (get-x f)))
-
- (pass-if "accessor 2"
- (= 2 (get-y f)))
-
- (pass-if "modifier"
- (set-y! f #t)
- (eq? #t (get-y f))))
diff --git a/test-suite/tests/strings.test b/test-suite/tests/strings.test
deleted file mode 100644
index 432100f6f..000000000
--- a/test-suite/tests/strings.test
+++ /dev/null
@@ -1,88 +0,0 @@
-;;;; strings.test --- test suite for Guile's string functions -*- scheme -*-
-;;;; Jim Blandy <jimb@red-bean.com> --- August 1999
-;;;;
-;;;; Copyright (C) 1999, 2001 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-
-;; FIXME: As soon as guile supports immutable strings, this has to be
-;; replaced with the appropriate error type and message.
-(define exception:immutable-string
- (cons 'some-error-type "^trying to modify an immutable string"))
-
-
-(with-test-prefix "string=?"
-
- (pass-if "respects 1st parameter's string length"
- (not (string=? "foo\0" "foo")))
-
- (pass-if "respects 2nd paramter's string length"
- (not (string=? "foo" "foo\0")))
-
- (with-test-prefix "wrong argument type"
-
- (pass-if-exception "1st argument symbol"
- exception:wrong-type-arg
- (string=? 'a "a"))
-
- (pass-if-exception "2nd argument symbol"
- exception:wrong-type-arg
- (string=? "a" 'b))))
-
-(with-test-prefix "string<?"
-
- (pass-if "respects string length"
- (and (not (string<? "foo\0a" "foo\0a"))
- (string<? "foo\0a" "foo\0b")))
-
- (with-test-prefix "wrong argument type"
-
- (pass-if-exception "1st argument symbol"
- exception:wrong-type-arg
- (string<? 'a "a"))
-
- (pass-if-exception "2nd argument symbol"
- exception:wrong-type-arg
- (string<? "a" 'b))))
-
-(with-test-prefix "string-ci<?"
-
- (pass-if "respects string length"
- (and (not (string-ci<? "foo\0a" "foo\0a"))
- (string-ci<? "foo\0a" "foo\0b")))
-
- (with-test-prefix "wrong argument type"
-
- (pass-if-exception "1st argument symbol"
- exception:wrong-type-arg
- (string-ci<? 'a "a"))
-
- (pass-if-exception "2nd argument symbol"
- exception:wrong-type-arg
- (string-ci<? "a" 'b))))
-
-(with-test-prefix "string-set!"
-
- (expect-fail-exception "string constant"
- exception:immutable-string
- (string-set! "abc" 1 #\space)))
-
-(with-test-prefix "substring-move!"
-
- (pass-if-exception "substring-move! checks start and end correctly"
- exception:out-of-range
- (substring-move! "sample" 3 0 "test" 3)))
diff --git a/test-suite/tests/symbols.test b/test-suite/tests/symbols.test
deleted file mode 100644
index 7831a9514..000000000
--- a/test-suite/tests/symbols.test
+++ /dev/null
@@ -1,90 +0,0 @@
-;;;; symbols.test --- test suite for Guile's symbols -*- scheme -*-
-;;;;
-;;;; Copyright (C) 2001 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-(use-modules (ice-9 documentation))
-
-
-;;;
-;;; miscellaneous
-;;;
-
-;; FIXME: As soon as guile supports immutable strings, this has to be
-;; replaced with the appropriate error type and message.
-(define exception:immutable-string
- (cons 'some-error-type "^trying to modify an immutable string"))
-
-(define (documented? object)
- (not (not (object-documentation object))))
-
-
-;;;
-;;; symbol?
-;;;
-
-(with-test-prefix "symbol?"
-
- (pass-if "documented?"
- (documented? symbol?))
-
- (pass-if "string"
- (not (symbol? "foo")))
-
- (pass-if "symbol"
- (symbol? 'foo)))
-
-
-;;;
-;;; symbol->string
-;;;
-
-(with-test-prefix "symbol->string"
-
- (expect-fail-exception "result is an immutable string"
- exception:immutable-string
- (string-set! (symbol->string 'abc) 1 #\space)))
-
-
-;;;
-;;; gensym
-;;;
-
-(with-test-prefix "gensym"
-
- (pass-if "documented?"
- (documented? gensym))
-
- (pass-if "produces a symbol"
- (symbol? (gensym)))
-
- (pass-if "produces a fresh symbol"
- (not (eq? (gensym) (gensym))))
-
- (pass-if "accepts a string prefix"
- (symbol? (gensym "foo")))
-
- (pass-if-exception "does not accept a symbol prefix"
- exception:wrong-type-arg
- (gensym 'foo))
-
- (pass-if "accepts long prefices"
- (symbol? (gensym (make-string 4000 #\!))))
-
- (pass-if "accepts embedded NULs"
- (> (string-length (symbol->string (gensym "foo\0bar\0braz\0foo\0bar\0braz\0foo\0bar\0braz\0foo\0bar\0braz\0foo\0bar\0braz\0foo\0bar\0braz\0"))) 6)))
-
diff --git a/test-suite/tests/syncase.test b/test-suite/tests/syncase.test
deleted file mode 100644
index 88667ea06..000000000
--- a/test-suite/tests/syncase.test
+++ /dev/null
@@ -1,37 +0,0 @@
-;;;; syncase.test --- test suite for (ice-9 syncase) -*- scheme -*-
-;;;;
-;;;; Copyright (C) 2001 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-;; These tests are in a module so that the syntax transformer does not
-;; affect code outside of this file.
-;;
-(define-module (syncase-test))
-
-(use-modules (test-suite lib))
-
-(pass-if "(ice-9 syncase) loads"
- (false-if-exception
- (begin (eval '(use-syntax (ice-9 syncase)) (current-module))
- #t)))
-
-(define-syntax plus
- (syntax-rules ()
- ((plus x ...) (+ x ...))))
-
-(pass-if "basic syncase macro"
- (= (plus 1 2 3) (+ 1 2 3)))
diff --git a/test-suite/tests/syntax.test b/test-suite/tests/syntax.test
deleted file mode 100644
index 14836fbc9..000000000
--- a/test-suite/tests/syntax.test
+++ /dev/null
@@ -1,532 +0,0 @@
-;;;; syntax.test --- test suite for Guile's syntactic forms -*- scheme -*-
-;;;;
-;;;; Copyright (C) 2001 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-
-(define exception:bad-bindings
- (cons 'misc-error "^bad bindings"))
-(define exception:duplicate-bindings
- (cons 'misc-error "^duplicate bindings"))
-(define exception:bad-body
- (cons 'misc-error "^bad body"))
-(define exception:bad-formals
- (cons 'misc-error "^bad formals"))
-(define exception:duplicate-formals
- (cons 'misc-error "^duplicate formals"))
-(define exception:bad-var
- (cons 'misc-error "^bad variable"))
-(define exception:bad/missing-clauses
- (cons 'misc-error "^bad or missing clauses"))
-(define exception:missing/extra-expr
- (cons 'misc-error "^missing or extra expression"))
-
-
-(with-test-prefix "expressions"
-
- (with-test-prefix "missing or extra expression"
-
- ;; R5RS says:
- ;; *Note:* In many dialects of Lisp, the empty combination, (),
- ;; is a legitimate expression. In Scheme, combinations must
- ;; have at least one subexpression, so () is not a syntactically
- ;; valid expression.
-
- ;; Fixed on 2001-3-3
- (pass-if-exception "empty parentheses \"()\""
- exception:missing/extra-expr
- ())))
-
-(with-test-prefix "quote"
- #t)
-
-(with-test-prefix "quasiquote"
-
- (with-test-prefix "unquote"
-
- (pass-if "repeated execution"
- (let ((foo (let ((i 0)) (lambda () (set! i (+ i 1)) `(,i)))))
- (and (equal? (foo) '(1)) (equal? (foo) '(2))))))
-
- (with-test-prefix "unquote-splicing"
-
- (pass-if-exception "extra arguments"
- exception:missing/extra-expr
- (quasiquote ((unquote-splicing (list 1 2) (list 3 4)))))))
-
-(with-test-prefix "begin"
-
- (pass-if "legal (begin)"
- (begin)
- #t)
-
- (expect-fail-exception "illegal (begin)"
- exception:bad-body
- (if #t (begin))
- #t))
-
-(with-test-prefix "lambda"
-
- (with-test-prefix "bad formals"
-
- (pass-if-exception "(lambda)"
- exception:bad-formals
- (lambda))
-
- (pass-if-exception "(lambda . \"foo\")"
- exception:bad-formals
- (lambda . "foo"))
-
- (pass-if-exception "(lambda \"foo\")"
- exception:bad-formals
- (lambda "foo"))
-
- (pass-if-exception "(lambda \"foo\" #f)"
- exception:bad-formals
- (lambda "foo" #f))
-
- (pass-if-exception "(lambda (x 1) 2)"
- exception:bad-formals
- (lambda (x 1) 2))
-
- (pass-if-exception "(lambda (1 x) 2)"
- exception:bad-formals
- (lambda (1 x) 2))
-
- (pass-if-exception "(lambda (x \"a\") 2)"
- exception:bad-formals
- (lambda (x "a") 2))
-
- (pass-if-exception "(lambda (\"a\" x) 2)"
- exception:bad-formals
- (lambda ("a" x) 2)))
-
- (with-test-prefix "duplicate formals"
-
- ;; Fixed on 2001-3-3
- (pass-if-exception "(lambda (x x) 1)"
- exception:duplicate-formals
- (lambda (x x) 1))
-
- ;; Fixed on 2001-3-3
- (pass-if-exception "(lambda (x x x) 1)"
- exception:duplicate-formals
- (lambda (x x x) 1)))
-
- (with-test-prefix "bad body"
-
- (pass-if-exception "(lambda ())"
- exception:bad-body
- (lambda ()))))
-
-(with-test-prefix "let"
-
- (with-test-prefix "bindings"
-
- (pass-if-exception "late binding"
- exception:unbound-var
- (let ((x 1) (y x)) y)))
-
- (with-test-prefix "bad bindings"
-
- (pass-if-exception "(let)"
- exception:bad-bindings
- (let))
-
- (pass-if-exception "(let 1)"
- exception:bad-bindings
- (let 1))
-
- (pass-if-exception "(let (x))"
- exception:bad-bindings
- (let (x)))
-
- ;; FIXME: Wouldn't one rather expect a 'bad bindings' error?
- ;; (Even although the body is bad as well...)
- (pass-if-exception "(let ((x)))"
- exception:bad-body
- (let ((x))))
-
- (pass-if-exception "(let (x) 1)"
- exception:bad-bindings
- (let (x) 1))
-
- (pass-if-exception "(let ((x)) 3)"
- exception:bad-bindings
- (let ((x)) 3))
-
- (pass-if-exception "(let ((x 1) y) x)"
- exception:bad-bindings
- (let ((x 1) y) x))
-
- (pass-if-exception "(let ((1 2)) 3)"
- exception:bad-var
- (let ((1 2)) 3)))
-
- (with-test-prefix "duplicate bindings"
-
- (pass-if-exception "(let ((x 1) (x 2)) x)"
- exception:duplicate-bindings
- (let ((x 1) (x 2)) x)))
-
- (with-test-prefix "bad body"
-
- (pass-if-exception "(let ())"
- exception:bad-body
- (let ()))
-
- (pass-if-exception "(let ((x 1)))"
- exception:bad-body
- (let ((x 1))))))
-
-(with-test-prefix "named let"
-
- (with-test-prefix "initializers"
-
- (pass-if "evaluated in outer environment"
- (let ((f -))
- (eqv? (let f ((n (f 1))) n) -1))))
-
- (with-test-prefix "bad bindings"
-
- (pass-if-exception "(let x (y))"
- exception:bad-bindings
- (let x (y))))
-
- (with-test-prefix "bad body"
-
- (pass-if-exception "(let x ())"
- exception:bad-body
- (let x ()))
-
- (pass-if-exception "(let x ((y 1)))"
- exception:bad-body
- (let x ((y 1))))))
-
-(with-test-prefix "let*"
-
- (with-test-prefix "bindings"
-
- (pass-if "(let* ((x 1) (x 2)) ...)"
- (let* ((x 1) (x 2))
- (= x 2)))
-
- (pass-if "(let* ((x 1) (x x)) ...)"
- (let* ((x 1) (x x))
- (= x 1))))
-
- (with-test-prefix "bad bindings"
-
- (pass-if-exception "(let*)"
- exception:bad-bindings
- (let*))
-
- (pass-if-exception "(let* 1)"
- exception:bad-bindings
- (let* 1))
-
- (pass-if-exception "(let* (x))"
- exception:bad-bindings
- (let* (x)))
-
- (pass-if-exception "(let* (x) 1)"
- exception:bad-bindings
- (let* (x) 1))
-
- (pass-if-exception "(let* ((x)) 3)"
- exception:bad-bindings
- (let* ((x)) 3))
-
- (pass-if-exception "(let* ((x 1) y) x)"
- exception:bad-bindings
- (let* ((x 1) y) x))
-
- (pass-if-exception "(let* x ())"
- exception:bad-bindings
- (let* x ()))
-
- (pass-if-exception "(let* x (y))"
- exception:bad-bindings
- (let* x (y)))
-
- (pass-if-exception "(let* ((1 2)) 3)"
- exception:bad-var
- (let* ((1 2)) 3)))
-
- (with-test-prefix "bad body"
-
- (pass-if-exception "(let* ())"
- exception:bad-body
- (let* ()))
-
- (pass-if-exception "(let* ((x 1)))"
- exception:bad-body
- (let* ((x 1))))))
-
-(with-test-prefix "letrec"
-
- (with-test-prefix "bindings"
-
- (pass-if-exception "initial bindings are undefined"
- exception:unbound-var
- (let ((x 1))
- (letrec ((x 1) (y x)) y))))
-
- (with-test-prefix "bad bindings"
-
- (pass-if-exception "(letrec)"
- exception:bad-bindings
- (letrec))
-
- (pass-if-exception "(letrec 1)"
- exception:bad-bindings
- (letrec 1))
-
- (pass-if-exception "(letrec (x))"
- exception:bad-bindings
- (letrec (x)))
-
- (pass-if-exception "(letrec (x) 1)"
- exception:bad-bindings
- (letrec (x) 1))
-
- (pass-if-exception "(letrec ((x)) 3)"
- exception:bad-bindings
- (letrec ((x)) 3))
-
- (pass-if-exception "(letrec ((x 1) y) x)"
- exception:bad-bindings
- (letrec ((x 1) y) x))
-
- (pass-if-exception "(letrec x ())"
- exception:bad-bindings
- (letrec x ()))
-
- (pass-if-exception "(letrec x (y))"
- exception:bad-bindings
- (letrec x (y)))
-
- (pass-if-exception "(letrec ((1 2)) 3)"
- exception:bad-var
- (letrec ((1 2)) 3)))
-
- (with-test-prefix "duplicate bindings"
-
- (pass-if-exception "(letrec ((x 1) (x 2)) x)"
- exception:duplicate-bindings
- (letrec ((x 1) (x 2)) x)))
-
- (with-test-prefix "bad body"
-
- (pass-if-exception "(letrec ())"
- exception:bad-body
- (letrec ()))
-
- (pass-if-exception "(letrec ((x 1)))"
- exception:bad-body
- (letrec ((x 1))))))
-
-(with-test-prefix "if"
-
- (with-test-prefix "missing or extra expressions"
-
- (pass-if-exception "(if)"
- exception:missing/extra-expr
- (if))
-
- (pass-if-exception "(if 1 2 3 4)"
- exception:missing/extra-expr
- (if 1 2 3 4))))
-
-(with-test-prefix "cond"
-
- (with-test-prefix "bad or missing clauses"
-
- (pass-if-exception "(cond)"
- exception:bad/missing-clauses
- (cond))
-
- (pass-if-exception "(cond #t)"
- exception:bad/missing-clauses
- (cond #t))
-
- (pass-if-exception "(cond 1)"
- exception:bad/missing-clauses
- (cond 1))
-
- (pass-if-exception "(cond 1 2)"
- exception:bad/missing-clauses
- (cond 1 2))
-
- (pass-if-exception "(cond 1 2 3)"
- exception:bad/missing-clauses
- (cond 1 2 3))
-
- (pass-if-exception "(cond 1 2 3 4)"
- exception:bad/missing-clauses
- (cond 1 2 3 4))
-
- (pass-if-exception "(cond ())"
- exception:bad/missing-clauses
- (cond ()))
-
- (pass-if-exception "(cond () 1)"
- exception:bad/missing-clauses
- (cond () 1))
-
- (pass-if-exception "(cond (1) 1)"
- exception:bad/missing-clauses
- (cond (1) 1))))
-
-(with-test-prefix "cond =>"
-
- (with-test-prefix "else is handled correctly"
-
- (pass-if "else =>"
- (let ((=> 'foo))
- (eq? (cond (else =>)) 'foo)))
-
- (pass-if "else => identity"
- (let* ((=> 'foo))
- (eq? (cond (else => identity)) identity))))
-
- (with-test-prefix "bad formals"
-
- (pass-if-exception "=> (lambda (x 1) 2)"
- exception:bad-formals
- (cond (1 => (lambda (x 1) 2))))))
-
-(with-test-prefix "case"
-
- (with-test-prefix "bad or missing clauses"
-
- (pass-if-exception "(case)"
- exception:bad/missing-clauses
- (case))
-
- (pass-if-exception "(case . \"foo\")"
- exception:bad/missing-clauses
- (case . "foo"))
-
- (pass-if-exception "(case 1)"
- exception:bad/missing-clauses
- (case 1))
-
- (pass-if-exception "(case 1 . \"foo\")"
- exception:bad/missing-clauses
- (case 1 . "foo"))
-
- (pass-if-exception "(case 1 \"foo\")"
- exception:bad/missing-clauses
- (case 1 "foo"))
-
- (pass-if-exception "(case 1 ())"
- exception:bad/missing-clauses
- (case 1 ()))
-
- (pass-if-exception "(case 1 (\"foo\"))"
- exception:bad/missing-clauses
- (case 1 ("foo")))
-
- (pass-if-exception "(case 1 (\"foo\" \"bar\"))"
- exception:bad/missing-clauses
- (case 1 ("foo" "bar")))
-
- ;; According to R5RS, the following one is syntactically correct.
- ;; (pass-if-exception "(case 1 (() \"bar\"))"
- ;; exception:bad/missing-clauses
- ;; (case 1 (() "bar")))
-
- (pass-if-exception "(case 1 ((2) \"bar\") . \"foo\")"
- exception:bad/missing-clauses
- (case 1 ((2) "bar") . "foo"))
-
- (pass-if-exception "(case 1 (else #f) ((1) #t))"
- exception:bad/missing-clauses
- (case 1 ((2) "bar") (else)))
-
- (pass-if-exception "(case 1 (else #f) . \"foo\")"
- exception:bad/missing-clauses
- (case 1 (else #f) . "foo"))
-
- (pass-if-exception "(case 1 (else #f) ((1) #t))"
- exception:bad/missing-clauses
- (case 1 (else #f) ((1) #t)))))
-
-(with-test-prefix "define"
-
- (with-test-prefix "currying"
-
- (pass-if "(define ((foo)) #f)"
- (define ((foo)) #t)
- ((foo))))
-
- (with-test-prefix "missing or extra expressions"
-
- (pass-if-exception "(define)"
- exception:missing/extra-expr
- (define))))
-
-(with-test-prefix "set!"
-
- (with-test-prefix "missing or extra expressions"
-
- (pass-if-exception "(set!)"
- exception:missing/extra-expr
- (set!))
-
- (pass-if-exception "(set! 1)"
- exception:missing/extra-expr
- (set! 1))
-
- (pass-if-exception "(set! 1 2 3)"
- exception:missing/extra-expr
- (set! 1 2 3)))
-
- (with-test-prefix "bad variable"
-
- (pass-if-exception "(set! \"\" #t)"
- exception:bad-var
- (set! "" #t))
-
- (pass-if-exception "(set! 1 #t)"
- exception:bad-var
- (set! 1 #t))
-
- (pass-if-exception "(set! #t #f)"
- exception:bad-var
- (set! #t #f))
-
- (pass-if-exception "(set! #f #t)"
- exception:bad-var
- (set! #f #t))
-
- (pass-if-exception "(set! #\space #f)"
- exception:bad-var
- (set! #\space #f))))
-
-(with-test-prefix "quote"
-
- (with-test-prefix "missing or extra expression"
-
- (pass-if-exception "(quote)"
- exception:missing/extra-expr
- (quote))
-
- (pass-if-exception "(quote a b)"
- exception:missing/extra-expr
- (quote a b))))
diff --git a/test-suite/tests/time.test b/test-suite/tests/time.test
deleted file mode 100644
index 59b9125db..000000000
--- a/test-suite/tests/time.test
+++ /dev/null
@@ -1,28 +0,0 @@
-;;;; time.test --- test suite for Guile's time functions -*- scheme -*-
-;;;; Jim Blandy <jimb@red-bean.com> --- June 1999
-;;;;
-;;;; Copyright (C) 1999 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-(use-modules (test-suite lib)
- (ice-9 regex))
-
-(pass-if "strftime %Z doesn't return garbage"
- (let ((t (localtime (current-time))))
- (vector-set! t 10 "ZOW")
- (string=? (strftime "%Z" t)
- "ZOW")))
diff --git a/test-suite/tests/version.test b/test-suite/tests/version.test
deleted file mode 100644
index 79587923d..000000000
--- a/test-suite/tests/version.test
+++ /dev/null
@@ -1,30 +0,0 @@
-;;;; versions.test --- test suite for Guile's version functions -*- scheme -*-
-;;;; Greg J. Badros <gjb@cs.washington.edu>
-;;;;
-;;;; Copyright (C) 2000, 2001 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, Inc., 59 Temple Place, Suite 330,
-;;;; Boston, MA 02111-1307 USA
-
-(use-modules (test-suite lib))
-
-(pass-if "version reporting works"
- (and (string? (major-version))
- (string? (minor-version))
- (string? (micro-version))
- (string=? (version)
- (string-append (major-version) "."
- (minor-version) "."
- (micro-version)))))
diff --git a/test-suite/tests/weaks.test b/test-suite/tests/weaks.test
deleted file mode 100644
index e66c89282..000000000
--- a/test-suite/tests/weaks.test
+++ /dev/null
@@ -1,210 +0,0 @@
-;;;; weaks.test --- tests guile's weaks -*- scheme -*-
-;;;; Copyright (C) 1999, 2001 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, 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 GUILE.
-;;;;
-;;;; The exception is that, if you link the GUILE 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 GUILE 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 GUILE. If you copy
-;;;; code from other Free Software Foundation releases into a copy of
-;;;; GUILE, 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 GUILE, it is your choice
-;;;; whether to permit this exception to apply to your modifications.
-;;;; If you do not wish that, delete this exception notice.
-
-;;; {Description}
-
-;;; This is a semi test suite for weaks; I say semi, because weaks
-;;; are pretty non-deterministic given the amount of information we
-;;; can infer from scheme.
-;;;
-;;; In particular, we can't always reliably test the more important
-;;; aspects of weaks (i.e., that an object is removed when it's dead)
-;;; because we have no way of knowing for certain that the object is
-;;; really dead. It tests it anyway, but the failures of any `death'
-;;; tests really shouldn't be surprising.
-;;;
-;;; Interpret failures in the dying functions here as a hint that you
-;;; should look at any changes you've made involving weaks
-;;; (everything else should always pass), but there are a host of
-;;; other reasons why they might not work as tested here, so if you
-;;; haven't done anything to weaks, don't sweat it :)
-
-;;; Creation functions
-
-
-(with-test-prefix
- "weak-creation"
- (with-test-prefix "make-weak-vector"
- (pass-if "normal"
- (make-weak-vector 10 #f)
- #t)
- (pass-if-exception "bad size"
- exception:wrong-type-arg
- (make-weak-vector 'foo)))
-
- (with-test-prefix "list->weak-vector"
- (pass-if "create"
- (let* ((lst '(a b c d e f g))
- (wv (list->weak-vector lst)))
- (and (eq? (vector-ref wv 0) 'a)
- (eq? (vector-ref wv 1) 'b)
- (eq? (vector-ref wv 2) 'c)
- (eq? (vector-ref wv 3) 'd)
- (eq? (vector-ref wv 4) 'e)
- (eq? (vector-ref wv 5) 'f)
- (eq? (vector-ref wv 6) 'g))))
- (pass-if-exception "bad-args"
- exception:wrong-type-arg
- (list->weak-vector 32)))
-
- (with-test-prefix "make-weak-key-hash-table"
- (pass-if "create"
- (make-weak-key-hash-table 17)
- #t)
- (pass-if-exception "bad-args"
- exception:wrong-type-arg
- (make-weak-key-hash-table '(bad arg))))
- (with-test-prefix "make-weak-value-hash-table"
- (pass-if "create"
- (make-weak-value-hash-table 17)
- #t)
- (pass-if-exception "bad-args"
- exception:wrong-type-arg
- (make-weak-value-hash-table '(bad arg))))
-
- (with-test-prefix "make-doubly-weak-hash-table"
- (pass-if "create"
- (make-doubly-weak-hash-table 17)
- #t)
- (pass-if-exception "bad-args"
- exception:wrong-type-arg
- (make-doubly-weak-hash-table '(bad arg)))))
-
-
-
-
-;; This should remove most of the non-dying problems associated with
-;; trying this inside a closure
-
-(define global-weak (make-weak-vector 10 #f))
-(begin
- (vector-set! global-weak 0 "string")
- (vector-set! global-weak 1 "beans")
- (vector-set! global-weak 2 "to")
- (vector-set! global-weak 3 "utah")
- (vector-set! global-weak 4 "yum yum")
- (gc))
-
-;;; Normal weak vectors
-(let ((x (make-weak-vector 10 #f))
- (bar "bar"))
- (with-test-prefix
- "weak-vector"
- (pass-if "lives"
- (begin
- (vector-set! x 0 bar)
- (gc)
- (and (vector-ref x 0) (eq? bar (vector-ref x 0)))))
- (pass-if "dies"
- (begin
- (gc)
- (or (not (vector-ref global-weak 0))
- (not (vector-ref global-weak 1))
- (not (vector-ref global-weak 2))
- (not (vector-ref global-weak 3))
- (not (vector-ref global-weak 4)))))))
-
- (let ((x (make-weak-key-hash-table 17))
- (y (make-weak-value-hash-table 17))
- (z (make-doubly-weak-hash-table 17))
- (test-key "foo")
- (test-value "bar"))
- (with-test-prefix
- "weak-hash"
- (pass-if "lives"
- (begin
- (hashq-set! x test-key test-value)
- (hashq-set! y test-key test-value)
- (hashq-set! z test-key test-value)
- (gc)
- (gc)
- (and (hashq-ref x test-key)
- (hashq-ref y test-key)
- (hashq-ref z test-key)
- #t)))
- (pass-if "weak-key dies"
- (begin
- (hashq-set! x "this" "is")
- (hashq-set! x "a" "test")
- (hashq-set! x "of" "the")
- (hashq-set! x "emergency" "weak")
- (hashq-set! x "key" "hash system")
- (gc)
- (and
- (or (not (hashq-ref x "this"))
- (not (hashq-ref x "a"))
- (not (hashq-ref x "of"))
- (not (hashq-ref x "emergency"))
- (not (hashq-ref x "key")))
- (hashq-ref x test-key)
- #t)))
-
- (pass-if "weak-value dies"
- (begin
- (hashq-set! y "this" "is")
- (hashq-set! y "a" "test")
- (hashq-set! y "of" "the")
- (hashq-set! y "emergency" "weak")
- (hashq-set! y "value" "hash system")
- (gc)
- (and (or (not (hashq-ref y "this"))
- (not (hashq-ref y "a"))
- (not (hashq-ref y "of"))
- (not (hashq-ref y "emergency"))
- (not (hashq-ref y "value")))
- (hashq-ref y test-key)
- #t)))
- (pass-if "doubly-weak dies"
- (begin
- (hashq-set! z "this" "is")
- (hashq-set! z "a" "test")
- (hashq-set! z "of" "the")
- (hashq-set! z "emergency" "weak")
- (hashq-set! z "all" "hash system")
- (gc)
- (and (or (not (hashq-ref z "this"))
- (not (hashq-ref z "a"))
- (not (hashq-ref z "of"))
- (not (hashq-ref z "emergency"))
- (not (hashq-ref z "all")))
- (hashq-ref z test-key)
- #t)))))